From 861180c62bc7ed95076fe85f3416a9a9d144ed49 Mon Sep 17 00:00:00 2001 From: Mobsuccess Bot Date: Mon, 13 Mar 2023 02:06:49 +0000 Subject: [PATCH] Run updater mobsuccess-devops/policy-github-updater-npm --- node_modules/.package-lock.json | 726 +- .../eslint-utils/LICENSE | 0 .../@eslint-community/eslint-utils/README.md | 37 + .../eslint-utils/index.js | 282 +- .../eslint-utils/index.js.map | 1 + .../eslint-utils/index.mjs | 281 +- .../eslint-utils/index.mjs.map | 1 + .../eslint-utils/package.json | 73 + .../{ => @eslint-community}/regexpp/LICENSE | 0 .../{ => @eslint-community}/regexpp/README.md | 19 +- .../@eslint-community/regexpp/index.d.ts | 257 + .../{ => @eslint-community}/regexpp/index.js | 563 +- .../@eslint-community/regexpp/index.js.map | 1 + .../{ => @eslint-community}/regexpp/index.mjs | 563 +- .../@eslint-community/regexpp/index.mjs.map | 1 + .../@eslint-community/regexpp/package.json | 87 + node_modules/@eslint/eslintrc/CHANGELOG.md | 32 - node_modules/@eslint/eslintrc/LICENSE | 12 +- node_modules/@eslint/eslintrc/README.md | 30 +- .../@eslint/eslintrc/conf/config-schema.js | 4 +- .../@eslint/eslintrc/conf/environments.js | 29 +- .../@eslint/eslintrc/conf/eslint-all.js | 12 - .../eslintrc/conf/eslint-recommended.js | 12 - .../eslintrc/dist/eslintrc-universal.cjs | 1092 +++ .../eslintrc/dist/eslintrc-universal.cjs.map | 1 + .../@eslint/eslintrc/dist/eslintrc.cjs | 4315 +++++++++++ .../@eslint/eslintrc/dist/eslintrc.cjs.map | 1 + .../lib/cascading-config-array-factory.js | 39 +- .../eslintrc/lib/config-array-factory.js | 104 +- .../eslintrc/lib/config-array/config-array.js | 35 +- .../lib/config-array/config-dependency.js | 5 +- .../lib/config-array/extracted-config.js | 5 +- .../lib/config-array/ignore-pattern.js | 17 +- .../eslintrc/lib/config-array/index.js | 13 +- .../lib/config-array/override-tester.js | 14 +- .../@eslint/eslintrc/lib/flat-compat.js | 52 +- .../@eslint/eslintrc/lib/index-universal.js | 29 + node_modules/@eslint/eslintrc/lib/index.js | 74 +- .../@eslint/eslintrc/lib/shared/ajv.js | 165 +- .../@eslint/eslintrc/lib/shared/config-ops.js | 219 +- .../eslintrc/lib/shared/config-validator.js | 21 +- .../lib/shared/deprecation-warnings.js | 5 +- .../@eslint/eslintrc/lib/shared/naming.js | 3 +- .../lib/shared/relative-module-resolver.js | 56 +- .../@eslint/eslintrc/lib/shared/types.js | 3 +- .../eslintrc/node_modules/.bin/js-yaml | 1 + .../node_modules/argparse/CHANGELOG.md | 216 + .../eslintrc/node_modules/argparse/LICENSE | 254 + .../eslintrc/node_modules/argparse/README.md | 84 + .../node_modules/argparse/argparse.js | 3707 ++++++++++ .../eslintrc/node_modules/argparse/lib/sub.js | 67 + .../node_modules/argparse/lib/textwrap.js | 440 ++ .../node_modules/argparse/package.json | 31 + .../node_modules/globals/globals.json | 260 +- .../node_modules/globals/package.json | 135 +- .../eslintrc/node_modules/globals/readme.md | 8 +- .../node_modules/js-yaml/CHANGELOG.md | 616 ++ .../eslintrc/node_modules/js-yaml}/LICENSE | 5 +- .../eslintrc/node_modules/js-yaml/README.md | 246 + .../node_modules/js-yaml/bin/js-yaml.js | 126 + .../node_modules/js-yaml/dist/js-yaml.js | 3874 ++++++++++ .../node_modules/js-yaml/dist/js-yaml.min.js | 2 + .../node_modules/js-yaml/dist/js-yaml.mjs | 3851 ++++++++++ .../eslintrc/node_modules/js-yaml/index.js | 47 + .../node_modules/js-yaml/lib/common.js | 59 + .../node_modules/js-yaml/lib/dumper.js | 965 +++ .../node_modules/js-yaml/lib/exception.js | 55 + .../node_modules/js-yaml/lib/loader.js | 1727 +++++ .../node_modules/js-yaml/lib/schema.js | 121 + .../node_modules/js-yaml/lib/schema/core.js | 11 + .../js-yaml/lib/schema/default.js | 22 + .../js-yaml/lib/schema/failsafe.js | 17 + .../node_modules/js-yaml/lib/schema/json.js | 19 + .../node_modules/js-yaml/lib/snippet.js | 101 + .../eslintrc/node_modules/js-yaml/lib/type.js | 66 + .../node_modules/js-yaml/lib/type/binary.js | 125 + .../node_modules/js-yaml/lib/type/bool.js | 35 + .../node_modules/js-yaml/lib/type/float.js | 97 + .../node_modules/js-yaml/lib/type/int.js | 156 + .../node_modules/js-yaml/lib/type/map.js | 8 + .../node_modules/js-yaml/lib/type/merge.js | 12 + .../node_modules/js-yaml/lib/type/null.js | 35 + .../node_modules/js-yaml/lib/type/omap.js | 44 + .../node_modules/js-yaml/lib/type/pairs.js | 53 + .../node_modules/js-yaml/lib/type/seq.js | 8 + .../node_modules/js-yaml/lib/type/set.js | 29 + .../node_modules/js-yaml/lib/type/str.js | 8 + .../js-yaml/lib/type/timestamp.js | 88 + .../node_modules/js-yaml/package.json | 66 + .../eslintrc/node_modules/type-fest/base.d.ts | 38 + .../node_modules/type-fest/index.d.ts | 2 + .../eslintrc/node_modules/type-fest}/license | 2 +- .../node_modules/type-fest/package.json | 58 + .../eslintrc/node_modules/type-fest/readme.md | 658 ++ .../type-fest/source/async-return-type.d.ts | 23 + .../type-fest/source/asyncify.d.ts | 31 + .../node_modules/type-fest/source/basic.d.ts | 67 + .../type-fest/source/conditional-except.d.ts | 43 + .../type-fest/source/conditional-keys.d.ts | 43 + .../type-fest/source/conditional-pick.d.ts | 42 + .../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 | 22 + .../type-fest/source/mutable.d.ts | 22 + .../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 + .../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 | 34 + .../type-fest/source/set-required.d.ts | 34 + .../type-fest/source/set-return-type.d.ts | 29 + .../type-fest/source/stringified.d.ts | 21 + .../type-fest/source/tsconfig-json.d.ts | 870 +++ .../source/union-to-intersection.d.ts | 58 + .../type-fest/source/utilities.d.ts | 3 + .../type-fest/source/value-of.d.ts | 40 + .../type-fest/ts41/camel-case.d.ts | 72 + .../type-fest/ts41/delimiter-case.d.ts | 85 + .../node_modules/type-fest/ts41/index.d.ts | 9 + .../type-fest/ts41/kebab-case.d.ts | 36 + .../type-fest/ts41/pascal-case.d.ts | 36 + .../type-fest/ts41/snake-case.d.ts | 35 + node_modules/@eslint/eslintrc/package.json | 143 +- node_modules/@eslint/eslintrc/universal.js | 9 + node_modules/{enquirer => @eslint/js}/LICENSE | 4 +- node_modules/@eslint/js/README.md | 57 + node_modules/@eslint/js/package.json | 31 + .../@eslint/js/src/configs/eslint-all.js | 279 + .../js/src/configs}/eslint-recommended.js | 14 +- node_modules/@eslint/js/src/index.js | 17 + .../@humanwhocodes/config-array/CHANGELOG.md | 198 + .../config-array}/LICENSE | 4 +- .../@humanwhocodes/config-array/README.md | 342 + .../@humanwhocodes/config-array/api.js | 979 +++ .../@humanwhocodes/config-array/package.json | 61 + .../module-importer/CHANGELOG.md | 15 + .../module-importer}/LICENSE | 4 +- .../@humanwhocodes/module-importer/README.md | 80 + .../module-importer/dist/module-importer.cjs | 22 + .../dist/module-importer.d.cts | 27 + .../module-importer/dist/module-importer.d.ts | 2 + .../module-importer/dist/module-importer.js | 18 + .../module-importer/package.json | 65 + .../module-importer/src/module-importer.cjs | 81 + .../module-importer/src/module-importer.js | 22 + .../@humanwhocodes/object-schema/.eslintrc.js | 29 + .../.github/workflows/nodejs-test.yml | 27 + .../.github/workflows/release-please.yml | 39 + .../@humanwhocodes/object-schema/CHANGELOG.md | 8 + .../@humanwhocodes/object-schema/LICENSE | 29 + .../@humanwhocodes/object-schema/README.md | 234 + .../@humanwhocodes/object-schema/package.json | 33 + .../@humanwhocodes/object-schema/src/index.js | 7 + .../object-schema/src/merge-strategy.js | 53 + .../object-schema/src/object-schema.js | 235 + .../object-schema/src/validation-strategy.js | 102 + .../object-schema/tests/merge-strategy.js | 66 + .../object-schema/tests/object-schema.js | 611 ++ .../tests/validation-strategy.js | 186 + .../fs.scandir}/LICENSE | 2 +- node_modules/@nodelib/fs.scandir/README.md | 171 + .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 + .../@nodelib/fs.scandir/out/adapters/fs.js | 19 + .../@nodelib/fs.scandir/out/constants.d.ts | 4 + .../@nodelib/fs.scandir/out/constants.js | 17 + .../@nodelib/fs.scandir/out/index.d.ts | 12 + node_modules/@nodelib/fs.scandir/out/index.js | 26 + .../fs.scandir/out/providers/async.d.ts | 7 + .../fs.scandir/out/providers/async.js | 104 + .../fs.scandir/out/providers/common.d.ts | 1 + .../fs.scandir/out/providers/common.js | 13 + .../fs.scandir/out/providers/sync.d.ts | 5 + .../@nodelib/fs.scandir/out/providers/sync.js | 54 + .../@nodelib/fs.scandir/out/settings.d.ts | 20 + .../@nodelib/fs.scandir/out/settings.js | 24 + .../@nodelib/fs.scandir/out/types/index.d.ts | 20 + .../fs.scandir/out}/types/index.js | 1 - .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/fs.js | 19 + .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 + .../fs.scandir/out/utils/index.js} | 4 +- node_modules/@nodelib/fs.scandir/package.json | 44 + node_modules/@nodelib/fs.stat/LICENSE | 21 + node_modules/@nodelib/fs.stat/README.md | 126 + .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 + .../@nodelib/fs.stat/out/adapters/fs.js | 17 + node_modules/@nodelib/fs.stat/out/index.d.ts | 12 + node_modules/@nodelib/fs.stat/out/index.js | 26 + .../@nodelib/fs.stat/out/providers/async.d.ts | 4 + .../@nodelib/fs.stat/out/providers/async.js | 36 + .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 + .../@nodelib/fs.stat/out/providers/sync.js | 23 + .../@nodelib/fs.stat/out/settings.d.ts | 16 + node_modules/@nodelib/fs.stat/out/settings.js | 16 + .../@nodelib/fs.stat/out/types/index.d.ts | 4 + .../fs.stat/out/types/index.js} | 1 - node_modules/@nodelib/fs.stat/package.json | 37 + node_modules/@nodelib/fs.walk/LICENSE | 21 + node_modules/@nodelib/fs.walk/README.md | 215 + node_modules/@nodelib/fs.walk/out/index.d.ts | 14 + node_modules/@nodelib/fs.walk/out/index.js | 34 + .../@nodelib/fs.walk/out/providers/async.d.ts | 12 + .../@nodelib/fs.walk/out/providers/async.js | 30 + .../@nodelib/fs.walk/out/providers/index.d.ts | 4 + .../@nodelib/fs.walk/out/providers/index.js | 9 + .../fs.walk/out/providers/stream.d.ts | 12 + .../@nodelib/fs.walk/out/providers/stream.js | 34 + .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 + .../@nodelib/fs.walk/out/providers/sync.js | 14 + .../@nodelib/fs.walk/out/readers/async.d.ts | 30 + .../@nodelib/fs.walk/out/readers/async.js | 97 + .../@nodelib/fs.walk/out/readers/common.d.ts | 7 + .../@nodelib/fs.walk/out/readers/common.js | 31 + .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 + .../@nodelib/fs.walk/out/readers/reader.js | 11 + .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 + .../@nodelib/fs.walk/out/readers/sync.js | 59 + .../@nodelib/fs.walk/out/settings.d.ts | 30 + node_modules/@nodelib/fs.walk/out/settings.js | 26 + .../@nodelib/fs.walk/out/types/index.d.ts | 8 + .../fs.walk/out/types/index.js} | 1 - node_modules/@nodelib/fs.walk/package.json | 44 + node_modules/acorn-jsx/index.d.ts | 12 + node_modules/acorn-jsx/package.json | 50 +- node_modules/acorn/CHANGELOG.md | 140 + node_modules/acorn/LICENSE | 2 +- node_modules/acorn/README.md | 28 +- node_modules/acorn/bin/acorn | 4 +- node_modules/acorn/dist/acorn.d.ts | 47 +- node_modules/acorn/dist/acorn.js | 1998 ++--- node_modules/acorn/dist/acorn.js.map | 1 - node_modules/acorn/dist/acorn.mjs | 1986 ++--- node_modules/acorn/dist/acorn.mjs.map | 1 - node_modules/acorn/dist/bin.js | 67 +- node_modules/acorn/package.json | 64 +- node_modules/ansi-colors/README.md | 315 - node_modules/ansi-colors/index.js | 177 - node_modules/ansi-colors/package.json | 152 - node_modules/ansi-colors/symbols.js | 70 - node_modules/ansi-colors/types/index.d.ts | 161 - node_modules/ansi-regex/index.js | 2 +- node_modules/ansi-regex/package.json | 139 +- node_modules/ansi-regex/readme.md | 2 +- node_modules/astral-regex/index.d.ts | 28 - node_modules/astral-regex/index.js | 6 - node_modules/astral-regex/package.json | 65 - node_modules/astral-regex/readme.md | 46 - node_modules/debug/LICENSE | 19 +- node_modules/debug/README.md | 28 +- node_modules/debug/package.json | 108 +- node_modules/debug/src/common.js | 19 +- node_modules/enquirer/CHANGELOG.md | 135 - node_modules/enquirer/README.md | 1752 ----- node_modules/enquirer/index.d.ts | 151 - node_modules/enquirer/index.js | 250 - node_modules/enquirer/lib/ansi.js | 116 - node_modules/enquirer/lib/combos.js | 75 - node_modules/enquirer/lib/completer.js | 52 - node_modules/enquirer/lib/interpolate.js | 266 - node_modules/enquirer/lib/keypress.js | 243 - node_modules/enquirer/lib/placeholder.js | 63 - node_modules/enquirer/lib/prompt.js | 485 -- .../enquirer/lib/prompts/autocomplete.js | 113 - .../enquirer/lib/prompts/basicauth.js | 41 - node_modules/enquirer/lib/prompts/confirm.js | 13 - node_modules/enquirer/lib/prompts/editable.js | 136 - node_modules/enquirer/lib/prompts/form.js | 196 - node_modules/enquirer/lib/prompts/index.js | 28 - node_modules/enquirer/lib/prompts/input.js | 55 - .../enquirer/lib/prompts/invisible.js | 11 - node_modules/enquirer/lib/prompts/list.js | 36 - .../enquirer/lib/prompts/multiselect.js | 11 - node_modules/enquirer/lib/prompts/numeral.js | 1 - node_modules/enquirer/lib/prompts/password.js | 18 - node_modules/enquirer/lib/prompts/quiz.js | 37 - node_modules/enquirer/lib/prompts/scale.js | 237 - node_modules/enquirer/lib/prompts/select.js | 139 - node_modules/enquirer/lib/prompts/snippet.js | 185 - node_modules/enquirer/lib/prompts/sort.js | 37 - node_modules/enquirer/lib/prompts/survey.js | 163 - node_modules/enquirer/lib/prompts/text.js | 1 - node_modules/enquirer/lib/prompts/toggle.js | 109 - node_modules/enquirer/lib/render.js | 33 - node_modules/enquirer/lib/roles.js | 46 - node_modules/enquirer/lib/state.js | 69 - node_modules/enquirer/lib/styles.js | 144 - node_modules/enquirer/lib/symbols.js | 66 - node_modules/enquirer/lib/theme.js | 11 - node_modules/enquirer/lib/timer.js | 38 - node_modules/enquirer/lib/types/array.js | 658 -- node_modules/enquirer/lib/types/auth.js | 29 - node_modules/enquirer/lib/types/boolean.js | 88 - node_modules/enquirer/lib/types/index.js | 7 - node_modules/enquirer/lib/types/number.js | 86 - node_modules/enquirer/lib/types/string.js | 185 - node_modules/enquirer/lib/utils.js | 268 - node_modules/enquirer/package.json | 148 - node_modules/eslint-scope/CHANGELOG.md | 70 - node_modules/eslint-scope/README.md | 34 +- .../eslint-scope/dist/eslint-scope.cjs | 2240 ++++++ node_modules/eslint-scope/lib/definition.js | 15 +- node_modules/eslint-scope/lib/index.js | 65 +- .../eslint-scope/lib/pattern-visitor.js | 11 +- node_modules/eslint-scope/lib/reference.js | 17 +- node_modules/eslint-scope/lib/referencer.js | 59 +- .../eslint-scope/lib/scope-manager.js | 64 +- node_modules/eslint-scope/lib/scope.js | 82 +- node_modules/eslint-scope/lib/variable.js | 7 +- node_modules/eslint-scope/lib/version.js | 3 + .../node_modules/estraverse/.jshintrc | 16 - .../node_modules/estraverse/LICENSE.BSD | 19 - .../node_modules/estraverse/README.md | 153 - .../node_modules/estraverse/estraverse.js | 782 -- .../node_modules/estraverse/gulpfile.js | 70 - .../node_modules/estraverse/package.json | 68 - node_modules/eslint-scope/package.json | 114 +- node_modules/eslint-utils/README.md | 38 - node_modules/eslint-utils/index.js.map | 1 - node_modules/eslint-utils/index.mjs.map | 1 - .../eslint-visitor-keys/CHANGELOG.md | 25 - .../eslint-visitor-keys/README.md | 98 - .../eslint-visitor-keys/lib/index.js | 81 - .../eslint-visitor-keys/lib/visitor-keys.json | 284 - .../eslint-visitor-keys/package.json | 71 - node_modules/eslint-utils/package.json | 92 - node_modules/eslint-visitor-keys/CHANGELOG.md | 30 - node_modules/eslint-visitor-keys/README.md | 17 +- .../dist/eslint-visitor-keys.cjs | 382 + .../eslint-visitor-keys/dist/index.d.ts | 18 + .../dist/visitor-keys.d.ts | 10 + node_modules/eslint-visitor-keys/lib/index.js | 90 +- .../lib/visitor-keys.js} | 194 +- .../eslint-visitor-keys/lib/visitor-keys.json | 284 - node_modules/eslint-visitor-keys/package.json | 106 +- node_modules/eslint/CHANGELOG.md | 6410 ----------------- node_modules/eslint/LICENSE | 2 +- node_modules/eslint/README.md | 146 +- node_modules/eslint/bin/eslint.js | 32 +- node_modules/eslint/conf/eslint-all.js | 31 - node_modules/eslint/conf/globals.js | 149 + ...category-list.json => rule-type-list.json} | 15 +- node_modules/eslint/lib/api.js | 24 +- .../eslint/lib/cli-engine/cli-engine.js | 116 +- .../eslint/lib/cli-engine/file-enumerator.js | 29 +- .../lib/cli-engine/formatters/codeframe.js | 138 - .../formatters/formatters-meta.json | 46 + .../formatters/html-template-message.html | 8 - .../formatters/html-template-page.html | 115 - .../formatters/html-template-result.html | 6 - .../eslint/lib/cli-engine/formatters/html.js | 231 +- .../eslint/lib/cli-engine/formatters/table.js | 159 - .../eslint/lib/cli-engine/formatters/tap.js | 2 +- node_modules/eslint/lib/cli-engine/hash.js | 4 +- .../lib/cli-engine/lint-result-cache.js | 2 +- .../eslint/lib/cli-engine/xml-escape.js | 2 +- node_modules/eslint/lib/cli.js | 219 +- .../eslint/lib/config/default-config.js | 70 + .../eslint/lib/config/flat-config-array.js | 275 + .../eslint/lib/config/flat-config-helpers.js | 111 + .../eslint/lib/config/flat-config-schema.js | 457 ++ .../eslint/lib/config/rule-validator.js | 157 + .../eslint/lib/eslint/eslint-helpers.js | 903 +++ node_modules/eslint/lib/eslint/eslint.js | 113 +- node_modules/eslint/lib/eslint/flat-eslint.js | 1182 +++ node_modules/eslint/lib/eslint/index.js | 4 +- node_modules/eslint/lib/init/autoconfig.js | 348 - node_modules/eslint/lib/init/config-file.js | 143 - .../eslint/lib/init/config-initializer.js | 691 -- node_modules/eslint/lib/init/config-rule.js | 317 - node_modules/eslint/lib/init/npm-utils.js | 178 - .../eslint/lib/init/source-code-utils.js | 109 - .../lib/linter/apply-disable-directives.js | 292 +- .../code-path-analysis/code-path-analyzer.js | 156 +- .../code-path-analysis/code-path-segment.js | 7 +- .../code-path-analysis/code-path-state.js | 21 +- .../linter/code-path-analysis/code-path.js | 21 +- .../code-path-analysis/debug-helpers.js | 10 +- .../linter/code-path-analysis/fork-context.js | 1 - .../linter/code-path-analysis/id-generator.js | 5 +- .../lib/linter/config-comment-parser.js | 11 +- node_modules/eslint/lib/linter/linter.js | 837 ++- .../eslint/lib/linter/node-event-generator.js | 55 +- .../eslint/lib/linter/report-translator.js | 24 +- node_modules/eslint/lib/linter/rules.js | 3 + .../eslint/lib/linter/safe-emitter.js | 4 +- .../eslint/lib/linter/source-code-fixer.js | 4 +- node_modules/eslint/lib/linter/timing.js | 15 +- node_modules/eslint/lib/options.js | 575 +- .../lib/rule-tester/flat-rule-tester.js | 1044 +++ .../eslint/lib/rule-tester/rule-tester.js | 243 +- .../eslint/lib/rules/accessor-pairs.js | 12 +- .../eslint/lib/rules/array-bracket-newline.js | 4 +- .../eslint/lib/rules/array-bracket-spacing.js | 4 +- .../eslint/lib/rules/array-callback-return.js | 8 +- .../eslint/lib/rules/array-element-newline.js | 5 +- .../eslint/lib/rules/arrow-body-style.js | 36 +- node_modules/eslint/lib/rules/arrow-parens.js | 4 +- .../eslint/lib/rules/arrow-spacing.js | 4 +- .../eslint/lib/rules/block-scoped-var.js | 6 +- .../eslint/lib/rules/block-spacing.js | 17 +- node_modules/eslint/lib/rules/brace-style.js | 10 +- .../eslint/lib/rules/callback-return.js | 9 +- node_modules/eslint/lib/rules/camelcase.js | 421 +- .../eslint/lib/rules/capitalized-comments.js | 6 +- .../lib/rules/class-methods-use-this.js | 78 +- node_modules/eslint/lib/rules/comma-dangle.js | 62 +- .../eslint/lib/rules/comma-spacing.js | 80 +- node_modules/eslint/lib/rules/comma-style.js | 9 +- node_modules/eslint/lib/rules/complexity.js | 117 +- .../lib/rules/computed-property-spacing.js | 7 +- .../eslint/lib/rules/consistent-return.js | 14 +- .../eslint/lib/rules/consistent-this.js | 8 +- .../eslint/lib/rules/constructor-super.js | 4 +- node_modules/eslint/lib/rules/curly.js | 17 +- .../eslint/lib/rules/default-case-last.js | 4 +- node_modules/eslint/lib/rules/default-case.js | 8 +- .../eslint/lib/rules/default-param-last.js | 6 +- node_modules/eslint/lib/rules/dot-location.js | 4 +- node_modules/eslint/lib/rules/dot-notation.js | 15 +- node_modules/eslint/lib/rules/eol-last.js | 20 +- node_modules/eslint/lib/rules/eqeqeq.js | 6 +- .../eslint/lib/rules/for-direction.js | 4 +- .../eslint/lib/rules/func-call-spacing.js | 4 +- .../eslint/lib/rules/func-name-matching.js | 22 +- node_modules/eslint/lib/rules/func-names.js | 5 +- node_modules/eslint/lib/rules/func-style.js | 4 +- .../rules/function-call-argument-newline.js | 4 +- .../lib/rules/function-paren-newline.js | 22 +- .../lib/rules/generator-star-spacing.js | 4 +- .../eslint/lib/rules/getter-return.js | 26 +- .../eslint/lib/rules/global-require.js | 14 +- .../lib/rules/grouped-accessor-pairs.js | 4 +- node_modules/eslint/lib/rules/guard-for-in.js | 4 +- .../eslint/lib/rules/handle-callback-err.js | 5 +- node_modules/eslint/lib/rules/id-blacklist.js | 20 +- node_modules/eslint/lib/rules/id-denylist.js | 61 +- node_modules/eslint/lib/rules/id-length.js | 91 +- node_modules/eslint/lib/rules/id-match.js | 96 +- .../lib/rules/implicit-arrow-linebreak.js | 4 +- .../eslint/lib/rules/indent-legacy.js | 17 +- node_modules/eslint/lib/rules/indent.js | 201 +- node_modules/eslint/lib/rules/index.js | 8 +- .../eslint/lib/rules/init-declarations.js | 4 +- node_modules/eslint/lib/rules/jsx-quotes.js | 6 +- node_modules/eslint/lib/rules/key-spacing.js | 132 +- .../eslint/lib/rules/keyword-spacing.js | 76 +- .../eslint/lib/rules/line-comment-position.js | 4 +- .../eslint/lib/rules/linebreak-style.js | 4 +- .../eslint/lib/rules/lines-around-comment.js | 93 +- .../lib/rules/lines-around-directive.js | 6 +- .../lib/rules/lines-between-class-members.js | 56 +- .../lib/rules/logical-assignment-operators.js | 474 ++ .../eslint/lib/rules/max-classes-per-file.js | 42 +- node_modules/eslint/lib/rules/max-depth.js | 6 +- node_modules/eslint/lib/rules/max-len.js | 6 +- .../lib/rules/max-lines-per-function.js | 11 +- node_modules/eslint/lib/rules/max-lines.js | 31 +- .../eslint/lib/rules/max-nested-callbacks.js | 4 +- node_modules/eslint/lib/rules/max-params.js | 9 +- .../lib/rules/max-statements-per-line.js | 4 +- .../eslint/lib/rules/max-statements.js | 19 +- .../lib/rules/multiline-comment-style.js | 49 +- .../eslint/lib/rules/multiline-ternary.js | 8 +- node_modules/eslint/lib/rules/new-cap.js | 11 +- node_modules/eslint/lib/rules/new-parens.js | 4 +- .../eslint/lib/rules/newline-after-var.js | 12 +- .../eslint/lib/rules/newline-before-return.js | 8 +- .../lib/rules/newline-per-chained-call.js | 6 +- node_modules/eslint/lib/rules/no-alert.js | 4 +- .../eslint/lib/rules/no-array-constructor.js | 4 +- .../lib/rules/no-async-promise-executor.js | 4 +- .../eslint/lib/rules/no-await-in-loop.js | 4 +- node_modules/eslint/lib/rules/no-bitwise.js | 18 +- .../eslint/lib/rules/no-buffer-constructor.js | 5 +- node_modules/eslint/lib/rules/no-caller.js | 4 +- .../eslint/lib/rules/no-case-declarations.js | 4 +- .../eslint/lib/rules/no-catch-shadow.js | 4 +- .../eslint/lib/rules/no-class-assign.js | 4 +- .../eslint/lib/rules/no-compare-neg-zero.js | 4 +- .../eslint/lib/rules/no-cond-assign.js | 4 +- .../eslint/lib/rules/no-confusing-arrow.js | 12 +- node_modules/eslint/lib/rules/no-console.js | 6 +- .../eslint/lib/rules/no-const-assign.js | 4 +- .../rules/no-constant-binary-expression.js | 507 ++ .../eslint/lib/rules/no-constant-condition.js | 157 +- .../eslint/lib/rules/no-constructor-return.js | 4 +- node_modules/eslint/lib/rules/no-continue.js | 4 +- .../eslint/lib/rules/no-control-regex.js | 39 +- node_modules/eslint/lib/rules/no-debugger.js | 4 +- .../eslint/lib/rules/no-delete-var.js | 4 +- node_modules/eslint/lib/rules/no-div-regex.js | 4 +- node_modules/eslint/lib/rules/no-dupe-args.js | 4 +- .../eslint/lib/rules/no-dupe-class-members.js | 13 +- .../eslint/lib/rules/no-dupe-else-if.js | 4 +- node_modules/eslint/lib/rules/no-dupe-keys.js | 5 +- .../eslint/lib/rules/no-duplicate-case.js | 4 +- .../eslint/lib/rules/no-duplicate-imports.js | 284 +- .../eslint/lib/rules/no-else-return.js | 6 +- .../lib/rules/no-empty-character-class.js | 29 +- .../eslint/lib/rules/no-empty-function.js | 6 +- .../eslint/lib/rules/no-empty-pattern.js | 4 +- .../eslint/lib/rules/no-empty-static-block.js | 47 + node_modules/eslint/lib/rules/no-empty.js | 25 +- node_modules/eslint/lib/rules/no-eq-null.js | 4 +- node_modules/eslint/lib/rules/no-eval.js | 41 +- node_modules/eslint/lib/rules/no-ex-assign.js | 4 +- .../eslint/lib/rules/no-extend-native.js | 4 +- .../eslint/lib/rules/no-extra-bind.js | 4 +- .../eslint/lib/rules/no-extra-boolean-cast.js | 15 +- .../eslint/lib/rules/no-extra-label.js | 4 +- .../eslint/lib/rules/no-extra-parens.js | 85 +- .../eslint/lib/rules/no-extra-semi.js | 8 +- .../eslint/lib/rules/no-fallthrough.js | 52 +- .../eslint/lib/rules/no-floating-decimal.js | 4 +- .../eslint/lib/rules/no-func-assign.js | 4 +- .../eslint/lib/rules/no-global-assign.js | 6 +- .../eslint/lib/rules/no-implicit-coercion.js | 101 +- .../eslint/lib/rules/no-implicit-globals.js | 9 +- .../eslint/lib/rules/no-implied-eval.js | 6 +- .../eslint/lib/rules/no-import-assign.js | 6 +- .../eslint/lib/rules/no-inline-comments.js | 4 +- .../eslint/lib/rules/no-inner-declarations.js | 34 +- .../eslint/lib/rules/no-invalid-regexp.js | 66 +- .../eslint/lib/rules/no-invalid-this.js | 101 +- .../lib/rules/no-irregular-whitespace.js | 4 +- node_modules/eslint/lib/rules/no-iterator.js | 4 +- node_modules/eslint/lib/rules/no-label-var.js | 4 +- node_modules/eslint/lib/rules/no-labels.js | 6 +- .../eslint/lib/rules/no-lone-blocks.js | 16 +- node_modules/eslint/lib/rules/no-lonely-if.js | 4 +- node_modules/eslint/lib/rules/no-loop-func.js | 8 +- .../eslint/lib/rules/no-loss-of-precision.js | 10 +- .../eslint/lib/rules/no-magic-numbers.js | 29 +- .../rules/no-misleading-character-class.js | 113 +- .../eslint/lib/rules/no-mixed-operators.js | 39 +- .../eslint/lib/rules/no-mixed-requires.js | 7 +- .../lib/rules/no-mixed-spaces-and-tabs.js | 4 +- .../eslint/lib/rules/no-multi-assign.js | 38 +- .../eslint/lib/rules/no-multi-spaces.js | 6 +- node_modules/eslint/lib/rules/no-multi-str.js | 4 +- .../lib/rules/no-multiple-empty-lines.js | 4 +- .../eslint/lib/rules/no-native-reassign.js | 6 +- .../eslint/lib/rules/no-negated-condition.js | 4 +- .../eslint/lib/rules/no-negated-in-lhs.js | 4 +- .../eslint/lib/rules/no-nested-ternary.js | 4 +- node_modules/eslint/lib/rules/no-new-func.js | 44 +- .../lib/rules/no-new-native-nonconstructor.js | 64 + .../eslint/lib/rules/no-new-object.js | 6 +- .../eslint/lib/rules/no-new-require.js | 5 +- .../eslint/lib/rules/no-new-symbol.js | 4 +- .../eslint/lib/rules/no-new-wrappers.js | 6 +- node_modules/eslint/lib/rules/no-new.js | 4 +- .../lib/rules/no-nonoctal-decimal-escape.js | 11 +- node_modules/eslint/lib/rules/no-obj-calls.js | 8 +- .../eslint/lib/rules/no-octal-escape.js | 4 +- node_modules/eslint/lib/rules/no-octal.js | 8 +- .../eslint/lib/rules/no-param-reassign.js | 4 +- .../eslint/lib/rules/no-path-concat.js | 5 +- node_modules/eslint/lib/rules/no-plusplus.js | 4 +- .../eslint/lib/rules/no-process-env.js | 5 +- .../eslint/lib/rules/no-process-exit.js | 5 +- .../lib/rules/no-promise-executor-return.js | 6 +- node_modules/eslint/lib/rules/no-proto.js | 4 +- .../eslint/lib/rules/no-prototype-builtins.js | 10 +- node_modules/eslint/lib/rules/no-redeclare.js | 6 +- .../eslint/lib/rules/no-regex-spaces.js | 6 +- .../eslint/lib/rules/no-restricted-exports.js | 132 +- .../eslint/lib/rules/no-restricted-globals.js | 6 +- .../eslint/lib/rules/no-restricted-imports.js | 189 +- .../eslint/lib/rules/no-restricted-modules.js | 12 +- .../lib/rules/no-restricted-properties.js | 8 +- .../eslint/lib/rules/no-restricted-syntax.js | 6 +- .../eslint/lib/rules/no-return-assign.js | 4 +- .../eslint/lib/rules/no-return-await.js | 33 +- .../eslint/lib/rules/no-script-url.js | 7 +- .../eslint/lib/rules/no-self-assign.js | 6 +- .../eslint/lib/rules/no-self-compare.js | 4 +- node_modules/eslint/lib/rules/no-sequences.js | 39 +- .../eslint/lib/rules/no-setter-return.js | 7 +- .../lib/rules/no-shadow-restricted-names.js | 4 +- node_modules/eslint/lib/rules/no-shadow.js | 151 +- .../eslint/lib/rules/no-spaced-func.js | 4 +- .../eslint/lib/rules/no-sparse-arrays.js | 6 +- node_modules/eslint/lib/rules/no-sync.js | 7 +- node_modules/eslint/lib/rules/no-tabs.js | 4 +- .../lib/rules/no-template-curly-in-string.js | 4 +- node_modules/eslint/lib/rules/no-ternary.js | 4 +- .../eslint/lib/rules/no-this-before-super.js | 4 +- .../eslint/lib/rules/no-throw-literal.js | 4 +- .../eslint/lib/rules/no-trailing-spaces.js | 4 +- .../eslint/lib/rules/no-undef-init.js | 4 +- node_modules/eslint/lib/rules/no-undef.js | 4 +- node_modules/eslint/lib/rules/no-undefined.js | 4 +- .../eslint/lib/rules/no-underscore-dangle.js | 87 +- .../lib/rules/no-unexpected-multiline.js | 4 +- .../lib/rules/no-unmodified-loop-condition.js | 4 +- .../eslint/lib/rules/no-unneeded-ternary.js | 6 +- .../eslint/lib/rules/no-unreachable-loop.js | 4 +- .../eslint/lib/rules/no-unreachable.js | 52 +- .../eslint/lib/rules/no-unsafe-finally.js | 4 +- .../eslint/lib/rules/no-unsafe-negation.js | 9 +- .../lib/rules/no-unsafe-optional-chaining.js | 6 +- .../eslint/lib/rules/no-unused-expressions.js | 20 +- .../eslint/lib/rules/no-unused-labels.js | 4 +- .../rules/no-unused-private-class-members.js | 195 + .../eslint/lib/rules/no-unused-vars.js | 135 +- .../eslint/lib/rules/no-use-before-define.js | 270 +- .../lib/rules/no-useless-backreference.js | 13 +- .../eslint/lib/rules/no-useless-call.js | 4 +- .../eslint/lib/rules/no-useless-catch.js | 4 +- .../lib/rules/no-useless-computed-key.js | 103 +- .../eslint/lib/rules/no-useless-concat.js | 4 +- .../lib/rules/no-useless-constructor.js | 4 +- .../eslint/lib/rules/no-useless-escape.js | 26 +- .../eslint/lib/rules/no-useless-rename.js | 16 +- .../eslint/lib/rules/no-useless-return.js | 6 +- node_modules/eslint/lib/rules/no-var.js | 8 +- node_modules/eslint/lib/rules/no-void.js | 4 +- .../eslint/lib/rules/no-warning-comments.js | 93 +- .../rules/no-whitespace-before-property.js | 4 +- node_modules/eslint/lib/rules/no-with.js | 4 +- .../rules/nonblock-statement-body-position.js | 4 +- .../eslint/lib/rules/object-curly-newline.js | 27 +- .../eslint/lib/rules/object-curly-spacing.js | 4 +- .../lib/rules/object-property-newline.js | 4 +- .../eslint/lib/rules/object-shorthand.js | 29 +- .../lib/rules/one-var-declaration-per-line.js | 4 +- node_modules/eslint/lib/rules/one-var.js | 12 +- .../eslint/lib/rules/operator-assignment.js | 33 +- .../eslint/lib/rules/operator-linebreak.js | 33 +- .../eslint/lib/rules/padded-blocks.js | 15 +- .../rules/padding-line-between-statements.js | 12 +- .../eslint/lib/rules/prefer-arrow-callback.js | 20 +- node_modules/eslint/lib/rules/prefer-const.js | 22 +- .../eslint/lib/rules/prefer-destructuring.js | 12 +- .../rules/prefer-exponentiation-operator.js | 6 +- .../lib/rules/prefer-named-capture-group.js | 85 +- .../lib/rules/prefer-numeric-literals.js | 4 +- .../eslint/lib/rules/prefer-object-has-own.js | 112 + .../eslint/lib/rules/prefer-object-spread.js | 6 +- .../lib/rules/prefer-promise-reject-errors.js | 4 +- .../eslint/lib/rules/prefer-reflect.js | 8 +- .../eslint/lib/rules/prefer-regex-literals.js | 343 +- .../eslint/lib/rules/prefer-rest-params.js | 6 +- .../eslint/lib/rules/prefer-spread.js | 4 +- .../eslint/lib/rules/prefer-template.js | 6 +- node_modules/eslint/lib/rules/quote-props.js | 24 +- node_modules/eslint/lib/rules/quotes.js | 20 +- node_modules/eslint/lib/rules/radix.js | 25 +- .../lib/rules/require-atomic-updates.js | 95 +- .../eslint/lib/rules/require-await.js | 4 +- .../eslint/lib/rules/require-jsdoc.js | 5 +- .../lib/rules/require-unicode-regexp.js | 6 +- .../eslint/lib/rules/require-yield.js | 5 +- .../eslint/lib/rules/rest-spread-spacing.js | 4 +- node_modules/eslint/lib/rules/semi-spacing.js | 7 +- node_modules/eslint/lib/rules/semi-style.js | 30 +- node_modules/eslint/lib/rules/semi.js | 102 +- node_modules/eslint/lib/rules/sort-imports.js | 4 +- node_modules/eslint/lib/rules/sort-keys.js | 47 +- node_modules/eslint/lib/rules/sort-vars.js | 4 +- .../eslint/lib/rules/space-before-blocks.js | 20 +- .../lib/rules/space-before-function-paren.js | 4 +- .../eslint/lib/rules/space-in-parens.js | 4 +- .../eslint/lib/rules/space-infix-ops.js | 30 +- .../eslint/lib/rules/space-unary-ops.js | 4 +- .../eslint/lib/rules/spaced-comment.js | 10 +- node_modules/eslint/lib/rules/strict.js | 6 +- .../eslint/lib/rules/switch-colon-spacing.js | 18 +- .../eslint/lib/rules/symbol-description.js | 4 +- .../lib/rules/template-curly-spacing.js | 4 +- .../eslint/lib/rules/template-tag-spacing.js | 4 +- node_modules/eslint/lib/rules/unicode-bom.js | 4 +- node_modules/eslint/lib/rules/use-isnan.js | 9 +- .../eslint/lib/rules/utils/ast-utils.js | 385 +- .../lib/rules/utils/lazy-loading-rule-map.js | 6 +- node_modules/eslint/lib/rules/valid-jsdoc.js | 7 +- node_modules/eslint/lib/rules/valid-typeof.js | 50 +- node_modules/eslint/lib/rules/vars-on-top.js | 43 +- node_modules/eslint/lib/rules/wrap-iife.js | 6 +- node_modules/eslint/lib/rules/wrap-regex.js | 4 +- .../eslint/lib/rules/yield-star-spacing.js | 4 +- node_modules/eslint/lib/rules/yoda.js | 6 +- node_modules/eslint/lib/shared/ajv.js | 2 +- .../eslint/lib/shared/config-validator.js | 23 +- .../eslint/lib/shared/deprecation-warnings.js | 24 +- node_modules/eslint/lib/shared/directives.js | 15 + node_modules/eslint/lib/shared/logging.js | 4 +- .../lib/shared/relative-module-resolver.js | 10 +- .../eslint/lib/shared/runtime-info.js | 9 +- .../eslint/lib/shared/string-utils.js | 22 + node_modules/eslint/lib/shared/traverser.js | 4 +- node_modules/eslint/lib/shared/types.js | 70 +- .../eslint/lib/source-code/source-code.js | 33 +- .../lib/source-code/token-store/cursor.js | 4 +- .../lib/source-code/token-store/index.js | 2 +- .../lib/source-code/token-store/utils.js | 16 +- node_modules/eslint/lib/unsupported-api.js | 27 + ...files-ignored.txt => all-files-ignored.js} | 12 +- .../eslint/messages/extend-config-missing.js | 13 + .../eslint/messages/extend-config-missing.txt | 5 - .../eslint/messages/failed-to-read-json.js | 11 + .../eslint/messages/failed-to-read-json.txt | 3 - .../eslint/messages/file-not-found.js | 10 + .../eslint/messages/file-not-found.txt | 2 - .../eslint/messages/no-config-found.js | 15 + .../eslint/messages/no-config-found.txt | 7 - .../eslint/messages/plugin-conflict.js | 22 + .../eslint/messages/plugin-conflict.txt | 7 - .../eslint/messages/plugin-invalid.js | 16 + .../eslint/messages/plugin-invalid.txt | 8 - .../eslint/messages/plugin-missing.js | 19 + .../eslint/messages/plugin-missing.txt | 11 - .../print-config-with-directory-path.js | 8 + .../print-config-with-directory-path.txt | 2 - .../eslint/messages/whitespace-found.js | 11 + .../eslint/messages/whitespace-found.txt | 3 - node_modules/eslint/node_modules/.bin/js-yaml | 1 + node_modules/eslint/node_modules/.bin/semver | 1 - .../node_modules/@babel/code-frame/README.md | 19 - .../@babel/code-frame/lib/index.js | 167 - .../@babel/code-frame/package.json | 57 - .../eslint/node_modules/argparse/CHANGELOG.md | 216 + .../eslint/node_modules/argparse/LICENSE | 254 + .../eslint/node_modules/argparse/README.md | 84 + .../eslint/node_modules/argparse/argparse.js | 3707 ++++++++++ .../eslint/node_modules/argparse/lib/sub.js | 67 + .../node_modules/argparse/lib/textwrap.js | 440 ++ .../eslint/node_modules/argparse/package.json | 31 + .../escape-string-regexp/index.d.ts | 18 + .../escape-string-regexp/index.js | 13 + .../escape-string-regexp}/license | 1 - .../escape-string-regexp/package.json | 38 + .../escape-string-regexp/readme.md | 34 + .../eslint/node_modules/find-up/index.d.ts | 138 + .../eslint/node_modules/find-up/index.js | 89 + .../eslint/node_modules/find-up/license | 9 + .../eslint/node_modules/find-up/package.json | 54 + .../eslint/node_modules/find-up/readme.md | 151 + .../eslint/node_modules/globals/globals.json | 84 +- .../eslint/node_modules/globals/package.json | 138 +- .../eslint/node_modules/js-yaml/CHANGELOG.md | 616 ++ .../node_modules/js-yaml}/LICENSE | 4 +- .../eslint/node_modules/js-yaml/README.md | 246 + .../node_modules/js-yaml/bin/js-yaml.js | 126 + .../node_modules/js-yaml/dist/js-yaml.js | 3874 ++++++++++ .../node_modules/js-yaml/dist/js-yaml.min.js | 2 + .../node_modules/js-yaml/dist/js-yaml.mjs | 3851 ++++++++++ .../eslint/node_modules/js-yaml/index.js | 47 + .../eslint/node_modules/js-yaml/lib/common.js | 59 + .../eslint/node_modules/js-yaml/lib/dumper.js | 965 +++ .../node_modules/js-yaml/lib/exception.js | 55 + .../eslint/node_modules/js-yaml/lib/loader.js | 1727 +++++ .../eslint/node_modules/js-yaml/lib/schema.js | 121 + .../node_modules/js-yaml/lib/schema/core.js | 11 + .../js-yaml/lib/schema/default.js | 22 + .../js-yaml/lib/schema/failsafe.js | 17 + .../node_modules/js-yaml/lib/schema/json.js | 19 + .../node_modules/js-yaml/lib/snippet.js | 101 + .../eslint/node_modules/js-yaml/lib/type.js | 66 + .../node_modules/js-yaml/lib/type/binary.js | 125 + .../node_modules/js-yaml/lib/type/bool.js | 35 + .../node_modules/js-yaml/lib/type/float.js | 97 + .../node_modules/js-yaml/lib/type/int.js | 156 + .../node_modules/js-yaml/lib/type/map.js | 8 + .../node_modules/js-yaml/lib/type/merge.js | 12 + .../node_modules/js-yaml/lib/type/null.js | 35 + .../node_modules/js-yaml/lib/type/omap.js | 44 + .../node_modules/js-yaml/lib/type/pairs.js | 53 + .../node_modules/js-yaml/lib/type/seq.js | 8 + .../node_modules/js-yaml/lib/type/set.js | 29 + .../node_modules/js-yaml/lib/type/str.js | 8 + .../js-yaml/lib/type/timestamp.js | 88 + .../eslint/node_modules/js-yaml/package.json | 66 + .../node_modules/locate-path/index.d.ts | 83 + .../eslint/node_modules/locate-path/index.js | 68 + .../eslint/node_modules/locate-path/license | 9 + .../node_modules/locate-path/package.json | 46 + .../eslint/node_modules/locate-path/readme.md | 125 + .../eslint/node_modules/p-limit/index.d.ts | 42 + .../eslint/node_modules/p-limit/index.js | 71 + .../eslint/node_modules/p-limit/license | 9 + .../eslint/node_modules/p-limit/package.json | 52 + .../eslint/node_modules/p-limit/readme.md | 101 + .../eslint/node_modules/p-locate/index.d.ts | 53 + .../eslint/node_modules/p-locate/index.js | 50 + .../eslint/node_modules/p-locate/license | 9 + .../eslint/node_modules/p-locate/package.json | 54 + .../eslint/node_modules/p-locate/readme.md | 93 + .../eslint/node_modules/semver/CHANGELOG.md | 111 - .../eslint/node_modules/semver/README.md | 566 -- .../eslint/node_modules/semver/bin/semver.js | 173 - .../node_modules/semver/classes/comparator.js | 135 - .../node_modules/semver/classes/index.js | 5 - .../node_modules/semver/classes/range.js | 510 -- .../node_modules/semver/classes/semver.js | 287 - .../node_modules/semver/functions/clean.js | 6 - .../node_modules/semver/functions/cmp.js | 48 - .../node_modules/semver/functions/coerce.js | 51 - .../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 | 23 - .../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 | 15 - .../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 | 33 - .../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 - .../eslint/node_modules/semver/index.js | 48 - .../node_modules/semver/internal/constants.js | 17 - .../node_modules/semver/internal/debug.js | 9 - .../semver/internal/identifiers.js | 23 - .../semver/internal/parse-options.js | 11 - .../eslint/node_modules/semver/internal/re.js | 182 - .../eslint/node_modules/semver/package.json | 73 - .../eslint/node_modules/semver/preload.js | 2 - .../eslint/node_modules/semver/range.bnf | 16 - .../eslint/node_modules/semver/ranges/gtr.js | 4 - .../node_modules/semver/ranges/intersects.js | 7 - .../eslint/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 | 60 - .../node_modules/semver/ranges/outside.js | 80 - .../node_modules/semver/ranges/simplify.js | 44 - .../node_modules/semver/ranges/subset.js | 222 - .../semver/ranges/to-comparators.js | 8 - .../node_modules/semver/ranges/valid.js | 11 - node_modules/eslint/package.json | 241 +- node_modules/espree/CHANGELOG.md | 509 -- node_modules/espree/README.md | 49 +- node_modules/espree/dist/espree.cjs | 940 +++ node_modules/espree/espree.js | 47 +- node_modules/espree/lib/ast-node-types.js | 96 - node_modules/espree/lib/espree.js | 148 +- node_modules/espree/lib/features.js | 4 +- node_modules/espree/lib/options.js | 102 +- node_modules/espree/lib/token-translator.js | 8 +- node_modules/espree/lib/version.js | 3 + node_modules/espree/lib/visitor-keys.js | 123 - node_modules/espree/node_modules/.bin/acorn | 1 - .../espree/node_modules/acorn/CHANGELOG.md | 620 -- .../espree/node_modules/acorn/LICENSE | 21 - .../espree/node_modules/acorn/README.md | 269 - .../espree/node_modules/acorn/bin/acorn | 4 - .../espree/node_modules/acorn/dist/acorn.d.ts | 209 - .../espree/node_modules/acorn/dist/acorn.js | 5186 ------------- .../node_modules/acorn/dist/acorn.js.map | 1 - .../espree/node_modules/acorn/dist/acorn.mjs | 5155 ------------- .../node_modules/acorn/dist/acorn.mjs.d.ts | 2 - .../node_modules/acorn/dist/acorn.mjs.map | 1 - .../espree/node_modules/acorn/dist/bin.js | 64 - .../espree/node_modules/acorn/package.json | 67 - .../eslint-visitor-keys/CHANGELOG.md | 25 - .../eslint-visitor-keys/README.md | 98 - .../eslint-visitor-keys/lib/index.js | 81 - .../eslint-visitor-keys/package.json | 71 - node_modules/espree/package.json | 130 +- node_modules/esquery/dist/esquery.esm.js | 2255 ++---- node_modules/esquery/dist/esquery.esm.min.js | 2 +- .../esquery/dist/esquery.esm.min.js.map | 2 +- node_modules/esquery/dist/esquery.js | 2255 ++---- node_modules/esquery/dist/esquery.lite.js | 2019 ++---- node_modules/esquery/dist/esquery.lite.min.js | 2 +- .../esquery/dist/esquery.lite.min.js.map | 2 +- node_modules/esquery/dist/esquery.min.js | 2 +- node_modules/esquery/dist/esquery.min.js.map | 2 +- node_modules/esquery/package.json | 124 +- node_modules/esquery/parser.js | 58 +- node_modules/fastq/.github/dependabot.yml | 11 + node_modules/fastq/.github/workflows/ci.yml | 50 + .../node_modules/semver => fastq}/LICENSE | 8 +- node_modules/fastq/README.md | 309 + node_modules/fastq/bench.js | 66 + node_modules/fastq/example.js | 14 + node_modules/fastq/example.mjs | 11 + node_modules/fastq/index.d.ts | 37 + node_modules/fastq/package.json | 52 + node_modules/fastq/queue.js | 289 + node_modules/fastq/test/example.ts | 81 + node_modules/fastq/test/promise.js | 248 + node_modules/fastq/test/test.js | 566 ++ node_modules/fastq/test/tsconfig.json | 11 + .../functional-red-black-tree/.npmignore | 16 - .../functional-red-black-tree/README.md | 237 - .../functional-red-black-tree/bench/test.js | 11 - .../functional-red-black-tree/package.json | 68 - .../functional-red-black-tree/rbtree.js | 996 --- .../functional-red-black-tree/test/test.js | 479 -- node_modules/glob-parent/CHANGELOG.md | 110 - node_modules/glob-parent/LICENSE | 2 +- node_modules/glob-parent/README.md | 49 +- node_modules/glob-parent/index.js | 45 +- node_modules/glob-parent/package.json | 106 +- node_modules/grapheme-splitter/LICENSE | 22 + node_modules/grapheme-splitter/README.md | 111 + node_modules/grapheme-splitter/index.d.ts | 24 + node_modules/grapheme-splitter/index.js | 1743 +++++ node_modules/grapheme-splitter/package.json | 34 + .../tests/GraphemeBreakTest.txt | 850 +++ .../tests/grapheme_splitter_tests.js | 83 + node_modules/ignore/CHANGELOG.md | 19 - node_modules/ignore/LICENSE-MIT | 0 node_modules/ignore/README.md | 171 +- node_modules/ignore/index.d.ts | 40 +- node_modules/ignore/index.js | 507 +- node_modules/ignore/legacy.js | 539 +- node_modules/ignore/package.json | 114 +- node_modules/is-extglob/package.json | 65 +- node_modules/is-glob/README.md | 2 +- node_modules/is-glob/index.js | 150 +- node_modules/is-glob/package.json | 83 +- node_modules/is-path-inside/index.d.ts | 27 + node_modules/is-path-inside/index.js | 12 + node_modules/is-path-inside/license | 9 + node_modules/is-path-inside/package.json | 36 + node_modules/is-path-inside/readme.md | 63 + node_modules/js-sdsl/CHANGELOG.md | 211 + .../json-schema-traverse => js-sdsl}/LICENSE | 2 +- node_modules/js-sdsl/README.md | 296 + node_modules/js-sdsl/README.zh-CN.md | 298 + .../cjs/container/ContainerBase/index.d.ts | 206 + .../dist/cjs/container/ContainerBase/index.js | 40 + .../cjs/container/ContainerBase/index.js.map | 1 + .../container/HashContainer/Base/index.d.ts | 29 + .../cjs/container/HashContainer/Base/index.js | 188 + .../container/HashContainer/Base/index.js.map | 1 + .../cjs/container/HashContainer/HashMap.d.ts | 49 + .../cjs/container/HashContainer/HashMap.js | 125 + .../container/HashContainer/HashMap.js.map | 1 + .../cjs/container/HashContainer/HashSet.d.ts | 39 + .../cjs/container/HashContainer/HashSet.js | 94 + .../container/HashContainer/HashSet.js.map | 1 + .../OtherContainer/PriorityQueue.d.ts | 79 + .../container/OtherContainer/PriorityQueue.js | 118 + .../OtherContainer/PriorityQueue.js.map | 1 + .../cjs/container/OtherContainer/Queue.d.ts | 22 + .../cjs/container/OtherContainer/Queue.js | 52 + .../cjs/container/OtherContainer/Queue.js.map | 1 + .../cjs/container/OtherContainer/Stack.d.ts | 22 + .../cjs/container/OtherContainer/Stack.js | 42 + .../cjs/container/OtherContainer/Stack.js.map | 1 + .../Base/RandomIterator.d.ts | 9 + .../Base/RandomIterator.js | 58 + .../Base/RandomIterator.js.map | 1 + .../SequentialContainer/Base/index.d.ts | 67 + .../SequentialContainer/Base/index.js | 16 + .../SequentialContainer/Base/index.js.map | 1 + .../container/SequentialContainer/Deque.d.ts | 58 + .../container/SequentialContainer/Deque.js | 338 + .../SequentialContainer/Deque.js.map | 1 + .../SequentialContainer/LinkList.d.ts | 58 + .../container/SequentialContainer/LinkList.js | 330 + .../SequentialContainer/LinkList.js.map | 1 + .../container/SequentialContainer/Vector.d.ts | 40 + .../container/SequentialContainer/Vector.js | 158 + .../SequentialContainer/Vector.js.map | 1 + .../TreeContainer/Base/TreeIterator.d.ts | 18 + .../TreeContainer/Base/TreeIterator.js | 80 + .../TreeContainer/Base/TreeIterator.js.map | 1 + .../TreeContainer/Base/TreeNode.d.ts | 47 + .../container/TreeContainer/Base/TreeNode.js | 115 + .../TreeContainer/Base/TreeNode.js.map | 1 + .../container/TreeContainer/Base/index.d.ts | 58 + .../cjs/container/TreeContainer/Base/index.js | 514 ++ .../container/TreeContainer/Base/index.js.map | 1 + .../container/TreeContainer/OrderedMap.d.ts | 62 + .../cjs/container/TreeContainer/OrderedMap.js | 127 + .../container/TreeContainer/OrderedMap.js.map | 1 + .../container/TreeContainer/OrderedSet.d.ts | 54 + .../cjs/container/TreeContainer/OrderedSet.js | 107 + .../container/TreeContainer/OrderedSet.js.map | 1 + node_modules/js-sdsl/dist/cjs/index.d.ts | 21 + node_modules/js-sdsl/dist/cjs/index.js | 102 + node_modules/js-sdsl/dist/cjs/index.js.map | 1 + .../js-sdsl/dist/cjs/utils/checkObject.d.ts | 1 + .../js-sdsl/dist/cjs/utils/checkObject.js | 13 + .../js-sdsl/dist/cjs/utils/checkObject.js.map | 1 + .../js-sdsl/dist/cjs/utils/throwError.d.ts | 1 + .../js-sdsl/dist/cjs/utils/throwError.js | 12 + .../js-sdsl/dist/cjs/utils/throwError.js.map | 1 + .../esm/container/ContainerBase/index.d.ts | 206 + .../dist/esm/container/ContainerBase/index.js | 68 + .../esm/container/ContainerBase/index.js.map | 1 + .../container/HashContainer/Base/index.d.ts | 29 + .../esm/container/HashContainer/Base/index.js | 201 + .../container/HashContainer/Base/index.js.map | 1 + .../esm/container/HashContainer/HashMap.d.ts | 49 + .../esm/container/HashContainer/HashMap.js | 248 + .../container/HashContainer/HashMap.js.map | 1 + .../esm/container/HashContainer/HashSet.d.ts | 39 + .../esm/container/HashContainer/HashSet.js | 223 + .../container/HashContainer/HashSet.js.map | 1 + .../OtherContainer/PriorityQueue.d.ts | 79 + .../container/OtherContainer/PriorityQueue.js | 171 + .../OtherContainer/PriorityQueue.js.map | 1 + .../esm/container/OtherContainer/Queue.d.ts | 22 + .../esm/container/OtherContainer/Queue.js | 69 + .../esm/container/OtherContainer/Queue.js.map | 1 + .../esm/container/OtherContainer/Stack.d.ts | 22 + .../esm/container/OtherContainer/Stack.js | 59 + .../esm/container/OtherContainer/Stack.js.map | 1 + .../Base/RandomIterator.d.ts | 9 + .../Base/RandomIterator.js | 78 + .../Base/RandomIterator.js.map | 1 + .../SequentialContainer/Base/index.d.ts | 67 + .../SequentialContainer/Base/index.js | 33 + .../SequentialContainer/Base/index.js.map | 1 + .../container/SequentialContainer/Deque.d.ts | 58 + .../container/SequentialContainer/Deque.js | 498 ++ .../SequentialContainer/Deque.js.map | 1 + .../SequentialContainer/LinkList.d.ts | 58 + .../container/SequentialContainer/LinkList.js | 456 ++ .../SequentialContainer/LinkList.js.map | 1 + .../container/SequentialContainer/Vector.d.ts | 40 + .../container/SequentialContainer/Vector.js | 323 + .../SequentialContainer/Vector.js.map | 1 + .../TreeContainer/Base/TreeIterator.d.ts | 18 + .../TreeContainer/Base/TreeIterator.js | 98 + .../TreeContainer/Base/TreeIterator.js.map | 1 + .../TreeContainer/Base/TreeNode.d.ts | 47 + .../container/TreeContainer/Base/TreeNode.js | 132 + .../TreeContainer/Base/TreeNode.js.map | 1 + .../container/TreeContainer/Base/index.d.ts | 58 + .../esm/container/TreeContainer/Base/index.js | 600 ++ .../container/TreeContainer/Base/index.js.map | 1 + .../container/TreeContainer/OrderedMap.d.ts | 62 + .../esm/container/TreeContainer/OrderedMap.js | 265 + .../container/TreeContainer/OrderedMap.js.map | 1 + .../container/TreeContainer/OrderedSet.d.ts | 54 + .../esm/container/TreeContainer/OrderedSet.js | 245 + .../container/TreeContainer/OrderedSet.js.map | 1 + node_modules/js-sdsl/dist/esm/index.d.ts | 21 + node_modules/js-sdsl/dist/esm/index.js | 20 + node_modules/js-sdsl/dist/esm/index.js.map | 1 + .../js-sdsl/dist/esm/utils/checkObject.d.ts | 1 + .../js-sdsl/dist/esm/utils/checkObject.js | 5 + .../js-sdsl/dist/esm/utils/checkObject.js.map | 1 + .../js-sdsl/dist/esm/utils/throwError.d.ts | 1 + .../js-sdsl/dist/esm/utils/throwError.js | 4 + .../js-sdsl/dist/esm/utils/throwError.js.map | 1 + node_modules/js-sdsl/dist/umd/js-sdsl.js | 3154 ++++++++ node_modules/js-sdsl/dist/umd/js-sdsl.min.js | 8 + .../js-sdsl/dist/umd/js-sdsl.min.js.map | 1 + node_modules/js-sdsl/package.json | 166 + .../code-frame => lodash.merge}/LICENSE | 29 +- node_modules/lodash.merge/README.md | 18 + node_modules/lodash.merge/index.js | 1977 +++++ node_modules/lodash.merge/package.json | 16 + node_modules/minimatch/README.md | 23 +- node_modules/minimatch/minimatch.js | 162 +- node_modules/minimatch/package.json | 73 +- node_modules/progress/CHANGELOG.md | 115 - node_modules/progress/LICENSE | 22 - node_modules/progress/Makefile | 8 - node_modules/progress/Readme.md | 146 - node_modules/progress/index.js | 1 - node_modules/progress/lib/node-progress.js | 236 - node_modules/progress/package.json | 70 - node_modules/queue-microtask/LICENSE | 20 + node_modules/queue-microtask/README.md | 90 + node_modules/queue-microtask/index.d.ts | 2 + node_modules/queue-microtask/index.js | 9 + node_modules/queue-microtask/package.json | 55 + node_modules/regexpp/index.d.ts | 247 - node_modules/regexpp/index.js.map | 1 - node_modules/regexpp/index.mjs.map | 1 - node_modules/regexpp/package.json | 112 - node_modules/require-from-string/index.js | 34 - node_modules/require-from-string/license | 21 - node_modules/require-from-string/package.json | 58 - node_modules/require-from-string/readme.md | 56 - node_modules/reusify/.coveralls.yml | 1 + node_modules/reusify/.travis.yml | 28 + .../node_modules/ajv => reusify}/LICENSE | 2 +- node_modules/reusify/README.md | 145 + .../benchmarks/createNoCodeFunction.js | 30 + node_modules/reusify/benchmarks/fib.js | 13 + .../reusify/benchmarks/reuseNoCodeFunction.js | 38 + node_modules/reusify/package.json | 45 + node_modules/reusify/reusify.js | 33 + node_modules/reusify/test.js | 66 + node_modules/run-parallel/LICENSE | 20 + node_modules/run-parallel/README.md | 85 + node_modules/run-parallel/index.js | 51 + node_modules/run-parallel/package.json | 58 + node_modules/slice-ansi/index.js | 103 - node_modules/slice-ansi/package.json | 84 - node_modules/slice-ansi/readme.md | 66 - node_modules/strip-ansi/package.json | 140 +- node_modules/table/LICENSE | 24 - node_modules/table/README.md | 734 -- node_modules/table/dist/alignString.js | 108 - node_modules/table/dist/alignString.js.flow | 96 - node_modules/table/dist/alignString.js.map | 1 - node_modules/table/dist/alignTableData.js | 35 - .../table/dist/alignTableData.js.flow | 21 - node_modules/table/dist/alignTableData.js.map | 1 - .../table/dist/calculateCellHeight.js | 38 - .../table/dist/calculateCellHeight.js.flow | 24 - .../table/dist/calculateCellHeight.js.map | 1 - .../table/dist/calculateCellWidthIndex.js | 28 - .../dist/calculateCellWidthIndex.js.flow | 17 - .../table/dist/calculateCellWidthIndex.js.map | 1 - .../dist/calculateMaximumColumnWidthIndex.js | 37 - .../calculateMaximumColumnWidthIndex.js.flow | 27 - .../calculateMaximumColumnWidthIndex.js.map | 1 - .../table/dist/calculateRowHeightIndex.js | 48 - .../dist/calculateRowHeightIndex.js.flow | 35 - .../table/dist/calculateRowHeightIndex.js.map | 1 - node_modules/table/dist/createStream.js | 127 - node_modules/table/dist/createStream.js.flow | 126 - node_modules/table/dist/createStream.js.map | 1 - node_modules/table/dist/drawBorder.js | 110 - node_modules/table/dist/drawBorder.js.flow | 101 - node_modules/table/dist/drawBorder.js.map | 1 - node_modules/table/dist/drawRow.js | 26 - node_modules/table/dist/drawRow.js.flow | 15 - node_modules/table/dist/drawRow.js.map | 1 - node_modules/table/dist/drawTable.js | 59 - node_modules/table/dist/drawTable.js.flow | 53 - node_modules/table/dist/drawTable.js.map | 1 - .../table/dist/getBorderCharacters.js | 119 - .../table/dist/getBorderCharacters.js.flow | 120 - .../table/dist/getBorderCharacters.js.map | 1 - node_modules/table/dist/index.js | 32 - node_modules/table/dist/index.js.flow | 9 - node_modules/table/dist/index.js.map | 1 - node_modules/table/dist/makeConfig.js | 94 - node_modules/table/dist/makeConfig.js.flow | 76 - node_modules/table/dist/makeConfig.js.map | 1 - node_modules/table/dist/makeStreamConfig.js | 101 - .../table/dist/makeStreamConfig.js.flow | 83 - .../table/dist/makeStreamConfig.js.map | 1 - .../table/dist/mapDataUsingRowHeightIndex.js | 44 - .../dist/mapDataUsingRowHeightIndex.js.flow | 34 - .../dist/mapDataUsingRowHeightIndex.js.map | 1 - node_modules/table/dist/padTableData.js | 24 - node_modules/table/dist/padTableData.js.flow | 14 - node_modules/table/dist/padTableData.js.map | 1 - node_modules/table/dist/schemas/config.json | 23 - node_modules/table/dist/schemas/shared.json | 98 - .../table/dist/schemas/streamConfig.json | 20 - node_modules/table/dist/stringifyTableData.js | 22 - .../table/dist/stringifyTableData.js.flow | 11 - .../table/dist/stringifyTableData.js.map | 1 - node_modules/table/dist/table.js | 110 - node_modules/table/dist/table.js.flow | 96 - node_modules/table/dist/table.js.map | 1 - node_modules/table/dist/truncateTableData.js | 30 - .../table/dist/truncateTableData.js.flow | 17 - .../table/dist/truncateTableData.js.map | 1 - node_modules/table/dist/validateConfig.js | 43 - .../table/dist/validateConfig.js.flow | 28 - node_modules/table/dist/validateConfig.js.map | 1 - node_modules/table/dist/validateTableData.js | 55 - .../table/dist/validateTableData.js.flow | 44 - .../table/dist/validateTableData.js.map | 1 - node_modules/table/dist/validators.js | 1492 ---- node_modules/table/dist/wrapCell.js | 48 - node_modules/table/dist/wrapCell.js.flow | 35 - node_modules/table/dist/wrapCell.js.map | 1 - node_modules/table/dist/wrapString.js | 40 - node_modules/table/dist/wrapString.js.flow | 29 - node_modules/table/dist/wrapString.js.map | 1 - node_modules/table/dist/wrapWord.js | 47 - node_modules/table/dist/wrapWord.js.flow | 39 - node_modules/table/dist/wrapWord.js.map | 1 - .../table/node_modules/ajv/.tonic_example.js | 20 - node_modules/table/node_modules/ajv/README.md | 331 - .../table/node_modules/ajv/dist/2019.d.ts | 17 - .../table/node_modules/ajv/dist/2019.js | 50 - .../table/node_modules/ajv/dist/2019.js.map | 1 - .../table/node_modules/ajv/dist/ajv.d.ts | 16 - .../table/node_modules/ajv/dist/ajv.js | 39 - .../table/node_modules/ajv/dist/ajv.js.map | 1 - .../ajv/dist/compile/codegen/code.d.ts | 38 - .../ajv/dist/compile/codegen/code.js | 143 - .../ajv/dist/compile/codegen/code.js.map | 1 - .../ajv/dist/compile/codegen/index.d.ts | 79 - .../ajv/dist/compile/codegen/index.js | 696 -- .../ajv/dist/compile/codegen/index.js.map | 1 - .../ajv/dist/compile/codegen/scope.d.ts | 79 - .../ajv/dist/compile/codegen/scope.js | 143 - .../ajv/dist/compile/codegen/scope.js.map | 1 - .../ajv/dist/compile/context.d.ts | 38 - .../node_modules/ajv/dist/compile/context.js | 240 - .../ajv/dist/compile/context.js.map | 1 - .../node_modules/ajv/dist/compile/equal.d.ts | 2 - .../node_modules/ajv/dist/compile/equal.js | 5 - .../ajv/dist/compile/equal.js.map | 1 - .../ajv/dist/compile/error_classes.d.ts | 12 - .../ajv/dist/compile/error_classes.js | 25 - .../ajv/dist/compile/error_classes.js.map | 1 - .../node_modules/ajv/dist/compile/errors.d.ts | 8 - .../node_modules/ajv/dist/compile/errors.js | 121 - .../ajv/dist/compile/errors.js.map | 1 - .../node_modules/ajv/dist/compile/index.d.ts | 76 - .../node_modules/ajv/dist/compile/index.js | 235 - .../ajv/dist/compile/index.js.map | 1 - .../ajv/dist/compile/jtd/parse.d.ts | 4 - .../ajv/dist/compile/jtd/parse.js | 341 - .../ajv/dist/compile/jtd/parse.js.map | 1 - .../ajv/dist/compile/jtd/serialize.d.ts | 4 - .../ajv/dist/compile/jtd/serialize.js | 223 - .../ajv/dist/compile/jtd/serialize.js.map | 1 - .../ajv/dist/compile/jtd/types.d.ts | 6 - .../ajv/dist/compile/jtd/types.js | 14 - .../ajv/dist/compile/jtd/types.js.map | 1 - .../node_modules/ajv/dist/compile/names.d.ts | 20 - .../node_modules/ajv/dist/compile/names.js | 28 - .../ajv/dist/compile/names.js.map | 1 - .../ajv/dist/compile/resolve.d.ts | 12 - .../node_modules/ajv/dist/compile/resolve.js | 152 - .../ajv/dist/compile/resolve.js.map | 1 - .../node_modules/ajv/dist/compile/rules.d.ts | 28 - .../node_modules/ajv/dist/compile/rules.js | 26 - .../ajv/dist/compile/rules.js.map | 1 - .../ajv/dist/compile/subschema.d.ts | 28 - .../ajv/dist/compile/subschema.js | 107 - .../ajv/dist/compile/subschema.js.map | 1 - .../ajv/dist/compile/timestamp.d.ts | 5 - .../ajv/dist/compile/timestamp.js | 31 - .../ajv/dist/compile/timestamp.js.map | 1 - .../ajv/dist/compile/ucs2length.d.ts | 1 - .../ajv/dist/compile/ucs2length.js | 23 - .../ajv/dist/compile/ucs2length.js.map | 1 - .../node_modules/ajv/dist/compile/util.d.ts | 34 - .../node_modules/ajv/dist/compile/util.js | 148 - .../node_modules/ajv/dist/compile/util.js.map | 1 - .../dist/compile/validate/applicability.d.ts | 6 - .../dist/compile/validate/applicability.js | 19 - .../compile/validate/applicability.js.map | 1 - .../ajv/dist/compile/validate/boolSchema.d.ts | 4 - .../ajv/dist/compile/validate/boolSchema.js | 50 - .../dist/compile/validate/boolSchema.js.map | 1 - .../ajv/dist/compile/validate/dataType.d.ts | 17 - .../ajv/dist/compile/validate/dataType.js | 202 - .../ajv/dist/compile/validate/dataType.js.map | 1 - .../ajv/dist/compile/validate/defaults.d.ts | 2 - .../ajv/dist/compile/validate/defaults.js | 35 - .../ajv/dist/compile/validate/defaults.js.map | 1 - .../ajv/dist/compile/validate/index.d.ts | 6 - .../ajv/dist/compile/validate/index.js | 187 - .../ajv/dist/compile/validate/index.js.map | 1 - .../ajv/dist/compile/validate/iterate.d.ts | 4 - .../ajv/dist/compile/validate/iterate.js | 109 - .../ajv/dist/compile/validate/iterate.js.map | 1 - .../ajv/dist/compile/validate/keyword.d.ts | 4 - .../ajv/dist/compile/validate/keyword.js | 107 - .../ajv/dist/compile/validate/keyword.js.map | 1 - .../table/node_modules/ajv/dist/core.d.ts | 159 - .../table/node_modules/ajv/dist/core.js | 591 -- .../table/node_modules/ajv/dist/core.js.map | 1 - .../table/node_modules/ajv/dist/jtd.d.ts | 45 - .../table/node_modules/ajv/dist/jtd.js | 68 - .../table/node_modules/ajv/dist/jtd.js.map | 1 - .../node_modules/ajv/dist/refs/data.json | 13 - .../dist/refs/json-schema-2019-09/index.d.ts | 2 - .../dist/refs/json-schema-2019-09/index.js | 28 - .../refs/json-schema-2019-09/index.js.map | 1 - .../json-schema-2019-09/meta/applicator.json | 53 - .../json-schema-2019-09/meta/content.json | 17 - .../refs/json-schema-2019-09/meta/core.json | 57 - .../refs/json-schema-2019-09/meta/format.json | 14 - .../json-schema-2019-09/meta/meta-data.json | 37 - .../json-schema-2019-09/meta/validation.json | 90 - .../dist/refs/json-schema-2019-09/schema.json | 39 - .../ajv/dist/refs/json-schema-draft-06.json | 137 - .../ajv/dist/refs/json-schema-draft-07.json | 151 - .../ajv/dist/refs/json-schema-secure.json | 88 - .../ajv/dist/refs/jtd-schema.d.ts | 3 - .../node_modules/ajv/dist/refs/jtd-schema.js | 118 - .../ajv/dist/refs/jtd-schema.js.map | 1 - .../ajv/dist/runtime/parseJson.d.ts | 18 - .../ajv/dist/runtime/parseJson.js | 183 - .../ajv/dist/runtime/parseJson.js.map | 1 - .../node_modules/ajv/dist/runtime/quote.d.ts | 1 - .../node_modules/ajv/dist/runtime/quote.js | 28 - .../ajv/dist/runtime/quote.js.map | 1 - .../ajv/dist/standalone/index.d.ts | 5 - .../node_modules/ajv/dist/standalone/index.js | 81 - .../ajv/dist/standalone/index.js.map | 1 - .../ajv/dist/standalone/instance.d.ts | 12 - .../ajv/dist/standalone/instance.js | 35 - .../ajv/dist/standalone/instance.js.map | 1 - .../node_modules/ajv/dist/types/index.d.ts | 169 - .../node_modules/ajv/dist/types/index.js.map | 1 - .../ajv/dist/types/json-schema.d.ts | 104 - .../ajv/dist/types/json-schema.js.map | 1 - .../ajv/dist/types/jtd-schema.d.ts | 136 - .../ajv/dist/types/jtd-schema.js.map | 1 - .../applicator/additionalItems.d.ts | 6 - .../applicator/additionalItems.js | 45 - .../applicator/additionalItems.js.map | 1 - .../applicator/additionalProperties.d.ts | 6 - .../applicator/additionalProperties.js | 107 - .../applicator/additionalProperties.js.map | 1 - .../dist/vocabularies/applicator/allOf.d.ts | 3 - .../ajv/dist/vocabularies/applicator/allOf.js | 23 - .../dist/vocabularies/applicator/allOf.js.map | 1 - .../dist/vocabularies/applicator/anyOf.d.ts | 4 - .../ajv/dist/vocabularies/applicator/anyOf.js | 14 - .../dist/vocabularies/applicator/anyOf.js.map | 1 - .../vocabularies/applicator/contains.d.ts | 7 - .../dist/vocabularies/applicator/contains.js | 89 - .../vocabularies/applicator/contains.js.map | 1 - .../vocabularies/applicator/dependencies.d.ts | 21 - .../vocabularies/applicator/dependencies.js | 85 - .../applicator/dependencies.js.map | 1 - .../applicator/dependentSchemas.d.ts | 3 - .../applicator/dependentSchemas.js | 11 - .../applicator/dependentSchemas.js.map | 1 - .../ajv/dist/vocabularies/applicator/if.d.ts | 6 - .../ajv/dist/vocabularies/applicator/if.js | 67 - .../dist/vocabularies/applicator/if.js.map | 1 - .../dist/vocabularies/applicator/index.d.ts | 13 - .../ajv/dist/vocabularies/applicator/index.js | 37 - .../dist/vocabularies/applicator/index.js.map | 1 - .../dist/vocabularies/applicator/items.d.ts | 3 - .../ajv/dist/vocabularies/applicator/items.js | 51 - .../dist/vocabularies/applicator/items.js.map | 1 - .../ajv/dist/vocabularies/applicator/not.d.ts | 4 - .../ajv/dist/vocabularies/applicator/not.js | 28 - .../dist/vocabularies/applicator/not.js.map | 1 - .../dist/vocabularies/applicator/oneOf.d.ts | 6 - .../ajv/dist/vocabularies/applicator/oneOf.js | 58 - .../dist/vocabularies/applicator/oneOf.js.map | 1 - .../applicator/patternProperties.d.ts | 3 - .../applicator/patternProperties.js | 70 - .../applicator/patternProperties.js.map | 1 - .../vocabularies/applicator/properties.d.ts | 3 - .../vocabularies/applicator/properties.js | 54 - .../vocabularies/applicator/properties.js.map | 1 - .../applicator/propertyNames.d.ts | 6 - .../vocabularies/applicator/propertyNames.js | 38 - .../applicator/propertyNames.js.map | 1 - .../vocabularies/applicator/thenElse.d.ts | 3 - .../dist/vocabularies/applicator/thenElse.js | 13 - .../vocabularies/applicator/thenElse.js.map | 1 - .../ajv/dist/vocabularies/code.d.ts | 17 - .../ajv/dist/vocabularies/code.js | 127 - .../ajv/dist/vocabularies/code.js.map | 1 - .../ajv/dist/vocabularies/core/id.d.ts | 3 - .../ajv/dist/vocabularies/core/id.js | 10 - .../ajv/dist/vocabularies/core/id.js.map | 1 - .../ajv/dist/vocabularies/core/index.d.ts | 3 - .../ajv/dist/vocabularies/core/index.js | 16 - .../ajv/dist/vocabularies/core/index.js.map | 1 - .../ajv/dist/vocabularies/core/ref.d.ts | 8 - .../ajv/dist/vocabularies/core/ref.js | 123 - .../ajv/dist/vocabularies/core/ref.js.map | 1 - .../ajv/dist/vocabularies/draft7.d.ts | 3 - .../ajv/dist/vocabularies/draft7.js | 17 - .../ajv/dist/vocabularies/draft7.js.map | 1 - .../vocabularies/dynamic/dynamicAnchor.d.ts | 5 - .../vocabularies/dynamic/dynamicAnchor.js | 29 - .../vocabularies/dynamic/dynamicAnchor.js.map | 1 - .../dist/vocabularies/dynamic/dynamicRef.d.ts | 5 - .../dist/vocabularies/dynamic/dynamicRef.js | 51 - .../vocabularies/dynamic/dynamicRef.js.map | 1 - .../ajv/dist/vocabularies/dynamic/index.d.ts | 3 - .../ajv/dist/vocabularies/dynamic/index.js | 9 - .../dist/vocabularies/dynamic/index.js.map | 1 - .../vocabularies/dynamic/recursiveAnchor.d.ts | 3 - .../vocabularies/dynamic/recursiveAnchor.js | 16 - .../dynamic/recursiveAnchor.js.map | 1 - .../vocabularies/dynamic/recursiveRef.d.ts | 3 - .../dist/vocabularies/dynamic/recursiveRef.js | 10 - .../vocabularies/dynamic/recursiveRef.js.map | 1 - .../ajv/dist/vocabularies/errors.d.ts | 8 - .../ajv/dist/vocabularies/errors.js.map | 1 - .../ajv/dist/vocabularies/format/format.d.ts | 8 - .../ajv/dist/vocabularies/format/format.js | 91 - .../dist/vocabularies/format/format.js.map | 1 - .../ajv/dist/vocabularies/format/index.d.ts | 3 - .../ajv/dist/vocabularies/format/index.js | 6 - .../ajv/dist/vocabularies/format/index.js.map | 1 - .../dist/vocabularies/jtd/discriminator.d.ts | 3 - .../dist/vocabularies/jtd/discriminator.js | 38 - .../vocabularies/jtd/discriminator.js.map | 1 - .../ajv/dist/vocabularies/jtd/elements.d.ts | 3 - .../ajv/dist/vocabularies/jtd/elements.js | 22 - .../ajv/dist/vocabularies/jtd/elements.js.map | 1 - .../ajv/dist/vocabularies/jtd/enum.d.ts | 3 - .../ajv/dist/vocabularies/jtd/enum.js | 41 - .../ajv/dist/vocabularies/jtd/enum.js.map | 1 - .../ajv/dist/vocabularies/jtd/index.d.ts | 3 - .../ajv/dist/vocabularies/jtd/index.js | 30 - .../ajv/dist/vocabularies/jtd/index.js.map | 1 - .../ajv/dist/vocabularies/jtd/metadata.d.ts | 5 - .../ajv/dist/vocabularies/jtd/metadata.js | 25 - .../ajv/dist/vocabularies/jtd/metadata.js.map | 1 - .../ajv/dist/vocabularies/jtd/nullable.d.ts | 4 - .../ajv/dist/vocabularies/jtd/nullable.js | 22 - .../ajv/dist/vocabularies/jtd/nullable.js.map | 1 - .../vocabularies/jtd/optionalProperties.d.ts | 3 - .../vocabularies/jtd/optionalProperties.js | 14 - .../jtd/optionalProperties.js.map | 1 - .../ajv/dist/vocabularies/jtd/properties.d.ts | 5 - .../ajv/dist/vocabularies/jtd/properties.js | 118 - .../dist/vocabularies/jtd/properties.js.map | 1 - .../ajv/dist/vocabularies/jtd/ref.d.ts | 4 - .../ajv/dist/vocabularies/jtd/ref.js | 66 - .../ajv/dist/vocabularies/jtd/ref.js.map | 1 - .../ajv/dist/vocabularies/jtd/type.d.ts | 7 - .../ajv/dist/vocabularies/jtd/type.js | 46 - .../ajv/dist/vocabularies/jtd/type.js.map | 1 - .../ajv/dist/vocabularies/jtd/union.d.ts | 3 - .../ajv/dist/vocabularies/jtd/union.js | 11 - .../ajv/dist/vocabularies/jtd/union.js.map | 1 - .../ajv/dist/vocabularies/jtd/values.d.ts | 3 - .../ajv/dist/vocabularies/jtd/values.js | 43 - .../ajv/dist/vocabularies/jtd/values.js.map | 1 - .../ajv/dist/vocabularies/metadata.d.ts | 3 - .../ajv/dist/vocabularies/metadata.js | 18 - .../ajv/dist/vocabularies/metadata.js.map | 1 - .../ajv/dist/vocabularies/next.d.ts | 3 - .../ajv/dist/vocabularies/next.js | 8 - .../ajv/dist/vocabularies/next.js.map | 1 - .../dist/vocabularies/unevaluated/index.d.ts | 3 - .../dist/vocabularies/unevaluated/index.js | 7 - .../vocabularies/unevaluated/index.js.map | 1 - .../unevaluated/unevaluatedItems.d.ts | 6 - .../unevaluated/unevaluatedItems.js | 41 - .../unevaluated/unevaluatedItems.js.map | 1 - .../unevaluated/unevaluatedProperties.d.ts | 6 - .../unevaluated/unevaluatedProperties.js | 66 - .../unevaluated/unevaluatedProperties.js.map | 1 - .../dist/vocabularies/validation/const.d.ts | 6 - .../ajv/dist/vocabularies/validation/const.js | 23 - .../dist/vocabularies/validation/const.js.map | 1 - .../validation/dependentRequired.d.ts | 5 - .../validation/dependentRequired.js | 12 - .../validation/dependentRequired.js.map | 1 - .../dist/vocabularies/validation/enum.d.ts | 8 - .../ajv/dist/vocabularies/validation/enum.js | 49 - .../dist/vocabularies/validation/enum.js.map | 1 - .../dist/vocabularies/validation/index.d.ts | 16 - .../ajv/dist/vocabularies/validation/index.js | 33 - .../dist/vocabularies/validation/index.js.map | 1 - .../validation/limitContains.d.ts | 3 - .../vocabularies/validation/limitContains.js | 15 - .../validation/limitContains.js.map | 1 - .../vocabularies/validation/limitItems.d.ts | 3 - .../vocabularies/validation/limitItems.js | 24 - .../vocabularies/validation/limitItems.js.map | 1 - .../vocabularies/validation/limitLength.d.ts | 3 - .../vocabularies/validation/limitLength.js | 36 - .../validation/limitLength.js.map | 1 - .../vocabularies/validation/limitNumber.d.ts | 11 - .../vocabularies/validation/limitNumber.js | 27 - .../validation/limitNumber.js.map | 1 - .../validation/limitProperties.d.ts | 3 - .../validation/limitProperties.js | 24 - .../validation/limitProperties.js.map | 1 - .../vocabularies/validation/multipleOf.d.ts | 8 - .../vocabularies/validation/multipleOf.js | 26 - .../vocabularies/validation/multipleOf.js.map | 1 - .../dist/vocabularies/validation/pattern.d.ts | 8 - .../dist/vocabularies/validation/pattern.js | 22 - .../vocabularies/validation/pattern.js.map | 1 - .../vocabularies/validation/required.d.ts | 8 - .../dist/vocabularies/validation/required.js | 79 - .../vocabularies/validation/required.js.map | 1 - .../vocabularies/validation/uniqueItems.d.ts | 9 - .../vocabularies/validation/uniqueItems.js | 66 - .../validation/uniqueItems.js.map | 1 - .../table/node_modules/ajv/lib/2019.ts | 72 - .../table/node_modules/ajv/lib/ajv.ts | 61 - .../ajv/lib/compile/codegen/code.ts | 156 - .../ajv/lib/compile/codegen/index.ts | 832 --- .../ajv/lib/compile/codegen/scope.ts | 215 - .../node_modules/ajv/lib/compile/context.ts | 266 - .../node_modules/ajv/lib/compile/equal.js | 3 - .../ajv/lib/compile/error_classes.ts | 30 - .../node_modules/ajv/lib/compile/errors.ts | 154 - .../node_modules/ajv/lib/compile/index.ts | 312 - .../node_modules/ajv/lib/compile/jtd/parse.ts | 403 -- .../ajv/lib/compile/jtd/serialize.ts | 266 - .../node_modules/ajv/lib/compile/jtd/types.ts | 16 - .../node_modules/ajv/lib/compile/names.ts | 27 - .../node_modules/ajv/lib/compile/resolve.ts | 145 - .../node_modules/ajv/lib/compile/rules.ts | 50 - .../node_modules/ajv/lib/compile/subschema.ts | 169 - .../node_modules/ajv/lib/compile/timestamp.ts | 31 - .../ajv/lib/compile/ucs2length.ts | 18 - .../node_modules/ajv/lib/compile/util.ts | 176 - .../ajv/lib/compile/validate/applicability.ts | 22 - .../ajv/lib/compile/validate/boolSchema.ts | 47 - .../ajv/lib/compile/validate/dataType.ts | 229 - .../ajv/lib/compile/validate/defaults.ts | 32 - .../ajv/lib/compile/validate/index.ts | 199 - .../ajv/lib/compile/validate/iterate.ts | 116 - .../ajv/lib/compile/validate/keyword.ts | 144 - .../table/node_modules/ajv/lib/core.ts | 827 --- .../table/node_modules/ajv/lib/jtd.ts | 128 - .../table/node_modules/ajv/lib/refs/data.json | 13 - .../ajv/lib/refs/json-schema-2019-09/index.ts | 28 - .../json-schema-2019-09/meta/applicator.json | 53 - .../json-schema-2019-09/meta/content.json | 17 - .../refs/json-schema-2019-09/meta/core.json | 57 - .../refs/json-schema-2019-09/meta/format.json | 14 - .../json-schema-2019-09/meta/meta-data.json | 37 - .../json-schema-2019-09/meta/validation.json | 90 - .../lib/refs/json-schema-2019-09/schema.json | 39 - .../ajv/lib/refs/json-schema-draft-06.json | 137 - .../ajv/lib/refs/json-schema-draft-07.json | 151 - .../ajv/lib/refs/json-schema-secure.json | 88 - .../node_modules/ajv/lib/refs/jtd-schema.ts | 130 - .../node_modules/ajv/lib/runtime/parseJson.ts | 175 - .../node_modules/ajv/lib/runtime/quote.ts | 28 - .../node_modules/ajv/lib/standalone/index.ts | 88 - .../ajv/lib/standalone/instance.ts | 36 - .../table/node_modules/ajv/lib/types/index.ts | 223 - .../node_modules/ajv/lib/types/json-schema.ts | 120 - .../node_modules/ajv/lib/types/jtd-schema.ts | 228 - .../applicator/additionalItems.ts | 53 - .../applicator/additionalProperties.ts | 118 - .../ajv/lib/vocabularies/applicator/allOf.ts | 22 - .../ajv/lib/vocabularies/applicator/anyOf.ts | 16 - .../lib/vocabularies/applicator/contains.ts | 104 - .../vocabularies/applicator/dependencies.ts | 112 - .../applicator/dependentSchemas.ts | 11 - .../ajv/lib/vocabularies/applicator/if.ts | 81 - .../ajv/lib/vocabularies/applicator/index.ts | 49 - .../ajv/lib/vocabularies/applicator/items.ts | 56 - .../ajv/lib/vocabularies/applicator/not.ts | 40 - .../ajv/lib/vocabularies/applicator/oneOf.ts | 81 - .../applicator/patternProperties.ts | 76 - .../lib/vocabularies/applicator/properties.ts | 57 - .../vocabularies/applicator/propertyNames.ts | 50 - .../lib/vocabularies/applicator/thenElse.ts | 13 - .../node_modules/ajv/lib/vocabularies/code.ts | 163 - .../ajv/lib/vocabularies/core/id.ts | 10 - .../ajv/lib/vocabularies/core/index.ts | 16 - .../ajv/lib/vocabularies/core/ref.ts | 130 - .../ajv/lib/vocabularies/draft7.ts | 17 - .../lib/vocabularies/dynamic/dynamicAnchor.ts | 30 - .../lib/vocabularies/dynamic/dynamicRef.ts | 51 - .../ajv/lib/vocabularies/dynamic/index.ts | 9 - .../vocabularies/dynamic/recursiveAnchor.ts | 14 - .../lib/vocabularies/dynamic/recursiveRef.ts | 10 - .../ajv/lib/vocabularies/errors.ts | 16 - .../ajv/lib/vocabularies/format/format.ts | 118 - .../ajv/lib/vocabularies/format/index.ts | 6 - .../ajv/lib/vocabularies/jtd/discriminator.ts | 44 - .../ajv/lib/vocabularies/jtd/elements.ts | 22 - .../ajv/lib/vocabularies/jtd/enum.ts | 39 - .../ajv/lib/vocabularies/jtd/index.ts | 30 - .../ajv/lib/vocabularies/jtd/metadata.ts | 24 - .../ajv/lib/vocabularies/jtd/nullable.ts | 18 - .../vocabularies/jtd/optionalProperties.ts | 14 - .../ajv/lib/vocabularies/jtd/properties.ts | 129 - .../ajv/lib/vocabularies/jtd/ref.ts | 71 - .../ajv/lib/vocabularies/jtd/type.ts | 49 - .../ajv/lib/vocabularies/jtd/union.ts | 11 - .../ajv/lib/vocabularies/jtd/values.ts | 48 - .../ajv/lib/vocabularies/metadata.ts | 17 - .../node_modules/ajv/lib/vocabularies/next.ts | 8 - .../ajv/lib/vocabularies/unevaluated/index.ts | 7 - .../unevaluated/unevaluatedItems.ts | 48 - .../unevaluated/unevaluatedProperties.ts | 86 - .../ajv/lib/vocabularies/validation/const.ts | 27 - .../validation/dependentRequired.ts | 23 - .../ajv/lib/vocabularies/validation/enum.ts | 54 - .../ajv/lib/vocabularies/validation/index.ts | 49 - .../vocabularies/validation/limitContains.ts | 16 - .../lib/vocabularies/validation/limitItems.ts | 26 - .../vocabularies/validation/limitLength.ts | 37 - .../vocabularies/validation/limitNumber.ts | 42 - .../validation/limitProperties.ts | 26 - .../lib/vocabularies/validation/multipleOf.ts | 34 - .../lib/vocabularies/validation/pattern.ts | 26 - .../lib/vocabularies/validation/required.ts | 98 - .../vocabularies/validation/uniqueItems.ts | 81 - .../table/node_modules/ajv/package.json | 150 - .../node_modules/ajv/scripts/.eslintrc.yml | 5 - .../table/node_modules/ajv/scripts/bundle.js | 48 - .../ajv/scripts/get-contributors.js | 57 - .../node_modules/ajv/scripts/jsontests.js | 31 - .../node_modules/ajv/scripts/prepare-site | 15 - .../node_modules/ajv/scripts/prepare-tests | 12 - .../node_modules/ajv/scripts/publish-bundles | 37 - .../node_modules/ajv/scripts/publish-site | 25 - .../json-schema-traverse/.eslintrc.yml | 27 - .../json-schema-traverse/.github/FUNDING.yml | 2 - .../.github/workflows/build.yml | 28 - .../.github/workflows/publish.yml | 27 - .../json-schema-traverse/README.md | 95 - .../json-schema-traverse/index.d.ts | 40 - .../json-schema-traverse/index.js | 93 - .../json-schema-traverse/package.json | 70 - .../json-schema-traverse/spec/.eslintrc.yml | 6 - .../spec/fixtures/schema.js | 125 - .../json-schema-traverse/spec/index.spec.js | 171 - node_modules/table/package.json | 118 - node_modules/v8-compile-cache/CHANGELOG.md | 53 - node_modules/v8-compile-cache/README.md | 55 - node_modules/v8-compile-cache/package.json | 66 - .../v8-compile-cache/v8-compile-cache.js | 371 - 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 | 1269 ++-- package.json | 2 +- 1629 files changed, 99448 insertions(+), 77510 deletions(-) rename node_modules/{ => @eslint-community}/eslint-utils/LICENSE (100%) create mode 100644 node_modules/@eslint-community/eslint-utils/README.md rename node_modules/{ => @eslint-community}/eslint-utils/index.js (88%) create mode 100644 node_modules/@eslint-community/eslint-utils/index.js.map rename node_modules/{ => @eslint-community}/eslint-utils/index.mjs (87%) create mode 100644 node_modules/@eslint-community/eslint-utils/index.mjs.map create mode 100644 node_modules/@eslint-community/eslint-utils/package.json rename node_modules/{ => @eslint-community}/regexpp/LICENSE (100%) rename node_modules/{ => @eslint-community}/regexpp/README.md (85%) create mode 100644 node_modules/@eslint-community/regexpp/index.d.ts rename node_modules/{ => @eslint-community}/regexpp/index.js (76%) create mode 100644 node_modules/@eslint-community/regexpp/index.js.map rename node_modules/{ => @eslint-community}/regexpp/index.mjs (76%) create mode 100644 node_modules/@eslint-community/regexpp/index.mjs.map create mode 100644 node_modules/@eslint-community/regexpp/package.json delete mode 100644 node_modules/@eslint/eslintrc/CHANGELOG.md delete mode 100644 node_modules/@eslint/eslintrc/conf/eslint-all.js delete mode 100644 node_modules/@eslint/eslintrc/conf/eslint-recommended.js create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc.cjs create mode 100644 node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map create mode 100644 node_modules/@eslint/eslintrc/lib/index-universal.js create mode 120000 node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/README.md create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/argparse.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/lib/sub.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/lib/textwrap.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/argparse/package.json create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/CHANGELOG.md rename node_modules/{functional-red-black-tree => @eslint/eslintrc/node_modules/js-yaml}/LICENSE (94%) create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md create mode 100755 node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.mjs create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/common.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/dumper.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/exception.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/loader.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/core.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/default.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/failsafe.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/json.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/snippet.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/binary.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/bool.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/float.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/int.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/map.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/merge.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/null.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/omap.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/pairs.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/seq.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/set.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/str.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/timestamp.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/base.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/index.d.ts rename node_modules/{astral-regex => @eslint/eslintrc/node_modules/type-fest}/license (92%) create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/package.json create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/readme.md create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/async-return-type.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/asyncify.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/basic.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-except.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-keys.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-pick.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/entries.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/entry.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/except.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/fixed-length-array.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/iterable-element.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/literal-union.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/mutable.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/opaque.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/package-json.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/partial-deep.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/promisable.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/promise-value.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-optional.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-required.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-return-type.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/stringified.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/tsconfig-json.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/union-to-intersection.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/utilities.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/source/value-of.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/camel-case.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/delimiter-case.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/index.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/kebab-case.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/pascal-case.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/snake-case.d.ts create mode 100644 node_modules/@eslint/eslintrc/universal.js rename node_modules/{enquirer => @eslint/js}/LICENSE (93%) create mode 100644 node_modules/@eslint/js/README.md create mode 100644 node_modules/@eslint/js/package.json create mode 100644 node_modules/@eslint/js/src/configs/eslint-all.js rename node_modules/{eslint/conf => @eslint/js/src/configs}/eslint-recommended.js (87%) create mode 100644 node_modules/@eslint/js/src/index.js create mode 100644 node_modules/@humanwhocodes/config-array/CHANGELOG.md rename node_modules/{espree/node_modules/eslint-visitor-keys => @humanwhocodes/config-array}/LICENSE (99%) create mode 100644 node_modules/@humanwhocodes/config-array/README.md create mode 100644 node_modules/@humanwhocodes/config-array/api.js create mode 100644 node_modules/@humanwhocodes/config-array/package.json create mode 100644 node_modules/@humanwhocodes/module-importer/CHANGELOG.md rename node_modules/{eslint-utils/node_modules/eslint-visitor-keys => @humanwhocodes/module-importer}/LICENSE (99%) create mode 100644 node_modules/@humanwhocodes/module-importer/README.md create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts create mode 100644 node_modules/@humanwhocodes/module-importer/dist/module-importer.js create mode 100644 node_modules/@humanwhocodes/module-importer/package.json create mode 100644 node_modules/@humanwhocodes/module-importer/src/module-importer.cjs create mode 100644 node_modules/@humanwhocodes/module-importer/src/module-importer.js create mode 100644 node_modules/@humanwhocodes/object-schema/.eslintrc.js create mode 100644 node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml create mode 100644 node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml create mode 100644 node_modules/@humanwhocodes/object-schema/CHANGELOG.md create mode 100644 node_modules/@humanwhocodes/object-schema/LICENSE create mode 100644 node_modules/@humanwhocodes/object-schema/README.md create mode 100644 node_modules/@humanwhocodes/object-schema/package.json create mode 100644 node_modules/@humanwhocodes/object-schema/src/index.js create mode 100644 node_modules/@humanwhocodes/object-schema/src/merge-strategy.js create mode 100644 node_modules/@humanwhocodes/object-schema/src/object-schema.js create mode 100644 node_modules/@humanwhocodes/object-schema/src/validation-strategy.js create mode 100644 node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js create mode 100644 node_modules/@humanwhocodes/object-schema/tests/object-schema.js create mode 100644 node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js rename node_modules/{v8-compile-cache => @nodelib/fs.scandir}/LICENSE (96%) create mode 100644 node_modules/@nodelib/fs.scandir/README.md create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js create mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts rename node_modules/{table/node_modules/ajv/dist => @nodelib/fs.scandir/out}/types/index.js (70%) create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts rename node_modules/{table/node_modules/ajv/dist/types/json-schema.js => @nodelib/fs.scandir/out/utils/index.js} (53%) create mode 100644 node_modules/@nodelib/fs.scandir/package.json create mode 100644 node_modules/@nodelib/fs.stat/LICENSE create mode 100644 node_modules/@nodelib/fs.stat/README.md create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/index.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/settings.js create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts rename node_modules/{table/node_modules/ajv/dist/vocabularies/errors.js => @nodelib/fs.stat/out/types/index.js} (69%) create mode 100644 node_modules/@nodelib/fs.stat/package.json create mode 100644 node_modules/@nodelib/fs.walk/LICENSE create mode 100644 node_modules/@nodelib/fs.walk/README.md create mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/settings.js create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts rename node_modules/{table/node_modules/ajv/dist/types/jtd-schema.js => @nodelib/fs.walk/out/types/index.js} (66%) create mode 100644 node_modules/@nodelib/fs.walk/package.json create mode 100644 node_modules/acorn-jsx/index.d.ts delete mode 100644 node_modules/acorn/dist/acorn.js.map delete mode 100644 node_modules/acorn/dist/acorn.mjs.map delete mode 100644 node_modules/ansi-colors/README.md delete mode 100644 node_modules/ansi-colors/index.js delete mode 100644 node_modules/ansi-colors/package.json delete mode 100644 node_modules/ansi-colors/symbols.js delete mode 100644 node_modules/ansi-colors/types/index.d.ts delete mode 100644 node_modules/astral-regex/index.d.ts delete mode 100644 node_modules/astral-regex/index.js delete mode 100644 node_modules/astral-regex/package.json delete mode 100644 node_modules/astral-regex/readme.md delete mode 100644 node_modules/enquirer/CHANGELOG.md delete mode 100644 node_modules/enquirer/README.md delete mode 100644 node_modules/enquirer/index.d.ts delete mode 100644 node_modules/enquirer/index.js delete mode 100644 node_modules/enquirer/lib/ansi.js delete mode 100644 node_modules/enquirer/lib/combos.js delete mode 100644 node_modules/enquirer/lib/completer.js delete mode 100644 node_modules/enquirer/lib/interpolate.js delete mode 100644 node_modules/enquirer/lib/keypress.js delete mode 100644 node_modules/enquirer/lib/placeholder.js delete mode 100644 node_modules/enquirer/lib/prompt.js delete mode 100644 node_modules/enquirer/lib/prompts/autocomplete.js delete mode 100644 node_modules/enquirer/lib/prompts/basicauth.js delete mode 100644 node_modules/enquirer/lib/prompts/confirm.js delete mode 100644 node_modules/enquirer/lib/prompts/editable.js delete mode 100644 node_modules/enquirer/lib/prompts/form.js delete mode 100644 node_modules/enquirer/lib/prompts/index.js delete mode 100644 node_modules/enquirer/lib/prompts/input.js delete mode 100644 node_modules/enquirer/lib/prompts/invisible.js delete mode 100644 node_modules/enquirer/lib/prompts/list.js delete mode 100644 node_modules/enquirer/lib/prompts/multiselect.js delete mode 100644 node_modules/enquirer/lib/prompts/numeral.js delete mode 100644 node_modules/enquirer/lib/prompts/password.js delete mode 100644 node_modules/enquirer/lib/prompts/quiz.js delete mode 100644 node_modules/enquirer/lib/prompts/scale.js delete mode 100644 node_modules/enquirer/lib/prompts/select.js delete mode 100644 node_modules/enquirer/lib/prompts/snippet.js delete mode 100644 node_modules/enquirer/lib/prompts/sort.js delete mode 100644 node_modules/enquirer/lib/prompts/survey.js delete mode 100644 node_modules/enquirer/lib/prompts/text.js delete mode 100644 node_modules/enquirer/lib/prompts/toggle.js delete mode 100644 node_modules/enquirer/lib/render.js delete mode 100644 node_modules/enquirer/lib/roles.js delete mode 100644 node_modules/enquirer/lib/state.js delete mode 100644 node_modules/enquirer/lib/styles.js delete mode 100644 node_modules/enquirer/lib/symbols.js delete mode 100644 node_modules/enquirer/lib/theme.js delete mode 100644 node_modules/enquirer/lib/timer.js delete mode 100644 node_modules/enquirer/lib/types/array.js delete mode 100644 node_modules/enquirer/lib/types/auth.js delete mode 100644 node_modules/enquirer/lib/types/boolean.js delete mode 100644 node_modules/enquirer/lib/types/index.js delete mode 100644 node_modules/enquirer/lib/types/number.js delete mode 100644 node_modules/enquirer/lib/types/string.js delete mode 100644 node_modules/enquirer/lib/utils.js delete mode 100644 node_modules/enquirer/package.json delete mode 100644 node_modules/eslint-scope/CHANGELOG.md create mode 100644 node_modules/eslint-scope/dist/eslint-scope.cjs create mode 100644 node_modules/eslint-scope/lib/version.js delete mode 100644 node_modules/eslint-scope/node_modules/estraverse/.jshintrc delete mode 100644 node_modules/eslint-scope/node_modules/estraverse/LICENSE.BSD delete mode 100644 node_modules/eslint-scope/node_modules/estraverse/README.md delete mode 100644 node_modules/eslint-scope/node_modules/estraverse/estraverse.js delete mode 100644 node_modules/eslint-scope/node_modules/estraverse/gulpfile.js delete mode 100644 node_modules/eslint-scope/node_modules/estraverse/package.json delete mode 100644 node_modules/eslint-utils/README.md delete mode 100644 node_modules/eslint-utils/index.js.map delete mode 100644 node_modules/eslint-utils/index.mjs.map delete mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md delete mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md delete mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js delete mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json delete mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json delete mode 100644 node_modules/eslint-utils/package.json delete mode 100644 node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs create mode 100644 node_modules/eslint-visitor-keys/dist/index.d.ts create mode 100644 node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts rename node_modules/{espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json => eslint-visitor-keys/lib/visitor-keys.js} (53%) delete mode 100644 node_modules/eslint-visitor-keys/lib/visitor-keys.json delete mode 100644 node_modules/eslint/CHANGELOG.md delete mode 100644 node_modules/eslint/conf/eslint-all.js create mode 100644 node_modules/eslint/conf/globals.js rename node_modules/eslint/conf/{category-list.json => rule-type-list.json} (66%) delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/codeframe.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-message.html delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-page.html delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-result.html delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/table.js create mode 100644 node_modules/eslint/lib/config/default-config.js create mode 100644 node_modules/eslint/lib/config/flat-config-array.js create mode 100644 node_modules/eslint/lib/config/flat-config-helpers.js create mode 100644 node_modules/eslint/lib/config/flat-config-schema.js create mode 100644 node_modules/eslint/lib/config/rule-validator.js create mode 100644 node_modules/eslint/lib/eslint/eslint-helpers.js create mode 100644 node_modules/eslint/lib/eslint/flat-eslint.js delete mode 100644 node_modules/eslint/lib/init/autoconfig.js delete mode 100644 node_modules/eslint/lib/init/config-file.js delete mode 100644 node_modules/eslint/lib/init/config-initializer.js delete mode 100644 node_modules/eslint/lib/init/config-rule.js delete mode 100644 node_modules/eslint/lib/init/npm-utils.js delete mode 100644 node_modules/eslint/lib/init/source-code-utils.js create mode 100644 node_modules/eslint/lib/rule-tester/flat-rule-tester.js create mode 100644 node_modules/eslint/lib/rules/logical-assignment-operators.js create mode 100644 node_modules/eslint/lib/rules/no-constant-binary-expression.js create mode 100644 node_modules/eslint/lib/rules/no-empty-static-block.js create mode 100644 node_modules/eslint/lib/rules/no-new-native-nonconstructor.js create mode 100644 node_modules/eslint/lib/rules/no-unused-private-class-members.js create mode 100644 node_modules/eslint/lib/rules/prefer-object-has-own.js create mode 100644 node_modules/eslint/lib/shared/directives.js create mode 100644 node_modules/eslint/lib/shared/string-utils.js create mode 100644 node_modules/eslint/lib/unsupported-api.js rename node_modules/eslint/messages/{all-files-ignored.txt => all-files-ignored.js} (50%) create mode 100644 node_modules/eslint/messages/extend-config-missing.js delete mode 100644 node_modules/eslint/messages/extend-config-missing.txt create mode 100644 node_modules/eslint/messages/failed-to-read-json.js delete mode 100644 node_modules/eslint/messages/failed-to-read-json.txt create mode 100644 node_modules/eslint/messages/file-not-found.js delete mode 100644 node_modules/eslint/messages/file-not-found.txt create mode 100644 node_modules/eslint/messages/no-config-found.js delete mode 100644 node_modules/eslint/messages/no-config-found.txt create mode 100644 node_modules/eslint/messages/plugin-conflict.js delete mode 100644 node_modules/eslint/messages/plugin-conflict.txt create mode 100644 node_modules/eslint/messages/plugin-invalid.js delete mode 100644 node_modules/eslint/messages/plugin-invalid.txt create mode 100644 node_modules/eslint/messages/plugin-missing.js delete mode 100644 node_modules/eslint/messages/plugin-missing.txt create mode 100644 node_modules/eslint/messages/print-config-with-directory-path.js delete mode 100644 node_modules/eslint/messages/print-config-with-directory-path.txt create mode 100644 node_modules/eslint/messages/whitespace-found.js delete mode 100644 node_modules/eslint/messages/whitespace-found.txt create mode 120000 node_modules/eslint/node_modules/.bin/js-yaml delete mode 120000 node_modules/eslint/node_modules/.bin/semver delete mode 100644 node_modules/eslint/node_modules/@babel/code-frame/README.md delete mode 100644 node_modules/eslint/node_modules/@babel/code-frame/lib/index.js delete mode 100644 node_modules/eslint/node_modules/@babel/code-frame/package.json create mode 100644 node_modules/eslint/node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/eslint/node_modules/argparse/LICENSE create mode 100644 node_modules/eslint/node_modules/argparse/README.md create mode 100644 node_modules/eslint/node_modules/argparse/argparse.js create mode 100644 node_modules/eslint/node_modules/argparse/lib/sub.js create mode 100644 node_modules/eslint/node_modules/argparse/lib/textwrap.js create mode 100644 node_modules/eslint/node_modules/argparse/package.json create mode 100644 node_modules/eslint/node_modules/escape-string-regexp/index.d.ts create mode 100644 node_modules/eslint/node_modules/escape-string-regexp/index.js rename node_modules/{slice-ansi => eslint/node_modules/escape-string-regexp}/license (96%) create mode 100644 node_modules/eslint/node_modules/escape-string-regexp/package.json create mode 100644 node_modules/eslint/node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/eslint/node_modules/find-up/index.d.ts create mode 100644 node_modules/eslint/node_modules/find-up/index.js create mode 100644 node_modules/eslint/node_modules/find-up/license create mode 100644 node_modules/eslint/node_modules/find-up/package.json create mode 100644 node_modules/eslint/node_modules/find-up/readme.md create mode 100644 node_modules/eslint/node_modules/js-yaml/CHANGELOG.md rename node_modules/{ansi-colors => eslint/node_modules/js-yaml}/LICENSE (93%) create mode 100644 node_modules/eslint/node_modules/js-yaml/README.md create mode 100755 node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/eslint/node_modules/js-yaml/dist/js-yaml.mjs create mode 100644 node_modules/eslint/node_modules/js-yaml/index.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/common.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/dumper.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/exception.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/loader.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/schema.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/schema/core.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/schema/default.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/schema/failsafe.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/schema/json.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/snippet.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/binary.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/bool.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/float.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/int.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/map.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/merge.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/null.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/omap.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/pairs.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/seq.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/set.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/str.js create mode 100644 node_modules/eslint/node_modules/js-yaml/lib/type/timestamp.js create mode 100644 node_modules/eslint/node_modules/js-yaml/package.json create mode 100644 node_modules/eslint/node_modules/locate-path/index.d.ts create mode 100644 node_modules/eslint/node_modules/locate-path/index.js create mode 100644 node_modules/eslint/node_modules/locate-path/license create mode 100644 node_modules/eslint/node_modules/locate-path/package.json create mode 100644 node_modules/eslint/node_modules/locate-path/readme.md create mode 100644 node_modules/eslint/node_modules/p-limit/index.d.ts create mode 100644 node_modules/eslint/node_modules/p-limit/index.js create mode 100644 node_modules/eslint/node_modules/p-limit/license create mode 100644 node_modules/eslint/node_modules/p-limit/package.json create mode 100644 node_modules/eslint/node_modules/p-limit/readme.md create mode 100644 node_modules/eslint/node_modules/p-locate/index.d.ts create mode 100644 node_modules/eslint/node_modules/p-locate/index.js create mode 100644 node_modules/eslint/node_modules/p-locate/license create mode 100644 node_modules/eslint/node_modules/p-locate/package.json create mode 100644 node_modules/eslint/node_modules/p-locate/readme.md delete mode 100644 node_modules/eslint/node_modules/semver/CHANGELOG.md delete mode 100644 node_modules/eslint/node_modules/semver/README.md delete mode 100755 node_modules/eslint/node_modules/semver/bin/semver.js delete mode 100644 node_modules/eslint/node_modules/semver/classes/comparator.js delete mode 100644 node_modules/eslint/node_modules/semver/classes/index.js delete mode 100644 node_modules/eslint/node_modules/semver/classes/range.js delete mode 100644 node_modules/eslint/node_modules/semver/classes/semver.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/clean.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/cmp.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/coerce.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/compare-build.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/compare-loose.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/compare.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/diff.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/eq.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/gt.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/gte.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/inc.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/lt.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/lte.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/major.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/minor.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/neq.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/parse.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/patch.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/prerelease.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/rcompare.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/rsort.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/satisfies.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/sort.js delete mode 100644 node_modules/eslint/node_modules/semver/functions/valid.js delete mode 100644 node_modules/eslint/node_modules/semver/index.js delete mode 100644 node_modules/eslint/node_modules/semver/internal/constants.js delete mode 100644 node_modules/eslint/node_modules/semver/internal/debug.js delete mode 100644 node_modules/eslint/node_modules/semver/internal/identifiers.js delete mode 100644 node_modules/eslint/node_modules/semver/internal/parse-options.js delete mode 100644 node_modules/eslint/node_modules/semver/internal/re.js delete mode 100644 node_modules/eslint/node_modules/semver/package.json delete mode 100644 node_modules/eslint/node_modules/semver/preload.js delete mode 100644 node_modules/eslint/node_modules/semver/range.bnf delete mode 100644 node_modules/eslint/node_modules/semver/ranges/gtr.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/intersects.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/ltr.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/max-satisfying.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/min-satisfying.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/min-version.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/outside.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/simplify.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/subset.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/to-comparators.js delete mode 100644 node_modules/eslint/node_modules/semver/ranges/valid.js delete mode 100644 node_modules/espree/CHANGELOG.md create mode 100644 node_modules/espree/dist/espree.cjs delete mode 100644 node_modules/espree/lib/ast-node-types.js create mode 100644 node_modules/espree/lib/version.js delete mode 100644 node_modules/espree/lib/visitor-keys.js delete mode 120000 node_modules/espree/node_modules/.bin/acorn delete mode 100644 node_modules/espree/node_modules/acorn/CHANGELOG.md delete mode 100644 node_modules/espree/node_modules/acorn/LICENSE delete mode 100644 node_modules/espree/node_modules/acorn/README.md delete mode 100755 node_modules/espree/node_modules/acorn/bin/acorn delete mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.d.ts delete mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.js.map delete mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.mjs delete mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.mjs.d.ts delete mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.mjs.map delete mode 100644 node_modules/espree/node_modules/acorn/dist/bin.js delete mode 100644 node_modules/espree/node_modules/acorn/package.json delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/CHANGELOG.md delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/README.md delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/fastq/.github/dependabot.yml create mode 100644 node_modules/fastq/.github/workflows/ci.yml rename node_modules/{eslint/node_modules/semver => fastq}/LICENSE (81%) create mode 100644 node_modules/fastq/README.md create mode 100644 node_modules/fastq/bench.js create mode 100644 node_modules/fastq/example.js create mode 100644 node_modules/fastq/example.mjs create mode 100644 node_modules/fastq/index.d.ts create mode 100644 node_modules/fastq/package.json create mode 100644 node_modules/fastq/queue.js create mode 100644 node_modules/fastq/test/example.ts create mode 100644 node_modules/fastq/test/promise.js create mode 100644 node_modules/fastq/test/test.js create mode 100644 node_modules/fastq/test/tsconfig.json delete mode 100644 node_modules/functional-red-black-tree/.npmignore delete mode 100644 node_modules/functional-red-black-tree/README.md delete mode 100644 node_modules/functional-red-black-tree/bench/test.js delete mode 100644 node_modules/functional-red-black-tree/package.json delete mode 100644 node_modules/functional-red-black-tree/rbtree.js delete mode 100644 node_modules/functional-red-black-tree/test/test.js delete mode 100644 node_modules/glob-parent/CHANGELOG.md create mode 100644 node_modules/grapheme-splitter/LICENSE create mode 100644 node_modules/grapheme-splitter/README.md create mode 100644 node_modules/grapheme-splitter/index.d.ts create mode 100644 node_modules/grapheme-splitter/index.js create mode 100644 node_modules/grapheme-splitter/package.json create mode 100644 node_modules/grapheme-splitter/tests/GraphemeBreakTest.txt create mode 100644 node_modules/grapheme-splitter/tests/grapheme_splitter_tests.js delete mode 100644 node_modules/ignore/CHANGELOG.md mode change 100755 => 100644 node_modules/ignore/LICENSE-MIT mode change 100755 => 100644 node_modules/ignore/README.md mode change 100755 => 100644 node_modules/ignore/index.js create mode 100644 node_modules/is-path-inside/index.d.ts create mode 100644 node_modules/is-path-inside/index.js create mode 100644 node_modules/is-path-inside/license create mode 100644 node_modules/is-path-inside/package.json create mode 100644 node_modules/is-path-inside/readme.md create mode 100644 node_modules/js-sdsl/CHANGELOG.md rename node_modules/{table/node_modules/json-schema-traverse => js-sdsl}/LICENSE (96%) create mode 100644 node_modules/js-sdsl/README.md create mode 100644 node_modules/js-sdsl/README.zh-CN.md create mode 100644 node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js create mode 100644 node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/index.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/index.js create mode 100644 node_modules/js-sdsl/dist/cjs/index.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/utils/checkObject.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/utils/checkObject.js create mode 100644 node_modules/js-sdsl/dist/cjs/utils/checkObject.js.map create mode 100644 node_modules/js-sdsl/dist/cjs/utils/throwError.d.ts create mode 100644 node_modules/js-sdsl/dist/cjs/utils/throwError.js create mode 100644 node_modules/js-sdsl/dist/cjs/utils/throwError.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js create mode 100644 node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js create mode 100644 node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js create mode 100644 node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js.map create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js create mode 100644 node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js.map create mode 100644 node_modules/js-sdsl/dist/esm/index.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/index.js create mode 100644 node_modules/js-sdsl/dist/esm/index.js.map create mode 100644 node_modules/js-sdsl/dist/esm/utils/checkObject.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/utils/checkObject.js create mode 100644 node_modules/js-sdsl/dist/esm/utils/checkObject.js.map create mode 100644 node_modules/js-sdsl/dist/esm/utils/throwError.d.ts create mode 100644 node_modules/js-sdsl/dist/esm/utils/throwError.js create mode 100644 node_modules/js-sdsl/dist/esm/utils/throwError.js.map create mode 100644 node_modules/js-sdsl/dist/umd/js-sdsl.js create mode 100644 node_modules/js-sdsl/dist/umd/js-sdsl.min.js create mode 100644 node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map create mode 100644 node_modules/js-sdsl/package.json rename node_modules/{eslint/node_modules/@babel/code-frame => lodash.merge}/LICENSE (52%) create mode 100644 node_modules/lodash.merge/README.md create mode 100644 node_modules/lodash.merge/index.js create mode 100644 node_modules/lodash.merge/package.json delete mode 100644 node_modules/progress/CHANGELOG.md delete mode 100644 node_modules/progress/LICENSE delete mode 100644 node_modules/progress/Makefile delete mode 100644 node_modules/progress/Readme.md delete mode 100644 node_modules/progress/index.js delete mode 100644 node_modules/progress/lib/node-progress.js delete mode 100644 node_modules/progress/package.json create mode 100755 node_modules/queue-microtask/LICENSE create mode 100644 node_modules/queue-microtask/README.md create mode 100644 node_modules/queue-microtask/index.d.ts create mode 100644 node_modules/queue-microtask/index.js create mode 100644 node_modules/queue-microtask/package.json delete mode 100644 node_modules/regexpp/index.d.ts delete mode 100644 node_modules/regexpp/index.js.map delete mode 100644 node_modules/regexpp/index.mjs.map delete mode 100644 node_modules/regexpp/package.json delete mode 100644 node_modules/require-from-string/index.js delete mode 100644 node_modules/require-from-string/license delete mode 100644 node_modules/require-from-string/package.json delete mode 100644 node_modules/require-from-string/readme.md create mode 100644 node_modules/reusify/.coveralls.yml create mode 100644 node_modules/reusify/.travis.yml rename node_modules/{table/node_modules/ajv => reusify}/LICENSE (96%) create mode 100644 node_modules/reusify/README.md create mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js create mode 100644 node_modules/reusify/benchmarks/fib.js create mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js create mode 100644 node_modules/reusify/package.json create mode 100644 node_modules/reusify/reusify.js create mode 100644 node_modules/reusify/test.js create mode 100644 node_modules/run-parallel/LICENSE create mode 100644 node_modules/run-parallel/README.md create mode 100644 node_modules/run-parallel/index.js create mode 100644 node_modules/run-parallel/package.json delete mode 100755 node_modules/slice-ansi/index.js delete mode 100644 node_modules/slice-ansi/package.json delete mode 100644 node_modules/slice-ansi/readme.md delete mode 100644 node_modules/table/LICENSE delete mode 100644 node_modules/table/README.md delete mode 100644 node_modules/table/dist/alignString.js delete mode 100644 node_modules/table/dist/alignString.js.flow delete mode 100644 node_modules/table/dist/alignString.js.map delete mode 100644 node_modules/table/dist/alignTableData.js delete mode 100644 node_modules/table/dist/alignTableData.js.flow delete mode 100644 node_modules/table/dist/alignTableData.js.map delete mode 100644 node_modules/table/dist/calculateCellHeight.js delete mode 100644 node_modules/table/dist/calculateCellHeight.js.flow delete mode 100644 node_modules/table/dist/calculateCellHeight.js.map delete mode 100644 node_modules/table/dist/calculateCellWidthIndex.js delete mode 100644 node_modules/table/dist/calculateCellWidthIndex.js.flow delete mode 100644 node_modules/table/dist/calculateCellWidthIndex.js.map delete mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js delete mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow delete mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map delete mode 100644 node_modules/table/dist/calculateRowHeightIndex.js delete mode 100644 node_modules/table/dist/calculateRowHeightIndex.js.flow delete mode 100644 node_modules/table/dist/calculateRowHeightIndex.js.map delete mode 100644 node_modules/table/dist/createStream.js delete mode 100644 node_modules/table/dist/createStream.js.flow delete mode 100644 node_modules/table/dist/createStream.js.map delete mode 100644 node_modules/table/dist/drawBorder.js delete mode 100644 node_modules/table/dist/drawBorder.js.flow delete mode 100644 node_modules/table/dist/drawBorder.js.map delete mode 100644 node_modules/table/dist/drawRow.js delete mode 100644 node_modules/table/dist/drawRow.js.flow delete mode 100644 node_modules/table/dist/drawRow.js.map delete mode 100644 node_modules/table/dist/drawTable.js delete mode 100644 node_modules/table/dist/drawTable.js.flow delete mode 100644 node_modules/table/dist/drawTable.js.map delete mode 100644 node_modules/table/dist/getBorderCharacters.js delete mode 100644 node_modules/table/dist/getBorderCharacters.js.flow delete mode 100644 node_modules/table/dist/getBorderCharacters.js.map delete mode 100644 node_modules/table/dist/index.js delete mode 100644 node_modules/table/dist/index.js.flow delete mode 100644 node_modules/table/dist/index.js.map delete mode 100644 node_modules/table/dist/makeConfig.js delete mode 100644 node_modules/table/dist/makeConfig.js.flow delete mode 100644 node_modules/table/dist/makeConfig.js.map delete mode 100644 node_modules/table/dist/makeStreamConfig.js delete mode 100644 node_modules/table/dist/makeStreamConfig.js.flow delete mode 100644 node_modules/table/dist/makeStreamConfig.js.map delete mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js delete mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow delete mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js.map delete mode 100644 node_modules/table/dist/padTableData.js delete mode 100644 node_modules/table/dist/padTableData.js.flow delete mode 100644 node_modules/table/dist/padTableData.js.map delete mode 100644 node_modules/table/dist/schemas/config.json delete mode 100644 node_modules/table/dist/schemas/shared.json delete mode 100644 node_modules/table/dist/schemas/streamConfig.json delete mode 100644 node_modules/table/dist/stringifyTableData.js delete mode 100644 node_modules/table/dist/stringifyTableData.js.flow delete mode 100644 node_modules/table/dist/stringifyTableData.js.map delete mode 100644 node_modules/table/dist/table.js delete mode 100644 node_modules/table/dist/table.js.flow delete mode 100644 node_modules/table/dist/table.js.map delete mode 100644 node_modules/table/dist/truncateTableData.js delete mode 100644 node_modules/table/dist/truncateTableData.js.flow delete mode 100644 node_modules/table/dist/truncateTableData.js.map delete mode 100644 node_modules/table/dist/validateConfig.js delete mode 100644 node_modules/table/dist/validateConfig.js.flow delete mode 100644 node_modules/table/dist/validateConfig.js.map delete mode 100644 node_modules/table/dist/validateTableData.js delete mode 100644 node_modules/table/dist/validateTableData.js.flow delete mode 100644 node_modules/table/dist/validateTableData.js.map delete mode 100644 node_modules/table/dist/validators.js delete mode 100644 node_modules/table/dist/wrapCell.js delete mode 100644 node_modules/table/dist/wrapCell.js.flow delete mode 100644 node_modules/table/dist/wrapCell.js.map delete mode 100644 node_modules/table/dist/wrapString.js delete mode 100644 node_modules/table/dist/wrapString.js.flow delete mode 100644 node_modules/table/dist/wrapString.js.map delete mode 100644 node_modules/table/dist/wrapWord.js delete mode 100644 node_modules/table/dist/wrapWord.js.flow delete mode 100644 node_modules/table/dist/wrapWord.js.map delete mode 100644 node_modules/table/node_modules/ajv/.tonic_example.js delete mode 100644 node_modules/table/node_modules/ajv/README.md delete mode 100644 node_modules/table/node_modules/ajv/dist/2019.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/2019.js delete mode 100644 node_modules/table/node_modules/ajv/dist/2019.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/ajv.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/ajv.js delete mode 100644 node_modules/table/node_modules/ajv/dist/ajv.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/code.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/code.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/scope.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/context.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/context.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/context.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/equal.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/equal.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/equal.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/error_classes.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/error_classes.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/error_classes.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/errors.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/errors.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/errors.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/parse.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/types.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/types.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/jtd/types.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/names.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/names.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/names.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/resolve.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/resolve.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/rules.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/rules.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/rules.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/subschema.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/subschema.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/subschema.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/timestamp.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/timestamp.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/timestamp.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/ucs2length.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/ucs2length.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/ucs2length.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/util.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/util.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/util.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/applicability.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/dataType.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/defaults.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/iterate.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/keyword.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/core.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/core.js delete mode 100644 node_modules/table/node_modules/ajv/dist/core.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/jtd.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/jtd.js delete mode 100644 node_modules/table/node_modules/ajv/dist/jtd.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/data.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/jtd-schema.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/parseJson.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/parseJson.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/parseJson.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/quote.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/quote.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/quote.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/standalone/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/standalone/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/standalone/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/standalone/instance.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/standalone/instance.js delete mode 100644 node_modules/table/node_modules/ajv/dist/standalone/instance.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/types/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/types/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/types/json-schema.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/types/jtd-schema.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/code.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/code.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/code.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/id.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/draft7.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/errors.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/format/format.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/format/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/metadata.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/next.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/next.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/next.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map delete mode 100644 node_modules/table/node_modules/ajv/lib/2019.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/ajv.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/codegen/code.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/codegen/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/codegen/scope.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/context.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/equal.js delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/error_classes.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/errors.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/jtd/parse.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/jtd/serialize.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/jtd/types.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/names.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/resolve.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/rules.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/subschema.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/timestamp.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/ucs2length.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/util.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/applicability.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/boolSchema.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/dataType.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/defaults.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/iterate.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/keyword.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/core.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/jtd.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/data.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/jtd-schema.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/runtime/parseJson.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/runtime/quote.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/standalone/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/standalone/instance.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/types/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/types/json-schema.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/allOf.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/contains.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/if.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/not.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/properties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/code.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/core/id.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/core/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/core/ref.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/draft7.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/errors.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/format/format.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/format/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/elements.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/enum.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/metadata.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/nullable.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/ref.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/type.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/union.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/metadata.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/next.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/const.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/enum.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitContains.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitItems.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitLength.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/pattern.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/required.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts delete mode 100644 node_modules/table/node_modules/ajv/package.json delete mode 100644 node_modules/table/node_modules/ajv/scripts/.eslintrc.yml delete mode 100644 node_modules/table/node_modules/ajv/scripts/bundle.js delete mode 100644 node_modules/table/node_modules/ajv/scripts/get-contributors.js delete mode 100644 node_modules/table/node_modules/ajv/scripts/jsontests.js delete mode 100755 node_modules/table/node_modules/ajv/scripts/prepare-site delete mode 100755 node_modules/table/node_modules/ajv/scripts/prepare-tests delete mode 100755 node_modules/table/node_modules/ajv/scripts/publish-bundles delete mode 100755 node_modules/table/node_modules/ajv/scripts/publish-site delete mode 100644 node_modules/table/node_modules/json-schema-traverse/.eslintrc.yml delete mode 100644 node_modules/table/node_modules/json-schema-traverse/.github/FUNDING.yml delete mode 100644 node_modules/table/node_modules/json-schema-traverse/.github/workflows/build.yml delete mode 100644 node_modules/table/node_modules/json-schema-traverse/.github/workflows/publish.yml delete mode 100644 node_modules/table/node_modules/json-schema-traverse/README.md delete mode 100644 node_modules/table/node_modules/json-schema-traverse/index.d.ts delete mode 100644 node_modules/table/node_modules/json-schema-traverse/index.js delete mode 100644 node_modules/table/node_modules/json-schema-traverse/package.json delete mode 100644 node_modules/table/node_modules/json-schema-traverse/spec/.eslintrc.yml delete mode 100644 node_modules/table/node_modules/json-schema-traverse/spec/fixtures/schema.js delete mode 100644 node_modules/table/node_modules/json-schema-traverse/spec/index.spec.js delete mode 100644 node_modules/table/package.json delete mode 100644 node_modules/v8-compile-cache/CHANGELOG.md delete mode 100644 node_modules/v8-compile-cache/README.md delete mode 100644 node_modules/v8-compile-cache/package.json delete mode 100644 node_modules/v8-compile-cache/v8-compile-cache.js 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/node_modules/.package-lock.json b/node_modules/.package-lock.json index dc8fcf918..68c6136f1 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -530,33 +530,66 @@ "node": ">=0.1.95" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", + "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", + "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", + "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.5.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" @@ -565,6 +598,72 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", + "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "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", @@ -823,6 +922,41 @@ "integrity": "sha512-77lub4Hu7iZVuxFU+CD50tJ+0rKTxqcNNYrfx8etHmWUdMWdgSHGZx7BfIex/leDW4oxkzY/FQUmHMpp0vnZeg==", "license": "UNLICENSED" }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@octokit/auth-token": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", @@ -1064,9 +1198,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.1.0.tgz", - "integrity": "sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1098,9 +1232,9 @@ } }, "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -1130,15 +1264,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1167,9 +1292,9 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "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" @@ -1285,15 +1410,6 @@ "node": ">=0.10.0" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -1919,9 +2035,9 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "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" @@ -2140,18 +2256,6 @@ "once": "^1.4.0" } }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2202,141 +2306,136 @@ } }, "node_modules/eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", + "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.5.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, "engines": { - "node": ">=4.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/eslint/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": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, "engines": { - "node": ">=4" + "node": ">= 8" } }, - "node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/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==", + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">= 8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/globals": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", - "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2348,6 +2447,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/eslint/node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2361,6 +2472,21 @@ "node": ">= 0.8.0" } }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -2378,6 +2504,36 @@ "node": ">= 0.8.0" } }, + "node_modules/eslint/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/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -2396,21 +2552,6 @@ "node": ">= 0.8.0" } }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint/node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2472,38 +2613,20 @@ } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", + "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -2520,9 +2643,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -2824,6 +2947,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -2943,12 +3075,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3026,15 +3152,15 @@ } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/globals": { @@ -3052,6 +3178,12 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -3233,9 +3365,9 @@ } }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -3442,7 +3574,7 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3467,9 +3599,9 @@ } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -3487,6 +3619,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "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", @@ -4300,6 +4441,16 @@ "node": ">= 10.14.2" } }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4555,6 +4706,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4660,9 +4817,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "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" @@ -5236,15 +5393,6 @@ "node": ">= 10" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/prompts": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", @@ -5289,6 +5437,26 @@ "node": ">=0.6" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -5354,18 +5522,6 @@ "node": ">=0.10.0" } }, - "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -5497,15 +5653,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -5562,6 +5709,16 @@ "node": ">=0.12" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5586,6 +5743,29 @@ "node": "6.* || >= 7.*" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5905,23 +6085,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, "node_modules/snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -6283,12 +6446,12 @@ } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "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.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -6364,43 +6527,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", - "dev": true, - "dependencies": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.3.tgz", - "integrity": "sha512-idv5WZvKVXDqKralOImQgPM9v6WOdLNa0IY3B3doOjw/YxRGT8I+allIJ6kd7Uaj+SF1xZUSU+nPM5aDNBVtnw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -6718,12 +6844,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-to-istanbul": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz", @@ -6975,6 +7095,18 @@ "engines": { "node": ">=6" } + }, + "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/eslint-utils/LICENSE b/node_modules/@eslint-community/eslint-utils/LICENSE similarity index 100% rename from node_modules/eslint-utils/LICENSE rename to node_modules/@eslint-community/eslint-utils/LICENSE diff --git a/node_modules/@eslint-community/eslint-utils/README.md b/node_modules/@eslint-community/eslint-utils/README.md new file mode 100644 index 000000000..90552a94e --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/README.md @@ -0,0 +1,37 @@ +# @eslint-community/eslint-utils + +[![npm version](https://img.shields.io/npm/v/@eslint-community/eslint-utils.svg)](https://www.npmjs.com/package/@eslint-community/eslint-utils) +[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/eslint-utils.svg)](http://www.npmtrends.com/@eslint-community/eslint-utils) +[![Build Status](https://github.com/eslint-community/eslint-utils/workflows/CI/badge.svg)](https://github.com/eslint-community/eslint-utils/actions) +[![Coverage Status](https://codecov.io/gh/eslint-community/eslint-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/eslint-utils) + +## 🏁 Goal + +This package provides utility functions and classes for make ESLint custom rules. + +For examples: + +- [`getStaticValue`](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST. +- [`ReferenceTracker`](https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. + +## 📖 Usage + +See [documentation](https://eslint-community.github.io/eslint-utils). + +## 📰 Changelog + +See [releases](https://github.com/eslint-community/eslint-utils/releases). + +## ❤️ Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run clean` removes the coverage result of `npm test` command. +- `npm run coverage` shows the coverage result of the last `npm test` command. +- `npm run lint` runs ESLint. +- `npm run watch` runs tests on each file change. diff --git a/node_modules/eslint-utils/index.js b/node_modules/@eslint-community/eslint-utils/index.js similarity index 88% rename from node_modules/eslint-utils/index.js rename to node_modules/@eslint-community/eslint-utils/index.js index 3d55509aa..ccf35c38a 100644 --- a/node_modules/eslint-utils/index.js +++ b/node_modules/@eslint-community/eslint-utils/index.js @@ -1,11 +1,8 @@ -/*! @author Toru Nagashima */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var evk = _interopDefault(require('eslint-visitor-keys')); +var eslintVisitorKeys = require('eslint-visitor-keys'); /** * Get the innermost scope which contains a given location. @@ -80,13 +77,23 @@ function negate(f) { return negate0.bind(f) } +/** + * Checks if the given token is a PunctuatorToken with the given value + * @param {Token} token - The token to check. + * @param {string} value - The value to check. + * @returns {boolean} `true` if the token is a PunctuatorToken with the given value. + */ +function isPunctuatorTokenWithValue(token, value) { + return token.type === "Punctuator" && token.value === value +} + /** * Checks if the given token is an arrow token or not. * @param {Token} token - The token to check. * @returns {boolean} `true` if the token is an arrow token. */ function isArrowToken(token) { - return token.value === "=>" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "=>") } /** @@ -95,7 +102,7 @@ function isArrowToken(token) { * @returns {boolean} `true` if the token is a comma token. */ function isCommaToken(token) { - return token.value === "," && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ",") } /** @@ -104,7 +111,7 @@ function isCommaToken(token) { * @returns {boolean} `true` if the token is a semicolon token. */ function isSemicolonToken(token) { - return token.value === ";" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ";") } /** @@ -113,7 +120,7 @@ function isSemicolonToken(token) { * @returns {boolean} `true` if the token is a colon token. */ function isColonToken(token) { - return token.value === ":" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ":") } /** @@ -122,7 +129,7 @@ function isColonToken(token) { * @returns {boolean} `true` if the token is an opening parenthesis token. */ function isOpeningParenToken(token) { - return token.value === "(" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "(") } /** @@ -131,7 +138,7 @@ function isOpeningParenToken(token) { * @returns {boolean} `true` if the token is a closing parenthesis token. */ function isClosingParenToken(token) { - return token.value === ")" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ")") } /** @@ -140,7 +147,7 @@ function isClosingParenToken(token) { * @returns {boolean} `true` if the token is an opening square bracket token. */ function isOpeningBracketToken(token) { - return token.value === "[" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "[") } /** @@ -149,7 +156,7 @@ function isOpeningBracketToken(token) { * @returns {boolean} `true` if the token is a closing square bracket token. */ function isClosingBracketToken(token) { - return token.value === "]" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "]") } /** @@ -158,7 +165,7 @@ function isClosingBracketToken(token) { * @returns {boolean} `true` if the token is an opening brace token. */ function isOpeningBraceToken(token) { - return token.value === "{" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "{") } /** @@ -167,7 +174,7 @@ function isOpeningBraceToken(token) { * @returns {boolean} `true` if the token is a closing brace token. */ function isClosingBraceToken(token) { - return token.value === "}" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "}") } /** @@ -176,11 +183,7 @@ function isClosingBraceToken(token) { * @returns {boolean} `true` if the token is a comment token. */ function isCommentToken(token) { - return ( - token.type === "Line" || - token.type === "Block" || - token.type === "Shebang" - ) + return ["Block", "Line", "Shebang"].includes(token.type) } const isNotArrowToken = negate(isArrowToken); @@ -225,7 +228,8 @@ function getFunctionHeadLocation(node, sourceCode) { end = arrowToken.loc.end; } else if ( parent.type === "Property" || - parent.type === "MethodDefinition" + parent.type === "MethodDefinition" || + parent.type === "PropertyDefinition" ) { start = parent.loc.start; end = getOpeningParenOfParams(node, sourceCode).loc.start; @@ -235,12 +239,12 @@ function getFunctionHeadLocation(node, sourceCode) { } return { - start: Object.assign({}, start), - end: Object.assign({}, end), + start: { ...start }, + end: { ...end }, } } -/* globals BigInt, globalThis, global, self, window */ +/* globals globalThis, global, self, window */ const globalObject = typeof globalThis !== "undefined" @@ -301,7 +305,7 @@ const builtinNames = Object.freeze( "unescape", "WeakMap", "WeakSet", - ]) + ]), ); const callAllowed = new Set( [ @@ -319,8 +323,8 @@ const callAllowed = new Set( isNaN, isPrototypeOf, ...Object.getOwnPropertyNames(Math) - .map(k => Math[k]) - .filter(f => typeof f === "function"), + .map((k) => Math[k]) + .filter((f) => typeof f === "function"), Number, Number.isFinite, Number.isNaN, @@ -341,11 +345,10 @@ const callAllowed = new Set( String.fromCharCode, String.fromCodePoint, String.raw, - Symbol, Symbol.for, Symbol.keyFor, unescape, - ].filter(f => typeof f === "function") + ].filter((f) => typeof f === "function"), ); const callPassThrough = new Set([ Object.freeze, @@ -469,7 +472,7 @@ const operations = Object.freeze({ case "%": return { value: left.value % right.value } case "**": - return { value: Math.pow(left.value, right.value) } + return { value: left.value ** right.value } case "|": return { value: left.value | right.value } case "^": @@ -490,6 +493,9 @@ const operations = Object.freeze({ if (args != null) { if (calleeNode.type === "MemberExpression") { + if (calleeNode.property.type === "PrivateIdentifier") { + return null + } const object = getStaticValueR(calleeNode.object, initialScope); if (object != null) { if ( @@ -498,9 +504,10 @@ const operations = Object.freeze({ ) { return { value: undefined, optional: true } } - const property = calleeNode.computed - ? getStaticValueR(calleeNode.property, initialScope) - : { value: calleeNode.property.name }; + const property = getStaticPropertyNameValue( + calleeNode, + initialScope, + ); if (property != null) { const receiver = object.value; @@ -607,14 +614,15 @@ const operations = Object.freeze({ }, MemberExpression(node, initialScope) { + if (node.property.type === "PrivateIdentifier") { + return null + } const object = getStaticValueR(node.object, initialScope); if (object != null) { if (object.value == null && (object.optional || node.optional)) { return { value: undefined, optional: true } } - const property = node.computed - ? getStaticValueR(node.property, initialScope) - : { value: node.property.name }; + const property = getStaticPropertyNameValue(node, initialScope); if (property != null && !isGetter(object.value, property.value)) { return { value: object.value[property.value] } @@ -653,9 +661,10 @@ const operations = Object.freeze({ if (propertyNode.kind !== "init") { return null } - const key = propertyNode.computed - ? getStaticValueR(propertyNode.key, initialScope) - : { value: propertyNode.key.name }; + const key = getStaticPropertyNameValue( + propertyNode, + initialScope, + ); const value = getStaticValueR(propertyNode.value, initialScope); if (key == null || value == null) { return null @@ -667,7 +676,7 @@ const operations = Object.freeze({ ) { const argument = getStaticValueR( propertyNode.argument, - initialScope + initialScope, ); if (argument == null) { return null @@ -690,13 +699,13 @@ const operations = Object.freeze({ const tag = getStaticValueR(node.tag, initialScope); const expressions = getElementValues( node.quasi.expressions, - initialScope + initialScope, ); if (tag != null && expressions != null) { const func = tag.value; - const strings = node.quasi.quasis.map(q => q.value.cooked); - strings.raw = node.quasi.quasis.map(q => q.value.raw); + const strings = node.quasi.quasis.map((q) => q.value.cooked); + strings.raw = node.quasi.quasis.map((q) => q.value.raw); if (func === String.raw) { return { value: func(strings, ...expressions) } @@ -763,6 +772,33 @@ function getStaticValueR(node, initialScope) { return null } +/** + * Get the static value of property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`. + */ +function getStaticPropertyNameValue(node, initialScope) { + const nameNode = node.type === "Property" ? node.key : node.property; + + if (node.computed) { + return getStaticValueR(nameNode, initialScope) + } + + if (nameNode.type === "Identifier") { + return { value: nameNode.name } + } + + if (nameNode.type === "Literal") { + if (nameNode.bigint) { + return { value: nameNode.bigint } + } + return { value: String(nameNode.value) } + } + + return null +} + /** * Get the value of a given node if it's a static value. * @param {Node} node The node to get. @@ -810,16 +846,23 @@ function getPropertyName(node, initialScope) { if (node.computed) { return getStringIfConstant(node.property, initialScope) } + if (node.property.type === "PrivateIdentifier") { + return null + } return node.property.name case "Property": case "MethodDefinition": + case "PropertyDefinition": if (node.computed) { return getStringIfConstant(node.key, initialScope) } if (node.key.type === "Literal") { return String(node.key.value) } + if (node.key.type === "PrivateIdentifier") { + return null + } return node.key.name // no default @@ -831,14 +874,27 @@ function getPropertyName(node, initialScope) { /** * Get the name and kind of the given function node. * @param {ASTNode} node - The function node to get. + * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys. * @returns {string} The name and kind of the function node. */ -function getFunctionNameWithKind(node) { +// eslint-disable-next-line complexity +function getFunctionNameWithKind(node, sourceCode) { const parent = node.parent; const tokens = []; - - if (parent.type === "MethodDefinition" && parent.static) { - tokens.push("static"); + const isObjectMethod = parent.type === "Property" && parent.value === node; + const isClassMethod = + parent.type === "MethodDefinition" && parent.value === node; + const isClassFieldMethod = + parent.type === "PropertyDefinition" && parent.value === node; + + // Modifiers. + if (isClassMethod || isClassFieldMethod) { + if (parent.static) { + tokens.push("static"); + } + if (parent.key.type === "PrivateIdentifier") { + tokens.push("private"); + } } if (node.async) { tokens.push("async"); @@ -847,12 +903,8 @@ function getFunctionNameWithKind(node) { tokens.push("generator"); } - if (node.type === "ArrowFunctionExpression") { - tokens.push("arrow", "function"); - } else if ( - parent.type === "Property" || - parent.type === "MethodDefinition" - ) { + // Kinds. + if (isObjectMethod || isClassMethod) { if (parent.kind === "constructor") { return "constructor" } @@ -863,35 +915,50 @@ function getFunctionNameWithKind(node) { } else { tokens.push("method"); } + } else if (isClassFieldMethod) { + tokens.push("method"); } else { - tokens.push("function"); - } - - if (node.id) { - tokens.push(`'${node.id.name}'`); - } else { - const name = getPropertyName(parent); - - if (name) { - tokens.push(`'${name}'`); + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow"); } + tokens.push("function"); } - if (node.type === "ArrowFunctionExpression") { - if ( - parent.type === "VariableDeclarator" && - parent.id && - parent.id.type === "Identifier" - ) { - tokens.push(`'${parent.id.name}'`); - } - if ( - parent.type === "AssignmentExpression" && - parent.left && - parent.left.type === "Identifier" - ) { - tokens.push(`'${parent.left.name}'`); + // Names. + if (isObjectMethod || isClassMethod || isClassFieldMethod) { + if (parent.key.type === "PrivateIdentifier") { + tokens.push(`#${parent.key.name}`); + } else { + const name = getPropertyName(parent); + if (name) { + tokens.push(`'${name}'`); + } else if (sourceCode) { + const keyText = sourceCode.getText(parent.key); + if (!keyText.includes("\n")) { + tokens.push(`[${keyText}]`); + } + } } + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } else if ( + parent.type === "VariableDeclarator" && + parent.id && + parent.id.type === "Identifier" + ) { + tokens.push(`'${parent.id.name}'`); + } else if ( + (parent.type === "AssignmentExpression" || + parent.type === "AssignmentPattern") && + parent.left && + parent.left.type === "Identifier" + ) { + tokens.push(`'${parent.left.name}'`); + } else if ( + parent.type === "ExportDefaultDeclaration" && + parent.declaration === node + ) { + tokens.push("'default'"); } return tokens.join(" ") @@ -917,7 +984,7 @@ const typeConversionBinaryOps = Object.freeze( "^", "&", "in", - ]) + ]), ); const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); @@ -945,7 +1012,7 @@ const visitor = Object.freeze( $visitChildren(node, options, visitorKeys) { const { type } = node; - for (const key of visitorKeys[type] || evk.getKeys(node)) { + for (const key of visitorKeys[type] || eslintVisitorKeys.getKeys(node)) { const value = node[key]; if (Array.isArray(value)) { @@ -1032,6 +1099,16 @@ const visitor = Object.freeze( } return this.$visitChildren(node, options, visitorKeys) }, + PropertyDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, UnaryExpression(node, options, visitorKeys) { if (node.operator === "delete") { return true @@ -1051,7 +1128,7 @@ const visitor = Object.freeze( YieldExpression() { return true }, - }) + }), ); /** @@ -1061,18 +1138,18 @@ const visitor = Object.freeze( * @param {object} [options] The option object. * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects. * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects. - * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. + * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. * @returns {boolean} `true` if the node has a certain side effect. */ function hasSideEffect( node, sourceCode, - { considerGetters = false, considerImplicitTypeConversion = false } = {} + { considerGetters = false, considerImplicitTypeConversion = false } = {}, ) { return visitor.$visit( node, { considerGetters, considerImplicitTypeConversion }, - sourceCode.visitorKeys || evk.KEYS + sourceCode.visitorKeys || eslintVisitorKeys.KEYS, ) } @@ -1092,7 +1169,7 @@ function getParentSyntaxParen(node, sourceCode) { if (parent.arguments.length === 1 && parent.arguments[0] === node) { return sourceCode.getTokenAfter( parent.callee, - isOpeningParenToken + isOpeningParenToken, ) } return null @@ -1101,7 +1178,7 @@ function getParentSyntaxParen(node, sourceCode) { if (parent.test === node) { return sourceCode.getTokenAfter( parent.body, - isOpeningParenToken + isOpeningParenToken, ) } return null @@ -1152,7 +1229,7 @@ function getParentSyntaxParen(node, sourceCode) { function isParenthesized( timesOrNode, nodeOrSourceCode, - optionalSourceCode + optionalSourceCode, ) { let times, node, sourceCode, maybeLeftParen, maybeRightParen; if (typeof timesOrNode === "number") { @@ -1168,7 +1245,13 @@ function isParenthesized( sourceCode = nodeOrSourceCode; } - if (node == null) { + if ( + node == null || + // `Program` can't be parenthesized + node.parent == null || + // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}` + (node.parent.type === "CatchClause" && node.parent.param === node) + ) { return false } @@ -1368,7 +1451,7 @@ function isModifiedGlobal(variable) { return ( variable == null || variable.defs.length !== 0 || - variable.references.some(r => r.isWrite()) + variable.references.some((r) => r.isWrite()) ) } @@ -1412,7 +1495,7 @@ class ReferenceTracker { { mode = "strict", globalObjectNames = ["global", "globalThis", "self", "window"], - } = {} + } = {}, ) { this.variableStack = []; this.globalScope = globalScope; @@ -1439,7 +1522,7 @@ class ReferenceTracker { variable, path, nextTraceMap, - true + true, ); } @@ -1455,7 +1538,7 @@ class ReferenceTracker { variable, path, traceMap, - false + false, ); } } @@ -1532,11 +1615,8 @@ class ReferenceTracker { esm ? nextTraceMap : this.mode === "legacy" - ? Object.assign( - { default: nextTraceMap }, - nextTraceMap - ) - : { default: nextTraceMap } + ? { default: nextTraceMap, ...nextTraceMap } + : { default: nextTraceMap }, ); if (esm) { @@ -1622,7 +1702,7 @@ class ReferenceTracker { yield* this._iteratePropertyReferences( parent, path, - nextTraceMap + nextTraceMap, ); } return @@ -1679,7 +1759,7 @@ class ReferenceTracker { variable, path, traceMap, - false + false, ); } return @@ -1705,7 +1785,7 @@ class ReferenceTracker { yield* this._iterateLhsReferences( property.value, nextPath, - nextTraceMap + nextTraceMap, ); } return @@ -1748,7 +1828,7 @@ class ReferenceTracker { findVariable(this.globalScope, specifierNode.local), path, nextTraceMap, - false + false, ); return @@ -1759,7 +1839,7 @@ class ReferenceTracker { findVariable(this.globalScope, specifierNode.local), path, traceMap, - false + false, ); return } @@ -1845,7 +1925,7 @@ exports.ESM = ESM; exports.PatternMatcher = PatternMatcher; exports.READ = READ; exports.ReferenceTracker = ReferenceTracker; -exports.default = index; +exports["default"] = index; exports.findVariable = findVariable; exports.getFunctionHeadLocation = getFunctionHeadLocation; exports.getFunctionNameWithKind = getFunctionNameWithKind; diff --git a/node_modules/@eslint-community/eslint-utils/index.js.map b/node_modules/@eslint-community/eslint-utils/index.js.map new file mode 100644 index 000000000..2179689e2 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["src/get-innermost-scope.mjs","src/find-variable.mjs","src/token-predicate.mjs","src/get-function-head-location.mjs","src/get-static-value.mjs","src/get-string-if-constant.mjs","src/get-property-name.mjs","src/get-function-name-with-kind.mjs","src/has-side-effect.mjs","src/is-parenthesized.mjs","src/pattern-matcher.mjs","src/reference-tracker.mjs","src/index.mjs"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope.mjs\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @param {Token} token - The token to check.\n * @param {string} value - The value to check.\n * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\" ||\n parent.type === \"PropertyDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: { ...start },\n end: { ...end },\n }\n}\n","/* globals globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable.mjs\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ]),\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map((k) => Math[k])\n .filter((f) => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter((f) => typeof f === \"function\"),\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: left.value ** right.value }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n if (calleeNode.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(\n calleeNode,\n initialScope,\n )\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(node, initialScope)\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = getStaticPropertyNameValue(\n propertyNode,\n initialScope,\n )\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope,\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope,\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map((q) => q.value.cooked)\n strings.raw = node.quasi.quasis.map((q) => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n const nameNode = node.type === \"Property\" ? node.key : node.property\n\n if (node.computed) {\n return getStaticValueR(nameNode, initialScope)\n }\n\n if (nameNode.type === \"Identifier\") {\n return { value: nameNode.name }\n }\n\n if (nameNode.type === \"Literal\") {\n if (nameNode.bigint) {\n return { value: nameNode.bigint }\n }\n return { value: String(nameNode.value) }\n }\n\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value.mjs\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n case \"PropertyDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n if (node.key.type === \"PrivateIdentifier\") {\n return null\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name.mjs\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nexport function getFunctionNameWithKind(node, sourceCode) {\n const parent = node.parent\n const tokens = []\n const isObjectMethod = parent.type === \"Property\" && parent.value === node\n const isClassMethod =\n parent.type === \"MethodDefinition\" && parent.value === node\n const isClassFieldMethod =\n parent.type === \"PropertyDefinition\" && parent.value === node\n\n // Modifiers.\n if (isClassMethod || isClassFieldMethod) {\n if (parent.static) {\n tokens.push(\"static\")\n }\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(\"private\")\n }\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n // Kinds.\n if (isObjectMethod || isClassMethod) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else if (isClassFieldMethod) {\n tokens.push(\"method\")\n } else {\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\")\n }\n tokens.push(\"function\")\n }\n\n // Names.\n if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(`#${parent.key.name}`)\n } else {\n const name = getPropertyName(parent)\n if (name) {\n tokens.push(`'${name}'`)\n } else if (sourceCode) {\n const keyText = sourceCode.getText(parent.key)\n if (!keyText.includes(\"\\n\")) {\n tokens.push(`[${keyText}]`)\n }\n }\n }\n } else if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n } else if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n } else if (\n parent.type === \"ExportDefaultDeclaration\" &&\n parent.declaration === node\n ) {\n tokens.push(\"'default'\")\n }\n\n return tokens.join(\" \")\n}\n","import { getKeys, KEYS } from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ]),\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n PropertyDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n }),\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {},\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || KEYS,\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode,\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (\n node == null ||\n // `Program` can't be parenthesized\n node.parent == null ||\n // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n (node.parent.type === \"CatchClause\" && node.parent.param === node)\n ) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some((r) => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {},\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true,\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? { default: nextTraceMap, ...nextTraceMap }\n : { default: nextTraceMap },\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap,\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap,\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false,\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false,\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location.mjs\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind.mjs\"\nimport { getInnermostScope } from \"./get-innermost-scope.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStaticValue } from \"./get-static-value.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\nimport { hasSideEffect } from \"./has-side-effect.mjs\"\nimport { isParenthesized } from \"./is-parenthesized.mjs\"\nimport { PatternMatcher } from \"./pattern-matcher.mjs\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker.mjs\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate.mjs\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":["getKeys","KEYS"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE;AACtD,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC;AAClC;AACA,IAAI,IAAI,KAAK,GAAG,aAAY;AAC5B,IAAI,IAAI,KAAK,GAAG,MAAK;AACrB,IAAI,GAAG;AACP,QAAQ,KAAK,GAAG,MAAK;AACrB,QAAQ,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,WAAW,EAAE;AACpD,YAAY,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,MAAK;AAChD;AACA,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE;AAC7D,gBAAgB,KAAK,GAAG,WAAU;AAClC,gBAAgB,KAAK,GAAG,KAAI;AAC5B,gBAAgB,KAAK;AACrB,aAAa;AACb,SAAS;AACT,KAAK,QAAQ,KAAK,CAAC;AACnB;AACA,IAAI,OAAO,KAAK;AAChB;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,YAAY,EAAE,UAAU,EAAE;AACvD,IAAI,IAAI,IAAI,GAAG,GAAE;AACjB,IAAI,IAAI,KAAK,GAAG,aAAY;AAC5B;AACA,IAAI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;AACxC,QAAQ,IAAI,GAAG,WAAU;AACzB,KAAK,MAAM;AACX,QAAQ,IAAI,GAAG,UAA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AAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/eslint-utils/index.mjs b/node_modules/@eslint-community/eslint-utils/index.mjs similarity index 87% rename from node_modules/eslint-utils/index.mjs rename to node_modules/@eslint-community/eslint-utils/index.mjs index 6940337c8..00cc62cc7 100644 --- a/node_modules/eslint-utils/index.mjs +++ b/node_modules/@eslint-community/eslint-utils/index.mjs @@ -1,5 +1,4 @@ -/*! @author Toru Nagashima */ -import evk from 'eslint-visitor-keys'; +import { getKeys, KEYS } from 'eslint-visitor-keys'; /** * Get the innermost scope which contains a given location. @@ -74,13 +73,23 @@ function negate(f) { return negate0.bind(f) } +/** + * Checks if the given token is a PunctuatorToken with the given value + * @param {Token} token - The token to check. + * @param {string} value - The value to check. + * @returns {boolean} `true` if the token is a PunctuatorToken with the given value. + */ +function isPunctuatorTokenWithValue(token, value) { + return token.type === "Punctuator" && token.value === value +} + /** * Checks if the given token is an arrow token or not. * @param {Token} token - The token to check. * @returns {boolean} `true` if the token is an arrow token. */ function isArrowToken(token) { - return token.value === "=>" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "=>") } /** @@ -89,7 +98,7 @@ function isArrowToken(token) { * @returns {boolean} `true` if the token is a comma token. */ function isCommaToken(token) { - return token.value === "," && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ",") } /** @@ -98,7 +107,7 @@ function isCommaToken(token) { * @returns {boolean} `true` if the token is a semicolon token. */ function isSemicolonToken(token) { - return token.value === ";" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ";") } /** @@ -107,7 +116,7 @@ function isSemicolonToken(token) { * @returns {boolean} `true` if the token is a colon token. */ function isColonToken(token) { - return token.value === ":" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ":") } /** @@ -116,7 +125,7 @@ function isColonToken(token) { * @returns {boolean} `true` if the token is an opening parenthesis token. */ function isOpeningParenToken(token) { - return token.value === "(" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "(") } /** @@ -125,7 +134,7 @@ function isOpeningParenToken(token) { * @returns {boolean} `true` if the token is a closing parenthesis token. */ function isClosingParenToken(token) { - return token.value === ")" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, ")") } /** @@ -134,7 +143,7 @@ function isClosingParenToken(token) { * @returns {boolean} `true` if the token is an opening square bracket token. */ function isOpeningBracketToken(token) { - return token.value === "[" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "[") } /** @@ -143,7 +152,7 @@ function isOpeningBracketToken(token) { * @returns {boolean} `true` if the token is a closing square bracket token. */ function isClosingBracketToken(token) { - return token.value === "]" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "]") } /** @@ -152,7 +161,7 @@ function isClosingBracketToken(token) { * @returns {boolean} `true` if the token is an opening brace token. */ function isOpeningBraceToken(token) { - return token.value === "{" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "{") } /** @@ -161,7 +170,7 @@ function isOpeningBraceToken(token) { * @returns {boolean} `true` if the token is a closing brace token. */ function isClosingBraceToken(token) { - return token.value === "}" && token.type === "Punctuator" + return isPunctuatorTokenWithValue(token, "}") } /** @@ -170,11 +179,7 @@ function isClosingBraceToken(token) { * @returns {boolean} `true` if the token is a comment token. */ function isCommentToken(token) { - return ( - token.type === "Line" || - token.type === "Block" || - token.type === "Shebang" - ) + return ["Block", "Line", "Shebang"].includes(token.type) } const isNotArrowToken = negate(isArrowToken); @@ -219,7 +224,8 @@ function getFunctionHeadLocation(node, sourceCode) { end = arrowToken.loc.end; } else if ( parent.type === "Property" || - parent.type === "MethodDefinition" + parent.type === "MethodDefinition" || + parent.type === "PropertyDefinition" ) { start = parent.loc.start; end = getOpeningParenOfParams(node, sourceCode).loc.start; @@ -229,12 +235,12 @@ function getFunctionHeadLocation(node, sourceCode) { } return { - start: Object.assign({}, start), - end: Object.assign({}, end), + start: { ...start }, + end: { ...end }, } } -/* globals BigInt, globalThis, global, self, window */ +/* globals globalThis, global, self, window */ const globalObject = typeof globalThis !== "undefined" @@ -295,7 +301,7 @@ const builtinNames = Object.freeze( "unescape", "WeakMap", "WeakSet", - ]) + ]), ); const callAllowed = new Set( [ @@ -313,8 +319,8 @@ const callAllowed = new Set( isNaN, isPrototypeOf, ...Object.getOwnPropertyNames(Math) - .map(k => Math[k]) - .filter(f => typeof f === "function"), + .map((k) => Math[k]) + .filter((f) => typeof f === "function"), Number, Number.isFinite, Number.isNaN, @@ -335,11 +341,10 @@ const callAllowed = new Set( String.fromCharCode, String.fromCodePoint, String.raw, - Symbol, Symbol.for, Symbol.keyFor, unescape, - ].filter(f => typeof f === "function") + ].filter((f) => typeof f === "function"), ); const callPassThrough = new Set([ Object.freeze, @@ -463,7 +468,7 @@ const operations = Object.freeze({ case "%": return { value: left.value % right.value } case "**": - return { value: Math.pow(left.value, right.value) } + return { value: left.value ** right.value } case "|": return { value: left.value | right.value } case "^": @@ -484,6 +489,9 @@ const operations = Object.freeze({ if (args != null) { if (calleeNode.type === "MemberExpression") { + if (calleeNode.property.type === "PrivateIdentifier") { + return null + } const object = getStaticValueR(calleeNode.object, initialScope); if (object != null) { if ( @@ -492,9 +500,10 @@ const operations = Object.freeze({ ) { return { value: undefined, optional: true } } - const property = calleeNode.computed - ? getStaticValueR(calleeNode.property, initialScope) - : { value: calleeNode.property.name }; + const property = getStaticPropertyNameValue( + calleeNode, + initialScope, + ); if (property != null) { const receiver = object.value; @@ -601,14 +610,15 @@ const operations = Object.freeze({ }, MemberExpression(node, initialScope) { + if (node.property.type === "PrivateIdentifier") { + return null + } const object = getStaticValueR(node.object, initialScope); if (object != null) { if (object.value == null && (object.optional || node.optional)) { return { value: undefined, optional: true } } - const property = node.computed - ? getStaticValueR(node.property, initialScope) - : { value: node.property.name }; + const property = getStaticPropertyNameValue(node, initialScope); if (property != null && !isGetter(object.value, property.value)) { return { value: object.value[property.value] } @@ -647,9 +657,10 @@ const operations = Object.freeze({ if (propertyNode.kind !== "init") { return null } - const key = propertyNode.computed - ? getStaticValueR(propertyNode.key, initialScope) - : { value: propertyNode.key.name }; + const key = getStaticPropertyNameValue( + propertyNode, + initialScope, + ); const value = getStaticValueR(propertyNode.value, initialScope); if (key == null || value == null) { return null @@ -661,7 +672,7 @@ const operations = Object.freeze({ ) { const argument = getStaticValueR( propertyNode.argument, - initialScope + initialScope, ); if (argument == null) { return null @@ -684,13 +695,13 @@ const operations = Object.freeze({ const tag = getStaticValueR(node.tag, initialScope); const expressions = getElementValues( node.quasi.expressions, - initialScope + initialScope, ); if (tag != null && expressions != null) { const func = tag.value; - const strings = node.quasi.quasis.map(q => q.value.cooked); - strings.raw = node.quasi.quasis.map(q => q.value.raw); + const strings = node.quasi.quasis.map((q) => q.value.cooked); + strings.raw = node.quasi.quasis.map((q) => q.value.raw); if (func === String.raw) { return { value: func(strings, ...expressions) } @@ -757,6 +768,33 @@ function getStaticValueR(node, initialScope) { return null } +/** + * Get the static value of property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`. + */ +function getStaticPropertyNameValue(node, initialScope) { + const nameNode = node.type === "Property" ? node.key : node.property; + + if (node.computed) { + return getStaticValueR(nameNode, initialScope) + } + + if (nameNode.type === "Identifier") { + return { value: nameNode.name } + } + + if (nameNode.type === "Literal") { + if (nameNode.bigint) { + return { value: nameNode.bigint } + } + return { value: String(nameNode.value) } + } + + return null +} + /** * Get the value of a given node if it's a static value. * @param {Node} node The node to get. @@ -804,16 +842,23 @@ function getPropertyName(node, initialScope) { if (node.computed) { return getStringIfConstant(node.property, initialScope) } + if (node.property.type === "PrivateIdentifier") { + return null + } return node.property.name case "Property": case "MethodDefinition": + case "PropertyDefinition": if (node.computed) { return getStringIfConstant(node.key, initialScope) } if (node.key.type === "Literal") { return String(node.key.value) } + if (node.key.type === "PrivateIdentifier") { + return null + } return node.key.name // no default @@ -825,14 +870,27 @@ function getPropertyName(node, initialScope) { /** * Get the name and kind of the given function node. * @param {ASTNode} node - The function node to get. + * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys. * @returns {string} The name and kind of the function node. */ -function getFunctionNameWithKind(node) { +// eslint-disable-next-line complexity +function getFunctionNameWithKind(node, sourceCode) { const parent = node.parent; const tokens = []; - - if (parent.type === "MethodDefinition" && parent.static) { - tokens.push("static"); + const isObjectMethod = parent.type === "Property" && parent.value === node; + const isClassMethod = + parent.type === "MethodDefinition" && parent.value === node; + const isClassFieldMethod = + parent.type === "PropertyDefinition" && parent.value === node; + + // Modifiers. + if (isClassMethod || isClassFieldMethod) { + if (parent.static) { + tokens.push("static"); + } + if (parent.key.type === "PrivateIdentifier") { + tokens.push("private"); + } } if (node.async) { tokens.push("async"); @@ -841,12 +899,8 @@ function getFunctionNameWithKind(node) { tokens.push("generator"); } - if (node.type === "ArrowFunctionExpression") { - tokens.push("arrow", "function"); - } else if ( - parent.type === "Property" || - parent.type === "MethodDefinition" - ) { + // Kinds. + if (isObjectMethod || isClassMethod) { if (parent.kind === "constructor") { return "constructor" } @@ -857,35 +911,50 @@ function getFunctionNameWithKind(node) { } else { tokens.push("method"); } + } else if (isClassFieldMethod) { + tokens.push("method"); } else { - tokens.push("function"); - } - - if (node.id) { - tokens.push(`'${node.id.name}'`); - } else { - const name = getPropertyName(parent); - - if (name) { - tokens.push(`'${name}'`); + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow"); } + tokens.push("function"); } - if (node.type === "ArrowFunctionExpression") { - if ( - parent.type === "VariableDeclarator" && - parent.id && - parent.id.type === "Identifier" - ) { - tokens.push(`'${parent.id.name}'`); - } - if ( - parent.type === "AssignmentExpression" && - parent.left && - parent.left.type === "Identifier" - ) { - tokens.push(`'${parent.left.name}'`); + // Names. + if (isObjectMethod || isClassMethod || isClassFieldMethod) { + if (parent.key.type === "PrivateIdentifier") { + tokens.push(`#${parent.key.name}`); + } else { + const name = getPropertyName(parent); + if (name) { + tokens.push(`'${name}'`); + } else if (sourceCode) { + const keyText = sourceCode.getText(parent.key); + if (!keyText.includes("\n")) { + tokens.push(`[${keyText}]`); + } + } } + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } else if ( + parent.type === "VariableDeclarator" && + parent.id && + parent.id.type === "Identifier" + ) { + tokens.push(`'${parent.id.name}'`); + } else if ( + (parent.type === "AssignmentExpression" || + parent.type === "AssignmentPattern") && + parent.left && + parent.left.type === "Identifier" + ) { + tokens.push(`'${parent.left.name}'`); + } else if ( + parent.type === "ExportDefaultDeclaration" && + parent.declaration === node + ) { + tokens.push("'default'"); } return tokens.join(" ") @@ -911,7 +980,7 @@ const typeConversionBinaryOps = Object.freeze( "^", "&", "in", - ]) + ]), ); const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); @@ -939,7 +1008,7 @@ const visitor = Object.freeze( $visitChildren(node, options, visitorKeys) { const { type } = node; - for (const key of visitorKeys[type] || evk.getKeys(node)) { + for (const key of visitorKeys[type] || getKeys(node)) { const value = node[key]; if (Array.isArray(value)) { @@ -1026,6 +1095,16 @@ const visitor = Object.freeze( } return this.$visitChildren(node, options, visitorKeys) }, + PropertyDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, UnaryExpression(node, options, visitorKeys) { if (node.operator === "delete") { return true @@ -1045,7 +1124,7 @@ const visitor = Object.freeze( YieldExpression() { return true }, - }) + }), ); /** @@ -1055,18 +1134,18 @@ const visitor = Object.freeze( * @param {object} [options] The option object. * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects. * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects. - * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. + * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. * @returns {boolean} `true` if the node has a certain side effect. */ function hasSideEffect( node, sourceCode, - { considerGetters = false, considerImplicitTypeConversion = false } = {} + { considerGetters = false, considerImplicitTypeConversion = false } = {}, ) { return visitor.$visit( node, { considerGetters, considerImplicitTypeConversion }, - sourceCode.visitorKeys || evk.KEYS + sourceCode.visitorKeys || KEYS, ) } @@ -1086,7 +1165,7 @@ function getParentSyntaxParen(node, sourceCode) { if (parent.arguments.length === 1 && parent.arguments[0] === node) { return sourceCode.getTokenAfter( parent.callee, - isOpeningParenToken + isOpeningParenToken, ) } return null @@ -1095,7 +1174,7 @@ function getParentSyntaxParen(node, sourceCode) { if (parent.test === node) { return sourceCode.getTokenAfter( parent.body, - isOpeningParenToken + isOpeningParenToken, ) } return null @@ -1146,7 +1225,7 @@ function getParentSyntaxParen(node, sourceCode) { function isParenthesized( timesOrNode, nodeOrSourceCode, - optionalSourceCode + optionalSourceCode, ) { let times, node, sourceCode, maybeLeftParen, maybeRightParen; if (typeof timesOrNode === "number") { @@ -1162,7 +1241,13 @@ function isParenthesized( sourceCode = nodeOrSourceCode; } - if (node == null) { + if ( + node == null || + // `Program` can't be parenthesized + node.parent == null || + // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}` + (node.parent.type === "CatchClause" && node.parent.param === node) + ) { return false } @@ -1362,7 +1447,7 @@ function isModifiedGlobal(variable) { return ( variable == null || variable.defs.length !== 0 || - variable.references.some(r => r.isWrite()) + variable.references.some((r) => r.isWrite()) ) } @@ -1406,7 +1491,7 @@ class ReferenceTracker { { mode = "strict", globalObjectNames = ["global", "globalThis", "self", "window"], - } = {} + } = {}, ) { this.variableStack = []; this.globalScope = globalScope; @@ -1433,7 +1518,7 @@ class ReferenceTracker { variable, path, nextTraceMap, - true + true, ); } @@ -1449,7 +1534,7 @@ class ReferenceTracker { variable, path, traceMap, - false + false, ); } } @@ -1526,11 +1611,8 @@ class ReferenceTracker { esm ? nextTraceMap : this.mode === "legacy" - ? Object.assign( - { default: nextTraceMap }, - nextTraceMap - ) - : { default: nextTraceMap } + ? { default: nextTraceMap, ...nextTraceMap } + : { default: nextTraceMap }, ); if (esm) { @@ -1616,7 +1698,7 @@ class ReferenceTracker { yield* this._iteratePropertyReferences( parent, path, - nextTraceMap + nextTraceMap, ); } return @@ -1673,7 +1755,7 @@ class ReferenceTracker { variable, path, traceMap, - false + false, ); } return @@ -1699,7 +1781,7 @@ class ReferenceTracker { yield* this._iterateLhsReferences( property.value, nextPath, - nextTraceMap + nextTraceMap, ); } return @@ -1742,7 +1824,7 @@ class ReferenceTracker { findVariable(this.globalScope, specifierNode.local), path, nextTraceMap, - false + false, ); return @@ -1753,7 +1835,7 @@ class ReferenceTracker { findVariable(this.globalScope, specifierNode.local), path, traceMap, - false + false, ); return } @@ -1833,6 +1915,5 @@ var index = { ReferenceTracker, }; -export default index; -export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken }; +export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, index as default, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken }; //# sourceMappingURL=index.mjs.map diff --git a/node_modules/@eslint-community/eslint-utils/index.mjs.map b/node_modules/@eslint-community/eslint-utils/index.mjs.map new file mode 100644 index 000000000..8a9804d25 --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["src/get-innermost-scope.mjs","src/find-variable.mjs","src/token-predicate.mjs","src/get-function-head-location.mjs","src/get-static-value.mjs","src/get-string-if-constant.mjs","src/get-property-name.mjs","src/get-function-name-with-kind.mjs","src/has-side-effect.mjs","src/is-parenthesized.mjs","src/pattern-matcher.mjs","src/reference-tracker.mjs","src/index.mjs"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope.mjs\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @param {Token} token - The token to check.\n * @param {string} value - The value to check.\n * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\" ||\n parent.type === \"PropertyDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: { ...start },\n end: { ...end },\n }\n}\n","/* globals globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable.mjs\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ]),\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map((k) => Math[k])\n .filter((f) => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter((f) => typeof f === \"function\"),\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: left.value ** right.value }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n if (calleeNode.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(\n calleeNode,\n initialScope,\n )\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = getStaticPropertyNameValue(node, initialScope)\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = getStaticPropertyNameValue(\n propertyNode,\n initialScope,\n )\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope,\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope,\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map((q) => q.value.cooked)\n strings.raw = node.quasi.quasis.map((q) => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n const nameNode = node.type === \"Property\" ? node.key : node.property\n\n if (node.computed) {\n return getStaticValueR(nameNode, initialScope)\n }\n\n if (nameNode.type === \"Identifier\") {\n return { value: nameNode.name }\n }\n\n if (nameNode.type === \"Literal\") {\n if (nameNode.bigint) {\n return { value: nameNode.bigint }\n }\n return { value: String(nameNode.value) }\n }\n\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value.mjs\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n if (node.property.type === \"PrivateIdentifier\") {\n return null\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n case \"PropertyDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n if (node.key.type === \"PrivateIdentifier\") {\n return null\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name.mjs\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nexport function getFunctionNameWithKind(node, sourceCode) {\n const parent = node.parent\n const tokens = []\n const isObjectMethod = parent.type === \"Property\" && parent.value === node\n const isClassMethod =\n parent.type === \"MethodDefinition\" && parent.value === node\n const isClassFieldMethod =\n parent.type === \"PropertyDefinition\" && parent.value === node\n\n // Modifiers.\n if (isClassMethod || isClassFieldMethod) {\n if (parent.static) {\n tokens.push(\"static\")\n }\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(\"private\")\n }\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n // Kinds.\n if (isObjectMethod || isClassMethod) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else if (isClassFieldMethod) {\n tokens.push(\"method\")\n } else {\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\")\n }\n tokens.push(\"function\")\n }\n\n // Names.\n if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n if (parent.key.type === \"PrivateIdentifier\") {\n tokens.push(`#${parent.key.name}`)\n } else {\n const name = getPropertyName(parent)\n if (name) {\n tokens.push(`'${name}'`)\n } else if (sourceCode) {\n const keyText = sourceCode.getText(parent.key)\n if (!keyText.includes(\"\\n\")) {\n tokens.push(`[${keyText}]`)\n }\n }\n }\n } else if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n } else if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n } else if (\n parent.type === \"ExportDefaultDeclaration\" &&\n parent.declaration === node\n ) {\n tokens.push(\"'default'\")\n }\n\n return tokens.join(\" \")\n}\n","import { getKeys, KEYS } from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ]),\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n PropertyDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n }),\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {},\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || KEYS,\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken,\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode,\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (\n node == null ||\n // `Program` can't be parenthesized\n node.parent == null ||\n // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n (node.parent.type === \"CatchClause\" && node.parent.param === node)\n ) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some((r) => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {},\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true,\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? { default: nextTraceMap, ...nextTraceMap }\n : { default: nextTraceMap },\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap,\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false,\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap,\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false,\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false,\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location.mjs\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind.mjs\"\nimport { getInnermostScope } from \"./get-innermost-scope.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStaticValue } from \"./get-static-value.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\nimport { hasSideEffect } from \"./has-side-effect.mjs\"\nimport { isParenthesized } from \"./is-parenthesized.mjs\"\nimport { PatternMatcher } from \"./pattern-matcher.mjs\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker.mjs\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate.mjs\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE;AACtD,IAAI,MAAM,QAAQ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gB,CAAC,GAAG,GAAG,IAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE;AACpC,IAAI,OAAO,EAAE,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,CAAC;AAC/C;;ACvZA,YAAe;AACf,IAAI,IAAI;AACR,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,YAAY;AAChB,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,mBAAmB;AACvB,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/@eslint-community/eslint-utils/package.json b/node_modules/@eslint-community/eslint-utils/package.json new file mode 100644 index 000000000..1e9f149ab --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/package.json @@ -0,0 +1,73 @@ +{ + "name": "@eslint-community/eslint-utils", + "version": "4.2.0", + "description": "Utilities for ESLint plugins.", + "keywords": [ + "eslint" + ], + "homepage": "https://github.com/eslint-community/eslint-utils#readme", + "bugs": { + "url": "https://github.com/eslint-community/eslint-utils/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/eslint-community/eslint-utils" + }, + "license": "MIT", + "author": "Toru Nagashima", + "sideEffects": false, + "exports": { + ".": { + "import": "./index.mjs", + "require": "./index.js" + }, + "./package.json": "./package.json" + }, + "main": "index", + "module": "index.mjs", + "files": [ + "index.*" + ], + "scripts": { + "prebuild": "npm run -s clean", + "build": "rollup -c", + "clean": "rimraf .nyc_output coverage index.*", + "coverage": "opener ./coverage/lcov-report/index.html", + "docs:build": "vitepress build docs", + "docs:watch": "vitepress dev docs", + "format": "npm run -s format:prettier -- --write", + "format:prettier": "prettier .", + "format:check": "npm run -s format:prettier -- --check", + "lint": "eslint .", + "test": "c8 mocha --reporter dot \"test/*.mjs\"", + "preversion": "npm test && npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", + "watch": "warun \"{src,test}/**/*.mjs\" -- npm run -s test:mocha" + }, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "devDependencies": { + "@eslint-community/eslint-plugin-mysticatea": "^15.2.0", + "c8": "^7.12.0", + "dot-prop": "^6.0.1", + "eslint": "^8.28.0", + "mocha": "^9.2.2", + "npm-run-all": "^4.1.5", + "opener": "^1.5.2", + "prettier": "2.8.4", + "rimraf": "^3.0.2", + "rollup": "^2.79.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "semver": "^7.3.8", + "vitepress": "^1.0.0-alpha.40", + "warun": "^1.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } +} diff --git a/node_modules/regexpp/LICENSE b/node_modules/@eslint-community/regexpp/LICENSE similarity index 100% rename from node_modules/regexpp/LICENSE rename to node_modules/@eslint-community/regexpp/LICENSE diff --git a/node_modules/regexpp/README.md b/node_modules/@eslint-community/regexpp/README.md similarity index 85% rename from node_modules/regexpp/README.md rename to node_modules/@eslint-community/regexpp/README.md index a5e2e147f..5bd353b2b 100644 --- a/node_modules/regexpp/README.md +++ b/node_modules/@eslint-community/regexpp/README.md @@ -1,20 +1,19 @@ -# regexpp +# @eslint-community/regexpp -[![npm version](https://img.shields.io/npm/v/regexpp.svg)](https://www.npmjs.com/package/regexpp) -[![Downloads/month](https://img.shields.io/npm/dm/regexpp.svg)](http://www.npmtrends.com/regexpp) -[![Build Status](https://github.com/mysticatea/regexpp/workflows/CI/badge.svg)](https://github.com/mysticatea/regexpp/actions) -[![codecov](https://codecov.io/gh/mysticatea/regexpp/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/regexpp) -[![Dependency Status](https://david-dm.org/mysticatea/regexpp.svg)](https://david-dm.org/mysticatea/regexpp) +[![npm version](https://img.shields.io/npm/v/@eslint-community/regexpp.svg)](https://www.npmjs.com/package/@eslint-community/regexpp) +[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/regexpp.svg)](http://www.npmtrends.com/@eslint-community/regexpp) +[![Build Status](https://github.com/eslint-community/regexpp/workflows/CI/badge.svg)](https://github.com/eslint-community/regexpp/actions) +[![codecov](https://codecov.io/gh/eslint-community/regexpp/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/regexpp) A regular expression parser for ECMAScript. ## 💿 Installation ```bash -$ npm install regexpp +$ npm install @eslint-community/regexpp ``` -- require Node.js 8 or newer. +- require Node@^12.0.0 || ^14.0.0 || ^16.0.0 || >=18.0.0. ## 📖 Usage @@ -27,7 +26,7 @@ import { parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST -} from "regexpp" +} from "@eslint-community/regexpp" ``` ### parseRegExpLiteral(source, options?) @@ -154,7 +153,7 @@ Validate a regular expression literal. ## 📰 Changelog -- [GitHub Releases](https://github.com/mysticatea/regexpp/releases) +- [GitHub Releases](https://github.com/eslint-community/regexpp/releases) ## 🍻 Contributing diff --git a/node_modules/@eslint-community/regexpp/index.d.ts b/node_modules/@eslint-community/regexpp/index.d.ts new file mode 100644 index 000000000..40ec88d0e --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.d.ts @@ -0,0 +1,257 @@ +// Generated by dts-bundle v0.7.3 + +declare module '@eslint-community/regexpp' { + import * as AST from "@eslint-community/regexpp/ast"; + import { RegExpParser } from "@eslint-community/regexpp/parser"; + import { RegExpValidator } from "@eslint-community/regexpp/validator"; + import { RegExpVisitor } from "@eslint-community/regexpp/visitor"; + export { AST, RegExpParser, RegExpValidator }; + export function parseRegExpLiteral(source: RegExp | string, options?: RegExpParser.Options): AST.RegExpLiteral; + export function validateRegExpLiteral(source: string, options?: RegExpValidator.Options): void; + export function visitRegExpAST(node: AST.Node, handlers: RegExpVisitor.Handlers): void; +} + +declare module '@eslint-community/regexpp/ast' { + export type Node = BranchNode | LeafNode; + export type BranchNode = Alternative | CapturingGroup | CharacterClass | CharacterClassRange | Group | LookaroundAssertion | Pattern | Quantifier | RegExpLiteral; + export type LeafNode = Backreference | BoundaryAssertion | Character | CharacterSet | Flags; + export type Element = Assertion | QuantifiableElement | Quantifier; + export type QuantifiableElement = Backreference | CapturingGroup | Character | CharacterClass | CharacterSet | Group | LookaheadAssertion; + export type CharacterClassElement = Character | CharacterClassRange | EscapeCharacterSet | UnicodePropertyCharacterSet; + export interface NodeBase { + type: Node["type"]; + parent: Node["parent"]; + start: number; + end: number; + raw: string; + } + export interface RegExpLiteral extends NodeBase { + type: "RegExpLiteral"; + parent: null; + pattern: Pattern; + flags: Flags; + } + export interface Pattern extends NodeBase { + type: "Pattern"; + parent: RegExpLiteral | null; + alternatives: Alternative[]; + } + export interface Alternative extends NodeBase { + type: "Alternative"; + parent: CapturingGroup | Group | LookaroundAssertion | Pattern; + elements: Element[]; + } + export interface Group extends NodeBase { + type: "Group"; + parent: Alternative | Quantifier; + alternatives: Alternative[]; + } + export interface CapturingGroup extends NodeBase { + type: "CapturingGroup"; + parent: Alternative | Quantifier; + name: string | null; + alternatives: Alternative[]; + references: Backreference[]; + } + export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion; + export interface LookaheadAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative | Quantifier; + kind: "lookahead"; + negate: boolean; + alternatives: Alternative[]; + } + export interface LookbehindAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative; + kind: "lookbehind"; + negate: boolean; + alternatives: Alternative[]; + } + export interface Quantifier extends NodeBase { + type: "Quantifier"; + parent: Alternative; + min: number; + max: number; + greedy: boolean; + element: QuantifiableElement; + } + export interface CharacterClass extends NodeBase { + type: "CharacterClass"; + parent: Alternative | Quantifier; + negate: boolean; + elements: CharacterClassElement[]; + } + export interface CharacterClassRange extends NodeBase { + type: "CharacterClassRange"; + parent: CharacterClass; + min: Character; + max: Character; + } + export type Assertion = BoundaryAssertion | LookaroundAssertion; + export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion; + export interface EdgeAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative | Quantifier; + kind: "end" | "start"; + } + export interface WordBoundaryAssertion extends NodeBase { + type: "Assertion"; + parent: Alternative | Quantifier; + kind: "word"; + negate: boolean; + } + export type CharacterSet = AnyCharacterSet | EscapeCharacterSet | UnicodePropertyCharacterSet; + export interface AnyCharacterSet extends NodeBase { + type: "CharacterSet"; + parent: Alternative | Quantifier; + kind: "any"; + } + export interface EscapeCharacterSet extends NodeBase { + type: "CharacterSet"; + parent: Alternative | CharacterClass | Quantifier; + kind: "digit" | "space" | "word"; + negate: boolean; + } + export interface UnicodePropertyCharacterSet extends NodeBase { + type: "CharacterSet"; + parent: Alternative | CharacterClass | Quantifier; + kind: "property"; + key: string; + value: string | null; + negate: boolean; + } + export interface Character extends NodeBase { + type: "Character"; + parent: Alternative | CharacterClass | CharacterClassRange | Quantifier; + value: number; + } + export interface Backreference extends NodeBase { + type: "Backreference"; + parent: Alternative | Quantifier; + ref: number | string; + resolved: CapturingGroup; + } + export interface Flags extends NodeBase { + type: "Flags"; + parent: RegExpLiteral | null; + dotAll: boolean; + global: boolean; + hasIndices: boolean; + ignoreCase: boolean; + multiline: boolean; + sticky: boolean; + unicode: boolean; + } +} + +declare module '@eslint-community/regexpp/parser' { + import type { Flags, RegExpLiteral, Pattern } from "@eslint-community/regexpp/ast"; + import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions"; + export namespace RegExpParser { + interface Options { + strict?: boolean; + ecmaVersion?: EcmaVersion; + } + } + export class RegExpParser { + constructor(options?: RegExpParser.Options); + parseLiteral(source: string, start?: number, end?: number): RegExpLiteral; + parseFlags(source: string, start?: number, end?: number): Flags; + parsePattern(source: string, start?: number, end?: number, uFlag?: boolean): Pattern; + } +} + +declare module '@eslint-community/regexpp/validator' { + import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions"; + export namespace RegExpValidator { + interface Options { + strict?: boolean; + ecmaVersion?: EcmaVersion; + onLiteralEnter?: (start: number) => void; + onLiteralLeave?: (start: number, end: number) => void; + onRegExpFlags?: (start: number, end: number, flags: { + global: boolean; + ignoreCase: boolean; + multiline: boolean; + unicode: boolean; + sticky: boolean; + dotAll: boolean; + hasIndices: boolean; + }) => void; + onFlags?: (start: number, end: number, global: boolean, ignoreCase: boolean, multiline: boolean, unicode: boolean, sticky: boolean, dotAll: boolean, hasIndices: boolean) => void; + onPatternEnter?: (start: number) => void; + onPatternLeave?: (start: number, end: number) => void; + onDisjunctionEnter?: (start: number) => void; + onDisjunctionLeave?: (start: number, end: number) => void; + onAlternativeEnter?: (start: number, index: number) => void; + onAlternativeLeave?: (start: number, end: number, index: number) => void; + onGroupEnter?: (start: number) => void; + onGroupLeave?: (start: number, end: number) => void; + onCapturingGroupEnter?: (start: number, name: string | null) => void; + onCapturingGroupLeave?: (start: number, end: number, name: string | null) => void; + onQuantifier?: (start: number, end: number, min: number, max: number, greedy: boolean) => void; + onLookaroundAssertionEnter?: (start: number, kind: "lookahead" | "lookbehind", negate: boolean) => void; + onLookaroundAssertionLeave?: (start: number, end: number, kind: "lookahead" | "lookbehind", negate: boolean) => void; + onEdgeAssertion?: (start: number, end: number, kind: "end" | "start") => void; + onWordBoundaryAssertion?: (start: number, end: number, kind: "word", negate: boolean) => void; + onAnyCharacterSet?: (start: number, end: number, kind: "any") => void; + onEscapeCharacterSet?: (start: number, end: number, kind: "digit" | "space" | "word", negate: boolean) => void; + onUnicodePropertyCharacterSet?: (start: number, end: number, kind: "property", key: string, value: string | null, negate: boolean) => void; + onCharacter?: (start: number, end: number, value: number) => void; + onBackreference?: (start: number, end: number, ref: number | string) => void; + onCharacterClassEnter?: (start: number, negate: boolean) => void; + onCharacterClassLeave?: (start: number, end: number, negate: boolean) => void; + onCharacterClassRange?: (start: number, end: number, min: number, max: number) => void; + } + } + export class RegExpValidator { + constructor(options?: RegExpValidator.Options); + validateLiteral(source: string, start?: number, end?: number): void; + validateFlags(source: string, start?: number, end?: number): void; + validatePattern(source: string, start?: number, end?: number, uFlag?: boolean): void; + } +} + +declare module '@eslint-community/regexpp/visitor' { + import type { Alternative, Assertion, Backreference, CapturingGroup, Character, CharacterClass, CharacterClassRange, CharacterSet, Flags, Group, Node, Pattern, Quantifier, RegExpLiteral } from "@eslint-community/regexpp/ast"; + export class RegExpVisitor { + constructor(handlers: RegExpVisitor.Handlers); + visit(node: Node): void; + } + export namespace RegExpVisitor { + interface Handlers { + onAlternativeEnter?: (node: Alternative) => void; + onAlternativeLeave?: (node: Alternative) => void; + onAssertionEnter?: (node: Assertion) => void; + onAssertionLeave?: (node: Assertion) => void; + onBackreferenceEnter?: (node: Backreference) => void; + onBackreferenceLeave?: (node: Backreference) => void; + onCapturingGroupEnter?: (node: CapturingGroup) => void; + onCapturingGroupLeave?: (node: CapturingGroup) => void; + onCharacterEnter?: (node: Character) => void; + onCharacterLeave?: (node: Character) => void; + onCharacterClassEnter?: (node: CharacterClass) => void; + onCharacterClassLeave?: (node: CharacterClass) => void; + onCharacterClassRangeEnter?: (node: CharacterClassRange) => void; + onCharacterClassRangeLeave?: (node: CharacterClassRange) => void; + onCharacterSetEnter?: (node: CharacterSet) => void; + onCharacterSetLeave?: (node: CharacterSet) => void; + onFlagsEnter?: (node: Flags) => void; + onFlagsLeave?: (node: Flags) => void; + onGroupEnter?: (node: Group) => void; + onGroupLeave?: (node: Group) => void; + onPatternEnter?: (node: Pattern) => void; + onPatternLeave?: (node: Pattern) => void; + onQuantifierEnter?: (node: Quantifier) => void; + onQuantifierLeave?: (node: Quantifier) => void; + onRegExpLiteralEnter?: (node: RegExpLiteral) => void; + onRegExpLiteralLeave?: (node: RegExpLiteral) => void; + } + } +} + +declare module '@eslint-community/regexpp/ecma-versions' { + export type EcmaVersion = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022; +} + diff --git a/node_modules/regexpp/index.js b/node_modules/@eslint-community/regexpp/index.js similarity index 76% rename from node_modules/regexpp/index.js rename to node_modules/@eslint-community/regexpp/index.js index 12b4a5f40..7343f0c4f 100644 --- a/node_modules/regexpp/index.js +++ b/node_modules/@eslint-community/regexpp/index.js @@ -1,12 +1,9 @@ -/*! @author Toru Nagashima */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); - - var ast = /*#__PURE__*/Object.freeze({ - + __proto__: null }); let largeIdStartRanges = undefined; @@ -40,17 +37,16 @@ function isIdContinue(cp) { return isLargeIdStart(cp) || isLargeIdContinue(cp); } function isLargeIdStart(cp) { - return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); + return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges())); } function isLargeIdContinue(cp) { - return isInRange(cp, largeIdContinueRanges || - (largeIdContinueRanges = initLargeIdContinueRanges())); + return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges())); } function initLargeIdStartRanges() { - return restoreRanges("170 0 11 0 5 0 6 22 2 30 2 457 5 11 15 4 8 0 2 0 130 4 2 1 3 3 2 0 7 0 2 2 2 0 2 19 2 82 2 138 9 165 2 37 3 0 7 40 72 26 5 3 46 42 36 1 2 98 2 0 16 1 8 1 11 2 3 0 17 0 2 29 30 88 12 0 25 32 10 1 5 0 6 21 5 0 10 0 4 0 24 24 8 10 54 20 2 17 61 53 4 0 19 0 8 9 16 15 5 7 3 1 3 21 2 6 2 0 4 3 4 0 17 0 14 1 2 2 15 1 11 0 9 5 5 1 3 21 2 6 2 1 2 1 2 1 32 3 2 0 20 2 17 8 2 2 2 21 2 6 2 1 2 4 4 0 19 0 16 1 24 0 12 7 3 1 3 21 2 6 2 1 2 4 4 0 31 1 2 2 16 0 18 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 11 23 0 53 7 2 2 2 22 2 15 4 0 27 2 6 1 31 0 5 7 2 2 2 22 2 9 2 4 4 0 33 0 2 1 16 1 18 8 2 2 2 40 3 0 17 0 6 2 9 2 25 5 6 17 4 23 2 8 2 0 3 6 59 47 2 1 13 6 59 1 2 0 2 4 2 23 2 0 2 9 2 1 10 0 3 4 2 0 22 3 33 0 64 7 2 35 28 4 116 42 21 0 17 5 5 3 4 0 4 1 8 2 5 12 13 0 18 37 2 0 6 0 3 42 2 332 2 3 3 6 2 0 2 3 3 40 2 3 3 32 2 3 3 6 2 0 2 3 3 14 2 56 2 3 3 66 38 15 17 85 3 5 4 619 3 16 2 25 6 74 4 10 8 12 2 3 15 17 15 17 15 12 2 2 16 51 36 0 5 0 68 88 8 40 2 0 6 69 11 30 50 29 3 4 12 43 5 25 55 22 10 52 83 0 94 46 18 6 56 29 14 1 11 43 27 35 42 2 11 35 3 8 8 42 3 2 42 3 2 5 2 1 4 0 6 191 65 277 3 5 3 37 3 5 3 7 2 0 2 0 2 0 2 30 3 52 2 6 2 0 4 2 2 6 4 3 3 5 5 12 6 2 2 6 117 0 14 0 17 12 102 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 15 3 3 6 4 5 0 18 40 2680 46 2 46 2 132 7 3 4 1 13 37 2 0 6 0 3 55 8 0 17 22 10 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 551 2 26 8 8 4 3 4 5 85 5 4 2 89 2 3 6 42 2 93 18 31 49 15 513 6591 65 20988 4 1164 68 45 3 268 4 15 11 1 21 46 17 30 3 79 40 8 3 102 3 52 3 8 43 12 2 2 2 3 2 22 30 51 15 49 63 5 4 0 2 1 12 27 11 22 26 28 8 46 29 0 17 4 2 9 11 4 2 40 24 2 2 7 21 22 4 0 4 49 2 0 4 1 3 4 3 0 2 0 25 2 3 10 8 2 13 5 3 5 3 5 10 6 2 6 2 42 2 13 7 114 30 11171 13 22 5 48 8453 365 3 105 39 6 13 4 6 0 2 9 2 12 2 4 2 0 2 1 2 1 2 107 34 362 19 63 3 53 41 11 117 4 2 134 37 25 7 25 12 88 4 5 3 5 3 5 3 2 36 11 2 25 2 18 2 1 2 14 3 13 35 122 70 52 268 28 4 48 48 31 14 29 6 37 11 29 3 35 5 7 2 4 43 157 19 35 5 35 5 39 9 51 157 310 10 21 11 7 153 5 3 0 2 43 2 1 4 0 3 22 11 22 10 30 66 18 2 1 11 21 11 25 71 55 7 1 65 0 16 3 2 2 2 28 43 28 4 28 36 7 2 27 28 53 11 21 11 18 14 17 111 72 56 50 14 50 14 35 349 41 7 1 79 28 11 0 9 21 107 20 28 22 13 52 76 44 33 24 27 35 30 0 3 0 9 34 4 0 13 47 15 3 22 0 2 0 36 17 2 24 85 6 2 0 2 3 2 14 2 9 8 46 39 7 3 1 3 21 2 6 2 1 2 4 4 0 19 0 13 4 159 52 19 3 21 2 31 47 21 1 2 0 185 46 42 3 37 47 21 0 60 42 14 0 72 26 230 43 117 63 32 7 3 0 3 7 2 1 2 23 16 0 2 0 95 7 3 38 17 0 2 0 29 0 11 39 8 0 22 0 12 45 20 0 35 56 264 8 2 36 18 0 50 29 113 6 2 1 2 37 22 0 26 5 2 1 2 31 15 0 328 18 190 0 80 921 103 110 18 195 2749 1070 4050 582 8634 568 8 30 114 29 19 47 17 3 32 20 6 18 689 63 129 74 6 0 67 12 65 1 2 0 29 6135 9 1237 43 8 8952 286 50 2 18 3 9 395 2309 106 6 12 4 8 8 9 5991 84 2 70 2 1 3 0 3 1 3 3 2 11 2 0 2 6 2 64 2 3 3 7 2 6 2 27 2 3 2 4 2 0 4 6 2 339 3 24 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 7 2357 44 11 6 17 0 370 43 1301 196 60 67 8 0 1205 3 2 26 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 16 6 2 2 4 2 16 4421 42717 35 4148 12 221 3 5761 15 7472 3104 541 1507 4938"); + return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 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8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 33u g6 6nu fs 8 u i 26 i t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r l1 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk 2e8 f1 15v 3t6 6 38f"); } function initLargeIdContinueRanges() { - return restoreRanges("183 0 585 111 24 0 252 4 266 44 2 0 2 1 2 1 2 0 73 10 49 30 7 0 102 6 3 5 3 1 2 3 3 9 24 0 31 26 92 10 16 9 34 8 10 0 25 3 2 8 2 2 2 4 44 2 120 14 2 32 55 2 2 17 2 6 11 1 3 9 18 2 57 0 2 6 3 1 3 2 10 0 11 1 3 9 15 0 3 2 57 0 2 4 5 1 3 2 4 0 21 11 4 0 12 2 57 0 2 7 2 2 2 2 21 1 3 9 11 5 2 2 57 0 2 6 3 1 3 2 8 2 11 1 3 9 19 0 60 4 4 2 2 3 10 0 15 9 17 4 58 6 2 2 2 3 8 1 12 1 3 9 18 2 57 0 2 6 2 2 2 3 8 1 12 1 3 9 17 3 56 1 2 6 2 2 2 3 10 0 11 1 3 9 18 2 71 0 5 5 2 0 2 7 7 9 3 1 62 0 3 6 13 7 2 9 88 0 3 8 12 5 3 9 63 1 7 9 12 0 2 0 2 0 5 1 50 19 2 1 6 10 2 35 10 0 101 19 2 9 13 3 5 2 2 2 3 6 4 3 14 11 2 14 704 2 10 8 929 2 30 2 30 1 31 1 65 31 10 0 3 9 34 2 3 9 144 0 119 11 5 11 11 9 129 10 61 4 58 9 2 28 3 10 7 9 23 13 2 1 64 4 48 16 12 9 18 8 13 2 31 12 3 9 45 13 49 19 9 9 7 9 119 2 2 20 5 0 7 0 3 2 199 57 2 4 576 1 20 0 124 12 5 0 4 11 3071 2 142 0 97 31 555 5 106 1 30086 9 70 0 5 9 33 1 81 1 273 0 4 0 5 0 24 4 5 0 84 1 51 17 11 9 7 17 14 10 29 7 26 12 45 3 48 13 16 9 12 0 11 9 48 13 13 0 9 1 3 9 34 2 51 0 2 2 3 1 6 1 2 0 42 4 6 1 237 7 2 1 3 9 20261 0 738 15 17 15 4 1 25 2 193 9 38 0 702 0 227 0 150 4 294 9 1368 2 2 1 6 3 41 2 5 0 166 1 574 3 9 9 370 1 154 10 176 2 54 14 32 9 16 3 46 10 54 9 7 2 37 13 2 9 6 1 45 0 13 2 49 13 9 3 2 11 83 11 7 0 161 11 6 9 7 3 56 1 2 6 3 1 3 2 10 0 11 1 3 6 4 4 193 17 10 9 5 0 82 19 13 9 214 6 3 8 28 1 83 16 16 9 82 12 9 9 84 14 5 9 243 14 166 9 71 5 2 1 3 3 2 0 2 1 13 9 120 6 3 6 4 0 29 9 41 6 2 3 9 0 10 10 47 15 406 7 2 7 17 9 57 21 2 13 123 5 4 0 2 1 2 6 2 0 9 9 49 4 2 1 2 4 9 9 330 3 19306 9 135 4 60 6 26 9 1014 0 2 54 8 3 82 0 12 1 19628 1 5319 4 4 5 9 7 3 6 31 3 149 2 1418 49 513 54 5 49 9 0 15 0 23 4 2 14 1361 6 2 16 3 6 2 1 2 4 262 6 10 9 419 13 1495 6 110 6 6 9 4759 9 787719 239"); + return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1p 7 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 29 2 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e 9 44n 0 7 e aob 9 2f 9 13 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 3mq 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d rb 6 32 6 6 9 3o7 9 gvt3 6n"); } function isInRange(cp, ranges) { let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; @@ -72,30 +68,48 @@ function isInRange(cp, ranges) { } function restoreRanges(data) { let last = 0; - return data.split(" ").map(s => (last += parseInt(s, 10) | 0)); + return data.split(" ").map((s) => (last += parseInt(s, 36) | 0)); } class DataSet { - constructor(raw2018, raw2019, raw2020) { + constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023) { this._raw2018 = raw2018; this._raw2019 = raw2019; this._raw2020 = raw2020; + this._raw2021 = raw2021; + this._raw2022 = raw2022; + this._raw2023 = raw2023; } get es2018() { - return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); + var _a; + return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" ")))); } get es2019() { - return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); + var _a; + return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" ")))); } get es2020() { - return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); + var _a; + return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" ")))); + } + get es2021() { + var _a; + return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" ")))); + } + get es2022() { + var _a; + return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" ")))); + } + get es2023() { + var _a; + return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" ")))); } } const gcNameSet = new Set(["General_Category", "gc"]); const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); -const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", ""); -const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho"); -const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", ""); +const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", ""); +const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", ""); +const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", ""); function isValidUnicodeProperty(version, name, value) { if (gcNameSet.has(name)) { return version >= 2018 && gcValueSets.es2018.has(value); @@ -103,114 +117,117 @@ function isValidUnicodeProperty(version, name, value) { if (scNameSet.has(name)) { return ((version >= 2018 && scValueSets.es2018.has(value)) || (version >= 2019 && scValueSets.es2019.has(value)) || - (version >= 2020 && scValueSets.es2020.has(value))); + (version >= 2020 && scValueSets.es2020.has(value)) || + (version >= 2021 && scValueSets.es2021.has(value)) || + (version >= 2022 && scValueSets.es2022.has(value))); } return false; } function isValidLoneUnicodeProperty(version, value) { return ((version >= 2018 && binPropertySets.es2018.has(value)) || - (version >= 2019 && binPropertySets.es2019.has(value))); + (version >= 2019 && binPropertySets.es2019.has(value)) || + (version >= 2021 && binPropertySets.es2021.has(value))); } -const Backspace = 0x08; -const CharacterTabulation = 0x09; -const LineFeed = 0x0a; -const LineTabulation = 0x0b; -const FormFeed = 0x0c; -const CarriageReturn = 0x0d; -const ExclamationMark = 0x21; -const DollarSign = 0x24; -const LeftParenthesis = 0x28; -const RightParenthesis = 0x29; -const Asterisk = 0x2a; -const PlusSign = 0x2b; -const Comma = 0x2c; -const HyphenMinus = 0x2d; -const FullStop = 0x2e; -const Solidus = 0x2f; -const DigitZero = 0x30; -const DigitOne = 0x31; -const DigitSeven = 0x37; -const DigitNine = 0x39; -const Colon = 0x3a; -const LessThanSign = 0x3c; -const EqualsSign = 0x3d; -const GreaterThanSign = 0x3e; -const QuestionMark = 0x3f; -const LatinCapitalLetterA = 0x41; -const LatinCapitalLetterB = 0x42; -const LatinCapitalLetterD = 0x44; -const LatinCapitalLetterF = 0x46; -const LatinCapitalLetterP = 0x50; -const LatinCapitalLetterS = 0x53; -const LatinCapitalLetterW = 0x57; -const LatinCapitalLetterZ = 0x5a; -const LowLine = 0x5f; -const LatinSmallLetterA = 0x61; -const LatinSmallLetterB = 0x62; -const LatinSmallLetterC = 0x63; -const LatinSmallLetterD = 0x64; -const LatinSmallLetterF = 0x66; -const LatinSmallLetterG = 0x67; -const LatinSmallLetterI = 0x69; -const LatinSmallLetterK = 0x6b; -const LatinSmallLetterM = 0x6d; -const LatinSmallLetterN = 0x6e; -const LatinSmallLetterP = 0x70; -const LatinSmallLetterR = 0x72; -const LatinSmallLetterS = 0x73; -const LatinSmallLetterT = 0x74; -const LatinSmallLetterU = 0x75; -const LatinSmallLetterV = 0x76; -const LatinSmallLetterW = 0x77; -const LatinSmallLetterX = 0x78; -const LatinSmallLetterY = 0x79; -const LatinSmallLetterZ = 0x7a; -const LeftSquareBracket = 0x5b; -const ReverseSolidus = 0x5c; -const RightSquareBracket = 0x5d; -const CircumflexAccent = 0x5e; -const LeftCurlyBracket = 0x7b; -const VerticalLine = 0x7c; -const RightCurlyBracket = 0x7d; -const ZeroWidthNonJoiner = 0x200c; -const ZeroWidthJoiner = 0x200d; -const LineSeparator = 0x2028; -const ParagraphSeparator = 0x2029; -const MinCodePoint = 0x00; -const MaxCodePoint = 0x10ffff; +const BACKSPACE = 0x08; +const CHARACTER_TABULATION = 0x09; +const LINE_FEED = 0x0a; +const LINE_TABULATION = 0x0b; +const FORM_FEED = 0x0c; +const CARRIAGE_RETURN = 0x0d; +const EXCLAMATION_MARK = 0x21; +const DOLLAR_SIGN = 0x24; +const LEFT_PARENTHESIS = 0x28; +const RIGHT_PARENTHESIS = 0x29; +const ASTERISK = 0x2a; +const PLUS_SIGN = 0x2b; +const COMMA = 0x2c; +const HYPHEN_MINUS = 0x2d; +const FULL_STOP = 0x2e; +const SOLIDUS = 0x2f; +const DIGIT_ZERO = 0x30; +const DIGIT_ONE = 0x31; +const DIGIT_SEVEN = 0x37; +const DIGIT_NINE = 0x39; +const COLON = 0x3a; +const LESS_THAN_SIGN = 0x3c; +const EQUALS_SIGN = 0x3d; +const GREATER_THAN_SIGN = 0x3e; +const QUESTION_MARK = 0x3f; +const LATIN_CAPITAL_LETTER_A = 0x41; +const LATIN_CAPITAL_LETTER_B = 0x42; +const LATIN_CAPITAL_LETTER_D = 0x44; +const LATIN_CAPITAL_LETTER_F = 0x46; +const LATIN_CAPITAL_LETTER_P = 0x50; +const LATIN_CAPITAL_LETTER_S = 0x53; +const LATIN_CAPITAL_LETTER_W = 0x57; +const LATIN_CAPITAL_LETTER_Z = 0x5a; +const LOW_LINE = 0x5f; +const LATIN_SMALL_LETTER_A = 0x61; +const LATIN_SMALL_LETTER_B = 0x62; +const LATIN_SMALL_LETTER_C = 0x63; +const LATIN_SMALL_LETTER_D = 0x64; +const LATIN_SMALL_LETTER_F = 0x66; +const LATIN_SMALL_LETTER_G = 0x67; +const LATIN_SMALL_LETTER_I = 0x69; +const LATIN_SMALL_LETTER_K = 0x6b; +const LATIN_SMALL_LETTER_M = 0x6d; +const LATIN_SMALL_LETTER_N = 0x6e; +const LATIN_SMALL_LETTER_P = 0x70; +const LATIN_SMALL_LETTER_R = 0x72; +const LATIN_SMALL_LETTER_S = 0x73; +const LATIN_SMALL_LETTER_T = 0x74; +const LATIN_SMALL_LETTER_U = 0x75; +const LATIN_SMALL_LETTER_V = 0x76; +const LATIN_SMALL_LETTER_W = 0x77; +const LATIN_SMALL_LETTER_X = 0x78; +const LATIN_SMALL_LETTER_Y = 0x79; +const LATIN_SMALL_LETTER_Z = 0x7a; +const LEFT_SQUARE_BRACKET = 0x5b; +const REVERSE_SOLIDUS = 0x5c; +const RIGHT_SQUARE_BRACKET = 0x5d; +const CIRCUMFLEX_ACCENT = 0x5e; +const LEFT_CURLY_BRACKET = 0x7b; +const VERTICAL_LINE = 0x7c; +const RIGHT_CURLY_BRACKET = 0x7d; +const ZERO_WIDTH_NON_JOINER = 0x200c; +const ZERO_WIDTH_JOINER = 0x200d; +const LINE_SEPARATOR = 0x2028; +const PARAGRAPH_SEPARATOR = 0x2029; +const MIN_CODE_POINT = 0x00; +const MAX_CODE_POINT = 0x10ffff; function isLatinLetter(code) { - return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); + return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z)); } function isDecimalDigit(code) { - return code >= DigitZero && code <= DigitNine; + return code >= DIGIT_ZERO && code <= DIGIT_NINE; } function isOctalDigit(code) { - return code >= DigitZero && code <= DigitSeven; + return code >= DIGIT_ZERO && code <= DIGIT_SEVEN; } function isHexDigit(code) { - return ((code >= DigitZero && code <= DigitNine) || - (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); + return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) || + (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F)); } function isLineTerminator(code) { - return (code === LineFeed || - code === CarriageReturn || - code === LineSeparator || - code === ParagraphSeparator); + return (code === LINE_FEED || + code === CARRIAGE_RETURN || + code === LINE_SEPARATOR || + code === PARAGRAPH_SEPARATOR); } function isValidUnicode(code) { - return code >= MinCodePoint && code <= MaxCodePoint; + return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT; } function digitToInt(code) { - if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { - return code - LatinSmallLetterA + 10; + if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) { + return code - LATIN_SMALL_LETTER_A + 10; } - if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { - return code - LatinCapitalLetterA + 10; + if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) { + return code - LATIN_CAPITAL_LETTER_A + 10; } - return code - DigitZero; + return code - DIGIT_ZERO; } function isLeadSurrogate(code) { return code >= 0xd800 && code <= 0xdbff; @@ -340,33 +357,33 @@ class RegExpSyntaxError extends SyntaxError { } function isSyntaxCharacter(cp) { - return (cp === CircumflexAccent || - cp === DollarSign || - cp === ReverseSolidus || - cp === FullStop || - cp === Asterisk || - cp === PlusSign || - cp === QuestionMark || - cp === LeftParenthesis || - cp === RightParenthesis || - cp === LeftSquareBracket || - cp === RightSquareBracket || - cp === LeftCurlyBracket || - cp === RightCurlyBracket || - cp === VerticalLine); + return (cp === CIRCUMFLEX_ACCENT || + cp === DOLLAR_SIGN || + cp === REVERSE_SOLIDUS || + cp === FULL_STOP || + cp === ASTERISK || + cp === PLUS_SIGN || + cp === QUESTION_MARK || + cp === LEFT_PARENTHESIS || + cp === RIGHT_PARENTHESIS || + cp === LEFT_SQUARE_BRACKET || + cp === RIGHT_SQUARE_BRACKET || + cp === LEFT_CURLY_BRACKET || + cp === RIGHT_CURLY_BRACKET || + cp === VERTICAL_LINE); } function isRegExpIdentifierStart(cp) { - return isIdStart(cp) || cp === DollarSign || cp === LowLine; + return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE; } function isRegExpIdentifierPart(cp) { return (isIdContinue(cp) || - cp === DollarSign || - cp === LowLine || - cp === ZeroWidthNonJoiner || - cp === ZeroWidthJoiner); + cp === DOLLAR_SIGN || + cp === LOW_LINE || + cp === ZERO_WIDTH_NON_JOINER || + cp === ZERO_WIDTH_JOINER); } function isUnicodePropertyNameCharacter(cp) { - return isLatinLetter(cp) || cp === LowLine; + return isLatinLetter(cp) || cp === LOW_LINE; } function isUnicodePropertyValueCharacter(cp) { return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); @@ -386,13 +403,13 @@ class RegExpValidator { this._numCapturingParens = 0; this._groupNames = new Set(); this._backreferenceNames = new Set(); - this._options = options || {}; + this._options = options !== null && options !== void 0 ? options : {}; } validateLiteral(source, start = 0, end = source.length) { this._uFlag = this._nFlag = false; this.reset(source, start, end); this.onLiteralEnter(start); - if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { + if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) { const flagStart = this.index; const uFlag = source.includes("u", flagStart); this.validateFlags(source, flagStart, end); @@ -415,35 +432,51 @@ class RegExpValidator { let sticky = false; let unicode = false; let dotAll = false; + let hasIndices = false; for (let i = start; i < end; ++i) { const flag = source.charCodeAt(i); if (existingFlags.has(flag)) { this.raise(`Duplicated flag '${source[i]}'`); } existingFlags.add(flag); - if (flag === LatinSmallLetterG) { + if (flag === LATIN_SMALL_LETTER_G) { global = true; } - else if (flag === LatinSmallLetterI) { + else if (flag === LATIN_SMALL_LETTER_I) { ignoreCase = true; } - else if (flag === LatinSmallLetterM) { + else if (flag === LATIN_SMALL_LETTER_M) { multiline = true; } - else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { + else if (flag === LATIN_SMALL_LETTER_U && + this.ecmaVersion >= 2015) { unicode = true; } - else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { + else if (flag === LATIN_SMALL_LETTER_Y && + this.ecmaVersion >= 2015) { sticky = true; } - else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { + else if (flag === LATIN_SMALL_LETTER_S && + this.ecmaVersion >= 2018) { dotAll = true; } + else if (flag === LATIN_SMALL_LETTER_D && + this.ecmaVersion >= 2022) { + hasIndices = true; + } else { this.raise(`Invalid flag '${source[i]}'`); } } - this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + this.onRegExpFlags(start, end, { + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + hasIndices, + }); } validatePattern(source, start = 0, end = source.length, uFlag = false) { this._uFlag = uFlag && this.ecmaVersion >= 2015; @@ -459,10 +492,11 @@ class RegExpValidator { } } get strict() { - return Boolean(this._options.strict || this._uFlag); + return Boolean(this._options.strict) || this._uFlag; } get ecmaVersion() { - return this._options.ecmaVersion || 2020; + var _a; + return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : 2022; } onLiteralEnter(start) { if (this._options.onLiteralEnter) { @@ -474,9 +508,12 @@ class RegExpValidator { this._options.onLiteralLeave(start, end); } } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + onRegExpFlags(start, end, flags) { + if (this._options.onRegExpFlags) { + this._options.onRegExpFlags(start, end, flags); + } if (this._options.onFlags) { - this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices); } } onPatternEnter(start) { @@ -646,17 +683,17 @@ class RegExpValidator { if (escaped) { escaped = false; } - else if (cp === ReverseSolidus) { + else if (cp === REVERSE_SOLIDUS) { escaped = true; } - else if (cp === LeftSquareBracket) { + else if (cp === LEFT_SQUARE_BRACKET) { inClass = true; } - else if (cp === RightSquareBracket) { + else if (cp === RIGHT_SQUARE_BRACKET) { inClass = false; } - else if ((cp === Solidus && !inClass) || - (cp === Asterisk && this.index === start)) { + else if ((cp === SOLIDUS && !inClass) || + (cp === ASTERISK && this.index === start)) { break; } this.advance(); @@ -672,13 +709,13 @@ class RegExpValidator { this.consumeDisjunction(); const cp = this.currentCodePoint; if (this.currentCodePoint !== -1) { - if (cp === RightParenthesis) { + if (cp === RIGHT_PARENTHESIS) { this.raise("Unmatched ')'"); } - if (cp === ReverseSolidus) { + if (cp === REVERSE_SOLIDUS) { this.raise("\\ at end of pattern"); } - if (cp === RightSquareBracket || cp === RightCurlyBracket) { + if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) { this.raise("Lone quantifier brackets"); } const c = String.fromCodePoint(cp); @@ -701,21 +738,21 @@ class RegExpValidator { if (escaped) { escaped = false; } - else if (cp === ReverseSolidus) { + else if (cp === REVERSE_SOLIDUS) { escaped = true; } - else if (cp === LeftSquareBracket) { + else if (cp === LEFT_SQUARE_BRACKET) { inClass = true; } - else if (cp === RightSquareBracket) { + else if (cp === RIGHT_SQUARE_BRACKET) { inClass = false; } - else if (cp === LeftParenthesis && + else if (cp === LEFT_PARENTHESIS && !inClass && - (this.nextCodePoint !== QuestionMark || - (this.nextCodePoint2 === LessThanSign && - this.nextCodePoint3 !== EqualsSign && - this.nextCodePoint3 !== ExclamationMark))) { + (this.nextCodePoint !== QUESTION_MARK || + (this.nextCodePoint2 === LESS_THAN_SIGN && + this.nextCodePoint3 !== EQUALS_SIGN && + this.nextCodePoint3 !== EXCLAMATION_MARK))) { count += 1; } this.advance(); @@ -729,11 +766,11 @@ class RegExpValidator { this.onDisjunctionEnter(start); do { this.consumeAlternative(i++); - } while (this.eat(VerticalLine)); + } while (this.eat(VERTICAL_LINE)); if (this.consumeQuantifier(true)) { this.raise("Nothing to repeat"); } - if (this.eat(LeftCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET)) { this.raise("Lone quantifier brackets"); } this.onDisjunctionLeave(start, this.index); @@ -762,30 +799,31 @@ class RegExpValidator { consumeAssertion() { const start = this.index; this._lastAssertionIsQuantifiable = false; - if (this.eat(CircumflexAccent)) { + if (this.eat(CIRCUMFLEX_ACCENT)) { this.onEdgeAssertion(start, this.index, "start"); return true; } - if (this.eat(DollarSign)) { + if (this.eat(DOLLAR_SIGN)) { this.onEdgeAssertion(start, this.index, "end"); return true; } - if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { + if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) { this.onWordBoundaryAssertion(start, this.index, "word", true); return true; } - if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { + if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) { this.onWordBoundaryAssertion(start, this.index, "word", false); return true; } - if (this.eat2(LeftParenthesis, QuestionMark)) { - const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN); let negate = false; - if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { + if (this.eat(EQUALS_SIGN) || + (negate = this.eat(EXCLAMATION_MARK))) { const kind = lookbehind ? "lookbehind" : "lookahead"; this.onLookaroundAssertionEnter(start, kind, negate); this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; @@ -801,15 +839,15 @@ class RegExpValidator { let min = 0; let max = 0; let greedy = false; - if (this.eat(Asterisk)) { + if (this.eat(ASTERISK)) { min = 0; max = Number.POSITIVE_INFINITY; } - else if (this.eat(PlusSign)) { + else if (this.eat(PLUS_SIGN)) { min = 1; max = Number.POSITIVE_INFINITY; } - else if (this.eat(QuestionMark)) { + else if (this.eat(QUESTION_MARK)) { min = 0; max = 1; } @@ -820,7 +858,7 @@ class RegExpValidator { else { return false; } - greedy = !this.eat(QuestionMark); + greedy = !this.eat(QUESTION_MARK); if (!noConsume) { this.onQuantifier(start, this.index, min, max, greedy); } @@ -828,17 +866,17 @@ class RegExpValidator { } eatBracedQuantifier(noError) { const start = this.index; - if (this.eat(LeftCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET)) { this._lastMinValue = 0; this._lastMaxValue = Number.POSITIVE_INFINITY; if (this.eatDecimalDigits()) { this._lastMinValue = this._lastMaxValue = this._lastIntValue; - if (this.eat(Comma)) { + if (this.eat(COMMA)) { this._lastMaxValue = this.eatDecimalDigits() ? this._lastIntValue : Number.POSITIVE_INFINITY; } - if (this.eat(RightCurlyBracket)) { + if (this.eat(RIGHT_CURLY_BRACKET)) { if (!noError && this._lastMaxValue < this._lastMinValue) { this.raise("numbers out of order in {} quantifier"); } @@ -861,7 +899,7 @@ class RegExpValidator { this.consumeCapturingGroup()); } consumeDot() { - if (this.eat(FullStop)) { + if (this.eat(FULL_STOP)) { this.onAnyCharacterSet(this.index - 1, this.index, "any"); return true; } @@ -869,7 +907,7 @@ class RegExpValidator { } consumeReverseSolidusAtomEscape() { const start = this.index; - if (this.eat(ReverseSolidus)) { + if (this.eat(REVERSE_SOLIDUS)) { if (this.consumeAtomEscape()) { return true; } @@ -879,10 +917,10 @@ class RegExpValidator { } consumeUncapturingGroup() { const start = this.index; - if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { + if (this.eat3(LEFT_PARENTHESIS, QUESTION_MARK, COLON)) { this.onGroupEnter(start); this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } this.onGroupLeave(start, this.index); @@ -892,19 +930,19 @@ class RegExpValidator { } consumeCapturingGroup() { const start = this.index; - if (this.eat(LeftParenthesis)) { + if (this.eat(LEFT_PARENTHESIS)) { let name = null; if (this.ecmaVersion >= 2018) { if (this.consumeGroupSpecifier()) { name = this._lastStrValue; } } - else if (this.currentCodePoint === QuestionMark) { + else if (this.currentCodePoint === QUESTION_MARK) { this.raise("Invalid group"); } this.onCapturingGroupEnter(start, name); this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } this.onCapturingGroupLeave(start, this.index, name); @@ -924,11 +962,11 @@ class RegExpValidator { } consumeReverseSolidusFollowedByC() { const start = this.index; - if (this.currentCodePoint === ReverseSolidus && - this.nextCodePoint === LatinSmallLetterC) { + if (this.currentCodePoint === REVERSE_SOLIDUS && + this.nextCodePoint === LATIN_SMALL_LETTER_C) { this._lastIntValue = this.currentCodePoint; this.advance(); - this.onCharacter(start, this.index, ReverseSolidus); + this.onCharacter(start, this.index, REVERSE_SOLIDUS); return true; } return false; @@ -953,17 +991,17 @@ class RegExpValidator { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && - cp !== CircumflexAccent && - cp !== DollarSign && - cp !== ReverseSolidus && - cp !== FullStop && - cp !== Asterisk && - cp !== PlusSign && - cp !== QuestionMark && - cp !== LeftParenthesis && - cp !== RightParenthesis && - cp !== LeftSquareBracket && - cp !== VerticalLine) { + cp !== CIRCUMFLEX_ACCENT && + cp !== DOLLAR_SIGN && + cp !== REVERSE_SOLIDUS && + cp !== FULL_STOP && + cp !== ASTERISK && + cp !== PLUS_SIGN && + cp !== QUESTION_MARK && + cp !== LEFT_PARENTHESIS && + cp !== RIGHT_PARENTHESIS && + cp !== LEFT_SQUARE_BRACKET && + cp !== VERTICAL_LINE) { this.advance(); this.onCharacter(start, this.index, cp); return true; @@ -971,7 +1009,7 @@ class RegExpValidator { return false; } consumeGroupSpecifier() { - if (this.eat(QuestionMark)) { + if (this.eat(QUESTION_MARK)) { if (this.eatGroupName()) { if (!this._groupNames.has(this._lastStrValue)) { this._groupNames.add(this._lastStrValue); @@ -1012,32 +1050,32 @@ class RegExpValidator { } consumeCharacterClassEscape() { const start = this.index; - if (this.eat(LatinSmallLetterD)) { + if (this.eat(LATIN_SMALL_LETTER_D)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", false); return true; } - if (this.eat(LatinCapitalLetterD)) { + if (this.eat(LATIN_CAPITAL_LETTER_D)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", true); return true; } - if (this.eat(LatinSmallLetterS)) { + if (this.eat(LATIN_SMALL_LETTER_S)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", false); return true; } - if (this.eat(LatinCapitalLetterS)) { + if (this.eat(LATIN_CAPITAL_LETTER_S)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", true); return true; } - if (this.eat(LatinSmallLetterW)) { + if (this.eat(LATIN_SMALL_LETTER_W)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", false); return true; } - if (this.eat(LatinCapitalLetterW)) { + if (this.eat(LATIN_CAPITAL_LETTER_W)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", true); return true; @@ -1045,12 +1083,12 @@ class RegExpValidator { let negate = false; if (this._uFlag && this.ecmaVersion >= 2018 && - (this.eat(LatinSmallLetterP) || - (negate = this.eat(LatinCapitalLetterP)))) { + (this.eat(LATIN_SMALL_LETTER_P) || + (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) { this._lastIntValue = -1; - if (this.eat(LeftCurlyBracket) && + if (this.eat(LEFT_CURLY_BRACKET) && this.eatUnicodePropertyValueExpression() && - this.eat(RightCurlyBracket)) { + this.eat(RIGHT_CURLY_BRACKET)) { this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); return true; } @@ -1076,7 +1114,7 @@ class RegExpValidator { } consumeKGroupName() { const start = this.index; - if (this.eat(LatinSmallLetterK)) { + if (this.eat(LATIN_SMALL_LETTER_K)) { if (this.eatGroupName()) { const groupName = this._lastStrValue; this._backreferenceNames.add(groupName); @@ -1089,11 +1127,11 @@ class RegExpValidator { } consumeCharacterClass() { const start = this.index; - if (this.eat(LeftSquareBracket)) { - const negate = this.eat(CircumflexAccent); + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); this.onCharacterClassEnter(start, negate); this.consumeClassRanges(); - if (!this.eat(RightSquareBracket)) { + if (!this.eat(RIGHT_SQUARE_BRACKET)) { this.raise("Unterminated character class"); } this.onCharacterClassLeave(start, this.index, negate); @@ -1109,10 +1147,10 @@ class RegExpValidator { break; } const min = this._lastIntValue; - if (!this.eat(HyphenMinus)) { + if (!this.eat(HYPHEN_MINUS)) { continue; } - this.onCharacter(this.index - 1, this.index, HyphenMinus); + this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS); if (!this.consumeClassAtom()) { break; } @@ -1132,18 +1170,21 @@ class RegExpValidator { consumeClassAtom() { const start = this.index; const cp = this.currentCodePoint; - if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { + if (cp !== -1 && + cp !== REVERSE_SOLIDUS && + cp !== RIGHT_SQUARE_BRACKET) { this.advance(); this._lastIntValue = cp; this.onCharacter(start, this.index, this._lastIntValue); return true; } - if (this.eat(ReverseSolidus)) { + if (this.eat(REVERSE_SOLIDUS)) { if (this.consumeClassEscape()) { return true; } - if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { - this._lastIntValue = ReverseSolidus; + if (!this.strict && + this.currentCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = REVERSE_SOLIDUS; this.onCharacter(start, this.index, this._lastIntValue); return true; } @@ -1156,21 +1197,21 @@ class RegExpValidator { } consumeClassEscape() { const start = this.index; - if (this.eat(LatinSmallLetterB)) { - this._lastIntValue = Backspace; + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } - if (this._uFlag && this.eat(HyphenMinus)) { - this._lastIntValue = HyphenMinus; + if (this._uFlag && this.eat(HYPHEN_MINUS)) { + this._lastIntValue = HYPHEN_MINUS; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } let cp = 0; if (!this.strict && !this._uFlag && - this.currentCodePoint === LatinSmallLetterC && - (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) { + this.currentCodePoint === LATIN_SMALL_LETTER_C && + (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) { this.advance(); this.advance(); this._lastIntValue = cp % 0x20; @@ -1180,8 +1221,8 @@ class RegExpValidator { return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); } eatGroupName() { - if (this.eat(LessThanSign)) { - if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { + if (this.eat(LESS_THAN_SIGN)) { + if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) { return true; } this.raise("Invalid capture group name"); @@ -1203,7 +1244,7 @@ class RegExpValidator { const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); - if (cp === ReverseSolidus && + if (cp === REVERSE_SOLIDUS && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } @@ -1227,7 +1268,7 @@ class RegExpValidator { const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); - if (cp === ReverseSolidus && + if (cp === REVERSE_SOLIDUS && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } @@ -1248,7 +1289,7 @@ class RegExpValidator { } eatCControlLetter() { const start = this.index; - if (this.eat(LatinSmallLetterC)) { + if (this.eat(LATIN_SMALL_LETTER_C)) { if (this.eatControlLetter()) { return true; } @@ -1257,7 +1298,7 @@ class RegExpValidator { return false; } eatZero() { - if (this.currentCodePoint === DigitZero && + if (this.currentCodePoint === DIGIT_ZERO && !isDecimalDigit(this.nextCodePoint)) { this._lastIntValue = 0; this.advance(); @@ -1266,24 +1307,24 @@ class RegExpValidator { return false; } eatControlEscape() { - if (this.eat(LatinSmallLetterF)) { - this._lastIntValue = FormFeed; + if (this.eat(LATIN_SMALL_LETTER_F)) { + this._lastIntValue = FORM_FEED; return true; } - if (this.eat(LatinSmallLetterN)) { - this._lastIntValue = LineFeed; + if (this.eat(LATIN_SMALL_LETTER_N)) { + this._lastIntValue = LINE_FEED; return true; } - if (this.eat(LatinSmallLetterR)) { - this._lastIntValue = CarriageReturn; + if (this.eat(LATIN_SMALL_LETTER_R)) { + this._lastIntValue = CARRIAGE_RETURN; return true; } - if (this.eat(LatinSmallLetterT)) { - this._lastIntValue = CharacterTabulation; + if (this.eat(LATIN_SMALL_LETTER_T)) { + this._lastIntValue = CHARACTER_TABULATION; return true; } - if (this.eat(LatinSmallLetterV)) { - this._lastIntValue = LineTabulation; + if (this.eat(LATIN_SMALL_LETTER_V)) { + this._lastIntValue = LINE_TABULATION; return true; } return false; @@ -1300,7 +1341,7 @@ class RegExpValidator { eatRegExpUnicodeEscapeSequence(forceUFlag = false) { const start = this.index; const uFlag = forceUFlag || this._uFlag; - if (this.eat(LatinSmallLetterU)) { + if (this.eat(LATIN_SMALL_LETTER_U)) { if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || this.eatFixedHexDigits(4) || (uFlag && this.eatRegExpUnicodeCodePointEscape())) { @@ -1318,8 +1359,8 @@ class RegExpValidator { if (this.eatFixedHexDigits(4)) { const lead = this._lastIntValue; if (isLeadSurrogate(lead) && - this.eat(ReverseSolidus) && - this.eat(LatinSmallLetterU) && + this.eat(REVERSE_SOLIDUS) && + this.eat(LATIN_SMALL_LETTER_U) && this.eatFixedHexDigits(4)) { const trail = this._lastIntValue; if (isTrailSurrogate(trail)) { @@ -1333,9 +1374,9 @@ class RegExpValidator { } eatRegExpUnicodeCodePointEscape() { const start = this.index; - if (this.eat(LeftCurlyBracket) && + if (this.eat(LEFT_CURLY_BRACKET) && this.eatHexDigits() && - this.eat(RightCurlyBracket) && + this.eat(RIGHT_CURLY_BRACKET) && isValidUnicode(this._lastIntValue)) { return true; } @@ -1356,32 +1397,32 @@ class RegExpValidator { return false; } if (this._uFlag) { - return isSyntaxCharacter(cp) || cp === Solidus; + return isSyntaxCharacter(cp) || cp === SOLIDUS; } if (this.strict) { return !isIdContinue(cp); } if (this._nFlag) { - return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); + return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K); } - return cp !== LatinSmallLetterC; + return cp !== LATIN_SMALL_LETTER_C; } eatDecimalEscape() { this._lastIntValue = 0; let cp = this.currentCodePoint; - if (cp >= DigitOne && cp <= DigitNine) { + if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) { do { - this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); + this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO); this.advance(); - } while ((cp = this.currentCodePoint) >= DigitZero && - cp <= DigitNine); + } while ((cp = this.currentCodePoint) >= DIGIT_ZERO && + cp <= DIGIT_NINE); return true; } return false; } eatUnicodePropertyValueExpression() { const start = this.index; - if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { + if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) { this._lastKeyValue = this._lastStrValue; if (this.eatUnicodePropertyValue()) { this._lastValValue = this._lastStrValue; @@ -1429,7 +1470,7 @@ class RegExpValidator { } eatHexEscapeSequence() { const start = this.index; - if (this.eat(LatinSmallLetterX)) { + if (this.eat(LATIN_SMALL_LETTER_X)) { if (this.eatFixedHexDigits(2)) { return true; } @@ -1483,7 +1524,7 @@ class RegExpValidator { const cp = this.currentCodePoint; if (isOctalDigit(cp)) { this.advance(); - this._lastIntValue = cp - DigitZero; + this._lastIntValue = cp - DIGIT_ZERO; return true; } this._lastIntValue = 0; @@ -1505,18 +1546,19 @@ class RegExpValidator { } } -const DummyPattern = {}; -const DummyFlags = {}; -const DummyCapturingGroup = {}; +const DUMMY_PATTERN = {}; +const DUMMY_FLAGS = {}; +const DUMMY_CAPTURING_GROUP = {}; class RegExpParserState { constructor(options) { - this._node = DummyPattern; - this._flags = DummyFlags; + var _a; + this._node = DUMMY_PATTERN; + this._flags = DUMMY_FLAGS; this._backreferences = []; this._capturingGroups = []; this.source = ""; - this.strict = Boolean(options && options.strict); - this.ecmaVersion = (options && options.ecmaVersion) || 2020; + this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict); + this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : 2022; } get pattern() { if (this._node.type !== "Pattern") { @@ -1530,7 +1572,7 @@ class RegExpParserState { } return this._flags; } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, }) { this._flags = { type: "Flags", parent: null, @@ -1543,6 +1585,7 @@ class RegExpParserState { unicode, sticky, dotAll, + hasIndices, }; } onPatternEnter(start) { @@ -1564,7 +1607,7 @@ class RegExpParserState { const ref = reference.ref; const group = typeof ref === "number" ? this._capturingGroups[ref - 1] - : this._capturingGroups.find(g => g.name === ref); + : this._capturingGroups.find((g) => g.name === ref); reference.resolved = group; group.references.push(reference); } @@ -1800,7 +1843,7 @@ class RegExpParserState { end, raw: this.source.slice(start, end), ref, - resolved: DummyCapturingGroup, + resolved: DUMMY_CAPTURING_GROUP, }; parent.elements.push(node); this._backreferences.push(node); @@ -1846,7 +1889,7 @@ class RegExpParserState { min.type !== "Character" || max.type !== "Character" || hyphen.type !== "Character" || - hyphen.value !== HyphenMinus) { + hyphen.value !== HYPHEN_MINUS) { throw new Error("UnknownError"); } const node = { @@ -2070,7 +2113,7 @@ function parseRegExpLiteral(source, options) { return new RegExpParser(options).parseLiteral(String(source)); } function validateRegExpLiteral(source, options) { - return new RegExpValidator(options).validateLiteral(source); + new RegExpValidator(options).validateLiteral(source); } function visitRegExpAST(node, handlers) { new RegExpVisitor(handlers).visit(node); diff --git a/node_modules/@eslint-community/regexpp/index.js.map b/node_modules/@eslint-community/regexpp/index.js.map new file mode 100644 index 000000000..ed50a9cf8 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;AAIA,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAErD,SAAU,SAAS,CAAC,EAAU,EAAA;IAChC,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;AAC1B,IAAA,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;AAC7B,CAAC;AAEK,SAAU,YAAY,CAAC,EAAU,EAAA;IACnC,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,KAAK,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC5B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,cAAc,CAAC,EAAU,EAAA;AAC9B,IAAA,OAAO,SAAS,CACZ,EAAE,EACF,kBAAkB,aAAlB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;AACJ;;ACvMe,SAAA,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B,EAAA;AAE9B,IAAA,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;AACjE,CAAC;AAOe,SAAA,qBAAqB,CACjC,MAAc,EACd,OAAiC,EAAA;IAEjC,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;AACxD,CAAC;AAEe,SAAA,cAAc,CAC1B,IAAc,EACd,QAAgC,EAAA;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3C;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/regexpp/index.mjs b/node_modules/@eslint-community/regexpp/index.mjs similarity index 76% rename from node_modules/regexpp/index.mjs rename to node_modules/@eslint-community/regexpp/index.mjs index d02491f0d..17f856da8 100644 --- a/node_modules/regexpp/index.mjs +++ b/node_modules/@eslint-community/regexpp/index.mjs @@ -1,8 +1,5 @@ -/*! @author Toru Nagashima */ - - var ast = /*#__PURE__*/Object.freeze({ - + __proto__: null }); let largeIdStartRanges = undefined; @@ -36,17 +33,16 @@ function isIdContinue(cp) { return isLargeIdStart(cp) || isLargeIdContinue(cp); } function isLargeIdStart(cp) { - return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); + return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges())); } function isLargeIdContinue(cp) { - return isInRange(cp, largeIdContinueRanges || - (largeIdContinueRanges = initLargeIdContinueRanges())); + return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges())); } function initLargeIdStartRanges() { - return restoreRanges("170 0 11 0 5 0 6 22 2 30 2 457 5 11 15 4 8 0 2 0 130 4 2 1 3 3 2 0 7 0 2 2 2 0 2 19 2 82 2 138 9 165 2 37 3 0 7 40 72 26 5 3 46 42 36 1 2 98 2 0 16 1 8 1 11 2 3 0 17 0 2 29 30 88 12 0 25 32 10 1 5 0 6 21 5 0 10 0 4 0 24 24 8 10 54 20 2 17 61 53 4 0 19 0 8 9 16 15 5 7 3 1 3 21 2 6 2 0 4 3 4 0 17 0 14 1 2 2 15 1 11 0 9 5 5 1 3 21 2 6 2 1 2 1 2 1 32 3 2 0 20 2 17 8 2 2 2 21 2 6 2 1 2 4 4 0 19 0 16 1 24 0 12 7 3 1 3 21 2 6 2 1 2 4 4 0 31 1 2 2 16 0 18 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 11 23 0 53 7 2 2 2 22 2 15 4 0 27 2 6 1 31 0 5 7 2 2 2 22 2 9 2 4 4 0 33 0 2 1 16 1 18 8 2 2 2 40 3 0 17 0 6 2 9 2 25 5 6 17 4 23 2 8 2 0 3 6 59 47 2 1 13 6 59 1 2 0 2 4 2 23 2 0 2 9 2 1 10 0 3 4 2 0 22 3 33 0 64 7 2 35 28 4 116 42 21 0 17 5 5 3 4 0 4 1 8 2 5 12 13 0 18 37 2 0 6 0 3 42 2 332 2 3 3 6 2 0 2 3 3 40 2 3 3 32 2 3 3 6 2 0 2 3 3 14 2 56 2 3 3 66 38 15 17 85 3 5 4 619 3 16 2 25 6 74 4 10 8 12 2 3 15 17 15 17 15 12 2 2 16 51 36 0 5 0 68 88 8 40 2 0 6 69 11 30 50 29 3 4 12 43 5 25 55 22 10 52 83 0 94 46 18 6 56 29 14 1 11 43 27 35 42 2 11 35 3 8 8 42 3 2 42 3 2 5 2 1 4 0 6 191 65 277 3 5 3 37 3 5 3 7 2 0 2 0 2 0 2 30 3 52 2 6 2 0 4 2 2 6 4 3 3 5 5 12 6 2 2 6 117 0 14 0 17 12 102 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 15 3 3 6 4 5 0 18 40 2680 46 2 46 2 132 7 3 4 1 13 37 2 0 6 0 3 55 8 0 17 22 10 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 551 2 26 8 8 4 3 4 5 85 5 4 2 89 2 3 6 42 2 93 18 31 49 15 513 6591 65 20988 4 1164 68 45 3 268 4 15 11 1 21 46 17 30 3 79 40 8 3 102 3 52 3 8 43 12 2 2 2 3 2 22 30 51 15 49 63 5 4 0 2 1 12 27 11 22 26 28 8 46 29 0 17 4 2 9 11 4 2 40 24 2 2 7 21 22 4 0 4 49 2 0 4 1 3 4 3 0 2 0 25 2 3 10 8 2 13 5 3 5 3 5 10 6 2 6 2 42 2 13 7 114 30 11171 13 22 5 48 8453 365 3 105 39 6 13 4 6 0 2 9 2 12 2 4 2 0 2 1 2 1 2 107 34 362 19 63 3 53 41 11 117 4 2 134 37 25 7 25 12 88 4 5 3 5 3 5 3 2 36 11 2 25 2 18 2 1 2 14 3 13 35 122 70 52 268 28 4 48 48 31 14 29 6 37 11 29 3 35 5 7 2 4 43 157 19 35 5 35 5 39 9 51 157 310 10 21 11 7 153 5 3 0 2 43 2 1 4 0 3 22 11 22 10 30 66 18 2 1 11 21 11 25 71 55 7 1 65 0 16 3 2 2 2 28 43 28 4 28 36 7 2 27 28 53 11 21 11 18 14 17 111 72 56 50 14 50 14 35 349 41 7 1 79 28 11 0 9 21 107 20 28 22 13 52 76 44 33 24 27 35 30 0 3 0 9 34 4 0 13 47 15 3 22 0 2 0 36 17 2 24 85 6 2 0 2 3 2 14 2 9 8 46 39 7 3 1 3 21 2 6 2 1 2 4 4 0 19 0 13 4 159 52 19 3 21 2 31 47 21 1 2 0 185 46 42 3 37 47 21 0 60 42 14 0 72 26 230 43 117 63 32 7 3 0 3 7 2 1 2 23 16 0 2 0 95 7 3 38 17 0 2 0 29 0 11 39 8 0 22 0 12 45 20 0 35 56 264 8 2 36 18 0 50 29 113 6 2 1 2 37 22 0 26 5 2 1 2 31 15 0 328 18 190 0 80 921 103 110 18 195 2749 1070 4050 582 8634 568 8 30 114 29 19 47 17 3 32 20 6 18 689 63 129 74 6 0 67 12 65 1 2 0 29 6135 9 1237 43 8 8952 286 50 2 18 3 9 395 2309 106 6 12 4 8 8 9 5991 84 2 70 2 1 3 0 3 1 3 3 2 11 2 0 2 6 2 64 2 3 3 7 2 6 2 27 2 3 2 4 2 0 4 6 2 339 3 24 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 7 2357 44 11 6 17 0 370 43 1301 196 60 67 8 0 1205 3 2 26 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 16 6 2 2 4 2 16 4421 42717 35 4148 12 221 3 5761 15 7472 3104 541 1507 4938"); + return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2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1 2 a 2 e 2 6 2 1 1w 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 33u g6 6nu fs 8 u i 26 i t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r l1 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk 2e8 f1 15v 3t6 6 38f"); } function initLargeIdContinueRanges() { - return restoreRanges("183 0 585 111 24 0 252 4 266 44 2 0 2 1 2 1 2 0 73 10 49 30 7 0 102 6 3 5 3 1 2 3 3 9 24 0 31 26 92 10 16 9 34 8 10 0 25 3 2 8 2 2 2 4 44 2 120 14 2 32 55 2 2 17 2 6 11 1 3 9 18 2 57 0 2 6 3 1 3 2 10 0 11 1 3 9 15 0 3 2 57 0 2 4 5 1 3 2 4 0 21 11 4 0 12 2 57 0 2 7 2 2 2 2 21 1 3 9 11 5 2 2 57 0 2 6 3 1 3 2 8 2 11 1 3 9 19 0 60 4 4 2 2 3 10 0 15 9 17 4 58 6 2 2 2 3 8 1 12 1 3 9 18 2 57 0 2 6 2 2 2 3 8 1 12 1 3 9 17 3 56 1 2 6 2 2 2 3 10 0 11 1 3 9 18 2 71 0 5 5 2 0 2 7 7 9 3 1 62 0 3 6 13 7 2 9 88 0 3 8 12 5 3 9 63 1 7 9 12 0 2 0 2 0 5 1 50 19 2 1 6 10 2 35 10 0 101 19 2 9 13 3 5 2 2 2 3 6 4 3 14 11 2 14 704 2 10 8 929 2 30 2 30 1 31 1 65 31 10 0 3 9 34 2 3 9 144 0 119 11 5 11 11 9 129 10 61 4 58 9 2 28 3 10 7 9 23 13 2 1 64 4 48 16 12 9 18 8 13 2 31 12 3 9 45 13 49 19 9 9 7 9 119 2 2 20 5 0 7 0 3 2 199 57 2 4 576 1 20 0 124 12 5 0 4 11 3071 2 142 0 97 31 555 5 106 1 30086 9 70 0 5 9 33 1 81 1 273 0 4 0 5 0 24 4 5 0 84 1 51 17 11 9 7 17 14 10 29 7 26 12 45 3 48 13 16 9 12 0 11 9 48 13 13 0 9 1 3 9 34 2 51 0 2 2 3 1 6 1 2 0 42 4 6 1 237 7 2 1 3 9 20261 0 738 15 17 15 4 1 25 2 193 9 38 0 702 0 227 0 150 4 294 9 1368 2 2 1 6 3 41 2 5 0 166 1 574 3 9 9 370 1 154 10 176 2 54 14 32 9 16 3 46 10 54 9 7 2 37 13 2 9 6 1 45 0 13 2 49 13 9 3 2 11 83 11 7 0 161 11 6 9 7 3 56 1 2 6 3 1 3 2 10 0 11 1 3 6 4 4 193 17 10 9 5 0 82 19 13 9 214 6 3 8 28 1 83 16 16 9 82 12 9 9 84 14 5 9 243 14 166 9 71 5 2 1 3 3 2 0 2 1 13 9 120 6 3 6 4 0 29 9 41 6 2 3 9 0 10 10 47 15 406 7 2 7 17 9 57 21 2 13 123 5 4 0 2 1 2 6 2 0 9 9 49 4 2 1 2 4 9 9 330 3 19306 9 135 4 60 6 26 9 1014 0 2 54 8 3 82 0 12 1 19628 1 5319 4 4 5 9 7 3 6 31 3 149 2 1418 49 513 54 5 49 9 0 15 0 23 4 2 14 1361 6 2 16 3 6 2 1 2 4 262 6 10 9 419 13 1495 6 110 6 6 9 4759 9 787719 239"); + return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1p 7 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 29 2 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e 9 44n 0 7 e aob 9 2f 9 13 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 3mq 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d rb 6 32 6 6 9 3o7 9 gvt3 6n"); } function isInRange(cp, ranges) { let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; @@ -68,30 +64,48 @@ function isInRange(cp, ranges) { } function restoreRanges(data) { let last = 0; - return data.split(" ").map(s => (last += parseInt(s, 10) | 0)); + return data.split(" ").map((s) => (last += parseInt(s, 36) | 0)); } class DataSet { - constructor(raw2018, raw2019, raw2020) { + constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023) { this._raw2018 = raw2018; this._raw2019 = raw2019; this._raw2020 = raw2020; + this._raw2021 = raw2021; + this._raw2022 = raw2022; + this._raw2023 = raw2023; } get es2018() { - return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); + var _a; + return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" ")))); } get es2019() { - return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); + var _a; + return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" ")))); } get es2020() { - return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); + var _a; + return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" ")))); + } + get es2021() { + var _a; + return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" ")))); + } + get es2022() { + var _a; + return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" ")))); + } + get es2023() { + var _a; + return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" ")))); } } const gcNameSet = new Set(["General_Category", "gc"]); const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); -const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", ""); -const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho"); -const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", ""); +const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", ""); +const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", ""); +const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", ""); function isValidUnicodeProperty(version, name, value) { if (gcNameSet.has(name)) { return version >= 2018 && gcValueSets.es2018.has(value); @@ -99,114 +113,117 @@ function isValidUnicodeProperty(version, name, value) { if (scNameSet.has(name)) { return ((version >= 2018 && scValueSets.es2018.has(value)) || (version >= 2019 && scValueSets.es2019.has(value)) || - (version >= 2020 && scValueSets.es2020.has(value))); + (version >= 2020 && scValueSets.es2020.has(value)) || + (version >= 2021 && scValueSets.es2021.has(value)) || + (version >= 2022 && scValueSets.es2022.has(value))); } return false; } function isValidLoneUnicodeProperty(version, value) { return ((version >= 2018 && binPropertySets.es2018.has(value)) || - (version >= 2019 && binPropertySets.es2019.has(value))); + (version >= 2019 && binPropertySets.es2019.has(value)) || + (version >= 2021 && binPropertySets.es2021.has(value))); } -const Backspace = 0x08; -const CharacterTabulation = 0x09; -const LineFeed = 0x0a; -const LineTabulation = 0x0b; -const FormFeed = 0x0c; -const CarriageReturn = 0x0d; -const ExclamationMark = 0x21; -const DollarSign = 0x24; -const LeftParenthesis = 0x28; -const RightParenthesis = 0x29; -const Asterisk = 0x2a; -const PlusSign = 0x2b; -const Comma = 0x2c; -const HyphenMinus = 0x2d; -const FullStop = 0x2e; -const Solidus = 0x2f; -const DigitZero = 0x30; -const DigitOne = 0x31; -const DigitSeven = 0x37; -const DigitNine = 0x39; -const Colon = 0x3a; -const LessThanSign = 0x3c; -const EqualsSign = 0x3d; -const GreaterThanSign = 0x3e; -const QuestionMark = 0x3f; -const LatinCapitalLetterA = 0x41; -const LatinCapitalLetterB = 0x42; -const LatinCapitalLetterD = 0x44; -const LatinCapitalLetterF = 0x46; -const LatinCapitalLetterP = 0x50; -const LatinCapitalLetterS = 0x53; -const LatinCapitalLetterW = 0x57; -const LatinCapitalLetterZ = 0x5a; -const LowLine = 0x5f; -const LatinSmallLetterA = 0x61; -const LatinSmallLetterB = 0x62; -const LatinSmallLetterC = 0x63; -const LatinSmallLetterD = 0x64; -const LatinSmallLetterF = 0x66; -const LatinSmallLetterG = 0x67; -const LatinSmallLetterI = 0x69; -const LatinSmallLetterK = 0x6b; -const LatinSmallLetterM = 0x6d; -const LatinSmallLetterN = 0x6e; -const LatinSmallLetterP = 0x70; -const LatinSmallLetterR = 0x72; -const LatinSmallLetterS = 0x73; -const LatinSmallLetterT = 0x74; -const LatinSmallLetterU = 0x75; -const LatinSmallLetterV = 0x76; -const LatinSmallLetterW = 0x77; -const LatinSmallLetterX = 0x78; -const LatinSmallLetterY = 0x79; -const LatinSmallLetterZ = 0x7a; -const LeftSquareBracket = 0x5b; -const ReverseSolidus = 0x5c; -const RightSquareBracket = 0x5d; -const CircumflexAccent = 0x5e; -const LeftCurlyBracket = 0x7b; -const VerticalLine = 0x7c; -const RightCurlyBracket = 0x7d; -const ZeroWidthNonJoiner = 0x200c; -const ZeroWidthJoiner = 0x200d; -const LineSeparator = 0x2028; -const ParagraphSeparator = 0x2029; -const MinCodePoint = 0x00; -const MaxCodePoint = 0x10ffff; +const BACKSPACE = 0x08; +const CHARACTER_TABULATION = 0x09; +const LINE_FEED = 0x0a; +const LINE_TABULATION = 0x0b; +const FORM_FEED = 0x0c; +const CARRIAGE_RETURN = 0x0d; +const EXCLAMATION_MARK = 0x21; +const DOLLAR_SIGN = 0x24; +const LEFT_PARENTHESIS = 0x28; +const RIGHT_PARENTHESIS = 0x29; +const ASTERISK = 0x2a; +const PLUS_SIGN = 0x2b; +const COMMA = 0x2c; +const HYPHEN_MINUS = 0x2d; +const FULL_STOP = 0x2e; +const SOLIDUS = 0x2f; +const DIGIT_ZERO = 0x30; +const DIGIT_ONE = 0x31; +const DIGIT_SEVEN = 0x37; +const DIGIT_NINE = 0x39; +const COLON = 0x3a; +const LESS_THAN_SIGN = 0x3c; +const EQUALS_SIGN = 0x3d; +const GREATER_THAN_SIGN = 0x3e; +const QUESTION_MARK = 0x3f; +const LATIN_CAPITAL_LETTER_A = 0x41; +const LATIN_CAPITAL_LETTER_B = 0x42; +const LATIN_CAPITAL_LETTER_D = 0x44; +const LATIN_CAPITAL_LETTER_F = 0x46; +const LATIN_CAPITAL_LETTER_P = 0x50; +const LATIN_CAPITAL_LETTER_S = 0x53; +const LATIN_CAPITAL_LETTER_W = 0x57; +const LATIN_CAPITAL_LETTER_Z = 0x5a; +const LOW_LINE = 0x5f; +const LATIN_SMALL_LETTER_A = 0x61; +const LATIN_SMALL_LETTER_B = 0x62; +const LATIN_SMALL_LETTER_C = 0x63; +const LATIN_SMALL_LETTER_D = 0x64; +const LATIN_SMALL_LETTER_F = 0x66; +const LATIN_SMALL_LETTER_G = 0x67; +const LATIN_SMALL_LETTER_I = 0x69; +const LATIN_SMALL_LETTER_K = 0x6b; +const LATIN_SMALL_LETTER_M = 0x6d; +const LATIN_SMALL_LETTER_N = 0x6e; +const LATIN_SMALL_LETTER_P = 0x70; +const LATIN_SMALL_LETTER_R = 0x72; +const LATIN_SMALL_LETTER_S = 0x73; +const LATIN_SMALL_LETTER_T = 0x74; +const LATIN_SMALL_LETTER_U = 0x75; +const LATIN_SMALL_LETTER_V = 0x76; +const LATIN_SMALL_LETTER_W = 0x77; +const LATIN_SMALL_LETTER_X = 0x78; +const LATIN_SMALL_LETTER_Y = 0x79; +const LATIN_SMALL_LETTER_Z = 0x7a; +const LEFT_SQUARE_BRACKET = 0x5b; +const REVERSE_SOLIDUS = 0x5c; +const RIGHT_SQUARE_BRACKET = 0x5d; +const CIRCUMFLEX_ACCENT = 0x5e; +const LEFT_CURLY_BRACKET = 0x7b; +const VERTICAL_LINE = 0x7c; +const RIGHT_CURLY_BRACKET = 0x7d; +const ZERO_WIDTH_NON_JOINER = 0x200c; +const ZERO_WIDTH_JOINER = 0x200d; +const LINE_SEPARATOR = 0x2028; +const PARAGRAPH_SEPARATOR = 0x2029; +const MIN_CODE_POINT = 0x00; +const MAX_CODE_POINT = 0x10ffff; function isLatinLetter(code) { - return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); + return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z)); } function isDecimalDigit(code) { - return code >= DigitZero && code <= DigitNine; + return code >= DIGIT_ZERO && code <= DIGIT_NINE; } function isOctalDigit(code) { - return code >= DigitZero && code <= DigitSeven; + return code >= DIGIT_ZERO && code <= DIGIT_SEVEN; } function isHexDigit(code) { - return ((code >= DigitZero && code <= DigitNine) || - (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); + return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) || + (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) || + (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F)); } function isLineTerminator(code) { - return (code === LineFeed || - code === CarriageReturn || - code === LineSeparator || - code === ParagraphSeparator); + return (code === LINE_FEED || + code === CARRIAGE_RETURN || + code === LINE_SEPARATOR || + code === PARAGRAPH_SEPARATOR); } function isValidUnicode(code) { - return code >= MinCodePoint && code <= MaxCodePoint; + return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT; } function digitToInt(code) { - if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { - return code - LatinSmallLetterA + 10; + if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) { + return code - LATIN_SMALL_LETTER_A + 10; } - if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { - return code - LatinCapitalLetterA + 10; + if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) { + return code - LATIN_CAPITAL_LETTER_A + 10; } - return code - DigitZero; + return code - DIGIT_ZERO; } function isLeadSurrogate(code) { return code >= 0xd800 && code <= 0xdbff; @@ -336,33 +353,33 @@ class RegExpSyntaxError extends SyntaxError { } function isSyntaxCharacter(cp) { - return (cp === CircumflexAccent || - cp === DollarSign || - cp === ReverseSolidus || - cp === FullStop || - cp === Asterisk || - cp === PlusSign || - cp === QuestionMark || - cp === LeftParenthesis || - cp === RightParenthesis || - cp === LeftSquareBracket || - cp === RightSquareBracket || - cp === LeftCurlyBracket || - cp === RightCurlyBracket || - cp === VerticalLine); + return (cp === CIRCUMFLEX_ACCENT || + cp === DOLLAR_SIGN || + cp === REVERSE_SOLIDUS || + cp === FULL_STOP || + cp === ASTERISK || + cp === PLUS_SIGN || + cp === QUESTION_MARK || + cp === LEFT_PARENTHESIS || + cp === RIGHT_PARENTHESIS || + cp === LEFT_SQUARE_BRACKET || + cp === RIGHT_SQUARE_BRACKET || + cp === LEFT_CURLY_BRACKET || + cp === RIGHT_CURLY_BRACKET || + cp === VERTICAL_LINE); } function isRegExpIdentifierStart(cp) { - return isIdStart(cp) || cp === DollarSign || cp === LowLine; + return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE; } function isRegExpIdentifierPart(cp) { return (isIdContinue(cp) || - cp === DollarSign || - cp === LowLine || - cp === ZeroWidthNonJoiner || - cp === ZeroWidthJoiner); + cp === DOLLAR_SIGN || + cp === LOW_LINE || + cp === ZERO_WIDTH_NON_JOINER || + cp === ZERO_WIDTH_JOINER); } function isUnicodePropertyNameCharacter(cp) { - return isLatinLetter(cp) || cp === LowLine; + return isLatinLetter(cp) || cp === LOW_LINE; } function isUnicodePropertyValueCharacter(cp) { return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); @@ -382,13 +399,13 @@ class RegExpValidator { this._numCapturingParens = 0; this._groupNames = new Set(); this._backreferenceNames = new Set(); - this._options = options || {}; + this._options = options !== null && options !== void 0 ? options : {}; } validateLiteral(source, start = 0, end = source.length) { this._uFlag = this._nFlag = false; this.reset(source, start, end); this.onLiteralEnter(start); - if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { + if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) { const flagStart = this.index; const uFlag = source.includes("u", flagStart); this.validateFlags(source, flagStart, end); @@ -411,35 +428,51 @@ class RegExpValidator { let sticky = false; let unicode = false; let dotAll = false; + let hasIndices = false; for (let i = start; i < end; ++i) { const flag = source.charCodeAt(i); if (existingFlags.has(flag)) { this.raise(`Duplicated flag '${source[i]}'`); } existingFlags.add(flag); - if (flag === LatinSmallLetterG) { + if (flag === LATIN_SMALL_LETTER_G) { global = true; } - else if (flag === LatinSmallLetterI) { + else if (flag === LATIN_SMALL_LETTER_I) { ignoreCase = true; } - else if (flag === LatinSmallLetterM) { + else if (flag === LATIN_SMALL_LETTER_M) { multiline = true; } - else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { + else if (flag === LATIN_SMALL_LETTER_U && + this.ecmaVersion >= 2015) { unicode = true; } - else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { + else if (flag === LATIN_SMALL_LETTER_Y && + this.ecmaVersion >= 2015) { sticky = true; } - else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { + else if (flag === LATIN_SMALL_LETTER_S && + this.ecmaVersion >= 2018) { dotAll = true; } + else if (flag === LATIN_SMALL_LETTER_D && + this.ecmaVersion >= 2022) { + hasIndices = true; + } else { this.raise(`Invalid flag '${source[i]}'`); } } - this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + this.onRegExpFlags(start, end, { + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + hasIndices, + }); } validatePattern(source, start = 0, end = source.length, uFlag = false) { this._uFlag = uFlag && this.ecmaVersion >= 2015; @@ -455,10 +488,11 @@ class RegExpValidator { } } get strict() { - return Boolean(this._options.strict || this._uFlag); + return Boolean(this._options.strict) || this._uFlag; } get ecmaVersion() { - return this._options.ecmaVersion || 2020; + var _a; + return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : 2022; } onLiteralEnter(start) { if (this._options.onLiteralEnter) { @@ -470,9 +504,12 @@ class RegExpValidator { this._options.onLiteralLeave(start, end); } } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + onRegExpFlags(start, end, flags) { + if (this._options.onRegExpFlags) { + this._options.onRegExpFlags(start, end, flags); + } if (this._options.onFlags) { - this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); + this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices); } } onPatternEnter(start) { @@ -642,17 +679,17 @@ class RegExpValidator { if (escaped) { escaped = false; } - else if (cp === ReverseSolidus) { + else if (cp === REVERSE_SOLIDUS) { escaped = true; } - else if (cp === LeftSquareBracket) { + else if (cp === LEFT_SQUARE_BRACKET) { inClass = true; } - else if (cp === RightSquareBracket) { + else if (cp === RIGHT_SQUARE_BRACKET) { inClass = false; } - else if ((cp === Solidus && !inClass) || - (cp === Asterisk && this.index === start)) { + else if ((cp === SOLIDUS && !inClass) || + (cp === ASTERISK && this.index === start)) { break; } this.advance(); @@ -668,13 +705,13 @@ class RegExpValidator { this.consumeDisjunction(); const cp = this.currentCodePoint; if (this.currentCodePoint !== -1) { - if (cp === RightParenthesis) { + if (cp === RIGHT_PARENTHESIS) { this.raise("Unmatched ')'"); } - if (cp === ReverseSolidus) { + if (cp === REVERSE_SOLIDUS) { this.raise("\\ at end of pattern"); } - if (cp === RightSquareBracket || cp === RightCurlyBracket) { + if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) { this.raise("Lone quantifier brackets"); } const c = String.fromCodePoint(cp); @@ -697,21 +734,21 @@ class RegExpValidator { if (escaped) { escaped = false; } - else if (cp === ReverseSolidus) { + else if (cp === REVERSE_SOLIDUS) { escaped = true; } - else if (cp === LeftSquareBracket) { + else if (cp === LEFT_SQUARE_BRACKET) { inClass = true; } - else if (cp === RightSquareBracket) { + else if (cp === RIGHT_SQUARE_BRACKET) { inClass = false; } - else if (cp === LeftParenthesis && + else if (cp === LEFT_PARENTHESIS && !inClass && - (this.nextCodePoint !== QuestionMark || - (this.nextCodePoint2 === LessThanSign && - this.nextCodePoint3 !== EqualsSign && - this.nextCodePoint3 !== ExclamationMark))) { + (this.nextCodePoint !== QUESTION_MARK || + (this.nextCodePoint2 === LESS_THAN_SIGN && + this.nextCodePoint3 !== EQUALS_SIGN && + this.nextCodePoint3 !== EXCLAMATION_MARK))) { count += 1; } this.advance(); @@ -725,11 +762,11 @@ class RegExpValidator { this.onDisjunctionEnter(start); do { this.consumeAlternative(i++); - } while (this.eat(VerticalLine)); + } while (this.eat(VERTICAL_LINE)); if (this.consumeQuantifier(true)) { this.raise("Nothing to repeat"); } - if (this.eat(LeftCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET)) { this.raise("Lone quantifier brackets"); } this.onDisjunctionLeave(start, this.index); @@ -758,30 +795,31 @@ class RegExpValidator { consumeAssertion() { const start = this.index; this._lastAssertionIsQuantifiable = false; - if (this.eat(CircumflexAccent)) { + if (this.eat(CIRCUMFLEX_ACCENT)) { this.onEdgeAssertion(start, this.index, "start"); return true; } - if (this.eat(DollarSign)) { + if (this.eat(DOLLAR_SIGN)) { this.onEdgeAssertion(start, this.index, "end"); return true; } - if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { + if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) { this.onWordBoundaryAssertion(start, this.index, "word", true); return true; } - if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { + if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) { this.onWordBoundaryAssertion(start, this.index, "word", false); return true; } - if (this.eat2(LeftParenthesis, QuestionMark)) { - const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN); let negate = false; - if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { + if (this.eat(EQUALS_SIGN) || + (negate = this.eat(EXCLAMATION_MARK))) { const kind = lookbehind ? "lookbehind" : "lookahead"; this.onLookaroundAssertionEnter(start, kind, negate); this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; @@ -797,15 +835,15 @@ class RegExpValidator { let min = 0; let max = 0; let greedy = false; - if (this.eat(Asterisk)) { + if (this.eat(ASTERISK)) { min = 0; max = Number.POSITIVE_INFINITY; } - else if (this.eat(PlusSign)) { + else if (this.eat(PLUS_SIGN)) { min = 1; max = Number.POSITIVE_INFINITY; } - else if (this.eat(QuestionMark)) { + else if (this.eat(QUESTION_MARK)) { min = 0; max = 1; } @@ -816,7 +854,7 @@ class RegExpValidator { else { return false; } - greedy = !this.eat(QuestionMark); + greedy = !this.eat(QUESTION_MARK); if (!noConsume) { this.onQuantifier(start, this.index, min, max, greedy); } @@ -824,17 +862,17 @@ class RegExpValidator { } eatBracedQuantifier(noError) { const start = this.index; - if (this.eat(LeftCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET)) { this._lastMinValue = 0; this._lastMaxValue = Number.POSITIVE_INFINITY; if (this.eatDecimalDigits()) { this._lastMinValue = this._lastMaxValue = this._lastIntValue; - if (this.eat(Comma)) { + if (this.eat(COMMA)) { this._lastMaxValue = this.eatDecimalDigits() ? this._lastIntValue : Number.POSITIVE_INFINITY; } - if (this.eat(RightCurlyBracket)) { + if (this.eat(RIGHT_CURLY_BRACKET)) { if (!noError && this._lastMaxValue < this._lastMinValue) { this.raise("numbers out of order in {} quantifier"); } @@ -857,7 +895,7 @@ class RegExpValidator { this.consumeCapturingGroup()); } consumeDot() { - if (this.eat(FullStop)) { + if (this.eat(FULL_STOP)) { this.onAnyCharacterSet(this.index - 1, this.index, "any"); return true; } @@ -865,7 +903,7 @@ class RegExpValidator { } consumeReverseSolidusAtomEscape() { const start = this.index; - if (this.eat(ReverseSolidus)) { + if (this.eat(REVERSE_SOLIDUS)) { if (this.consumeAtomEscape()) { return true; } @@ -875,10 +913,10 @@ class RegExpValidator { } consumeUncapturingGroup() { const start = this.index; - if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { + if (this.eat3(LEFT_PARENTHESIS, QUESTION_MARK, COLON)) { this.onGroupEnter(start); this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } this.onGroupLeave(start, this.index); @@ -888,19 +926,19 @@ class RegExpValidator { } consumeCapturingGroup() { const start = this.index; - if (this.eat(LeftParenthesis)) { + if (this.eat(LEFT_PARENTHESIS)) { let name = null; if (this.ecmaVersion >= 2018) { if (this.consumeGroupSpecifier()) { name = this._lastStrValue; } } - else if (this.currentCodePoint === QuestionMark) { + else if (this.currentCodePoint === QUESTION_MARK) { this.raise("Invalid group"); } this.onCapturingGroupEnter(start, name); this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } this.onCapturingGroupLeave(start, this.index, name); @@ -920,11 +958,11 @@ class RegExpValidator { } consumeReverseSolidusFollowedByC() { const start = this.index; - if (this.currentCodePoint === ReverseSolidus && - this.nextCodePoint === LatinSmallLetterC) { + if (this.currentCodePoint === REVERSE_SOLIDUS && + this.nextCodePoint === LATIN_SMALL_LETTER_C) { this._lastIntValue = this.currentCodePoint; this.advance(); - this.onCharacter(start, this.index, ReverseSolidus); + this.onCharacter(start, this.index, REVERSE_SOLIDUS); return true; } return false; @@ -949,17 +987,17 @@ class RegExpValidator { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && - cp !== CircumflexAccent && - cp !== DollarSign && - cp !== ReverseSolidus && - cp !== FullStop && - cp !== Asterisk && - cp !== PlusSign && - cp !== QuestionMark && - cp !== LeftParenthesis && - cp !== RightParenthesis && - cp !== LeftSquareBracket && - cp !== VerticalLine) { + cp !== CIRCUMFLEX_ACCENT && + cp !== DOLLAR_SIGN && + cp !== REVERSE_SOLIDUS && + cp !== FULL_STOP && + cp !== ASTERISK && + cp !== PLUS_SIGN && + cp !== QUESTION_MARK && + cp !== LEFT_PARENTHESIS && + cp !== RIGHT_PARENTHESIS && + cp !== LEFT_SQUARE_BRACKET && + cp !== VERTICAL_LINE) { this.advance(); this.onCharacter(start, this.index, cp); return true; @@ -967,7 +1005,7 @@ class RegExpValidator { return false; } consumeGroupSpecifier() { - if (this.eat(QuestionMark)) { + if (this.eat(QUESTION_MARK)) { if (this.eatGroupName()) { if (!this._groupNames.has(this._lastStrValue)) { this._groupNames.add(this._lastStrValue); @@ -1008,32 +1046,32 @@ class RegExpValidator { } consumeCharacterClassEscape() { const start = this.index; - if (this.eat(LatinSmallLetterD)) { + if (this.eat(LATIN_SMALL_LETTER_D)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", false); return true; } - if (this.eat(LatinCapitalLetterD)) { + if (this.eat(LATIN_CAPITAL_LETTER_D)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", true); return true; } - if (this.eat(LatinSmallLetterS)) { + if (this.eat(LATIN_SMALL_LETTER_S)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", false); return true; } - if (this.eat(LatinCapitalLetterS)) { + if (this.eat(LATIN_CAPITAL_LETTER_S)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", true); return true; } - if (this.eat(LatinSmallLetterW)) { + if (this.eat(LATIN_SMALL_LETTER_W)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", false); return true; } - if (this.eat(LatinCapitalLetterW)) { + if (this.eat(LATIN_CAPITAL_LETTER_W)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", true); return true; @@ -1041,12 +1079,12 @@ class RegExpValidator { let negate = false; if (this._uFlag && this.ecmaVersion >= 2018 && - (this.eat(LatinSmallLetterP) || - (negate = this.eat(LatinCapitalLetterP)))) { + (this.eat(LATIN_SMALL_LETTER_P) || + (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) { this._lastIntValue = -1; - if (this.eat(LeftCurlyBracket) && + if (this.eat(LEFT_CURLY_BRACKET) && this.eatUnicodePropertyValueExpression() && - this.eat(RightCurlyBracket)) { + this.eat(RIGHT_CURLY_BRACKET)) { this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); return true; } @@ -1072,7 +1110,7 @@ class RegExpValidator { } consumeKGroupName() { const start = this.index; - if (this.eat(LatinSmallLetterK)) { + if (this.eat(LATIN_SMALL_LETTER_K)) { if (this.eatGroupName()) { const groupName = this._lastStrValue; this._backreferenceNames.add(groupName); @@ -1085,11 +1123,11 @@ class RegExpValidator { } consumeCharacterClass() { const start = this.index; - if (this.eat(LeftSquareBracket)) { - const negate = this.eat(CircumflexAccent); + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); this.onCharacterClassEnter(start, negate); this.consumeClassRanges(); - if (!this.eat(RightSquareBracket)) { + if (!this.eat(RIGHT_SQUARE_BRACKET)) { this.raise("Unterminated character class"); } this.onCharacterClassLeave(start, this.index, negate); @@ -1105,10 +1143,10 @@ class RegExpValidator { break; } const min = this._lastIntValue; - if (!this.eat(HyphenMinus)) { + if (!this.eat(HYPHEN_MINUS)) { continue; } - this.onCharacter(this.index - 1, this.index, HyphenMinus); + this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS); if (!this.consumeClassAtom()) { break; } @@ -1128,18 +1166,21 @@ class RegExpValidator { consumeClassAtom() { const start = this.index; const cp = this.currentCodePoint; - if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { + if (cp !== -1 && + cp !== REVERSE_SOLIDUS && + cp !== RIGHT_SQUARE_BRACKET) { this.advance(); this._lastIntValue = cp; this.onCharacter(start, this.index, this._lastIntValue); return true; } - if (this.eat(ReverseSolidus)) { + if (this.eat(REVERSE_SOLIDUS)) { if (this.consumeClassEscape()) { return true; } - if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { - this._lastIntValue = ReverseSolidus; + if (!this.strict && + this.currentCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = REVERSE_SOLIDUS; this.onCharacter(start, this.index, this._lastIntValue); return true; } @@ -1152,21 +1193,21 @@ class RegExpValidator { } consumeClassEscape() { const start = this.index; - if (this.eat(LatinSmallLetterB)) { - this._lastIntValue = Backspace; + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } - if (this._uFlag && this.eat(HyphenMinus)) { - this._lastIntValue = HyphenMinus; + if (this._uFlag && this.eat(HYPHEN_MINUS)) { + this._lastIntValue = HYPHEN_MINUS; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } let cp = 0; if (!this.strict && !this._uFlag && - this.currentCodePoint === LatinSmallLetterC && - (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) { + this.currentCodePoint === LATIN_SMALL_LETTER_C && + (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) { this.advance(); this.advance(); this._lastIntValue = cp % 0x20; @@ -1176,8 +1217,8 @@ class RegExpValidator { return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); } eatGroupName() { - if (this.eat(LessThanSign)) { - if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { + if (this.eat(LESS_THAN_SIGN)) { + if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) { return true; } this.raise("Invalid capture group name"); @@ -1199,7 +1240,7 @@ class RegExpValidator { const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); - if (cp === ReverseSolidus && + if (cp === REVERSE_SOLIDUS && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } @@ -1223,7 +1264,7 @@ class RegExpValidator { const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); - if (cp === ReverseSolidus && + if (cp === REVERSE_SOLIDUS && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } @@ -1244,7 +1285,7 @@ class RegExpValidator { } eatCControlLetter() { const start = this.index; - if (this.eat(LatinSmallLetterC)) { + if (this.eat(LATIN_SMALL_LETTER_C)) { if (this.eatControlLetter()) { return true; } @@ -1253,7 +1294,7 @@ class RegExpValidator { return false; } eatZero() { - if (this.currentCodePoint === DigitZero && + if (this.currentCodePoint === DIGIT_ZERO && !isDecimalDigit(this.nextCodePoint)) { this._lastIntValue = 0; this.advance(); @@ -1262,24 +1303,24 @@ class RegExpValidator { return false; } eatControlEscape() { - if (this.eat(LatinSmallLetterF)) { - this._lastIntValue = FormFeed; + if (this.eat(LATIN_SMALL_LETTER_F)) { + this._lastIntValue = FORM_FEED; return true; } - if (this.eat(LatinSmallLetterN)) { - this._lastIntValue = LineFeed; + if (this.eat(LATIN_SMALL_LETTER_N)) { + this._lastIntValue = LINE_FEED; return true; } - if (this.eat(LatinSmallLetterR)) { - this._lastIntValue = CarriageReturn; + if (this.eat(LATIN_SMALL_LETTER_R)) { + this._lastIntValue = CARRIAGE_RETURN; return true; } - if (this.eat(LatinSmallLetterT)) { - this._lastIntValue = CharacterTabulation; + if (this.eat(LATIN_SMALL_LETTER_T)) { + this._lastIntValue = CHARACTER_TABULATION; return true; } - if (this.eat(LatinSmallLetterV)) { - this._lastIntValue = LineTabulation; + if (this.eat(LATIN_SMALL_LETTER_V)) { + this._lastIntValue = LINE_TABULATION; return true; } return false; @@ -1296,7 +1337,7 @@ class RegExpValidator { eatRegExpUnicodeEscapeSequence(forceUFlag = false) { const start = this.index; const uFlag = forceUFlag || this._uFlag; - if (this.eat(LatinSmallLetterU)) { + if (this.eat(LATIN_SMALL_LETTER_U)) { if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || this.eatFixedHexDigits(4) || (uFlag && this.eatRegExpUnicodeCodePointEscape())) { @@ -1314,8 +1355,8 @@ class RegExpValidator { if (this.eatFixedHexDigits(4)) { const lead = this._lastIntValue; if (isLeadSurrogate(lead) && - this.eat(ReverseSolidus) && - this.eat(LatinSmallLetterU) && + this.eat(REVERSE_SOLIDUS) && + this.eat(LATIN_SMALL_LETTER_U) && this.eatFixedHexDigits(4)) { const trail = this._lastIntValue; if (isTrailSurrogate(trail)) { @@ -1329,9 +1370,9 @@ class RegExpValidator { } eatRegExpUnicodeCodePointEscape() { const start = this.index; - if (this.eat(LeftCurlyBracket) && + if (this.eat(LEFT_CURLY_BRACKET) && this.eatHexDigits() && - this.eat(RightCurlyBracket) && + this.eat(RIGHT_CURLY_BRACKET) && isValidUnicode(this._lastIntValue)) { return true; } @@ -1352,32 +1393,32 @@ class RegExpValidator { return false; } if (this._uFlag) { - return isSyntaxCharacter(cp) || cp === Solidus; + return isSyntaxCharacter(cp) || cp === SOLIDUS; } if (this.strict) { return !isIdContinue(cp); } if (this._nFlag) { - return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); + return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K); } - return cp !== LatinSmallLetterC; + return cp !== LATIN_SMALL_LETTER_C; } eatDecimalEscape() { this._lastIntValue = 0; let cp = this.currentCodePoint; - if (cp >= DigitOne && cp <= DigitNine) { + if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) { do { - this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); + this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO); this.advance(); - } while ((cp = this.currentCodePoint) >= DigitZero && - cp <= DigitNine); + } while ((cp = this.currentCodePoint) >= DIGIT_ZERO && + cp <= DIGIT_NINE); return true; } return false; } eatUnicodePropertyValueExpression() { const start = this.index; - if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { + if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) { this._lastKeyValue = this._lastStrValue; if (this.eatUnicodePropertyValue()) { this._lastValValue = this._lastStrValue; @@ -1425,7 +1466,7 @@ class RegExpValidator { } eatHexEscapeSequence() { const start = this.index; - if (this.eat(LatinSmallLetterX)) { + if (this.eat(LATIN_SMALL_LETTER_X)) { if (this.eatFixedHexDigits(2)) { return true; } @@ -1479,7 +1520,7 @@ class RegExpValidator { const cp = this.currentCodePoint; if (isOctalDigit(cp)) { this.advance(); - this._lastIntValue = cp - DigitZero; + this._lastIntValue = cp - DIGIT_ZERO; return true; } this._lastIntValue = 0; @@ -1501,18 +1542,19 @@ class RegExpValidator { } } -const DummyPattern = {}; -const DummyFlags = {}; -const DummyCapturingGroup = {}; +const DUMMY_PATTERN = {}; +const DUMMY_FLAGS = {}; +const DUMMY_CAPTURING_GROUP = {}; class RegExpParserState { constructor(options) { - this._node = DummyPattern; - this._flags = DummyFlags; + var _a; + this._node = DUMMY_PATTERN; + this._flags = DUMMY_FLAGS; this._backreferences = []; this._capturingGroups = []; this.source = ""; - this.strict = Boolean(options && options.strict); - this.ecmaVersion = (options && options.ecmaVersion) || 2020; + this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict); + this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : 2022; } get pattern() { if (this._node.type !== "Pattern") { @@ -1526,7 +1568,7 @@ class RegExpParserState { } return this._flags; } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { + onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, }) { this._flags = { type: "Flags", parent: null, @@ -1539,6 +1581,7 @@ class RegExpParserState { unicode, sticky, dotAll, + hasIndices, }; } onPatternEnter(start) { @@ -1560,7 +1603,7 @@ class RegExpParserState { const ref = reference.ref; const group = typeof ref === "number" ? this._capturingGroups[ref - 1] - : this._capturingGroups.find(g => g.name === ref); + : this._capturingGroups.find((g) => g.name === ref); reference.resolved = group; group.references.push(reference); } @@ -1796,7 +1839,7 @@ class RegExpParserState { end, raw: this.source.slice(start, end), ref, - resolved: DummyCapturingGroup, + resolved: DUMMY_CAPTURING_GROUP, }; parent.elements.push(node); this._backreferences.push(node); @@ -1842,7 +1885,7 @@ class RegExpParserState { min.type !== "Character" || max.type !== "Character" || hyphen.type !== "Character" || - hyphen.value !== HyphenMinus) { + hyphen.value !== HYPHEN_MINUS) { throw new Error("UnknownError"); } const node = { @@ -2066,7 +2109,7 @@ function parseRegExpLiteral(source, options) { return new RegExpParser(options).parseLiteral(String(source)); } function validateRegExpLiteral(source, options) { - return new RegExpValidator(options).validateLiteral(source); + new RegExpValidator(options).validateLiteral(source); } function visitRegExpAST(node, handlers) { new RegExpVisitor(handlers).visit(node); diff --git a/node_modules/@eslint-community/regexpp/index.mjs.map b/node_modules/@eslint-community/regexpp/index.mjs.map new file mode 100644 index 000000000..90b91e12d --- /dev/null +++ b/node_modules/@eslint-community/regexpp/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;AAIA,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAErD,SAAU,SAAS,CAAC,EAAU,EAAA;IAChC,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;AAC1B,IAAA,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;AAC7B,CAAC;AAEK,SAAU,YAAY,CAAC,EAAU,EAAA;IACnC,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,KAAK,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC5B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,cAAc,CAAC,EAAU,EAAA;AAC9B,I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AAoB,CAAC,IAAI,CAAC,CAAA;AAC5C,SAAA;KACJ;AACJ;;ACvMe,SAAA,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B,EAAA;AAE9B,IAAA,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;AACjE,CAAC;AAOe,SAAA,qBAAqB,CACjC,MAAc,EACd,OAAiC,EAAA;IAEjC,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;AACxD,CAAC;AAEe,SAAA,cAAc,CAC1B,IAAc,EACd,QAAgC,EAAA;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3C;;;;"} \ No newline at end of file diff --git a/node_modules/@eslint-community/regexpp/package.json b/node_modules/@eslint-community/regexpp/package.json new file mode 100644 index 000000000..9f6aeab90 --- /dev/null +++ b/node_modules/@eslint-community/regexpp/package.json @@ -0,0 +1,87 @@ +{ + "name": "@eslint-community/regexpp", + "version": "4.4.0", + "description": "Regular expression parser for ECMAScript.", + "keywords": [ + "regexp", + "regular", + "expression", + "parser", + "validator", + "ast", + "abstract", + "syntax", + "tree", + "ecmascript", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020", + "es2021", + "annexB" + ], + "homepage": "https://github.com/eslint-community/regexpp#readme", + "bugs": { + "url": "https://github.com/eslint-community/regexpp/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/eslint-community/regexpp" + }, + "license": "MIT", + "author": "Toru Nagashima", + "exports": { + ".": { + "import": "./index.mjs", + "default": "./index.js" + }, + "./package.json": "./package.json" + }, + "main": "index", + "files": [ + "index.*" + ], + "scripts": { + "prebuild": "npm run -s clean", + "build": "run-s build:*", + "build:tsc": "tsc --module es2015", + "build:rollup": "rollup -c", + "build:dts": "dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts", + "clean": "rimraf .temp index.*", + "lint": "eslint . --ext .ts", + "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", + "update:test": "ts-node scripts/update-fixtures.ts", + "update:unicode": "run-s update:unicode:*", + "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", + "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", + "preversion": "npm test && npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", + "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" + }, + "dependencies": {}, + "devDependencies": { + "@eslint-community/eslint-plugin-mysticatea": "^15.3.0", + "@rollup/plugin-node-resolve": "^14.1.0", + "@types/eslint": "^8.4.10", + "@types/jsdom": "^16.2.15", + "@types/mocha": "^9.1.1", + "@types/node": "^12.20.55", + "dts-bundle": "^0.7.3", + "eslint": "^8.31.0", + "jsdom": "^19.0.0", + "mocha": "^9.2.2", + "npm-run-all": "^4.1.5", + "nyc": "^14.1.1", + "rimraf": "^3.0.2", + "rollup": "^2.79.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "ts-node": "^10.9.1", + "typescript": "~4.9.4" + }, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } +} diff --git a/node_modules/@eslint/eslintrc/CHANGELOG.md b/node_modules/@eslint/eslintrc/CHANGELOG.md deleted file mode 100644 index a15ce7c39..000000000 --- a/node_modules/@eslint/eslintrc/CHANGELOG.md +++ /dev/null @@ -1,32 +0,0 @@ -v0.4.0 - February 27, 2021 - -* [`d9a527b`](https://github.com/eslint/eslintrc/commit/d9a527bdb16af46a28d37fa9022131149970a438) New: Implement DotCompat class (#20) (Nicholas C. Zakas) -* [`dac76c0`](https://github.com/eslint/eslintrc/commit/dac76c035a9ab9d315050f688867373966aab288) Chore: Replace usage of lodash with cache set (#29) (Tim van der Lippe) -* [`3ae2d77`](https://github.com/eslint/eslintrc/commit/3ae2d770cb810c026de817e6861e25dac111da9f) Update: add AggregateError global to es2021 environment (#28) (Milos Djermanovic) - -v0.3.0 - January 15, 2021 - -* [`5184490`](https://github.com/eslint/eslintrc/commit/51844902bc4132f264f05a0614f2cdeb89290f68) Upgrade: lodash@4.17.20 (#24) (Milos Djermanovic) -* [`f1179c5`](https://github.com/eslint/eslintrc/commit/f1179c587ae09fabb5c3402598363cfcec2494f7) Update: Implement missing functionality from ESLint port (fixes #12) (#23) (Nicholas C. Zakas) - -v0.2.2 - December 5, 2020 - -* [`1746840`](https://github.com/eslint/eslintrc/commit/17468407c1baf05747cb261c91f7f7b7c2a82422) Fix: include loadRules in internalSlotsMap cache (#19) (Henry Q. Dineen) -* [`f30bb49`](https://github.com/eslint/eslintrc/commit/f30bb4935aaf3f4c1b268490da495a59647e58d8) Chore: Test fixes for CascadingConfigArrayFactory (#17) (Nicholas C. Zakas) -* [`4440df8`](https://github.com/eslint/eslintrc/commit/4440df8237a127e15cbde5c697353e1224f12ec1) Chore: Fix config-array tests (#16) (Nicholas C. Zakas) -* [`7890e02`](https://github.com/eslint/eslintrc/commit/7890e027df530a0fb53bcf5751c8c7a008b2a494) Chore: Test fixes for config-array-factory.js (#13) (Nicholas C. Zakas) - -v0.2.1 - October 26, 2020 - -* [`8b202ff`](https://github.com/eslint/eslintrc/commit/8b202ff866a39efdaad6394fde9f88372afbfca8) Fix: validate schema for built-in rules (#14) (Milos Djermanovic) -* [`04f3cae`](https://github.com/eslint/eslintrc/commit/04f3cae17fe07b2fd0b74fd3e88482b3094e75e3) Fix: cache compiled config schema (#9) (Milos Djermanovic) - -v0.2.0 - October 16, 2020 - -* [`cb12255`](https://github.com/eslint/eslintrc/commit/cb12255b85390e932e1942e479c2c97310149390) Update: Allow eslint:all and eslint:recommended paths to be passed in (#11) (Nicholas C. Zakas) -* [`a75bacd`](https://github.com/eslint/eslintrc/commit/a75bacd9a743a7bbcdb8c59e5d4f9de3dc8b0f20) Chore: use GitHub Actions (#10) (Milos Djermanovic) - -v0.1.3 - September 1, 2020 - -* [`8647a61`](https://github.com/eslint/eslintrc/commit/8647a61991fe121f923d33e96232475209b78210) Fix: version number and eslint-release version (refs #6) (Nicholas C. Zakas) - diff --git a/node_modules/@eslint/eslintrc/LICENSE b/node_modules/@eslint/eslintrc/LICENSE index f9556ee61..b607bb36e 100644 --- a/node_modules/@eslint/eslintrc/LICENSE +++ b/node_modules/@eslint/eslintrc/LICENSE @@ -1,6 +1,4 @@ -MIT License - -Copyright (c) 2020 ESLint +Copyright OpenJS Foundation and other contributors, Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,13 +7,13 @@ 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 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@eslint/eslintrc/README.md b/node_modules/@eslint/eslintrc/README.md index 11ff46ec0..9d816179f 100644 --- a/node_modules/@eslint/eslintrc/README.md +++ b/node_modules/@eslint/eslintrc/README.md @@ -1,8 +1,8 @@ # ESLintRC Library -This repository contains the legacy ESLintRC configuration file format for ESLint. +This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. -**Note:** This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. +**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system. ## Installation @@ -16,33 +16,43 @@ npm install @eslint/eslintrc --save-dev yarn add @eslint/eslintrc -D ``` -## Future Usage - -**Note:** This package is not intended for public use at this time. The following is an example of how it will be used in the future. +## Usage The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file: ```js import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import path from "path"; +import { fileURLToPath } from "url"; + +// mimic CommonJS variables -- not needed if using CommonJS +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); -const compat = new FlatCompat(); +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname, // optional + recommendedConfig: js.configs.recommended, // optional + allConfig: js.configs.all, // optional +}); export default [ // mimic ESLintRC-style extends - compat.extends("standard", "example"), + ...compat.extends("standard", "example"), // mimic environments - compat.env({ + ...compat.env({ es2020: true, node: true }), // mimic plugins - compat.plugins("airbnb", "react"), + ...compat.plugins("airbnb", "react"), // translate an entire config - compat.config({ + ...compat.config({ plugins: ["airbnb", "react"], extends: "standard", env: { diff --git a/node_modules/@eslint/eslintrc/conf/config-schema.js b/node_modules/@eslint/eslintrc/conf/config-schema.js index 712fc4235..ada90e135 100644 --- a/node_modules/@eslint/eslintrc/conf/config-schema.js +++ b/node_modules/@eslint/eslintrc/conf/config-schema.js @@ -3,8 +3,6 @@ * @author Sylvan Mably */ -"use strict"; - const baseConfigProperties = { $schema: { type: "string" }, env: { type: "object" }, @@ -78,4 +76,4 @@ const configSchema = { $ref: "#/definitions/objectConfig" }; -module.exports = configSchema; +export default configSchema; diff --git a/node_modules/@eslint/eslintrc/conf/environments.js b/node_modules/@eslint/eslintrc/conf/environments.js index 757c9fe69..f84285256 100644 --- a/node_modules/@eslint/eslintrc/conf/environments.js +++ b/node_modules/@eslint/eslintrc/conf/environments.js @@ -2,13 +2,12 @@ * @fileoverview Defines environment settings and globals. * @author Elan Shanker */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const globals = require("globals"); +import globals from "globals"; //------------------------------------------------------------------------------ // Helpers @@ -55,7 +54,7 @@ const newGlobals2021 = { //------------------------------------------------------------------------------ /** @type {Map} */ -module.exports = new Map(Object.entries({ +export default new Map(Object.entries({ // Language builtin: { @@ -73,12 +72,30 @@ module.exports = new Map(Object.entries({ ecmaVersion: 6 } }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, es2017: { globals: { ...newGlobals2015, ...newGlobals2017 }, parserOptions: { ecmaVersion: 8 } }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, es2020: { globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, parserOptions: { @@ -91,6 +108,12 @@ module.exports = new Map(Object.entries({ ecmaVersion: 12 } }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, // Platforms browser: { diff --git a/node_modules/@eslint/eslintrc/conf/eslint-all.js b/node_modules/@eslint/eslintrc/conf/eslint-all.js deleted file mode 100644 index 859811c8d..000000000 --- a/node_modules/@eslint/eslintrc/conf/eslint-all.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @fileoverview Stub eslint:all config - * @author Nicholas C. Zakas - */ - -"use strict"; - -module.exports = { - settings: { - "eslint:all": true - } -}; diff --git a/node_modules/@eslint/eslintrc/conf/eslint-recommended.js b/node_modules/@eslint/eslintrc/conf/eslint-recommended.js deleted file mode 100644 index 96300919a..000000000 --- a/node_modules/@eslint/eslintrc/conf/eslint-recommended.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @fileoverview Stub eslint:recommended config - * @author Nicholas C. Zakas - */ - -"use strict"; - -module.exports = { - settings: { - "eslint:recommended": true - } -}; diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs new file mode 100644 index 000000000..b1b755306 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs @@ -0,0 +1,1092 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var util = require('util'); +var path = require('path'); +var Ajv = require('ajv'); +var globals = require('globals'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv); +var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals); + +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +var ConfigOps = { + __proto__: null, + getRuleSeverity: getRuleSeverity, + normalizeToStrings: normalizeToStrings, + isErrorSeverity: isErrorSeverity, + isValidSeverity: isValidSeverity, + isEverySeverityValid: isEverySeverityValid, + normalizeConfigGlobal: normalizeConfigGlobal +}; + +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path__default["default"].relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +var ajvOrig = (additionalOptions = {}) => { + const ajv = new Ajv__default["default"]({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +var environments = new Map(Object.entries({ + + // Language + builtin: { + globals: globals__default["default"].es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + + // Platforms + browser: { + globals: globals__default["default"].browser + }, + node: { + globals: globals__default["default"].node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals__default["default"]["shared-node-browser"] + }, + worker: { + globals: globals__default["default"].worker + }, + serviceworker: { + globals: globals__default["default"].serviceworker + }, + + // Frameworks + commonjs: { + globals: globals__default["default"].commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals__default["default"].amd + }, + mocha: { + globals: globals__default["default"].mocha + }, + jasmine: { + globals: globals__default["default"].jasmine + }, + jest: { + globals: globals__default["default"].jest + }, + phantomjs: { + globals: globals__default["default"].phantomjs + }, + jquery: { + globals: globals__default["default"].jquery + }, + qunit: { + globals: globals__default["default"].qunit + }, + prototypejs: { + globals: globals__default["default"].prototypejs + }, + shelljs: { + globals: globals__default["default"].shelljs + }, + meteor: { + globals: globals__default["default"].meteor + }, + mongo: { + globals: globals__default["default"].mongo + }, + protractor: { + globals: globals__default["default"].protractor + }, + applescript: { + globals: globals__default["default"].applescript + }, + nashorn: { + globals: globals__default["default"].nashorn + }, + atomtest: { + globals: globals__default["default"].atomtest + }, + embertest: { + globals: globals__default["default"].embertest + }, + webextensions: { + globals: globals__default["default"].webextensions + }, + greasemonkey: { + globals: globals__default["default"].greasemonkey + } +})); + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || environments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} + +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +var naming = { + __proto__: null, + normalizePackageName: normalizePackageName, + getShorthandName: getShorthandName, + getNamespaceFromTerm: getNamespaceFromTerm +}; + +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + environments, + + // shared + ConfigOps, + ConfigValidator, + naming +}; + +exports.Legacy = Legacy; +//# sourceMappingURL=eslintrc-universal.cjs.map diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map new file mode 100644 index 000000000..72665f644 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"eslintrc-universal.cjs","sources":["../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/index-universal.js"],"sourcesContent":["/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, \"off\", \"warn\", \"error\"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule's options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: \"array\",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n naming\n};\n\nexport {\n Legacy\n};\n"],"names":["path","Ajv","globals","util","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;AACtD,IAAI,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,KAAK;AACxE,QAAQ,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAC3B,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK,EAAE,EAAE,CAAC;AACV,IAAI,gBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,UAAU,EAAE;AACrC,IAAI,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;AACjF;AACA,IAAI,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,EAAE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AAC,MAAM,GAAG;AACf,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,MAAM;AACV;;;;"} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs new file mode 100644 index 000000000..753117b32 --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs @@ -0,0 +1,4315 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var debugOrig = require('debug'); +var fs = require('fs'); +var importFresh = require('import-fresh'); +var Module = require('module'); +var path = require('path'); +var stripComments = require('strip-json-comments'); +var assert = require('assert'); +var ignore = require('ignore'); +var util = require('util'); +var minimatch = require('minimatch'); +var Ajv = require('ajv'); +var globals = require('globals'); +var os = require('os'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var debugOrig__default = /*#__PURE__*/_interopDefaultLegacy(debugOrig); +var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +var importFresh__default = /*#__PURE__*/_interopDefaultLegacy(importFresh); +var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); +var stripComments__default = /*#__PURE__*/_interopDefaultLegacy(stripComments); +var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); +var ignore__default = /*#__PURE__*/_interopDefaultLegacy(ignore); +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); +var minimatch__default = /*#__PURE__*/_interopDefaultLegacy(minimatch); +var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv); +var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals); +var os__default = /*#__PURE__*/_interopDefaultLegacy(os); + +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ + +const debug$3 = debugOrig__default["default"]("eslintrc:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path__default["default"].sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path__default["default"].sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path__default["default"].sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path__default["default"].relative(from, to); + + if (path__default["default"].sep === "/") { + return relPath; + } + return relPath.split(path__default["default"].sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path__default["default"].sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug$3("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = [].concat( + ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath)) + ); + const ig = ignore__default["default"]({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]); + const dotIg = ignore__default["default"]({ allowRelativePaths: true }).add(patterns); + + debug$3(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert__default["default"](path__default["default"].isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug$3("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert__default["default"](path__default["default"].isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert__default["default"](path__default["default"].isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap$2 = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @param {function(T): U} [normalize] The normalize function for each value. + * @returns {void} + */ +function collect(pluginId, defs, map, normalize) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set( + `${prefix}${key}`, + normalize ? normalize(value) : value + ); + } + } +} + +/** + * Normalize a rule definition. + * @param {Function|Rule} rule The rule definition to normalize. + * @returns {Rule} The normalized rule definition. + */ +function normalizePluginRule(rule) { + return typeof rule === "function" ? { create: rule } : rule; +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap$2.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap$2.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +/** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ +function getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap$2.get(instance); + + return Array.from(cache.values()); +} + +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util__default["default"].inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util__default["default"].inspect.custom]() { + const { + definition: _ignore, // eslint-disable-line no-unused-vars + ...obj + } = this; + + return obj; + } +} + +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ + +const { Minimatch } = minimatch__default["default"]; + +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert__default["default"].strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + */ + test(filePath) { + if (typeof filePath !== "string" || !path__default["default"].isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path__default["default"].relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util__default["default"].inspect.custom]() { + return this.toJSON(); + } +} + +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ + +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } +} + +var ConfigOps = { + __proto__: null, + getRuleSeverity: getRuleSeverity, + normalizeToStrings: normalizeToStrings, + isErrorSeverity: isErrorSeverity, + isValidSeverity: isValidSeverity, + isEverySeverityValid: isEverySeverityValid, + normalizeConfigGlobal: normalizeConfigGlobal +}; + +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path__default["default"].relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +var ajvOrig = (additionalOptions = {}) => { + const ajv = new Ajv__default["default"]({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +const baseConfigProperties = { + $schema: { type: "string" }, + env: { type: "object" }, + extends: { $ref: "#/definitions/stringOrStrings" }, + globals: { type: "object" }, + overrides: { + type: "array", + items: { $ref: "#/definitions/overrideConfig" }, + additionalItems: false + }, + parser: { type: ["string", "null"] }, + parserOptions: { type: "object" }, + plugins: { type: "array" }, + processor: { type: "string" }, + rules: { type: "object" }, + settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, + reportUnusedDisableDirectives: { type: "boolean" }, + + ecmaFeatures: { type: "object" } // deprecated; logs a warning when used +}; + +const configSchema = { + definitions: { + stringOrStrings: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false + } + ] + }, + stringOrStringsRequired: { + oneOf: [ + { type: "string" }, + { + type: "array", + items: { type: "string" }, + additionalItems: false, + minItems: 1 + } + ] + }, + + // Config at top-level. + objectConfig: { + type: "object", + properties: { + root: { type: "boolean" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...baseConfigProperties + }, + additionalProperties: false + }, + + // Config in `overrides`. + overrideConfig: { + type: "object", + properties: { + excludedFiles: { $ref: "#/definitions/stringOrStrings" }, + files: { $ref: "#/definitions/stringOrStringsRequired" }, + ...baseConfigProperties + }, + required: ["files"], + additionalProperties: false + } + }, + + $ref: "#/definitions/objectConfig" +}; + +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +var environments = new Map(Object.entries({ + + // Language + builtin: { + globals: globals__default["default"].es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2016: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 7 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2018: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 9 + } + }, + es2019: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 10 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + + // Platforms + browser: { + globals: globals__default["default"].browser + }, + node: { + globals: globals__default["default"].node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals__default["default"]["shared-node-browser"] + }, + worker: { + globals: globals__default["default"].worker + }, + serviceworker: { + globals: globals__default["default"].serviceworker + }, + + // Frameworks + commonjs: { + globals: globals__default["default"].commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals__default["default"].amd + }, + mocha: { + globals: globals__default["default"].mocha + }, + jasmine: { + globals: globals__default["default"].jasmine + }, + jest: { + globals: globals__default["default"].jest + }, + phantomjs: { + globals: globals__default["default"].phantomjs + }, + jquery: { + globals: globals__default["default"].jquery + }, + qunit: { + globals: globals__default["default"].qunit + }, + prototypejs: { + globals: globals__default["default"].prototypejs + }, + shelljs: { + globals: globals__default["default"].shelljs + }, + meteor: { + globals: globals__default["default"].meteor + }, + mongo: { + globals: globals__default["default"].mongo + }, + protractor: { + globals: globals__default["default"].protractor + }, + applescript: { + globals: globals__default["default"].applescript + }, + nashorn: { + globals: globals__default["default"].nashorn + }, + atomtest: { + globals: globals__default["default"].atomtest + }, + embertest: { + globals: globals__default["default"].embertest + }, + webextensions: { + globals: globals__default["default"].webextensions + }, + greasemonkey: { + globals: globals__default["default"].greasemonkey + } +})); + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +const ajv = ajvOrig(); + +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || environments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ + validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +} + +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +var naming = { + __proto__: null, + normalizePackageName: normalizePackageName, + getShorthandName: getShorthandName, + getNamespaceFromTerm: getNamespaceFromTerm +}; + +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +const createRequire = Module__default["default"].createRequire; + +/** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ +function resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } +} + +var ModuleResolver = { + __proto__: null, + resolve: resolve +}; + +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ + +const require$1 = Module.createRequire(require('url').pathToFileURL(__filename).toString()); + +const debug$2 = debugOrig__default["default"]("eslintrc:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap$1 = new WeakMap(); + +/** @type {WeakMap} */ +const normalizedPlugins = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path__default["default"].isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs__default["default"].readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug$2(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require$1("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.load(readFile(filePath)) || {}; + } catch (e) { + debug$2(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug$2(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments__default["default"](readFile(filePath))); + } catch (e) { + debug$2(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug$2(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require$1("js-yaml"); + + try { + return yaml.load(stripComments__default["default"](readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug$2("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug$2(`Loading JS config file: ${filePath}`); + try { + return importFresh__default["default"](filePath); + } catch (e) { + debug$2(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug$2(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug$2(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug$2(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug$2(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. + * @returns {Error} The error object to throw + * @private + */ +function configInvalidError(configName, importerName, messageTemplate) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate, + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path__default["default"].extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path__default["default"].basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug$2.enabled) { + let nameAndVersion = null; + + try { + const packageJsonPath = resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require$1(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug$2("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug$2("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path__default["default"].resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path__default["default"].resolve(cwd, providedMatchBasePath)) || + (filePath && path__default["default"].dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path__default["default"].relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path__default["default"].dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + + // first check the cache + let normalizedPlugin = normalizedPlugins.get(plugin); + + if (normalizedPlugin) { + return normalizedPlugin; + } + + normalizedPlugin = { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; + + // save the reference for later + normalizedPlugins.set(plugin, normalizedPlugin); + + return normalizedPlugin; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo, + builtInRules, + resolver = ModuleResolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = {}) { + internalSlotsMap$1.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path__default["default"].resolve(cwd, resolvePluginsRelativeTo), + builtInRules, + resolver, + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap$1.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap$1.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap$1.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path__default["default"].join(directoryPath, filename), + basePath + ); + + if (fs__default["default"].existsSync(ctx.filePath) && fs__default["default"].statSync(ctx.filePath).isFile()) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug$2(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug$2(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path__default["default"].join(directoryPath, filename); + + if (fs__default["default"].existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap$1.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap$1.get(this); + const eslintIgnorePath = path__default["default"].resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path__default["default"].resolve(slots.cwd, "package.json"); + + if (fs__default["default"].existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs__default["default"].existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwnProperty.call(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + const validator = new ConfigValidator(); + + validator.validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtends(extendName, ctx) { + debug$2("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + const { + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = internalSlotsMap$1.get(this); + + if (extendName === "eslint:recommended") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintRecommendedConfig) { + if (typeof getEslintRecommendedConfig !== "function") { + throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`); + } + return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintRecommendedPath + }); + } + if (extendName === "eslint:all") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintAllConfig) { + if (typeof getEslintAllConfig !== "function") { + throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`); + } + return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: "" }); + } + return this._loadConfigData({ + ...ctx, + name, + filePath: eslintAllPath + }); + } + + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd, resolver } = internalSlotsMap$1.get(this); + const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug$2("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd, resolver } = internalSlotsMap$1.get(this); + const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js"); + + try { + const filePath = resolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require$1(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug$2("Fallback espree."); + return new ConfigDependency({ + definition: require$1("espree"), + filePath: require$1.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug$2("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug$2("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool, resolver } = internalSlotsMap$1.get(this); + const request = normalizePackageName(name, "eslint-plugin"); + const id = getShorthandName(request, "eslint-plugin"); + const relativeTo = path__default["default"].join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require$1(filePath); + + debug$2(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug$2("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ + +const debug$1 = debugOrig__default["default"]("eslintrc:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("./shared/types").ConfigData} ConfigData */ +/** @typedef {import("./shared/types").Parser} Parser */ +/** @typedef {import("./shared/types").Plugin} Plugin */ +/** @typedef {import("./shared/types").Rule} Rule */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + * @property {Function} loadRules The function to use to load rules. + * @property {Map} builtInRules The rules that are built in to ESLint. + * @property {Object} [resolver=ModuleResolver] The module resolver object. + * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. + * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd, + loadRules +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true, + builtInRules = new Map(), + loadRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo, + builtInRules, + resolver, + eslintRecommendedPath, + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths, + loadRules + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc, + builtInRules, + loadRules + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path__default["default"].dirname(path__default["default"].resolve(cwd, filePath)); + + debug$1(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug$1(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug$1(`No cache found: ${directoryPath}.`); + + const homePath = os__default["default"].homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug$1("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug$1("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug$1("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path__default["default"].dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc, + builtInRules + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os__default["default"].homedir(); + + debug$1("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray[personalConfigArray.length - 1]; + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + const validator = new ConfigValidator({ + builtInRules + }); + + validator.validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug$1( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +/** + * @fileoverview Compatibility class for flat config. + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").Processor} Processor */ + +const debug = debugOrig__default["default"]("eslintrc:flat-compat"); +const cafactory = Symbol("cafactory"); + +/** + * Translates an ESLintRC-style config object into a flag-config-style config + * object. + * @param {Object} eslintrcConfig An ESLintRC-style config object. + * @param {Object} options Options to help translate the config. + * @param {string} options.resolveConfigRelativeTo To the directory to resolve + * configs from. + * @param {string} options.resolvePluginsRelativeTo The directory to resolve + * plugins from. + * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment + * names to objects. + * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor + * names to objects. + * @returns {Object} A flag-config-style config object. + */ +function translateESLintRC(eslintrcConfig, { + resolveConfigRelativeTo, + resolvePluginsRelativeTo, + pluginEnvironments, + pluginProcessors +}) { + + const flatConfig = {}; + const configs = []; + const languageOptions = {}; + const linterOptions = {}; + const keysToCopy = ["settings", "rules", "processor"]; + const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; + const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; + + // copy over simple translations + for (const key of keysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig[key] = eslintrcConfig[key]; + } + } + + // copy over languageOptions + for (const key of languageOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + + // create the languageOptions key in the flat config + flatConfig.languageOptions = languageOptions; + + if (key === "parser") { + debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`); + + if (eslintrcConfig[key].error) { + throw eslintrcConfig[key].error; + } + + languageOptions[key] = eslintrcConfig[key].definition; + continue; + } + + // clone any object values that are in the eslintrc config + if (eslintrcConfig[key] && typeof eslintrcConfig[key] === "object") { + languageOptions[key] = { + ...eslintrcConfig[key] + }; + } else { + languageOptions[key] = eslintrcConfig[key]; + } + } + } + + // copy over linterOptions + for (const key of linterOptionsKeysToCopy) { + if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { + flatConfig.linterOptions = linterOptions; + linterOptions[key] = eslintrcConfig[key]; + } + } + + // move ecmaVersion a level up + if (languageOptions.parserOptions) { + + if ("ecmaVersion" in languageOptions.parserOptions) { + languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion; + delete languageOptions.parserOptions.ecmaVersion; + } + + if ("sourceType" in languageOptions.parserOptions) { + languageOptions.sourceType = languageOptions.parserOptions.sourceType; + delete languageOptions.parserOptions.sourceType; + } + + // check to see if we even need parserOptions anymore and remove it if not + if (Object.keys(languageOptions.parserOptions).length === 0) { + delete languageOptions.parserOptions; + } + } + + // overrides + if (eslintrcConfig.criteria) { + flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)]; + } + + // translate plugins + if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === "object") { + debug(`Translating plugins: ${eslintrcConfig.plugins}`); + + flatConfig.plugins = {}; + + for (const pluginName of Object.keys(eslintrcConfig.plugins)) { + + debug(`Translating plugin: ${pluginName}`); + debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); + + const { definition: plugin, error } = eslintrcConfig.plugins[pluginName]; + + if (error) { + throw error; + } + + flatConfig.plugins[pluginName] = plugin; + + // create a config for any processors + if (plugin.processors) { + for (const processorName of Object.keys(plugin.processors)) { + if (processorName.startsWith(".")) { + debug(`Assigning processor: ${pluginName}/${processorName}`); + + configs.unshift({ + files: [`**/*${processorName}`], + processor: pluginProcessors.get(`${pluginName}/${processorName}`) + }); + } + + } + } + } + } + + // translate env - must come after plugins + if (eslintrcConfig.env && typeof eslintrcConfig.env === "object") { + for (const envName of Object.keys(eslintrcConfig.env)) { + + // only add environments that are true + if (eslintrcConfig.env[envName]) { + debug(`Translating environment: ${envName}`); + + if (environments.has(envName)) { + + // built-in environments should be defined first + configs.unshift(...translateESLintRC(environments.get(envName), { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } else if (pluginEnvironments.has(envName)) { + + // if the environment comes from a plugin, it should come after the plugin config + configs.push(...translateESLintRC(pluginEnvironments.get(envName), { + resolveConfigRelativeTo, + resolvePluginsRelativeTo + })); + } + } + } + } + + // only add if there are actually keys in the config + if (Object.keys(flatConfig).length > 0) { + configs.push(flatConfig); + } + + return configs; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * A compatibility class for working with configs. + */ +class FlatCompat { + + constructor({ + baseDirectory = process.cwd(), + resolvePluginsRelativeTo = baseDirectory, + recommendedConfig, + allConfig + } = {}) { + this.baseDirectory = baseDirectory; + this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + this[cafactory] = new ConfigArrayFactory({ + cwd: baseDirectory, + resolvePluginsRelativeTo, + getEslintAllConfig: () => { + + if (!allConfig) { + throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor."); + } + + return allConfig; + }, + getEslintRecommendedConfig: () => { + + if (!recommendedConfig) { + throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor."); + } + + return recommendedConfig; + } + }); + } + + /** + * Translates an ESLintRC-style config into a flag-config-style config. + * @param {Object} eslintrcConfig The ESLintRC-style config object. + * @returns {Object} A flag-config-style config object. + */ + config(eslintrcConfig) { + const eslintrcArray = this[cafactory].create(eslintrcConfig, { + basePath: this.baseDirectory + }); + + const flatArray = []; + let hasIgnorePatterns = false; + + eslintrcArray.forEach(configData => { + if (configData.type === "config") { + hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern; + flatArray.push(...translateESLintRC(configData, { + resolveConfigRelativeTo: path__default["default"].join(this.baseDirectory, "__placeholder.js"), + resolvePluginsRelativeTo: path__default["default"].join(this.resolvePluginsRelativeTo, "__placeholder.js"), + pluginEnvironments: eslintrcArray.pluginEnvironments, + pluginProcessors: eslintrcArray.pluginProcessors + })); + } + }); + + // combine ignorePatterns to emulate ESLintRC behavior better + if (hasIgnorePatterns) { + flatArray.unshift({ + ignores: [filePath => { + + // Compute the final config for this file. + // This filters config array elements by `files`/`excludedFiles` then merges the elements. + const finalConfig = eslintrcArray.extractConfig(filePath); + + // Test the `ignorePattern` properties of the final config. + return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath); + }] + }); + } + + return flatArray; + } + + /** + * Translates the `env` section of an ESLintRC-style config. + * @param {Object} envConfig The `env` section of an ESLintRC config. + * @returns {Object[]} An array of flag-config objects representing the environments. + */ + env(envConfig) { + return this.config({ + env: envConfig + }); + } + + /** + * Translates the `extends` section of an ESLintRC-style config. + * @param {...string} configsToExtend The names of the configs to load. + * @returns {Object[]} An array of flag-config objects representing the config. + */ + extends(...configsToExtend) { + return this.config({ + extends: configsToExtend + }); + } + + /** + * Translates the `plugins` section of an ESLintRC-style config. + * @param {...string} plugins The names of the plugins to load. + * @returns {Object[]} An array of flag-config objects representing the plugins. + */ + plugins(...plugins) { + return this.config({ + plugins + }); + } +} + +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext: createContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; + +exports.FlatCompat = FlatCompat; +exports.Legacy = Legacy; +//# sourceMappingURL=eslintrc.cjs.map diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map new file mode 100644 index 000000000..58d9dbbcd --- /dev/null +++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"eslintrc.cjs","sources":["../lib/config-array/ignore-pattern.js","../lib/config-array/extracted-config.js","../lib/config-array/config-array.js","../lib/config-array/config-dependency.js","../lib/config-array/override-tester.js","../lib/config-array/index.js","../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/shared/relative-module-resolver.js","../lib/config-array-factory.js","../lib/cascading-config-array-factory.js","../lib/flat-compat.js","../lib/index.js"],"sourcesContent":["/**\n * @fileoverview `IgnorePattern` class.\n *\n * `IgnorePattern` class has the set of glob patterns and the base path.\n *\n * It provides two static methods.\n *\n * - `IgnorePattern.createDefaultIgnore(cwd)`\n * Create the default predicate function.\n * - `IgnorePattern.createIgnore(ignorePatterns)`\n * Create the predicate function from multiple `IgnorePattern` objects.\n *\n * It provides two properties and a method.\n *\n * - `patterns`\n * The glob patterns that ignore to lint.\n * - `basePath`\n * The base path of the glob patterns. If absolute paths existed in the\n * glob patterns, those are handled as relative paths to the base path.\n * - `getPatternsRelativeTo(basePath)`\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n *\n * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes\n * `ignorePatterns` properties.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport ignore from \"ignore\";\nimport debugOrig from \"debug\";\n\nconst debug = debugOrig(\"eslintrc:ignore-pattern\");\n\n/** @typedef {ReturnType} Ignore */\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the path to the common ancestor directory of given paths.\n * @param {string[]} sourcePaths The paths to calculate the common ancestor.\n * @returns {string} The path to the common ancestor directory.\n */\nfunction getCommonAncestorPath(sourcePaths) {\n let result = sourcePaths[0];\n\n for (let i = 1; i < sourcePaths.length; ++i) {\n const a = result;\n const b = sourcePaths[i];\n\n // Set the shorter one (it's the common ancestor if one includes the other).\n result = a.length < b.length ? a : b;\n\n // Set the common ancestor.\n for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) {\n if (a[j] !== b[j]) {\n result = a.slice(0, lastSepPos);\n break;\n }\n if (a[j] === path.sep) {\n lastSepPos = j;\n }\n }\n }\n\n let resolvedResult = result || path.sep;\n\n // if Windows common ancestor is root of drive must have trailing slash to be absolute.\n if (resolvedResult && resolvedResult.endsWith(\":\") && process.platform === \"win32\") {\n resolvedResult += path.sep;\n }\n return resolvedResult;\n}\n\n/**\n * Make relative path.\n * @param {string} from The source path to get relative path.\n * @param {string} to The destination path to get relative path.\n * @returns {string} The relative path.\n */\nfunction relative(from, to) {\n const relPath = path.relative(from, to);\n\n if (path.sep === \"/\") {\n return relPath;\n }\n return relPath.split(path.sep).join(\"/\");\n}\n\n/**\n * Get the trailing slash if existed.\n * @param {string} filePath The path to check.\n * @returns {string} The trailing slash if existed.\n */\nfunction dirSuffix(filePath) {\n const isDir = (\n filePath.endsWith(path.sep) ||\n (process.platform === \"win32\" && filePath.endsWith(\"/\"))\n );\n\n return isDir ? \"/\" : \"\";\n}\n\nconst DefaultPatterns = Object.freeze([\"/**/node_modules/*\"]);\nconst DotPatterns = Object.freeze([\".*\", \"!.eslintrc.*\", \"!../\"]);\n\n//------------------------------------------------------------------------------\n// Public\n//------------------------------------------------------------------------------\n\nclass IgnorePattern {\n\n /**\n * The default patterns.\n * @type {string[]}\n */\n static get DefaultPatterns() {\n return DefaultPatterns;\n }\n\n /**\n * Create the default predicate function.\n * @param {string} cwd The current working directory.\n * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createDefaultIgnore(cwd) {\n return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]);\n }\n\n /**\n * Create the predicate function from multiple `IgnorePattern` objects.\n * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns.\n * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createIgnore(ignorePatterns) {\n debug(\"Create with: %o\", ignorePatterns);\n\n const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));\n const patterns = [].concat(\n ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath))\n );\n const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]);\n const dotIg = ignore({ allowRelativePaths: true }).add(patterns);\n\n debug(\" processed: %o\", { basePath, patterns });\n\n return Object.assign(\n (filePath, dot = false) => {\n assert(path.isAbsolute(filePath), \"'filePath' should be an absolute path.\");\n const relPathRaw = relative(basePath, filePath);\n const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath));\n const adoptedIg = dot ? dotIg : ig;\n const result = relPath !== \"\" && adoptedIg.ignores(relPath);\n\n debug(\"Check\", { filePath, dot, relativePath: relPath, result });\n return result;\n },\n { basePath, patterns }\n );\n }\n\n /**\n * Initialize a new `IgnorePattern` instance.\n * @param {string[]} patterns The glob patterns that ignore to lint.\n * @param {string} basePath The base path of `patterns`.\n */\n constructor(patterns, basePath) {\n assert(path.isAbsolute(basePath), \"'basePath' should be an absolute path.\");\n\n /**\n * The glob patterns that ignore to lint.\n * @type {string[]}\n */\n this.patterns = patterns;\n\n /**\n * The base path of `patterns`.\n * @type {string}\n */\n this.basePath = basePath;\n\n /**\n * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`.\n *\n * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility.\n * It's `false` as-is for `ignorePatterns` property in config files.\n * @type {boolean}\n */\n this.loose = false;\n }\n\n /**\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n * @param {string} newBasePath The base path.\n * @returns {string[]} Modifired patterns.\n */\n getPatternsRelativeTo(newBasePath) {\n assert(path.isAbsolute(newBasePath), \"'newBasePath' should be an absolute path.\");\n const { basePath, loose, patterns } = this;\n\n if (newBasePath === basePath) {\n return patterns;\n }\n const prefix = `/${relative(newBasePath, basePath)}`;\n\n return patterns.map(pattern => {\n const negative = pattern.startsWith(\"!\");\n const head = negative ? \"!\" : \"\";\n const body = negative ? pattern.slice(1) : pattern;\n\n if (body.startsWith(\"/\") || body.startsWith(\"../\")) {\n return `${head}${prefix}${body}`;\n }\n return loose ? pattern : `${head}${prefix}/**/${body}`;\n });\n }\n}\n\nexport { IgnorePattern };\n","/**\n * @fileoverview `ExtractedConfig` class.\n *\n * `ExtractedConfig` class expresses a final configuration for a specific file.\n *\n * It provides one method.\n *\n * - `toCompatibleObjectAsConfigFileContent()`\n * Convert this configuration to the compatible object as the content of\n * config files. It converts the loaded parser and plugins to strings.\n * `CLIEngine#getConfigForFile(filePath)` method uses this method.\n *\n * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance.\n *\n * @author Toru Nagashima \n */\n\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n// For VSCode intellisense\n/** @typedef {import(\"../../shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").SeverityConf} SeverityConf */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n\n/**\n * Check if `xs` starts with `ys`.\n * @template T\n * @param {T[]} xs The array to check.\n * @param {T[]} ys The array that may be the first part of `xs`.\n * @returns {boolean} `true` if `xs` starts with `ys`.\n */\nfunction startsWith(xs, ys) {\n return xs.length >= ys.length && ys.every((y, i) => y === xs[i]);\n}\n\n/**\n * The class for extracted config data.\n */\nclass ExtractedConfig {\n constructor() {\n\n /**\n * The config name what `noInlineConfig` setting came from.\n * @type {string}\n */\n this.configNameOfNoInlineConfig = \"\";\n\n /**\n * Environments.\n * @type {Record}\n */\n this.env = {};\n\n /**\n * Global variables.\n * @type {Record}\n */\n this.globals = {};\n\n /**\n * The glob patterns that ignore to lint.\n * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined}\n */\n this.ignores = void 0;\n\n /**\n * The flag that disables directive comments.\n * @type {boolean|undefined}\n */\n this.noInlineConfig = void 0;\n\n /**\n * Parser definition.\n * @type {DependentParser|null}\n */\n this.parser = null;\n\n /**\n * Options for the parser.\n * @type {Object}\n */\n this.parserOptions = {};\n\n /**\n * Plugin definitions.\n * @type {Record}\n */\n this.plugins = {};\n\n /**\n * Processor ID.\n * @type {string|null}\n */\n this.processor = null;\n\n /**\n * The flag that reports unused `eslint-disable` directive comments.\n * @type {boolean|undefined}\n */\n this.reportUnusedDisableDirectives = void 0;\n\n /**\n * Rule settings.\n * @type {Record}\n */\n this.rules = {};\n\n /**\n * Shared settings.\n * @type {Object}\n */\n this.settings = {};\n }\n\n /**\n * Convert this config to the compatible object as a config file content.\n * @returns {ConfigData} The converted object.\n */\n toCompatibleObjectAsConfigFileContent() {\n const {\n /* eslint-disable no-unused-vars */\n configNameOfNoInlineConfig: _ignore1,\n processor: _ignore2,\n /* eslint-enable no-unused-vars */\n ignores,\n ...config\n } = this;\n\n config.parser = config.parser && config.parser.filePath;\n config.plugins = Object.keys(config.plugins).filter(Boolean).reverse();\n config.ignorePatterns = ignores ? ignores.patterns : [];\n\n // Strip the default patterns from `ignorePatterns`.\n if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) {\n config.ignorePatterns =\n config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length);\n }\n\n return config;\n }\n}\n\nexport { ExtractedConfig };\n","/**\n * @fileoverview `ConfigArray` class.\n *\n * `ConfigArray` class expresses the full of a configuration. It has the entry\n * config file, base config files that were extended, loaded parsers, and loaded\n * plugins.\n *\n * `ConfigArray` class provides three properties and two methods.\n *\n * - `pluginEnvironments`\n * - `pluginProcessors`\n * - `pluginRules`\n * The `Map` objects that contain the members of all plugins that this\n * config array contains. Those map objects don't have mutation methods.\n * Those keys are the member ID such as `pluginId/memberName`.\n * - `isRoot()`\n * If `true` then this configuration has `root:true` property.\n * - `extractConfig(filePath)`\n * Extract the final configuration for a given file. This means merging\n * every config array element which that `criteria` property matched. The\n * `filePath` argument must be an absolute path.\n *\n * `ConfigArrayFactory` provides the loading logic of config files.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").RuleConf} RuleConf */\n/** @typedef {import(\"../../shared/types\").Rule} Rule */\n/** @typedef {import(\"../../shared/types\").Plugin} Plugin */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {import(\"./override-tester\")[\"OverrideTester\"]} OverrideTester */\n\n/**\n * @typedef {Object} ConfigArrayElement\n * @property {string} name The name of this config element.\n * @property {string} filePath The path to the source file of this config element.\n * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element.\n * @property {Record|undefined} env The environment settings.\n * @property {Record|undefined} globals The global variable settings.\n * @property {IgnorePattern|undefined} ignorePattern The ignore patterns.\n * @property {boolean|undefined} noInlineConfig The flag that disables directive comments.\n * @property {DependentParser|undefined} parser The parser loader.\n * @property {Object|undefined} parserOptions The parser options.\n * @property {Record|undefined} plugins The plugin loaders.\n * @property {string|undefined} processor The processor name to refer plugin's processor.\n * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments.\n * @property {boolean|undefined} root The flag to express root.\n * @property {Record|undefined} rules The rule settings\n * @property {Object|undefined} settings The shared settings.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The element type.\n */\n\n/**\n * @typedef {Object} ConfigArrayInternalSlots\n * @property {Map} cache The cache to extract configs.\n * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition.\n * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition.\n * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new class extends WeakMap {\n get(key) {\n let value = super.get(key);\n\n if (!value) {\n value = {\n cache: new Map(),\n envMap: null,\n processorMap: null,\n ruleMap: null\n };\n super.set(key, value);\n }\n\n return value;\n }\n}();\n\n/**\n * Get the indices which are matched to a given file.\n * @param {ConfigArrayElement[]} elements The elements.\n * @param {string} filePath The path to a target file.\n * @returns {number[]} The indices.\n */\nfunction getMatchedIndices(elements, filePath) {\n const indices = [];\n\n for (let i = elements.length - 1; i >= 0; --i) {\n const element = elements[i];\n\n if (!element.criteria || (filePath && element.criteria.test(filePath))) {\n indices.push(i);\n }\n }\n\n return indices;\n}\n\n/**\n * Check if a value is a non-null object.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is a non-null object.\n */\nfunction isNonNullObject(x) {\n return typeof x === \"object\" && x !== null;\n}\n\n/**\n * Merge two objects.\n *\n * Assign every property values of `y` to `x` if `x` doesn't have the property.\n * If `x`'s property value is an object, it does recursive.\n * @param {Object} target The destination to merge\n * @param {Object|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeWithoutOverwrite(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n\n if (isNonNullObject(target[key])) {\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (target[key] === void 0) {\n if (isNonNullObject(source[key])) {\n target[key] = Array.isArray(source[key]) ? [] : {};\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (source[key] !== void 0) {\n target[key] = source[key];\n }\n }\n }\n}\n\n/**\n * The error for plugin conflicts.\n */\nclass PluginConflictError extends Error {\n\n /**\n * Initialize this error object.\n * @param {string} pluginId The plugin ID.\n * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins.\n */\n constructor(pluginId, plugins) {\n super(`Plugin \"${pluginId}\" was conflicted between ${plugins.map(p => `\"${p.importerName}\"`).join(\" and \")}.`);\n this.messageTemplate = \"plugin-conflict\";\n this.messageData = { pluginId, plugins };\n }\n}\n\n/**\n * Merge plugins.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergePlugins(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetValue = target[key];\n const sourceValue = source[key];\n\n // Adopt the plugin which was found at first.\n if (targetValue === void 0) {\n if (sourceValue.error) {\n throw sourceValue.error;\n }\n target[key] = sourceValue;\n } else if (sourceValue.filePath !== targetValue.filePath) {\n throw new PluginConflictError(key, [\n {\n filePath: targetValue.filePath,\n importerName: targetValue.importerName\n },\n {\n filePath: sourceValue.filePath,\n importerName: sourceValue.importerName\n }\n ]);\n }\n }\n}\n\n/**\n * Merge rule configs.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeRuleConfigs(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetDef = target[key];\n const sourceDef = source[key];\n\n // Adopt the rule config which was found at first.\n if (targetDef === void 0) {\n if (Array.isArray(sourceDef)) {\n target[key] = [...sourceDef];\n } else {\n target[key] = [sourceDef];\n }\n\n /*\n * If the first found rule config is severity only and the current rule\n * config has options, merge the severity and the options.\n */\n } else if (\n targetDef.length === 1 &&\n Array.isArray(sourceDef) &&\n sourceDef.length >= 2\n ) {\n targetDef.push(...sourceDef.slice(1));\n }\n }\n}\n\n/**\n * Create the extracted config.\n * @param {ConfigArray} instance The config elements.\n * @param {number[]} indices The indices to use.\n * @returns {ExtractedConfig} The extracted config.\n */\nfunction createConfig(instance, indices) {\n const config = new ExtractedConfig();\n const ignorePatterns = [];\n\n // Merge elements.\n for (const index of indices) {\n const element = instance[index];\n\n // Adopt the parser which was found at first.\n if (!config.parser && element.parser) {\n if (element.parser.error) {\n throw element.parser.error;\n }\n config.parser = element.parser;\n }\n\n // Adopt the processor which was found at first.\n if (!config.processor && element.processor) {\n config.processor = element.processor;\n }\n\n // Adopt the noInlineConfig which was found at first.\n if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) {\n config.noInlineConfig = element.noInlineConfig;\n config.configNameOfNoInlineConfig = element.name;\n }\n\n // Adopt the reportUnusedDisableDirectives which was found at first.\n if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) {\n config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives;\n }\n\n // Collect ignorePatterns\n if (element.ignorePattern) {\n ignorePatterns.push(element.ignorePattern);\n }\n\n // Merge others.\n mergeWithoutOverwrite(config.env, element.env);\n mergeWithoutOverwrite(config.globals, element.globals);\n mergeWithoutOverwrite(config.parserOptions, element.parserOptions);\n mergeWithoutOverwrite(config.settings, element.settings);\n mergePlugins(config.plugins, element.plugins);\n mergeRuleConfigs(config.rules, element.rules);\n }\n\n // Create the predicate function for ignore patterns.\n if (ignorePatterns.length > 0) {\n config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse());\n }\n\n return config;\n}\n\n/**\n * Collect definitions.\n * @template T, U\n * @param {string} pluginId The plugin ID for prefix.\n * @param {Record} defs The definitions to collect.\n * @param {Map} map The map to output.\n * @param {function(T): U} [normalize] The normalize function for each value.\n * @returns {void}\n */\nfunction collect(pluginId, defs, map, normalize) {\n if (defs) {\n const prefix = pluginId && `${pluginId}/`;\n\n for (const [key, value] of Object.entries(defs)) {\n map.set(\n `${prefix}${key}`,\n normalize ? normalize(value) : value\n );\n }\n }\n}\n\n/**\n * Normalize a rule definition.\n * @param {Function|Rule} rule The rule definition to normalize.\n * @returns {Rule} The normalized rule definition.\n */\nfunction normalizePluginRule(rule) {\n return typeof rule === \"function\" ? { create: rule } : rule;\n}\n\n/**\n * Delete the mutation methods from a given map.\n * @param {Map} map The map object to delete.\n * @returns {void}\n */\nfunction deleteMutationMethods(map) {\n Object.defineProperties(map, {\n clear: { configurable: true, value: void 0 },\n delete: { configurable: true, value: void 0 },\n set: { configurable: true, value: void 0 }\n });\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArrayElement[]} elements The config elements.\n * @param {ConfigArrayInternalSlots} slots The internal slots.\n * @returns {void}\n */\nfunction initPluginMemberMaps(elements, slots) {\n const processed = new Set();\n\n slots.envMap = new Map();\n slots.processorMap = new Map();\n slots.ruleMap = new Map();\n\n for (const element of elements) {\n if (!element.plugins) {\n continue;\n }\n\n for (const [pluginId, value] of Object.entries(element.plugins)) {\n const plugin = value.definition;\n\n if (!plugin || processed.has(pluginId)) {\n continue;\n }\n processed.add(pluginId);\n\n collect(pluginId, plugin.environments, slots.envMap);\n collect(pluginId, plugin.processors, slots.processorMap);\n collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule);\n }\n }\n\n deleteMutationMethods(slots.envMap);\n deleteMutationMethods(slots.processorMap);\n deleteMutationMethods(slots.ruleMap);\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArray} instance The config elements.\n * @returns {ConfigArrayInternalSlots} The extracted config.\n */\nfunction ensurePluginMemberMaps(instance) {\n const slots = internalSlotsMap.get(instance);\n\n if (!slots.ruleMap) {\n initPluginMemberMaps(instance, slots);\n }\n\n return slots;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The Config Array.\n *\n * `ConfigArray` instance contains all settings, parsers, and plugins.\n * You need to call `ConfigArray#extractConfig(filePath)` method in order to\n * extract, merge and get only the config data which is related to an arbitrary\n * file.\n * @extends {Array}\n */\nclass ConfigArray extends Array {\n\n /**\n * Get the plugin environments.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin environments.\n */\n get pluginEnvironments() {\n return ensurePluginMemberMaps(this).envMap;\n }\n\n /**\n * Get the plugin processors.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin processors.\n */\n get pluginProcessors() {\n return ensurePluginMemberMaps(this).processorMap;\n }\n\n /**\n * Get the plugin rules.\n * The returned map cannot be mutated.\n * @returns {ReadonlyMap} The plugin rules.\n */\n get pluginRules() {\n return ensurePluginMemberMaps(this).ruleMap;\n }\n\n /**\n * Check if this config has `root` flag.\n * @returns {boolean} `true` if this config array is root.\n */\n isRoot() {\n for (let i = this.length - 1; i >= 0; --i) {\n const root = this[i].root;\n\n if (typeof root === \"boolean\") {\n return root;\n }\n }\n return false;\n }\n\n /**\n * Extract the config data which is related to a given file.\n * @param {string} filePath The absolute path to the target file.\n * @returns {ExtractedConfig} The extracted config data.\n */\n extractConfig(filePath) {\n const { cache } = internalSlotsMap.get(this);\n const indices = getMatchedIndices(this, filePath);\n const cacheKey = indices.join(\",\");\n\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, createConfig(this, indices));\n }\n\n return cache.get(cacheKey);\n }\n\n /**\n * Check if a given path is an additional lint target.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the file is an additional lint target.\n */\n isAdditionalTargetPath(filePath) {\n for (const { criteria, type } of this) {\n if (\n type === \"config\" &&\n criteria &&\n !criteria.endsWithWildcard &&\n criteria.test(filePath)\n ) {\n return true;\n }\n }\n return false;\n }\n}\n\n/**\n * Get the used extracted configs.\n * CLIEngine will use this method to collect used deprecated rules.\n * @param {ConfigArray} instance The config array object to get.\n * @returns {ExtractedConfig[]} The used extracted configs.\n * @private\n */\nfunction getUsedExtractedConfigs(instance) {\n const { cache } = internalSlotsMap.get(instance);\n\n return Array.from(cache.values());\n}\n\n\nexport {\n ConfigArray,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview `ConfigDependency` class.\n *\n * `ConfigDependency` class expresses a loaded parser or plugin.\n *\n * If the parser or plugin was loaded successfully, it has `definition` property\n * and `filePath` property. Otherwise, it has `error` property.\n *\n * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it\n * omits `definition` property.\n *\n * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers\n * or plugins.\n *\n * @author Toru Nagashima \n */\n\nimport util from \"util\";\n\n/**\n * The class is to store parsers or plugins.\n * This class hides the loaded object from `JSON.stringify()` and `console.log`.\n * @template T\n */\nclass ConfigDependency {\n\n /**\n * Initialize this instance.\n * @param {Object} data The dependency data.\n * @param {T} [data.definition] The dependency if the loading succeeded.\n * @param {Error} [data.error] The error object if the loading failed.\n * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded.\n * @param {string} data.id The ID of this dependency.\n * @param {string} data.importerName The name of the config file which loads this dependency.\n * @param {string} data.importerPath The path to the config file which loads this dependency.\n */\n constructor({\n definition = null,\n error = null,\n filePath = null,\n id,\n importerName,\n importerPath\n }) {\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {T|null}\n */\n this.definition = definition;\n\n /**\n * The error object if the loading failed.\n * @type {Error|null}\n */\n this.error = error;\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {string|null}\n */\n this.filePath = filePath;\n\n /**\n * The ID of this dependency.\n * @type {string}\n */\n this.id = id;\n\n /**\n * The name of the config file which loads this dependency.\n * @type {string}\n */\n this.importerName = importerName;\n\n /**\n * The path to the config file which loads this dependency.\n * @type {string}\n */\n this.importerPath = importerPath;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n const obj = this[util.inspect.custom]();\n\n // Display `error.message` (`Error#message` is unenumerable).\n if (obj.error instanceof Error) {\n obj.error = { ...obj.error, message: obj.error.message };\n }\n\n return obj;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n const {\n definition: _ignore, // eslint-disable-line no-unused-vars\n ...obj\n } = this;\n\n return obj;\n }\n}\n\n/** @typedef {ConfigDependency} DependentParser */\n/** @typedef {ConfigDependency} DependentPlugin */\n\nexport { ConfigDependency };\n","/**\n * @fileoverview `OverrideTester` class.\n *\n * `OverrideTester` class handles `files` property and `excludedFiles` property\n * of `overrides` config.\n *\n * It provides one method.\n *\n * - `test(filePath)`\n * Test if a file path matches the pair of `files` property and\n * `excludedFiles` property. The `filePath` argument must be an absolute\n * path.\n *\n * `ConfigArrayFactory` creates `OverrideTester` objects when it processes\n * `overrides` properties.\n *\n * @author Toru Nagashima \n */\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport util from \"util\";\nimport minimatch from \"minimatch\";\n\nconst { Minimatch } = minimatch;\n\nconst minimatchOpts = { dot: true, matchBase: true };\n\n/**\n * @typedef {Object} Pattern\n * @property {InstanceType[] | null} includes The positive matchers.\n * @property {InstanceType[] | null} excludes The negative matchers.\n */\n\n/**\n * Normalize a given pattern to an array.\n * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns.\n * @returns {string[]|null} Normalized patterns.\n * @private\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.filter(Boolean);\n }\n if (typeof patterns === \"string\" && patterns) {\n return [patterns];\n }\n return [];\n}\n\n/**\n * Create the matchers of given patterns.\n * @param {string[]} patterns The patterns.\n * @returns {InstanceType[] | null} The matchers.\n */\nfunction toMatcher(patterns) {\n if (patterns.length === 0) {\n return null;\n }\n return patterns.map(pattern => {\n if (/^\\.[/\\\\]/u.test(pattern)) {\n return new Minimatch(\n pattern.slice(2),\n\n // `./*.js` should not match with `subdir/foo.js`\n { ...minimatchOpts, matchBase: false }\n );\n }\n return new Minimatch(pattern, minimatchOpts);\n });\n}\n\n/**\n * Convert a given matcher to string.\n * @param {Pattern} matchers The matchers.\n * @returns {string} The string expression of the matcher.\n */\nfunction patternToJson({ includes, excludes }) {\n return {\n includes: includes && includes.map(m => m.pattern),\n excludes: excludes && excludes.map(m => m.pattern)\n };\n}\n\n/**\n * The class to test given paths are matched by the patterns.\n */\nclass OverrideTester {\n\n /**\n * Create a tester with given criteria.\n * If there are no criteria, returns `null`.\n * @param {string|string[]} files The glob patterns for included files.\n * @param {string|string[]} excludedFiles The glob patterns for excluded files.\n * @param {string} basePath The path to the base directory to test paths.\n * @returns {OverrideTester|null} The created instance or `null`.\n */\n static create(files, excludedFiles, basePath) {\n const includePatterns = normalizePatterns(files);\n const excludePatterns = normalizePatterns(excludedFiles);\n let endsWithWildcard = false;\n\n if (includePatterns.length === 0) {\n return null;\n }\n\n // Rejects absolute paths or relative paths to parents.\n for (const pattern of includePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n if (pattern.endsWith(\"*\")) {\n endsWithWildcard = true;\n }\n }\n for (const pattern of excludePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n }\n\n const includes = toMatcher(includePatterns);\n const excludes = toMatcher(excludePatterns);\n\n return new OverrideTester(\n [{ includes, excludes }],\n basePath,\n endsWithWildcard\n );\n }\n\n /**\n * Combine two testers by logical and.\n * If either of the testers was `null`, returns the other tester.\n * The `basePath` property of the two must be the same value.\n * @param {OverrideTester|null} a A tester.\n * @param {OverrideTester|null} b Another tester.\n * @returns {OverrideTester|null} Combined tester.\n */\n static and(a, b) {\n if (!b) {\n return a && new OverrideTester(\n a.patterns,\n a.basePath,\n a.endsWithWildcard\n );\n }\n if (!a) {\n return new OverrideTester(\n b.patterns,\n b.basePath,\n b.endsWithWildcard\n );\n }\n\n assert.strictEqual(a.basePath, b.basePath);\n return new OverrideTester(\n a.patterns.concat(b.patterns),\n a.basePath,\n a.endsWithWildcard || b.endsWithWildcard\n );\n }\n\n /**\n * Initialize this instance.\n * @param {Pattern[]} patterns The matchers.\n * @param {string} basePath The base path.\n * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`.\n */\n constructor(patterns, basePath, endsWithWildcard = false) {\n\n /** @type {Pattern[]} */\n this.patterns = patterns;\n\n /** @type {string} */\n this.basePath = basePath;\n\n /** @type {boolean} */\n this.endsWithWildcard = endsWithWildcard;\n }\n\n /**\n * Test if a given path is matched or not.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the path was matched.\n */\n test(filePath) {\n if (typeof filePath !== \"string\" || !path.isAbsolute(filePath)) {\n throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`);\n }\n const relativePath = path.relative(this.basePath, filePath);\n\n return this.patterns.every(({ includes, excludes }) => (\n (!includes || includes.some(m => m.match(relativePath))) &&\n (!excludes || !excludes.some(m => m.match(relativePath)))\n ));\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n if (this.patterns.length === 1) {\n return {\n ...patternToJson(this.patterns[0]),\n basePath: this.basePath\n };\n }\n return {\n AND: this.patterns.map(patternToJson),\n basePath: this.basePath\n };\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n return this.toJSON();\n }\n}\n\nexport { OverrideTester };\n","/**\n * @fileoverview `ConfigArray` class.\n * @author Toru Nagashima \n */\n\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array.js\";\nimport { ConfigDependency } from \"./config-dependency.js\";\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\nimport { OverrideTester } from \"./override-tester.js\";\n\nexport {\n ConfigArray,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, \"off\", \"warn\", \"error\"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule's options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: \"array\",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * Utility for resolving a module relative to another module\n * @author Teddy Katz\n */\n\nimport Module from \"module\";\n\n/*\n * `Module.createRequire` is added in v12.2.0. It supports URL as well.\n * We only support the case where the argument is a filepath, not a URL.\n */\nconst createRequire = Module.createRequire;\n\n/**\n * Resolves a Node module relative to another module\n * @param {string} moduleName The name of a Node module, or a path to a Node module.\n * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be\n * a file rather than a directory, but the file need not actually exist.\n * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`\n */\nfunction resolve(moduleName, relativeToPath) {\n try {\n return createRequire(relativeToPath).resolve(moduleName);\n } catch (error) {\n\n // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.\n if (\n typeof error === \"object\" &&\n error !== null &&\n error.code === \"MODULE_NOT_FOUND\" &&\n !error.requireStack &&\n error.message.includes(moduleName)\n ) {\n error.message += `\\nRequire stack:\\n- ${relativeToPath}`;\n }\n throw error;\n }\n}\n\nexport {\n resolve\n};\n","/**\n * @fileoverview The factory of `ConfigArray` objects.\n *\n * This class provides methods to create `ConfigArray` instance.\n *\n * - `create(configData, options)`\n * Create a `ConfigArray` instance from a config data. This is to handle CLI\n * options except `--config`.\n * - `loadFile(filePath, options)`\n * Create a `ConfigArray` instance from a config file. This is to handle\n * `--config` option. If the file was not found, throws the following error:\n * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error.\n * - If the filename was `package.json`, an IO error or an\n * `ESLINT_CONFIG_FIELD_NOT_FOUND` error.\n * - Otherwise, an IO error such as `ENOENT`.\n * - `loadInDirectory(directoryPath, options)`\n * Create a `ConfigArray` instance from a config file which is on a given\n * directory. This tries to load `.eslintrc.*` or `package.json`. If not\n * found, returns an empty `ConfigArray`.\n * - `loadESLintIgnore(filePath)`\n * Create a `ConfigArray` instance from a config file that is `.eslintignore`\n * format. This is to handle `--ignore-path` option.\n * - `loadDefaultESLintIgnore()`\n * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in\n * the current working directory.\n *\n * `ConfigArrayFactory` class has the responsibility that loads configuration\n * files, including loading `extends`, `parser`, and `plugins`. The created\n * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`.\n *\n * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class\n * handles cascading and hierarchy.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport fs from \"fs\";\nimport importFresh from \"import-fresh\";\nimport { createRequire } from \"module\";\nimport path from \"path\";\nimport stripComments from \"strip-json-comments\";\n\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern,\n OverrideTester\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\n\nconst require = createRequire(import.meta.url);\n\nconst debug = debugOrig(\"eslintrc:config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\nconst configFilenames = [\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.yaml\",\n \".eslintrc.yml\",\n \".eslintrc.json\",\n \".eslintrc\",\n \"package.json\"\n];\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").OverrideConfigData} OverrideConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {import(\"./config-array/config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-array/config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {ConfigArray[0]} ConfigArrayElement */\n\n/**\n * @typedef {Object} ConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {string} [cwd] The path to the current working directory.\n * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryInternalSlots\n * @property {Map} additionalPluginPool The map for additional plugins.\n * @property {string} cwd The path to the current working directory.\n * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {string} pluginBasePath The base path to resolve plugins.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/** @type {WeakMap} */\nconst normalizedPlugins = new WeakMap();\n\n/**\n * Check if a given string is a file path.\n * @param {string} nameOrPath A module name or file path.\n * @returns {boolean} `true` if the `nameOrPath` is a file path.\n */\nfunction isFilePath(nameOrPath) {\n return (\n /^\\.{1,2}[/\\\\]/u.test(nameOrPath) ||\n path.isAbsolute(nameOrPath)\n );\n}\n\n/**\n * Convenience wrapper for synchronously reading file contents.\n * @param {string} filePath The filename to read.\n * @returns {string} The file contents, with the BOM removed.\n * @private\n */\nfunction readFile(filePath) {\n return fs.readFileSync(filePath, \"utf8\").replace(/^\\ufeff/u, \"\");\n}\n\n/**\n * Loads a YAML configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadYAMLConfigFile(filePath) {\n debug(`Loading YAML config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n\n // empty YAML file can be null, so always use\n return yaml.load(readFile(filePath)) || {};\n } catch (e) {\n debug(`Error reading YAML file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JSON configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSONConfigFile(filePath) {\n debug(`Loading JSON config file: ${filePath}`);\n\n try {\n return JSON.parse(stripComments(readFile(filePath)));\n } catch (e) {\n debug(`Error reading JSON file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n e.messageTemplate = \"failed-to-read-json\";\n e.messageData = {\n path: filePath,\n message: e.message\n };\n throw e;\n }\n}\n\n/**\n * Loads a legacy (.eslintrc) configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadLegacyConfigFile(filePath) {\n debug(`Loading legacy config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};\n } catch (e) {\n debug(\"Error reading YAML file: %s\\n%o\", filePath, e);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JavaScript configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSConfigFile(filePath) {\n debug(`Loading JS config file: ${filePath}`);\n try {\n return importFresh(filePath);\n } catch (e) {\n debug(`Error reading JavaScript file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a configuration from a package.json file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadPackageJSONConfigFile(filePath) {\n debug(`Loading package.json config file: ${filePath}`);\n try {\n const packageData = loadJSONConfigFile(filePath);\n\n if (!Object.hasOwnProperty.call(packageData, \"eslintConfig\")) {\n throw Object.assign(\n new Error(\"package.json file doesn't have 'eslintConfig' field.\"),\n { code: \"ESLINT_CONFIG_FIELD_NOT_FOUND\" }\n );\n }\n\n return packageData.eslintConfig;\n } catch (e) {\n debug(`Error reading package.json file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a `.eslintignore` from a file.\n * @param {string} filePath The filename to load.\n * @returns {string[]} The ignore patterns from the file.\n * @private\n */\nfunction loadESLintIgnoreFile(filePath) {\n debug(`Loading .eslintignore file: ${filePath}`);\n\n try {\n return readFile(filePath)\n .split(/\\r?\\n/gu)\n .filter(line => line.trim() !== \"\" && !line.startsWith(\"#\"));\n } catch (e) {\n debug(`Error reading .eslintignore file: ${filePath}`);\n e.message = `Cannot read .eslintignore file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Creates an error to notify about a missing config to extend from.\n * @param {string} configName The name of the missing config.\n * @param {string} importerName The name of the config that imported the missing config\n * @param {string} messageTemplate The text template to source error strings from.\n * @returns {Error} The error object to throw\n * @private\n */\nfunction configInvalidError(configName, importerName, messageTemplate) {\n return Object.assign(\n new Error(`Failed to load config \"${configName}\" to extend from.`),\n {\n messageTemplate,\n messageData: { configName, importerName }\n }\n );\n}\n\n/**\n * Loads a configuration file regardless of the source. Inspects the file path\n * to determine the correctly way to load the config file.\n * @param {string} filePath The path to the configuration.\n * @returns {ConfigData|null} The configuration information.\n * @private\n */\nfunction loadConfigFile(filePath) {\n switch (path.extname(filePath)) {\n case \".js\":\n case \".cjs\":\n return loadJSConfigFile(filePath);\n\n case \".json\":\n if (path.basename(filePath) === \"package.json\") {\n return loadPackageJSONConfigFile(filePath);\n }\n return loadJSONConfigFile(filePath);\n\n case \".yaml\":\n case \".yml\":\n return loadYAMLConfigFile(filePath);\n\n default:\n return loadLegacyConfigFile(filePath);\n }\n}\n\n/**\n * Write debug log.\n * @param {string} request The requested module name.\n * @param {string} relativeTo The file path to resolve the request relative to.\n * @param {string} filePath The resolved file path.\n * @returns {void}\n */\nfunction writeDebugLogForLoading(request, relativeTo, filePath) {\n /* istanbul ignore next */\n if (debug.enabled) {\n let nameAndVersion = null;\n\n try {\n const packageJsonPath = ModuleResolver.resolve(\n `${request}/package.json`,\n relativeTo\n );\n const { version = \"unknown\" } = require(packageJsonPath);\n\n nameAndVersion = `${request}@${version}`;\n } catch (error) {\n debug(\"package.json was not found:\", error.message);\n nameAndVersion = request;\n }\n\n debug(\"Loaded: %s (%s)\", nameAndVersion, filePath);\n }\n}\n\n/**\n * Create a new context with default values.\n * @param {ConfigArrayFactoryInternalSlots} slots The internal slots.\n * @param {\"config\" | \"ignore\" | \"implicit-processor\" | undefined} providedType The type of the current configuration. Default is `\"config\"`.\n * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.\n * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string.\n * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`.\n * @returns {ConfigArrayFactoryLoadingContext} The created context.\n */\nfunction createContext(\n { cwd, resolvePluginsRelativeTo },\n providedType,\n providedName,\n providedFilePath,\n providedMatchBasePath\n) {\n const filePath = providedFilePath\n ? path.resolve(cwd, providedFilePath)\n : \"\";\n const matchBasePath =\n (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const name =\n providedName ||\n (filePath && path.relative(cwd, filePath)) ||\n \"\";\n const pluginBasePath =\n resolvePluginsRelativeTo ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const type = providedType || \"config\";\n\n return { filePath, matchBasePath, name, pluginBasePath, type };\n}\n\n/**\n * Normalize a given plugin.\n * - Ensure the object to have four properties: configs, environments, processors, and rules.\n * - Ensure the object to not have other properties.\n * @param {Plugin} plugin The plugin to normalize.\n * @returns {Plugin} The normalized plugin.\n */\nfunction normalizePlugin(plugin) {\n\n // first check the cache\n let normalizedPlugin = normalizedPlugins.get(plugin);\n\n if (normalizedPlugin) {\n return normalizedPlugin;\n }\n\n normalizedPlugin = {\n configs: plugin.configs || {},\n environments: plugin.environments || {},\n processors: plugin.processors || {},\n rules: plugin.rules || {}\n };\n\n // save the reference for later\n normalizedPlugins.set(plugin, normalizedPlugin);\n\n return normalizedPlugin;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The factory of `ConfigArray` objects.\n */\nclass ConfigArrayFactory {\n\n /**\n * Initialize this instance.\n * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.\n */\n constructor({\n additionalPluginPool = new Map(),\n cwd = process.cwd(),\n resolvePluginsRelativeTo,\n builtInRules,\n resolver = ModuleResolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = {}) {\n internalSlotsMap.set(this, {\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo:\n resolvePluginsRelativeTo &&\n path.resolve(cwd, resolvePluginsRelativeTo),\n builtInRules,\n resolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n });\n }\n\n /**\n * Create `ConfigArray` instance from a config data.\n * @param {ConfigData|null} configData The config data to create.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.filePath] The path to this config data.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n create(configData, { basePath, filePath, name } = {}) {\n if (!configData) {\n return new ConfigArray();\n }\n\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n const elements = this._normalizeConfigData(configData, ctx);\n\n return new ConfigArray(...elements);\n }\n\n /**\n * Load a config file.\n * @param {string} filePath The path to a config file.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n loadFile(filePath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n\n return new ConfigArray(...this._loadConfigData(ctx));\n }\n\n /**\n * Load the config file on a given directory if exists.\n * @param {string} directoryPath The path to a directory.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadInDirectory(directoryPath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n\n for (const filename of configFilenames) {\n const ctx = createContext(\n slots,\n \"config\",\n name,\n path.join(directoryPath, filename),\n basePath\n );\n\n if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) {\n let configData;\n\n try {\n configData = loadConfigFile(ctx.filePath);\n } catch (error) {\n if (!error || error.code !== \"ESLINT_CONFIG_FIELD_NOT_FOUND\") {\n throw error;\n }\n }\n\n if (configData) {\n debug(`Config file found: ${ctx.filePath}`);\n return new ConfigArray(\n ...this._normalizeConfigData(configData, ctx)\n );\n }\n }\n }\n\n debug(`Config file not found on ${directoryPath}`);\n return new ConfigArray();\n }\n\n /**\n * Check if a config file on a given directory exists or not.\n * @param {string} directoryPath The path to a directory.\n * @returns {string | null} The path to the found config file. If not found then null.\n */\n static getPathToConfigFileInDirectory(directoryPath) {\n for (const filename of configFilenames) {\n const filePath = path.join(directoryPath, filename);\n\n if (fs.existsSync(filePath)) {\n if (filename === \"package.json\") {\n try {\n loadPackageJSONConfigFile(filePath);\n return filePath;\n } catch { /* ignore */ }\n } else {\n return filePath;\n }\n }\n }\n return null;\n }\n\n /**\n * Load `.eslintignore` file.\n * @param {string} filePath The path to a `.eslintignore` file to load.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadESLintIgnore(filePath) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(\n slots,\n \"ignore\",\n void 0,\n filePath,\n slots.cwd\n );\n const ignorePatterns = loadESLintIgnoreFile(ctx.filePath);\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)\n );\n }\n\n /**\n * Load `.eslintignore` file in the current working directory.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadDefaultESLintIgnore() {\n const slots = internalSlotsMap.get(this);\n const eslintIgnorePath = path.resolve(slots.cwd, \".eslintignore\");\n const packageJsonPath = path.resolve(slots.cwd, \"package.json\");\n\n if (fs.existsSync(eslintIgnorePath)) {\n return this.loadESLintIgnore(eslintIgnorePath);\n }\n if (fs.existsSync(packageJsonPath)) {\n const data = loadJSONConfigFile(packageJsonPath);\n\n if (Object.hasOwnProperty.call(data, \"eslintIgnore\")) {\n if (!Array.isArray(data.eslintIgnore)) {\n throw new Error(\"Package.json eslintIgnore property requires an array of paths\");\n }\n const ctx = createContext(\n slots,\n \"ignore\",\n \"eslintIgnore in package.json\",\n packageJsonPath,\n slots.cwd\n );\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)\n );\n }\n }\n\n return new ConfigArray();\n }\n\n /**\n * Load a given config file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} Loaded config.\n * @private\n */\n _loadConfigData(ctx) {\n return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx);\n }\n\n /**\n * Normalize a given `.eslintignore` data to config array elements.\n * @param {string[]} ignorePatterns The patterns to ignore files.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeESLintIgnoreData(ignorePatterns, ctx) {\n const elements = this._normalizeObjectConfigData(\n { ignorePatterns },\n ctx\n );\n\n // Set `ignorePattern.loose` flag for backward compatibility.\n for (const element of elements) {\n if (element.ignorePattern) {\n element.ignorePattern.loose = true;\n }\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _normalizeConfigData(configData, ctx) {\n const validator = new ConfigValidator();\n\n validator.validateConfigSchema(configData, ctx.name || ctx.filePath);\n return this._normalizeObjectConfigData(configData, ctx);\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData|OverrideConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigData(configData, ctx) {\n const { files, excludedFiles, ...configBody } = configData;\n const criteria = OverrideTester.create(\n files,\n excludedFiles,\n ctx.matchBasePath\n );\n const elements = this._normalizeObjectConfigDataBody(configBody, ctx);\n\n // Apply the criteria to every element.\n for (const element of elements) {\n\n /*\n * Merge the criteria.\n * This is for the `overrides` entries that came from the\n * configurations of `overrides[].extends`.\n */\n element.criteria = OverrideTester.and(criteria, element.criteria);\n\n /*\n * Remove `root` property to ignore `root` settings which came from\n * `extends` in `overrides`.\n */\n if (element.criteria) {\n element.root = void 0;\n }\n\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigDataBody(\n {\n env,\n extends: extend,\n globals,\n ignorePatterns,\n noInlineConfig,\n parser: parserName,\n parserOptions,\n plugins: pluginList,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings,\n overrides: overrideList = []\n },\n ctx\n ) {\n const extendList = Array.isArray(extend) ? extend : [extend];\n const ignorePattern = ignorePatterns && new IgnorePattern(\n Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],\n ctx.matchBasePath\n );\n\n // Flatten `extends`.\n for (const extendName of extendList.filter(Boolean)) {\n yield* this._loadExtends(extendName, ctx);\n }\n\n // Load parser & plugins.\n const parser = parserName && this._loadParser(parserName, ctx);\n const plugins = pluginList && this._loadPlugins(pluginList, ctx);\n\n // Yield pseudo config data for file extension processors.\n if (plugins) {\n yield* this._takeFileExtensionProcessors(plugins, ctx);\n }\n\n // Yield the config data except `extends` and `overrides`.\n yield {\n\n // Debug information.\n type: ctx.type,\n name: ctx.name,\n filePath: ctx.filePath,\n\n // Config data.\n criteria: null,\n env,\n globals,\n ignorePattern,\n noInlineConfig,\n parser,\n parserOptions,\n plugins,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings\n };\n\n // Flatten `overries`.\n for (let i = 0; i < overrideList.length; ++i) {\n yield* this._normalizeObjectConfigData(\n overrideList[i],\n { ...ctx, name: `${ctx.name}#overrides[${i}]` }\n );\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtends(extendName, ctx) {\n debug(\"Loading {extends:%j} relative to %s\", extendName, ctx.filePath);\n try {\n if (extendName.startsWith(\"eslint:\")) {\n return this._loadExtendedBuiltInConfig(extendName, ctx);\n }\n if (extendName.startsWith(\"plugin:\")) {\n return this._loadExtendedPluginConfig(extendName, ctx);\n }\n return this._loadExtendedShareableConfig(extendName, ctx);\n } catch (error) {\n error.message += `\\nReferenced from: ${ctx.filePath || ctx.name}`;\n throw error;\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedBuiltInConfig(extendName, ctx) {\n const {\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = internalSlotsMap.get(this);\n\n if (extendName === \"eslint:recommended\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintRecommendedConfig) {\n if (typeof getEslintRecommendedConfig !== \"function\") {\n throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`);\n }\n return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintRecommendedPath\n });\n }\n if (extendName === \"eslint:all\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintAllConfig) {\n if (typeof getEslintAllConfig !== \"function\") {\n throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`);\n }\n return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintAllPath\n });\n }\n\n throw configInvalidError(extendName, ctx.name, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedPluginConfig(extendName, ctx) {\n const slashIndex = extendName.lastIndexOf(\"/\");\n\n if (slashIndex === -1) {\n throw configInvalidError(extendName, ctx.filePath, \"plugin-invalid\");\n }\n\n const pluginName = extendName.slice(\"plugin:\".length, slashIndex);\n const configName = extendName.slice(slashIndex + 1);\n\n if (isFilePath(pluginName)) {\n throw new Error(\"'extends' cannot use a file path for plugins.\");\n }\n\n const plugin = this._loadPlugin(pluginName, ctx);\n const configData =\n plugin.definition &&\n plugin.definition.configs[configName];\n\n if (configData) {\n return this._normalizeConfigData(configData, {\n ...ctx,\n filePath: plugin.filePath || ctx.filePath,\n name: `${ctx.name} » plugin:${plugin.id}/${configName}`\n });\n }\n\n throw plugin.error || configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedShareableConfig(extendName, ctx) {\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n let request;\n\n if (isFilePath(extendName)) {\n request = extendName;\n } else if (extendName.startsWith(\".\")) {\n request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior.\n } else {\n request = naming.normalizePackageName(\n extendName,\n \"eslint-config\"\n );\n }\n\n let filePath;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (error) {\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n throw configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n throw error;\n }\n\n writeDebugLogForLoading(request, relativeTo, filePath);\n return this._loadConfigData({\n ...ctx,\n filePath,\n name: `${ctx.name} » ${request}`\n });\n }\n\n /**\n * Load given plugins.\n * @param {string[]} names The plugin names to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {Record} The loaded parser.\n * @private\n */\n _loadPlugins(names, ctx) {\n return names.reduce((map, name) => {\n if (isFilePath(name)) {\n throw new Error(\"Plugins array cannot includes file paths.\");\n }\n const plugin = this._loadPlugin(name, ctx);\n\n map[plugin.id] = plugin;\n\n return map;\n }, {});\n }\n\n /**\n * Load a given parser.\n * @param {string} nameOrPath The package name or the path to a parser file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentParser} The loaded parser.\n */\n _loadParser(nameOrPath, ctx) {\n debug(\"Loading parser %j from %s\", nameOrPath, ctx.filePath);\n\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n\n try {\n const filePath = resolver.resolve(nameOrPath, relativeTo);\n\n writeDebugLogForLoading(nameOrPath, relativeTo, filePath);\n\n return new ConfigDependency({\n definition: require(filePath),\n filePath,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (error) {\n\n // If the parser name is \"espree\", load the espree of ESLint.\n if (nameOrPath === \"espree\") {\n debug(\"Fallback espree.\");\n return new ConfigDependency({\n definition: require(\"espree\"),\n filePath: require.resolve(\"espree\"),\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n debug(\"Failed to load parser '%s' declared in '%s'.\", nameOrPath, ctx.name);\n error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;\n\n return new ConfigDependency({\n error,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n }\n\n /**\n * Load a given plugin.\n * @param {string} name The plugin name to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentPlugin} The loaded plugin.\n * @private\n */\n _loadPlugin(name, ctx) {\n debug(\"Loading plugin %j from %s\", name, ctx.filePath);\n\n const { additionalPluginPool, resolver } = internalSlotsMap.get(this);\n const request = naming.normalizePackageName(name, \"eslint-plugin\");\n const id = naming.getShorthandName(request, \"eslint-plugin\");\n const relativeTo = path.join(ctx.pluginBasePath, \"__placeholder__.js\");\n\n if (name.match(/\\s+/u)) {\n const error = Object.assign(\n new Error(`Whitespace found in plugin name '${name}'`),\n {\n messageTemplate: \"whitespace-found\",\n messageData: { pluginName: request }\n }\n );\n\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n // Check for additional pool.\n const plugin =\n additionalPluginPool.get(request) ||\n additionalPluginPool.get(id);\n\n if (plugin) {\n return new ConfigDependency({\n definition: normalizePlugin(plugin),\n filePath: \"\", // It's unknown where the plugin came from.\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n let filePath;\n let error;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (resolveError) {\n error = resolveError;\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n error.messageTemplate = \"plugin-missing\";\n error.messageData = {\n pluginName: request,\n resolvePluginsRelativeTo: ctx.pluginBasePath,\n importerName: ctx.name\n };\n }\n }\n\n if (filePath) {\n try {\n writeDebugLogForLoading(request, relativeTo, filePath);\n\n const startTime = Date.now();\n const pluginDefinition = require(filePath);\n\n debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);\n\n return new ConfigDependency({\n definition: normalizePlugin(pluginDefinition),\n filePath,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (loadError) {\n error = loadError;\n }\n }\n\n debug(\"Failed to load plugin '%s' declared in '%s'.\", name, ctx.name);\n error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`;\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n /**\n * Take file expression processors as config array elements.\n * @param {Record} plugins The plugin definitions.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The config array elements of file expression processors.\n * @private\n */\n *_takeFileExtensionProcessors(plugins, ctx) {\n for (const pluginId of Object.keys(plugins)) {\n const processors =\n plugins[pluginId] &&\n plugins[pluginId].definition &&\n plugins[pluginId].definition.processors;\n\n if (!processors) {\n continue;\n }\n\n for (const processorId of Object.keys(processors)) {\n if (processorId.startsWith(\".\")) {\n yield* this._normalizeObjectConfigData(\n {\n files: [`*${processorId}`],\n processor: `${pluginId}/${processorId}`\n },\n {\n ...ctx,\n type: \"implicit-processor\",\n name: `${ctx.name}#processors[\"${pluginId}/${processorId}\"]`\n }\n );\n }\n }\n }\n }\n}\n\nexport { ConfigArrayFactory, createContext };\n","/**\n * @fileoverview `CascadingConfigArrayFactory` class.\n *\n * `CascadingConfigArrayFactory` class has a responsibility:\n *\n * 1. Handles cascading of config files.\n *\n * It provides two methods:\n *\n * - `getConfigArrayForFile(filePath)`\n * Get the corresponded configuration of a given file. This method doesn't\n * throw even if the given file didn't exist.\n * - `clearCache()`\n * Clear the internal cache. You have to call this method when\n * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends\n * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.)\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport os from \"os\";\nimport path from \"path\";\n\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport { emitDeprecationWarning } from \"./shared/deprecation-warnings.js\";\n\nconst debug = debugOrig(\"eslintrc:cascading-config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {ReturnType} ConfigArray */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {ConfigData} [baseConfig] The config by `baseConfig` option.\n * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.\n * @property {string} [cwd] The base directory to start lookup.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]} [rulePaths] The value of `--rulesdir` option.\n * @property {string} [specificConfigPath] The value of `--config` option.\n * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryInternalSlots\n * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option.\n * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`.\n * @property {ConfigArray} cliConfigArray The config array of CLI options.\n * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`.\n * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays.\n * @property {Map} configCache The cache from directory paths to config arrays.\n * @property {string} cwd The base directory to start lookup.\n * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.\n * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.\n * @property {boolean} useEslintrc if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Create the config array from `baseConfig` and `rulePaths`.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createBaseConfigArray({\n configArrayFactory,\n baseConfigData,\n rulePaths,\n cwd,\n loadRules\n}) {\n const baseConfigArray = configArrayFactory.create(\n baseConfigData,\n { name: \"BaseConfig\" }\n );\n\n /*\n * Create the config array element for the default ignore patterns.\n * This element has `ignorePattern` property that ignores the default\n * patterns in the current working directory.\n */\n baseConfigArray.unshift(configArrayFactory.create(\n { ignorePatterns: IgnorePattern.DefaultPatterns },\n { name: \"DefaultIgnorePattern\" }\n )[0]);\n\n /*\n * Load rules `--rulesdir` option as a pseudo plugin.\n * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate\n * the rule's options with only information in the config array.\n */\n if (rulePaths && rulePaths.length > 0) {\n baseConfigArray.push({\n type: \"config\",\n name: \"--rulesdir\",\n filePath: \"\",\n plugins: {\n \"\": new ConfigDependency({\n definition: {\n rules: rulePaths.reduce(\n (map, rulesPath) => Object.assign(\n map,\n loadRules(rulesPath, cwd)\n ),\n {}\n )\n },\n filePath: \"\",\n id: \"\",\n importerName: \"--rulesdir\",\n importerPath: \"\"\n })\n }\n });\n }\n\n return baseConfigArray;\n}\n\n/**\n * Create the config array from CLI options.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n}) {\n const cliConfigArray = configArrayFactory.create(\n cliConfigData,\n { name: \"CLIOptions\" }\n );\n\n cliConfigArray.unshift(\n ...(ignorePath\n ? configArrayFactory.loadESLintIgnore(ignorePath)\n : configArrayFactory.loadDefaultESLintIgnore())\n );\n\n if (specificConfigPath) {\n cliConfigArray.unshift(\n ...configArrayFactory.loadFile(\n specificConfigPath,\n { name: \"--config\", basePath: cwd }\n )\n );\n }\n\n return cliConfigArray;\n}\n\n/**\n * The error type when there are files matched by a glob, but all of them have been ignored.\n */\nclass ConfigurationNotFoundError extends Error {\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @param {string} directoryPath The directory path.\n */\n constructor(directoryPath) {\n super(`No ESLint configuration found in ${directoryPath}.`);\n this.messageTemplate = \"no-config-found\";\n this.messageData = { directoryPath };\n }\n}\n\n/**\n * This class provides the functionality that enumerates every file which is\n * matched by given glob patterns and that configuration.\n */\nclass CascadingConfigArrayFactory {\n\n /**\n * Initialize this enumerator.\n * @param {CascadingConfigArrayFactoryOptions} options The options.\n */\n constructor({\n additionalPluginPool = new Map(),\n baseConfig: baseConfigData = null,\n cliConfig: cliConfigData = null,\n cwd = process.cwd(),\n ignorePath,\n resolvePluginsRelativeTo,\n rulePaths = [],\n specificConfigPath = null,\n useEslintrc = true,\n builtInRules = new Map(),\n loadRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n } = {}) {\n const configArrayFactory = new ConfigArrayFactory({\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo,\n builtInRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n });\n\n internalSlotsMap.set(this, {\n baseConfigArray: createBaseConfigArray({\n baseConfigData,\n configArrayFactory,\n cwd,\n rulePaths,\n loadRules\n }),\n baseConfigData,\n cliConfigArray: createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n }),\n cliConfigData,\n configArrayFactory,\n configCache: new Map(),\n cwd,\n finalizeCache: new WeakMap(),\n ignorePath,\n rulePaths,\n specificConfigPath,\n useEslintrc,\n builtInRules,\n loadRules\n });\n }\n\n /**\n * The path to the current working directory.\n * This is used by tests.\n * @type {string}\n */\n get cwd() {\n const { cwd } = internalSlotsMap.get(this);\n\n return cwd;\n }\n\n /**\n * Get the config array of a given file.\n * If `filePath` was not given, it returns the config which contains only\n * `baseConfigData` and `cliConfigData`.\n * @param {string} [filePath] The file path to a file.\n * @param {Object} [options] The options.\n * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The config array of the file.\n */\n getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {\n const {\n baseConfigArray,\n cliConfigArray,\n cwd\n } = internalSlotsMap.get(this);\n\n if (!filePath) {\n return new ConfigArray(...baseConfigArray, ...cliConfigArray);\n }\n\n const directoryPath = path.dirname(path.resolve(cwd, filePath));\n\n debug(`Load config files for ${directoryPath}.`);\n\n return this._finalizeConfigArray(\n this._loadConfigInAncestors(directoryPath),\n directoryPath,\n ignoreNotFoundError\n );\n }\n\n /**\n * Set the config data to override all configs.\n * Require to call `clearCache()` method after this method is called.\n * @param {ConfigData} configData The config data to override all configs.\n * @returns {void}\n */\n setOverrideConfig(configData) {\n const slots = internalSlotsMap.get(this);\n\n slots.cliConfigData = configData;\n }\n\n /**\n * Clear config cache.\n * @returns {void}\n */\n clearCache() {\n const slots = internalSlotsMap.get(this);\n\n slots.baseConfigArray = createBaseConfigArray(slots);\n slots.cliConfigArray = createCLIConfigArray(slots);\n slots.configCache.clear();\n }\n\n /**\n * Load and normalize config files from the ancestor directories.\n * @param {string} directoryPath The path to a leaf directory.\n * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) {\n const {\n baseConfigArray,\n configArrayFactory,\n configCache,\n cwd,\n useEslintrc\n } = internalSlotsMap.get(this);\n\n if (!useEslintrc) {\n return baseConfigArray;\n }\n\n let configArray = configCache.get(directoryPath);\n\n // Hit cache.\n if (configArray) {\n debug(`Cache hit: ${directoryPath}.`);\n return configArray;\n }\n debug(`No cache found: ${directoryPath}.`);\n\n const homePath = os.homedir();\n\n // Consider this is root.\n if (directoryPath === homePath && cwd !== homePath) {\n debug(\"Stop traversing because of considered root.\");\n if (configsExistInSubdirs) {\n const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath);\n\n if (filePath) {\n emitDeprecationWarning(\n filePath,\n \"ESLINT_PERSONAL_CONFIG_SUPPRESS\"\n );\n }\n }\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n\n // Load the config on this directory.\n try {\n configArray = configArrayFactory.loadInDirectory(directoryPath);\n } catch (error) {\n /* istanbul ignore next */\n if (error.code === \"EACCES\") {\n debug(\"Stop traversing because of 'EACCES' error.\");\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n throw error;\n }\n\n if (configArray.length > 0 && configArray.isRoot()) {\n debug(\"Stop traversing because of 'root:true'.\");\n configArray.unshift(...baseConfigArray);\n return this._cacheConfig(directoryPath, configArray);\n }\n\n // Load from the ancestors and merge it.\n const parentPath = path.dirname(directoryPath);\n const parentConfigArray = parentPath && parentPath !== directoryPath\n ? this._loadConfigInAncestors(\n parentPath,\n configsExistInSubdirs || configArray.length > 0\n )\n : baseConfigArray;\n\n if (configArray.length > 0) {\n configArray.unshift(...parentConfigArray);\n } else {\n configArray = parentConfigArray;\n }\n\n // Cache and return.\n return this._cacheConfig(directoryPath, configArray);\n }\n\n /**\n * Freeze and cache a given config.\n * @param {string} directoryPath The path to a directory as a cache key.\n * @param {ConfigArray} configArray The config array as a cache value.\n * @returns {ConfigArray} The `configArray` (frozen).\n */\n _cacheConfig(directoryPath, configArray) {\n const { configCache } = internalSlotsMap.get(this);\n\n Object.freeze(configArray);\n configCache.set(directoryPath, configArray);\n\n return configArray;\n }\n\n /**\n * Finalize a given config array.\n * Concatenate `--config` and other CLI options.\n * @param {ConfigArray} configArray The parent config array.\n * @param {string} directoryPath The path to the leaf directory to find config files.\n * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {\n const {\n cliConfigArray,\n configArrayFactory,\n finalizeCache,\n useEslintrc,\n builtInRules\n } = internalSlotsMap.get(this);\n\n let finalConfigArray = finalizeCache.get(configArray);\n\n if (!finalConfigArray) {\n finalConfigArray = configArray;\n\n // Load the personal config if there are no regular config files.\n if (\n useEslintrc &&\n configArray.every(c => !c.filePath) &&\n cliConfigArray.every(c => !c.filePath) // `--config` option can be a file.\n ) {\n const homePath = os.homedir();\n\n debug(\"Loading the config file of the home directory:\", homePath);\n\n const personalConfigArray = configArrayFactory.loadInDirectory(\n homePath,\n { name: \"PersonalConfig\" }\n );\n\n if (\n personalConfigArray.length > 0 &&\n !directoryPath.startsWith(homePath)\n ) {\n const lastElement =\n personalConfigArray[personalConfigArray.length - 1];\n\n emitDeprecationWarning(\n lastElement.filePath,\n \"ESLINT_PERSONAL_CONFIG_LOAD\"\n );\n }\n\n finalConfigArray = finalConfigArray.concat(personalConfigArray);\n }\n\n // Apply CLI options.\n if (cliConfigArray.length > 0) {\n finalConfigArray = finalConfigArray.concat(cliConfigArray);\n }\n\n // Validate rule settings and environments.\n const validator = new ConfigValidator({\n builtInRules\n });\n\n validator.validateConfigArray(finalConfigArray);\n\n // Cache it.\n Object.freeze(finalConfigArray);\n finalizeCache.set(configArray, finalConfigArray);\n\n debug(\n \"Configuration was determined: %o on %s\",\n finalConfigArray,\n directoryPath\n );\n }\n\n // At least one element (the default ignore patterns) exists.\n if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {\n throw new ConfigurationNotFoundError(directoryPath);\n }\n\n return finalConfigArray;\n }\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport { CascadingConfigArrayFactory };\n","/**\n * @fileoverview Compatibility class for flat config.\n * @author Nicholas C. Zakas\n */\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nimport createDebug from \"debug\";\nimport path from \"path\";\n\nimport environments from \"../conf/environments.js\";\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n\nconst debug = createDebug(\"eslintrc:flat-compat\");\nconst cafactory = Symbol(\"cafactory\");\n\n/**\n * Translates an ESLintRC-style config object into a flag-config-style config\n * object.\n * @param {Object} eslintrcConfig An ESLintRC-style config object.\n * @param {Object} options Options to help translate the config.\n * @param {string} options.resolveConfigRelativeTo To the directory to resolve\n * configs from.\n * @param {string} options.resolvePluginsRelativeTo The directory to resolve\n * plugins from.\n * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment\n * names to objects.\n * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor\n * names to objects.\n * @returns {Object} A flag-config-style config object.\n */\nfunction translateESLintRC(eslintrcConfig, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo,\n pluginEnvironments,\n pluginProcessors\n}) {\n\n const flatConfig = {};\n const configs = [];\n const languageOptions = {};\n const linterOptions = {};\n const keysToCopy = [\"settings\", \"rules\", \"processor\"];\n const languageOptionsKeysToCopy = [\"globals\", \"parser\", \"parserOptions\"];\n const linterOptionsKeysToCopy = [\"noInlineConfig\", \"reportUnusedDisableDirectives\"];\n\n // copy over simple translations\n for (const key of keysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig[key] = eslintrcConfig[key];\n }\n }\n\n // copy over languageOptions\n for (const key of languageOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n\n // create the languageOptions key in the flat config\n flatConfig.languageOptions = languageOptions;\n\n if (key === \"parser\") {\n debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`);\n\n if (eslintrcConfig[key].error) {\n throw eslintrcConfig[key].error;\n }\n\n languageOptions[key] = eslintrcConfig[key].definition;\n continue;\n }\n\n // clone any object values that are in the eslintrc config\n if (eslintrcConfig[key] && typeof eslintrcConfig[key] === \"object\") {\n languageOptions[key] = {\n ...eslintrcConfig[key]\n };\n } else {\n languageOptions[key] = eslintrcConfig[key];\n }\n }\n }\n\n // copy over linterOptions\n for (const key of linterOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig.linterOptions = linterOptions;\n linterOptions[key] = eslintrcConfig[key];\n }\n }\n\n // move ecmaVersion a level up\n if (languageOptions.parserOptions) {\n\n if (\"ecmaVersion\" in languageOptions.parserOptions) {\n languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion;\n delete languageOptions.parserOptions.ecmaVersion;\n }\n\n if (\"sourceType\" in languageOptions.parserOptions) {\n languageOptions.sourceType = languageOptions.parserOptions.sourceType;\n delete languageOptions.parserOptions.sourceType;\n }\n\n // check to see if we even need parserOptions anymore and remove it if not\n if (Object.keys(languageOptions.parserOptions).length === 0) {\n delete languageOptions.parserOptions;\n }\n }\n\n // overrides\n if (eslintrcConfig.criteria) {\n flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)];\n }\n\n // translate plugins\n if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === \"object\") {\n debug(`Translating plugins: ${eslintrcConfig.plugins}`);\n\n flatConfig.plugins = {};\n\n for (const pluginName of Object.keys(eslintrcConfig.plugins)) {\n\n debug(`Translating plugin: ${pluginName}`);\n debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`);\n\n const { definition: plugin, error } = eslintrcConfig.plugins[pluginName];\n\n if (error) {\n throw error;\n }\n\n flatConfig.plugins[pluginName] = plugin;\n\n // create a config for any processors\n if (plugin.processors) {\n for (const processorName of Object.keys(plugin.processors)) {\n if (processorName.startsWith(\".\")) {\n debug(`Assigning processor: ${pluginName}/${processorName}`);\n\n configs.unshift({\n files: [`**/*${processorName}`],\n processor: pluginProcessors.get(`${pluginName}/${processorName}`)\n });\n }\n\n }\n }\n }\n }\n\n // translate env - must come after plugins\n if (eslintrcConfig.env && typeof eslintrcConfig.env === \"object\") {\n for (const envName of Object.keys(eslintrcConfig.env)) {\n\n // only add environments that are true\n if (eslintrcConfig.env[envName]) {\n debug(`Translating environment: ${envName}`);\n\n if (environments.has(envName)) {\n\n // built-in environments should be defined first\n configs.unshift(...translateESLintRC(environments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n } else if (pluginEnvironments.has(envName)) {\n\n // if the environment comes from a plugin, it should come after the plugin config\n configs.push(...translateESLintRC(pluginEnvironments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n }\n }\n }\n }\n\n // only add if there are actually keys in the config\n if (Object.keys(flatConfig).length > 0) {\n configs.push(flatConfig);\n }\n\n return configs;\n}\n\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * A compatibility class for working with configs.\n */\nclass FlatCompat {\n\n constructor({\n baseDirectory = process.cwd(),\n resolvePluginsRelativeTo = baseDirectory,\n recommendedConfig,\n allConfig\n } = {}) {\n this.baseDirectory = baseDirectory;\n this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;\n this[cafactory] = new ConfigArrayFactory({\n cwd: baseDirectory,\n resolvePluginsRelativeTo,\n getEslintAllConfig: () => {\n\n if (!allConfig) {\n throw new TypeError(\"Missing parameter 'allConfig' in FlatCompat constructor.\");\n }\n\n return allConfig;\n },\n getEslintRecommendedConfig: () => {\n\n if (!recommendedConfig) {\n throw new TypeError(\"Missing parameter 'recommendedConfig' in FlatCompat constructor.\");\n }\n\n return recommendedConfig;\n }\n });\n }\n\n /**\n * Translates an ESLintRC-style config into a flag-config-style config.\n * @param {Object} eslintrcConfig The ESLintRC-style config object.\n * @returns {Object} A flag-config-style config object.\n */\n config(eslintrcConfig) {\n const eslintrcArray = this[cafactory].create(eslintrcConfig, {\n basePath: this.baseDirectory\n });\n\n const flatArray = [];\n let hasIgnorePatterns = false;\n\n eslintrcArray.forEach(configData => {\n if (configData.type === \"config\") {\n hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern;\n flatArray.push(...translateESLintRC(configData, {\n resolveConfigRelativeTo: path.join(this.baseDirectory, \"__placeholder.js\"),\n resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, \"__placeholder.js\"),\n pluginEnvironments: eslintrcArray.pluginEnvironments,\n pluginProcessors: eslintrcArray.pluginProcessors\n }));\n }\n });\n\n // combine ignorePatterns to emulate ESLintRC behavior better\n if (hasIgnorePatterns) {\n flatArray.unshift({\n ignores: [filePath => {\n\n // Compute the final config for this file.\n // This filters config array elements by `files`/`excludedFiles` then merges the elements.\n const finalConfig = eslintrcArray.extractConfig(filePath);\n\n // Test the `ignorePattern` properties of the final config.\n return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath);\n }]\n });\n }\n\n return flatArray;\n }\n\n /**\n * Translates the `env` section of an ESLintRC-style config.\n * @param {Object} envConfig The `env` section of an ESLintRC config.\n * @returns {Object[]} An array of flag-config objects representing the environments.\n */\n env(envConfig) {\n return this.config({\n env: envConfig\n });\n }\n\n /**\n * Translates the `extends` section of an ESLintRC-style config.\n * @param {...string} configsToExtend The names of the configs to load.\n * @returns {Object[]} An array of flag-config objects representing the config.\n */\n extends(...configsToExtend) {\n return this.config({\n extends: configsToExtend\n });\n }\n\n /**\n * Translates the `plugins` section of an ESLintRC-style config.\n * @param {...string} plugins The names of the plugins to load.\n * @returns {Object[]} An array of flag-config objects representing the plugins.\n */\n plugins(...plugins) {\n return this.config({\n plugins\n });\n }\n}\n\nexport { FlatCompat };\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport {\n ConfigArrayFactory,\n createContext as createConfigArrayFactoryContext\n} from \"./config-array-factory.js\";\n\nimport { CascadingConfigArrayFactory } from \"./cascading-config-array-factory.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array/index.js\";\nimport { ConfigDependency } from \"./config-array/config-dependency.js\";\nimport { ExtractedConfig } from \"./config-array/extracted-config.js\";\nimport { IgnorePattern } from \"./config-array/ignore-pattern.js\";\nimport { OverrideTester } from \"./config-array/override-tester.js\";\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport { FlatCompat } from \"./flat-compat.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n ConfigArray,\n createConfigArrayFactoryContext,\n CascadingConfigArrayFactory,\n ConfigArrayFactory,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs,\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n ModuleResolver,\n naming\n};\n\nexport {\n\n Legacy,\n\n FlatCompat\n\n};\n"],"names":["debug","debugOrig","path","ignore","assert","internalSlotsMap","util","minimatch","Ajv","globals","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal","Module","require","createRequire","fs","stripComments","importFresh","ModuleResolver.resolve","naming.normalizePackageName","naming.getShorthandName","os","createDebug","createConfigArrayFactoryContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yBAAyB,CAAC,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,WAAW,EAAE;AAC5C,IAAI,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAChC;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;AACjD,QAAQ,MAAM,CAAC,GAAG,M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AACA;AACA;AACA;AAsBA;AACA,MAAMC,SAAO,GAAGC,oBAAa,CAAC,mDAAe,CAAC,CAAC;AAC/C;AACA,MAAMd,OAAK,GAAGC,6BAAS,CAAC,+BAA+B,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG;AACxB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,kBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC;AACA;AACA,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAE,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,UAAU,EAAE;AAChC,IAAI;AACJ,QAAQ,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC;AACzC,QAAQH,wBAAI,CAAC,UAAU,CAAC,UAAU,CAAC;AACnC,MAAM;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,QAAQ,EAAE;AAC5B,IAAI,OAAOa,sBAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kBAAkB,CAAC,QAAQ,EAAE;AACtC,IAAIf,OAAK,CAAC,CAAC,0B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AA4B,IAAI,EAAE,oBAAoB;AACtD,4BAA4B,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;AACxF,yBAAyB;AACzB,qBAAqB,CAAC;AACtB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AC1nCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yCAAyC,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC;AAC/B,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,SAAS;AACb,CAAC,EAAE;AACH,IAAI,MAAM,eAAe,GAAG,kBAAkB,CAAC,MAAM;AACrD,QAAQ,cAAc;AACtB,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE;AAC9B,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM;AACrD,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,eAAe,EAAE;AACzD,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE;AACxC,KAAK,CAAC,CAAC,CAAC,CAAC,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AAS,CAAC,CAAC;AACX,KAAK;AACL;;ACrTA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACK,MAAC,MAAM,GAAG;AACf,IAAI,WAAW;AACf,qCAAIqB,aAA+B;AACnC,IAAI,2BAA2B;AAC/B,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,uBAAuB;AAC3B,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,MAAM;AACV;;;;;"} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js index c991c24b6..597352e43 100644 --- a/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +++ b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js @@ -17,19 +17,25 @@ * * @author Toru Nagashima */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const os = require("os"); -const path = require("path"); -const ConfigValidator = require("./shared/config-validator"); -const { emitDeprecationWarning } = require("./shared/deprecation-warnings"); -const { ConfigArrayFactory } = require("./config-array-factory"); -const { ConfigArray, ConfigDependency, IgnorePattern } = require("./config-array"); -const debug = require("debug")("eslintrc:cascading-config-array-factory"); +import debugOrig from "debug"; +import os from "os"; +import path from "path"; + +import { ConfigArrayFactory } from "./config-array-factory.js"; +import { + ConfigArray, + ConfigDependency, + IgnorePattern +} from "./config-array/index.js"; +import ConfigValidator from "./shared/config-validator.js"; +import { emitDeprecationWarning } from "./shared/deprecation-warnings.js"; + +const debug = debugOrig("eslintrc:cascading-config-array-factory"); //------------------------------------------------------------------------------ // Helpers @@ -56,7 +62,9 @@ const debug = require("debug")("eslintrc:cascading-config-array-factory"); * @property {Map} builtInRules The rules that are built in to ESLint. * @property {Object} [resolver=ModuleResolver] The module resolver object. * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. */ /** @@ -77,7 +85,9 @@ const debug = require("debug")("eslintrc:cascading-config-array-factory"); * @property {Map} builtInRules The rules that are built in to ESLint. * @property {Object} [resolver=ModuleResolver] The module resolver object. * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. */ /** @type {WeakMap} */ @@ -218,7 +228,9 @@ class CascadingConfigArrayFactory { loadRules, resolver, eslintRecommendedPath, - eslintAllPath + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig } = {}) { const configArrayFactory = new ConfigArrayFactory({ additionalPluginPool, @@ -227,7 +239,9 @@ class CascadingConfigArrayFactory { builtInRules, resolver, eslintRecommendedPath, - eslintAllPath + getEslintRecommendedConfig, + eslintAllPath, + getEslintAllConfig }); internalSlotsMap.set(this, { @@ -236,8 +250,7 @@ class CascadingConfigArrayFactory { configArrayFactory, cwd, rulePaths, - loadRules, - resolver + loadRules }), baseConfigData, cliConfigArray: createCLIConfigArray({ @@ -516,4 +529,4 @@ class CascadingConfigArrayFactory { // Public Interface //------------------------------------------------------------------------------ -module.exports = { CascadingConfigArrayFactory }; +export { CascadingConfigArrayFactory }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js index c7ff6a09a..99851e15f 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array-factory.js +++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js @@ -33,26 +33,31 @@ * * @author Toru Nagashima */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const fs = require("fs"); -const path = require("path"); -const importFresh = require("import-fresh"); -const stripComments = require("strip-json-comments"); -const ConfigValidator = require("./shared/config-validator"); -const naming = require("./shared/naming"); -const ModuleResolver = require("./shared/relative-module-resolver"); -const { +import debugOrig from "debug"; +import fs from "fs"; +import importFresh from "import-fresh"; +import { createRequire } from "module"; +import path from "path"; +import stripComments from "strip-json-comments"; + +import { ConfigArray, ConfigDependency, IgnorePattern, OverrideTester -} = require("./config-array"); -const debug = require("debug")("eslintrc:config-array-factory"); +} from "./config-array/index.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import * as ModuleResolver from "./shared/relative-module-resolver.js"; + +const require = createRequire(import.meta.url); + +const debug = debugOrig("eslintrc:config-array-factory"); //------------------------------------------------------------------------------ // Helpers @@ -86,7 +91,9 @@ const configFilenames = [ * @property {Map} builtInRules The rules that are built in to ESLint. * @property {Object} [resolver=ModuleResolver] The module resolver object. * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. */ /** @@ -97,7 +104,9 @@ const configFilenames = [ * @property {Map} builtInRules The rules that are built in to ESLint. * @property {Object} [resolver=ModuleResolver] The module resolver object. * @property {string} eslintAllPath The path to the definitions for eslint:all. + * @property {Function} getEslintAllConfig Returns the config data for eslint:all. * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended. + * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended. */ /** @@ -120,6 +129,9 @@ const configFilenames = [ /** @type {WeakMap} */ const internalSlotsMap = new WeakMap(); +/** @type {WeakMap} */ +const normalizedPlugins = new WeakMap(); + /** * Check if a given string is a file path. * @param {string} nameOrPath A module name or file path. @@ -158,7 +170,7 @@ function loadYAMLConfigFile(filePath) { try { // empty YAML file can be null, so always use - return yaml.safeLoad(readFile(filePath)) || {}; + return yaml.load(readFile(filePath)) || {}; } catch (e) { debug(`Error reading YAML file: ${filePath}`); e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; @@ -204,7 +216,7 @@ function loadLegacyConfigFile(filePath) { const yaml = require("js-yaml"); try { - return yaml.safeLoad(stripComments(readFile(filePath))) || /* istanbul ignore next */ {}; + return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {}; } catch (e) { debug("Error reading YAML file: %s\n%o", filePath, e); e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; @@ -396,12 +408,25 @@ function createContext( * @returns {Plugin} The normalized plugin. */ function normalizePlugin(plugin) { - return { + + // first check the cache + let normalizedPlugin = normalizedPlugins.get(plugin); + + if (normalizedPlugin) { + return normalizedPlugin; + } + + normalizedPlugin = { configs: plugin.configs || {}, environments: plugin.environments || {}, processors: plugin.processors || {}, rules: plugin.rules || {} }; + + // save the reference for later + normalizedPlugins.set(plugin, normalizedPlugin); + + return normalizedPlugin; } //------------------------------------------------------------------------------ @@ -424,7 +449,9 @@ class ConfigArrayFactory { builtInRules, resolver = ModuleResolver, eslintAllPath, - eslintRecommendedPath + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig } = {}) { internalSlotsMap.set(this, { additionalPluginPool, @@ -435,7 +462,9 @@ class ConfigArrayFactory { builtInRules, resolver, eslintAllPath, - eslintRecommendedPath + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig }); } @@ -495,7 +524,7 @@ class ConfigArrayFactory { basePath ); - if (fs.existsSync(ctx.filePath)) { + if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) { let configData; try { @@ -793,20 +822,41 @@ class ConfigArrayFactory { * @private */ _loadExtendedBuiltInConfig(extendName, ctx) { - const { eslintAllPath, eslintRecommendedPath } = internalSlotsMap.get(this); + const { + eslintAllPath, + getEslintAllConfig, + eslintRecommendedPath, + getEslintRecommendedConfig + } = internalSlotsMap.get(this); if (extendName === "eslint:recommended") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintRecommendedConfig) { + if (typeof getEslintRecommendedConfig !== "function") { + throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`); + } + return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: "" }); + } return this._loadConfigData({ ...ctx, - filePath: eslintRecommendedPath, - name: `${ctx.name} » ${extendName}` + name, + filePath: eslintRecommendedPath }); } if (extendName === "eslint:all") { + const name = `${ctx.name} » ${extendName}`; + + if (getEslintAllConfig) { + if (typeof getEslintAllConfig !== "function") { + throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`); + } + return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: "" }); + } return this._loadConfigData({ ...ctx, - filePath: eslintAllPath, - name: `${ctx.name} » ${extendName}` + name, + filePath: eslintAllPath }); } @@ -922,11 +972,11 @@ class ConfigArrayFactory { _loadParser(nameOrPath, ctx) { debug("Loading parser %j from %s", nameOrPath, ctx.filePath); - const { cwd } = internalSlotsMap.get(this); + const { cwd, resolver } = internalSlotsMap.get(this); const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); try { - const filePath = ModuleResolver.resolve(nameOrPath, relativeTo); + const filePath = resolver.resolve(nameOrPath, relativeTo); writeDebugLogForLoading(nameOrPath, relativeTo, filePath); @@ -973,7 +1023,7 @@ class ConfigArrayFactory { _loadPlugin(name, ctx) { debug("Loading plugin %j from %s", name, ctx.filePath); - const { additionalPluginPool } = internalSlotsMap.get(this); + const { additionalPluginPool, resolver } = internalSlotsMap.get(this); const request = naming.normalizePackageName(name, "eslint-plugin"); const id = naming.getShorthandName(request, "eslint-plugin"); const relativeTo = path.join(ctx.pluginBasePath, "__placeholder__.js"); @@ -1014,7 +1064,7 @@ class ConfigArrayFactory { let error; try { - filePath = ModuleResolver.resolve(request, relativeTo); + filePath = resolver.resolve(request, relativeTo); } catch (resolveError) { error = resolveError; /* istanbul ignore else */ @@ -1096,4 +1146,4 @@ class ConfigArrayFactory { } } -module.exports = { ConfigArrayFactory, createContext }; +export { ConfigArrayFactory, createContext }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-array.js b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js index 42a736273..133f5a242 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js @@ -24,14 +24,13 @@ * * @author Toru Nagashima */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const { ExtractedConfig } = require("./extracted-config"); -const { IgnorePattern } = require("./ignore-pattern"); +import { ExtractedConfig } from "./extracted-config.js"; +import { IgnorePattern } from "./ignore-pattern.js"; //------------------------------------------------------------------------------ // Helpers @@ -504,21 +503,21 @@ class ConfigArray extends Array { } } -const exportObject = { - ConfigArray, +/** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ +function getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap.get(instance); - /** - * Get the used extracted configs. - * CLIEngine will use this method to collect used deprecated rules. - * @param {ConfigArray} instance The config array object to get. - * @returns {ExtractedConfig[]} The used extracted configs. - * @private - */ - getUsedExtractedConfigs(instance) { - const { cache } = internalSlotsMap.get(instance); + return Array.from(cache.values()); +} - return Array.from(cache.values()); - } -}; -module.exports = exportObject; +export { + ConfigArray, + getUsedExtractedConfigs +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js index 0d5f6f713..2883c3a2a 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js @@ -14,9 +14,8 @@ * * @author Toru Nagashima */ -"use strict"; -const util = require("util"); +import util from "util"; /** * The class is to store parsers or plugins. @@ -113,4 +112,4 @@ class ConfigDependency { /** @typedef {ConfigDependency} DependentParser */ /** @typedef {ConfigDependency} DependentPlugin */ -module.exports = { ConfigDependency }; +export { ConfigDependency }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js index b27d6ffb1..e93b0b67b 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +++ b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js @@ -14,9 +14,8 @@ * * @author Toru Nagashima */ -"use strict"; -const { IgnorePattern } = require("./ignore-pattern"); +import { IgnorePattern } from "./ignore-pattern.js"; // For VSCode intellisense /** @typedef {import("../../shared/types").ConfigData} ConfigData */ @@ -143,4 +142,4 @@ class ExtractedConfig { } } -module.exports = { ExtractedConfig }; +export { ExtractedConfig }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js index 4c16278ee..3022ba9f4 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +++ b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js @@ -27,16 +27,17 @@ * * @author Toru Nagashima */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const assert = require("assert"); -const path = require("path"); -const ignore = require("ignore"); -const debug = require("debug")("eslintrc:ignore-pattern"); +import assert from "assert"; +import path from "path"; +import ignore from "ignore"; +import debugOrig from "debug"; + +const debug = debugOrig("eslintrc:ignore-pattern"); /** @typedef {ReturnType} Ignore */ @@ -155,8 +156,8 @@ class IgnorePattern { const patterns = [].concat( ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath)) ); - const ig = ignore().add([...DotPatterns, ...patterns]); - const dotIg = ignore().add(patterns); + const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]); + const dotIg = ignore({ allowRelativePaths: true }).add(patterns); debug(" processed: %o", { basePath, patterns }); @@ -234,4 +235,4 @@ class IgnorePattern { } } -module.exports = { IgnorePattern }; +export { IgnorePattern }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/index.js b/node_modules/@eslint/eslintrc/lib/config-array/index.js index 928d76c83..647f02b74 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array/index.js +++ b/node_modules/@eslint/eslintrc/lib/config-array/index.js @@ -2,15 +2,14 @@ * @fileoverview `ConfigArray` class. * @author Toru Nagashima */ -"use strict"; -const { ConfigArray, getUsedExtractedConfigs } = require("./config-array"); -const { ConfigDependency } = require("./config-dependency"); -const { ExtractedConfig } = require("./extracted-config"); -const { IgnorePattern } = require("./ignore-pattern"); -const { OverrideTester } = require("./override-tester"); +import { ConfigArray, getUsedExtractedConfigs } from "./config-array.js"; +import { ConfigDependency } from "./config-dependency.js"; +import { ExtractedConfig } from "./extracted-config.js"; +import { IgnorePattern } from "./ignore-pattern.js"; +import { OverrideTester } from "./override-tester.js"; -module.exports = { +export { ConfigArray, ConfigDependency, ExtractedConfig, diff --git a/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js index e7ba1202f..460aafcf8 100644 --- a/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +++ b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js @@ -16,12 +16,14 @@ * * @author Toru Nagashima */ -"use strict"; -const assert = require("assert"); -const path = require("path"); -const util = require("util"); -const { Minimatch } = require("minimatch"); +import assert from "assert"; +import path from "path"; +import util from "util"; +import minimatch from "minimatch"; + +const { Minimatch } = minimatch; + const minimatchOpts = { dot: true, matchBase: true }; /** @@ -220,4 +222,4 @@ class OverrideTester { } } -module.exports = { OverrideTester }; +export { OverrideTester }; diff --git a/node_modules/@eslint/eslintrc/lib/flat-compat.js b/node_modules/@eslint/eslintrc/lib/flat-compat.js index c0d0ea228..821d008ad 100644 --- a/node_modules/@eslint/eslintrc/lib/flat-compat.js +++ b/node_modules/@eslint/eslintrc/lib/flat-compat.js @@ -3,16 +3,15 @@ * @author Nicholas C. Zakas */ -"use strict"; - //----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- -const path = require("path"); -const environments = require("../conf/environments"); -const createDebug = require("debug"); -const { ConfigArrayFactory } = require("./config-array-factory"); +import createDebug from "debug"; +import path from "path"; + +import environments from "../conf/environments.js"; +import { ConfigArrayFactory } from "./config-array-factory.js"; //----------------------------------------------------------------------------- // Helpers @@ -54,17 +53,6 @@ function translateESLintRC(eslintrcConfig, { const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; - // check for special settings for eslint:all and eslint:recommended: - if (eslintrcConfig.settings) { - if (eslintrcConfig.settings["eslint:all"] === true) { - return ["eslint:all"]; - } - - if (eslintrcConfig.settings["eslint:recommended"] === true) { - return ["eslint:recommended"]; - } - } - // copy over simple translations for (const key of keysToCopy) { if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { @@ -216,15 +204,31 @@ class FlatCompat { constructor({ baseDirectory = process.cwd(), - resolvePluginsRelativeTo = baseDirectory + resolvePluginsRelativeTo = baseDirectory, + recommendedConfig, + allConfig } = {}) { this.baseDirectory = baseDirectory; this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; this[cafactory] = new ConfigArrayFactory({ cwd: baseDirectory, resolvePluginsRelativeTo, - eslintAllPath: path.resolve(__dirname, "../conf/eslint-all.js"), - eslintRecommendedPath: path.resolve(__dirname, "../conf/eslint-recommended.js") + getEslintAllConfig: () => { + + if (!allConfig) { + throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor."); + } + + return allConfig; + }, + getEslintRecommendedConfig: () => { + + if (!recommendedConfig) { + throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor."); + } + + return recommendedConfig; + } }); } @@ -274,7 +278,7 @@ class FlatCompat { /** * Translates the `env` section of an ESLintRC-style config. * @param {Object} envConfig The `env` section of an ESLintRC config. - * @returns {Object} A flag-config object representing the environments. + * @returns {Object[]} An array of flag-config objects representing the environments. */ env(envConfig) { return this.config({ @@ -285,7 +289,7 @@ class FlatCompat { /** * Translates the `extends` section of an ESLintRC-style config. * @param {...string} configsToExtend The names of the configs to load. - * @returns {Object} A flag-config object representing the config. + * @returns {Object[]} An array of flag-config objects representing the config. */ extends(...configsToExtend) { return this.config({ @@ -296,7 +300,7 @@ class FlatCompat { /** * Translates the `plugins` section of an ESLintRC-style config. * @param {...string} plugins The names of the plugins to load. - * @returns {Object} A flag-config object representing the plugins. + * @returns {Object[]} An array of flag-config objects representing the plugins. */ plugins(...plugins) { return this.config({ @@ -305,4 +309,4 @@ class FlatCompat { } } -exports.FlatCompat = FlatCompat; +export { FlatCompat }; diff --git a/node_modules/@eslint/eslintrc/lib/index-universal.js b/node_modules/@eslint/eslintrc/lib/index-universal.js new file mode 100644 index 000000000..6f6b30265 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/index-universal.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import * as ConfigOps from "./shared/config-ops.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import environments from "../conf/environments.js"; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +const Legacy = { + environments, + + // shared + ConfigOps, + ConfigValidator, + naming +}; + +export { + Legacy +}; diff --git a/node_modules/@eslint/eslintrc/lib/index.js b/node_modules/@eslint/eslintrc/lib/index.js index 3e8dd90e6..9e3d13f5f 100644 --- a/node_modules/@eslint/eslintrc/lib/index.js +++ b/node_modules/@eslint/eslintrc/lib/index.js @@ -2,52 +2,54 @@ * @fileoverview Package exports for @eslint/eslintrc * @author Nicholas C. Zakas */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const { +import { ConfigArrayFactory, - createContext: createConfigArrayFactoryContext -} = require("./config-array-factory"); - -const { CascadingConfigArrayFactory } = require("./cascading-config-array-factory"); -const { ModuleResolver } = require("./shared/relative-module-resolver"); -const { ConfigArray, getUsedExtractedConfigs } = require("./config-array"); -const { ConfigDependency } = require("./config-array/config-dependency"); -const { ExtractedConfig } = require("./config-array/extracted-config"); -const { IgnorePattern } = require("./config-array/ignore-pattern"); -const { OverrideTester } = require("./config-array/override-tester"); -const ConfigOps = require("./shared/config-ops"); -const ConfigValidator = require("./shared/config-validator"); -const naming = require("./shared/naming"); -const { FlatCompat } = require("./flat-compat"); + createContext as createConfigArrayFactoryContext +} from "./config-array-factory.js"; + +import { CascadingConfigArrayFactory } from "./cascading-config-array-factory.js"; +import * as ModuleResolver from "./shared/relative-module-resolver.js"; +import { ConfigArray, getUsedExtractedConfigs } from "./config-array/index.js"; +import { ConfigDependency } from "./config-array/config-dependency.js"; +import { ExtractedConfig } from "./config-array/extracted-config.js"; +import { IgnorePattern } from "./config-array/ignore-pattern.js"; +import { OverrideTester } from "./config-array/override-tester.js"; +import * as ConfigOps from "./shared/config-ops.js"; +import ConfigValidator from "./shared/config-validator.js"; +import * as naming from "./shared/naming.js"; +import { FlatCompat } from "./flat-compat.js"; +import environments from "../conf/environments.js"; //----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- -module.exports = { - - Legacy: { - ConfigArray, - createConfigArrayFactoryContext, - CascadingConfigArrayFactory, - ConfigArrayFactory, - ConfigDependency, - ExtractedConfig, - IgnorePattern, - OverrideTester, - getUsedExtractedConfigs, - - // shared - ConfigOps, - ConfigValidator, - ModuleResolver, - naming - }, +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; + +export { + + Legacy, FlatCompat diff --git a/node_modules/@eslint/eslintrc/lib/shared/ajv.js b/node_modules/@eslint/eslintrc/lib/shared/ajv.js index 3fb0fbdd3..b79ad36c3 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/ajv.js +++ b/node_modules/@eslint/eslintrc/lib/shared/ajv.js @@ -2,20 +2,177 @@ * @fileoverview The instance of Ajv validator. * @author Evgeny Poberezkin */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const Ajv = require("ajv"), - metaSchema = require("ajv/lib/refs/json-schema-draft-04.json"); +import Ajv from "ajv"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/* + * Copied from ajv/lib/refs/json-schema-draft-04.json + * The MIT License (MIT) + * Copyright (c) 2015-2017 Evgeny Poberezkin + */ +const metaSchema = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string" + }, + $schema: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: { }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + items: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/schemaArray" } + ], + default: { } + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [ + { type: "boolean" }, + { $ref: "#" } + ], + default: { } + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: { } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { $ref: "#" }, + { $ref: "#/definitions/stringArray" } + ] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: { } +}; //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ -module.exports = (additionalOptions = {}) => { +export default (additionalOptions = {}) => { const ajv = new Ajv({ meta: false, useDefaults: true, diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-ops.js b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js index 3b4d5699d..d203be0e0 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +++ b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js @@ -3,7 +3,6 @@ * so no Node-specific code can be here. * @author Nicholas C. Zakas */ -"use strict"; //------------------------------------------------------------------------------ // Private @@ -20,111 +19,117 @@ const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], // Public Interface //------------------------------------------------------------------------------ -module.exports = { - - /** - * Normalizes the severity value of a rule's configuration to a number - * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally - * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), - * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array - * whose first element is one of the above values. Strings are matched case-insensitively. - * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. - */ - getRuleSeverity(ruleConfig) { - const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; - - if (severityValue === 0 || severityValue === 1 || severityValue === 2) { - return severityValue; - } - - if (typeof severityValue === "string") { - return RULE_SEVERITY[severityValue.toLowerCase()] || 0; - } - - return 0; - }, - - /** - * Converts old-style severity settings (0, 1, 2) into new-style - * severity settings (off, warn, error) for all rules. Assumption is that severity - * values have already been validated as correct. - * @param {Object} config The config object to normalize. - * @returns {void} - */ - normalizeToStrings(config) { - - if (config.rules) { - Object.keys(config.rules).forEach(ruleId => { - const ruleConfig = config.rules[ruleId]; - - if (typeof ruleConfig === "number") { - config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; - } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { - ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; - } - }); - } - }, - - /** - * Determines if the severity for the given rule configuration represents an error. - * @param {int|string|Array} ruleConfig The configuration for an individual rule. - * @returns {boolean} True if the rule represents an error, false if not. - */ - isErrorSeverity(ruleConfig) { - return module.exports.getRuleSeverity(ruleConfig) === 2; - }, - - /** - * Checks whether a given config has valid severity or not. - * @param {number|string|Array} ruleConfig The configuration for an individual rule. - * @returns {boolean} `true` if the configuration has valid severity. - */ - isValidSeverity(ruleConfig) { - let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; - - if (typeof severity === "string") { - severity = severity.toLowerCase(); - } - return VALID_SEVERITIES.indexOf(severity) !== -1; - }, - - /** - * Checks whether every rule of a given config has valid severity or not. - * @param {Object} config The configuration for rules. - * @returns {boolean} `true` if the configuration has valid severity. - */ - isEverySeverityValid(config) { - return Object.keys(config).every(ruleId => this.isValidSeverity(config[ruleId])); - }, - - /** - * Normalizes a value for a global in a config - * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in - * a global directive comment - * @returns {("readable"|"writeable"|"off")} The value normalized as a string - * @throws Error if global value is invalid - */ - normalizeConfigGlobal(configuredValue) { - switch (configuredValue) { - case "off": - return "off"; - - case true: - case "true": - case "writeable": - case "writable": - return "writable"; - - case null: - case false: - case "false": - case "readable": - case "readonly": - return "readonly"; - - default: - throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); - } +/** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; +} + +/** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ +function normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } +} + +/** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ +function isErrorSeverity(ruleConfig) { + return getRuleSeverity(ruleConfig) === 2; +} + +/** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; +} + +/** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ +function isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId])); +} + +/** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ +function normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); } +} + +export { + getRuleSeverity, + normalizeToStrings, + isErrorSeverity, + isValidSeverity, + isEverySeverityValid, + normalizeConfigGlobal }; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-validator.js b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js index dbc6f3f38..32174a56b 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +++ b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js @@ -3,20 +3,21 @@ * @author Brandon Mills */ -"use strict"; +/* eslint class-methods-use-this: "off" */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const - util = require("util"), - configSchema = require("../../conf/config-schema"), - BuiltInEnvironments = require("../../conf/environments"), - ConfigOps = require("./config-ops"), - { emitDeprecationWarning } = require("./deprecation-warnings"); +import util from "util"; +import * as ConfigOps from "./config-ops.js"; +import { emitDeprecationWarning } from "./deprecation-warnings.js"; +import ajvOrig from "./ajv.js"; +import configSchema from "../../conf/config-schema.js"; +import BuiltInEnvironments from "../../conf/environments.js"; + +const ajv = ajvOrig(); -const ajv = require("./ajv")(); const ruleValidators = new WeakMap(); const noop = Function.prototype; @@ -36,7 +37,7 @@ const validated = new WeakSet(); // Exports //----------------------------------------------------------------------------- -module.exports = class ConfigValidator { +export default class ConfigValidator { constructor({ builtInRules = new Map() } = {}) { this.builtInRules = builtInRules; } @@ -321,4 +322,4 @@ module.exports = class ConfigValidator { } } -}; +} diff --git a/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js index 136fc255f..91907b137 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +++ b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js @@ -2,13 +2,12 @@ * @fileoverview Provide the function that emits deprecation warnings. * @author Toru Nagashima */ -"use strict"; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"); +import path from "path"; //------------------------------------------------------------------------------ // Private @@ -59,6 +58,6 @@ function emitDeprecationWarning(source, errorCode) { // Public Interface //------------------------------------------------------------------------------ -module.exports = { +export { emitDeprecationWarning }; diff --git a/node_modules/@eslint/eslintrc/lib/shared/naming.js b/node_modules/@eslint/eslintrc/lib/shared/naming.js index 32cff9453..93df5fc43 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/naming.js +++ b/node_modules/@eslint/eslintrc/lib/shared/naming.js @@ -1,7 +1,6 @@ /** * @fileoverview Common helpers for naming of plugins, formatters and configs */ -"use strict"; const NAMESPACE_REGEX = /^@.*\//iu; @@ -90,7 +89,7 @@ function getNamespaceFromTerm(term) { // Public Interface //------------------------------------------------------------------------------ -module.exports = { +export { normalizePackageName, getShorthandName, getNamespaceFromTerm diff --git a/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js index 80335c5cf..1df0ca807 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +++ b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js @@ -3,42 +3,40 @@ * @author Teddy Katz */ -"use strict"; - -const Module = require("module"); +import Module from "module"; /* * `Module.createRequire` is added in v12.2.0. It supports URL as well. * We only support the case where the argument is a filepath, not a URL. */ -// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api -const createRequire = Module.createRequire || Module.createRequireFromPath; - -module.exports = { +const createRequire = Module.createRequire; - /** - * Resolves a Node module relative to another module - * @param {string} moduleName The name of a Node module, or a path to a Node module. - * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be - * a file rather than a directory, but the file need not actually exist. - * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` - */ - resolve(moduleName, relativeToPath) { - try { - return createRequire(relativeToPath).resolve(moduleName); - } catch (error) { +/** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ +function resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { - // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. - if ( - typeof error === "object" && - error !== null && - error.code === "MODULE_NOT_FOUND" && - !error.requireStack && - error.message.includes(moduleName) - ) { - error.message += `\nRequire stack:\n- ${relativeToPath}`; - } - throw error; + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; } + throw error; } +} + +export { + resolve }; diff --git a/node_modules/@eslint/eslintrc/lib/shared/types.js b/node_modules/@eslint/eslintrc/lib/shared/types.js index d4ac14e26..a32c35e39 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/types.js +++ b/node_modules/@eslint/eslintrc/lib/shared/types.js @@ -2,10 +2,9 @@ * @fileoverview Define common types for input completion. * @author Toru Nagashima */ -"use strict"; /** @type {any} */ -module.exports = {}; +export default {}; /** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ /** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ diff --git a/node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml b/node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml new file mode 120000 index 000000000..9dbd010d4 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/node_modules/argparse/CHANGELOG.md b/node_modules/@eslint/eslintrc/node_modules/argparse/CHANGELOG.md new file mode 100644 index 000000000..dc39ed695 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/CHANGELOG.md @@ -0,0 +1,216 @@ +# 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). + + +## [2.0.1] - 2020-08-29 +### Fixed +- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150. + + +## [2.0.0] - 2020-08-14 +### Changed +- Full rewrite. Now port from python 3.9.0 & more precise following. + See [doc](./doc) for difference and migration info. +- node.js 10+ required +- Removed most of local docs in favour of original ones. + + +## [1.0.10] - 2018-02-15 +### Fixed +- Use .concat instead of + for arrays, #122. + + +## [1.0.9] - 2016-09-29 +### Changed +- Rerelease after 1.0.8 - deps cleanup. + + +## [1.0.8] - 2016-09-29 +### Changed +- Maintenance (deps bump, fix node 6.5+ tests, coverage report). + + +## [1.0.7] - 2016-03-17 +### Changed +- Teach `addArgument` to accept string arg names. #97, @tomxtobin. + + +## [1.0.6] - 2016-02-06 +### Changed +- Maintenance: moved to eslint & updated CS. + + +## [1.0.5] - 2016-02-05 +### Changed +- Removed lodash dependency to significantly reduce install size. + Thanks to @mourner. + + +## [1.0.4] - 2016-01-17 +### Changed +- Maintenance: lodash update to 4.0.0. + + +## [1.0.3] - 2015-10-27 +### Fixed +- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. + + +## [1.0.2] - 2015-03-22 +### Changed +- Relaxed lodash version dependency. + + +## [1.0.1] - 2015-02-20 +### Changed +- Changed dependencies to be compatible with ancient nodejs. + + +## [1.0.0] - 2015-02-19 +### Changed +- Maintenance release. +- Replaced `underscore` with `lodash`. +- Bumped version to 1.0.0 to better reflect semver meaning. +- HISTORY.md -> CHANGELOG.md + + +## [0.1.16] - 2013-12-01 +### Changed +- Maintenance release. Updated dependencies and docs. + + +## [0.1.15] - 2013-05-13 +### Fixed +- Fixed #55, @trebor89 + + +## [0.1.14] - 2013-05-12 +### Fixed +- Fixed #62, @maxtaco + + +## [0.1.13] - 2013-04-08 +### Changed +- Added `.npmignore` to reduce package size + + +## [0.1.12] - 2013-02-10 +### Fixed +- Fixed conflictHandler (#46), @hpaulj + + +## [0.1.11] - 2013-02-07 +### Added +- Added 70+ tests (ported from python), @hpaulj +- Added conflictHandler, @applepicke +- Added fromfilePrefixChar, @hpaulj + +### Fixed +- Multiple bugfixes, @hpaulj + + +## [0.1.10] - 2012-12-30 +### Added +- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) + support, thanks to @hpaulj + +### Fixed +- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj + + +## [0.1.9] - 2012-12-27 +### Fixed +- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj +- Fixed default value behavior with `*` positionals, thanks to @hpaulj +- Improve `getDefault()` behavior, thanks to @hpaulj +- Improve negative argument parsing, thanks to @hpaulj + + +## [0.1.8] - 2012-12-01 +### Fixed +- Fixed parser parents (issue #19), thanks to @hpaulj +- Fixed negative argument parse (issue #20), thanks to @hpaulj + + +## [0.1.7] - 2012-10-14 +### Fixed +- Fixed 'choices' argument parse (issue #16) +- Fixed stderr output (issue #15) + + +## [0.1.6] - 2012-09-09 +### Fixed +- Fixed check for conflict of options (thanks to @tomxtobin) + + +## [0.1.5] - 2012-09-03 +### Fixed +- Fix parser #setDefaults method (thanks to @tomxtobin) + + +## [0.1.4] - 2012-07-30 +### Fixed +- Fixed pseudo-argument support (thanks to @CGamesPlay) +- Fixed addHelp default (should be true), if not set (thanks to @benblank) + + +## [0.1.3] - 2012-06-27 +### Fixed +- Fixed formatter api name: Formatter -> HelpFormatter + + +## [0.1.2] - 2012-05-29 +### Fixed +- Removed excess whitespace in help +- Fixed error reporting, when parcer with subcommands + called with empty arguments + +### Added +- Added basic tests + + +## [0.1.1] - 2012-05-23 +### Fixed +- Fixed line wrapping in help formatter +- Added better error reporting on invalid arguments + + +## [0.1.0] - 2012-05-16 +### Added +- First release. + + +[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0 +[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10 +[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9 +[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8 +[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7 +[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6 +[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5 +[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4 +[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0 +[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16 +[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15 +[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14 +[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13 +[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12 +[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11 +[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10 +[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9 +[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8 +[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7 +[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6 +[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5 +[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4 +[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2 +[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1 +[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0 diff --git a/node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE b/node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE new file mode 100644 index 000000000..66a3ac80d --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE @@ -0,0 +1,254 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, 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/@eslint/eslintrc/node_modules/argparse/README.md b/node_modules/@eslint/eslintrc/node_modules/argparse/README.md new file mode 100644 index 000000000..550b5c9b7 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/README.md @@ -0,0 +1,84 @@ +argparse +======== + +[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) +[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) + +CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)). + +**Difference with original.** + +- JS has no keyword arguments support. + - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`. +- JS has no python's types `int`, `float`, ... + - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`. +- `%r` format specifier uses `require('util').inspect()`. + +More details in [doc](./doc). + + +Example +------- + +`test.js` file: + +```javascript +#!/usr/bin/env node +'use strict'; + +const { ArgumentParser } = require('argparse'); +const { version } = require('./package.json'); + +const parser = new ArgumentParser({ + description: 'Argparse example' +}); + +parser.add_argument('-v', '--version', { action: 'version', version }); +parser.add_argument('-f', '--foo', { help: 'foo bar' }); +parser.add_argument('-b', '--bar', { help: 'bar foo' }); +parser.add_argument('--baz', { help: 'baz bar' }); + +console.dir(parser.parse_args()); +``` + +Display help: + +``` +$ ./test.js -h +usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] + +Argparse example + +optional arguments: + -h, --help show this help message and exit + -v, --version show program's version number and exit + -f FOO, --foo FOO foo bar + -b BAR, --bar BAR bar foo + --baz BAZ baz bar +``` + +Parse arguments: + +``` +$ ./test.js -f=3 --bar=4 --baz 5 +{ foo: '3', bar: '4', baz: '5' } +``` + + +API docs +-------- + +Since this is a port with minimal divergence, there's no separate documentation. +Use original one instead, with notes about difference. + +1. [Original doc](https://docs.python.org/3.9/library/argparse.html). +2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html). +3. [Difference with python](./doc). + + +argparse for enterprise +----------------------- + +Available as part of the Tidelift Subscription + +The maintainers of argparse 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-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/@eslint/eslintrc/node_modules/argparse/argparse.js b/node_modules/@eslint/eslintrc/node_modules/argparse/argparse.js new file mode 100644 index 000000000..2b8c8c631 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/argparse.js @@ -0,0 +1,3707 @@ +// Port of python's argparse module, version 3.9.0: +// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py + +'use strict' + +// Copyright (C) 2010-2020 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors + +/* + * Command-line parsing library + * + * This module is an optparse-inspired command-line parsing library that: + * + * - handles both optional and positional arguments + * - produces highly informative usage messages + * - supports parsers that dispatch to sub-parsers + * + * The following is a simple usage example that sums integers from the + * command-line and writes the result to a file:: + * + * parser = argparse.ArgumentParser( + * description='sum the integers at the command line') + * parser.add_argument( + * 'integers', metavar='int', nargs='+', type=int, + * help='an integer to be summed') + * parser.add_argument( + * '--log', default=sys.stdout, type=argparse.FileType('w'), + * help='the file where the sum should be written') + * args = parser.parse_args() + * args.log.write('%s' % sum(args.integers)) + * args.log.close() + * + * The module contains the following public classes: + * + * - ArgumentParser -- The main entry point for command-line parsing. As the + * example above shows, the add_argument() method is used to populate + * the parser with actions for optional and positional arguments. Then + * the parse_args() method is invoked to convert the args at the + * command-line into an object with attributes. + * + * - ArgumentError -- The exception raised by ArgumentParser objects when + * there are errors with the parser's actions. Errors raised while + * parsing the command-line are caught by ArgumentParser and emitted + * as command-line messages. + * + * - FileType -- A factory for defining types of files to be created. As the + * example above shows, instances of FileType are typically passed as + * the type= argument of add_argument() calls. + * + * - Action -- The base class for parser actions. Typically actions are + * selected by passing strings like 'store_true' or 'append_const' to + * the action= argument of add_argument(). However, for greater + * customization of ArgumentParser actions, subclasses of Action may + * be defined and passed as the action= argument. + * + * - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, + * ArgumentDefaultsHelpFormatter -- Formatter classes which + * may be passed as the formatter_class= argument to the + * ArgumentParser constructor. HelpFormatter is the default, + * RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser + * not to change the formatting for help text, and + * ArgumentDefaultsHelpFormatter adds information about argument defaults + * to the help. + * + * All other classes in this module are considered implementation details. + * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only + * considered public as object names -- the API of the formatter objects is + * still considered an implementation detail.) + */ + +const SUPPRESS = '==SUPPRESS==' + +const OPTIONAL = '?' +const ZERO_OR_MORE = '*' +const ONE_OR_MORE = '+' +const PARSER = 'A...' +const REMAINDER = '...' +const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args' + + +// ================================== +// Utility functions used for porting +// ================================== +const assert = require('assert') +const util = require('util') +const fs = require('fs') +const sub = require('./lib/sub') +const path = require('path') +const repr = util.inspect + +function get_argv() { + // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.) + return process.argv.slice(1) +} + +function get_terminal_size() { + return { + columns: +process.env.COLUMNS || process.stdout.columns || 80 + } +} + +function hasattr(object, name) { + return Object.prototype.hasOwnProperty.call(object, name) +} + +function getattr(object, name, value) { + return hasattr(object, name) ? object[name] : value +} + +function setattr(object, name, value) { + object[name] = value +} + +function setdefault(object, name, value) { + if (!hasattr(object, name)) object[name] = value + return object[name] +} + +function delattr(object, name) { + delete object[name] +} + +function range(from, to, step=1) { + // range(10) is equivalent to range(0, 10) + if (arguments.length === 1) [ to, from ] = [ from, 0 ] + if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') { + throw new TypeError('argument cannot be interpreted as an integer') + } + if (step === 0) throw new TypeError('range() arg 3 must not be zero') + + let result = [] + if (step > 0) { + for (let i = from; i < to; i += step) result.push(i) + } else { + for (let i = from; i > to; i += step) result.push(i) + } + return result +} + +function splitlines(str, keepends = false) { + let result + if (!keepends) { + result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/) + } else { + result = [] + let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/) + for (let i = 0; i < parts.length; i += 2) { + result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : '')) + } + } + if (!result[result.length - 1]) result.pop() + return result +} + +function _string_lstrip(string, prefix_chars) { + let idx = 0 + while (idx < string.length && prefix_chars.includes(string[idx])) idx++ + return idx ? string.slice(idx) : string +} + +function _string_split(string, sep, maxsplit) { + let result = string.split(sep) + if (result.length > maxsplit) { + result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ]) + } + return result +} + +function _array_equal(array1, array2) { + if (array1.length !== array2.length) return false + for (let i = 0; i < array1.length; i++) { + if (array1[i] !== array2[i]) return false + } + return true +} + +function _array_remove(array, item) { + let idx = array.indexOf(item) + if (idx === -1) throw new TypeError(sub('%r not in list', item)) + array.splice(idx, 1) +} + +// normalize choices to array; +// this isn't required in python because `in` and `map` operators work with anything, +// but in js dealing with multiple types here is too clunky +function _choices_to_array(choices) { + if (choices === undefined) { + return [] + } else if (Array.isArray(choices)) { + return choices + } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') { + return Array.from(choices) + } else if (typeof choices === 'object' && choices !== null) { + return Object.keys(choices) + } else { + throw new Error(sub('invalid choices value: %r', choices)) + } +} + +// decorator that allows a class to be called without new +function _callable(cls) { + let result = { // object is needed for inferred class name + [cls.name]: function (...args) { + let this_class = new.target === result || !new.target + return Reflect.construct(cls, args, this_class ? cls : new.target) + } + } + result[cls.name].prototype = cls.prototype + // fix default tag for toString, e.g. [object Action] instead of [object Object] + cls.prototype[Symbol.toStringTag] = cls.name + return result[cls.name] +} + +function _alias(object, from, to) { + try { + let name = object.constructor.name + Object.defineProperty(object, from, { + value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()', + name, from, name, to)), + enumerable: false + }) + } catch {} +} + +// decorator that allows snake_case class methods to be called with camelCase and vice versa +function _camelcase_alias(_class) { + for (let name of Object.getOwnPropertyNames(_class.prototype)) { + let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (camelcase !== name) _alias(_class.prototype, camelcase, name) + } + return _class +} + +function _to_legacy_name(key) { + key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (key === 'default') key = 'defaultValue' + if (key === 'const') key = 'constant' + return key +} + +function _to_new_name(key) { + if (key === 'defaultValue') key = 'default' + if (key === 'constant') key = 'const' + key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase()) + return key +} + +// parse options +let no_default = Symbol('no_default_value') +function _parse_opts(args, descriptor) { + function get_name() { + let stack = new Error().stack.split('\n') + .map(x => x.match(/^ at (.*) \(.*\)$/)) + .filter(Boolean) + .map(m => m[1]) + .map(fn => fn.match(/[^ .]*$/)[0]) + + if (stack.length && stack[0] === get_name.name) stack.shift() + if (stack.length && stack[0] === _parse_opts.name) stack.shift() + return stack.length ? stack[0] : '' + } + + args = Array.from(args) + let kwargs = {} + let result = [] + let last_opt = args.length && args[args.length - 1] + + if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) && + (!last_opt.constructor || last_opt.constructor.name === 'Object')) { + kwargs = Object.assign({}, args.pop()) + } + + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(descriptor)) { + let old_name = _to_legacy_name(key) + if (old_name !== key && (old_name in kwargs)) { + if (key in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else { + kwargs[key] = kwargs[old_name] + } + renames.push([ old_name, key ]) + delete kwargs[old_name] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + + let missing_positionals = [] + let positional_count = args.length + + for (let [ key, def ] of Object.entries(descriptor)) { + if (key[0] === '*') { + if (key.length > 0 && key[1] === '*') { + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(kwargs)) { + let new_name = _to_new_name(key) + if (new_name !== key && (key in kwargs)) { + if (new_name in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name)) + } else { + kwargs[new_name] = kwargs[key] + } + renames.push([ key, new_name ]) + delete kwargs[key] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + result.push(kwargs) + kwargs = {} + } else { + result.push(args) + args = [] + } + } else if (key in kwargs && args.length > 0) { + throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else if (key in kwargs) { + result.push(kwargs[key]) + delete kwargs[key] + } else if (args.length > 0) { + result.push(args.shift()) + } else if (def !== no_default) { + result.push(def) + } else { + missing_positionals.push(key) + } + } + + if (Object.keys(kwargs).length) { + throw new TypeError(sub('%s() got an unexpected keyword argument %r', + get_name(), Object.keys(kwargs)[0])) + } + + if (args.length) { + let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length + let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length + throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given', + get_name(), + from === to ? sub('from %s to %s', from, to) : to, + from === to && to === 1 ? '' : 's', + positional_count, + positional_count === 1 ? 'was' : 'were')) + } + + if (missing_positionals.length) { + let strs = missing_positionals.map(repr) + if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1] + let str_joined = strs.join(strs.length === 2 ? '' : ', ') + throw new TypeError(sub('%s() missing %i required positional argument%s: %s', + get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined)) + } + + return result +} + +let _deprecations = {} +function deprecate(id, string) { + _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string) + _deprecations[id]() +} + + +// ============================= +// Utility functions and classes +// ============================= +function _AttributeHolder(cls = Object) { + /* + * Abstract base class that provides __repr__. + * + * The __repr__ method returns a string in the format:: + * ClassName(attr=name, attr=name, ...) + * The attributes are determined either by a class-level attribute, + * '_kwarg_names', or by inspecting the instance __dict__. + */ + + return class _AttributeHolder extends cls { + [util.inspect.custom]() { + let type_name = this.constructor.name + let arg_strings = [] + let star_args = {} + for (let arg of this._get_args()) { + arg_strings.push(repr(arg)) + } + for (let [ name, value ] of this._get_kwargs()) { + if (/^[a-z_][a-z0-9_$]*$/i.test(name)) { + arg_strings.push(sub('%s=%r', name, value)) + } else { + star_args[name] = value + } + } + if (Object.keys(star_args).length) { + arg_strings.push(sub('**%s', repr(star_args))) + } + return sub('%s(%s)', type_name, arg_strings.join(', ')) + } + + toString() { + return this[util.inspect.custom]() + } + + _get_kwargs() { + return Object.entries(this) + } + + _get_args() { + return [] + } + } +} + + +function _copy_items(items) { + if (items === undefined) { + return [] + } + return items.slice(0) +} + + +// =============== +// Formatting Help +// =============== +const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter { + /* + * Formatter for generating usage messages and argument help strings. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + constructor() { + let [ + prog, + indent_increment, + max_help_position, + width + ] = _parse_opts(arguments, { + prog: no_default, + indent_increment: 2, + max_help_position: 24, + width: undefined + }) + + // default setting for width + if (width === undefined) { + width = get_terminal_size().columns + width -= 2 + } + + this._prog = prog + this._indent_increment = indent_increment + this._max_help_position = Math.min(max_help_position, + Math.max(width - 20, indent_increment * 2)) + this._width = width + + this._current_indent = 0 + this._level = 0 + this._action_max_length = 0 + + this._root_section = this._Section(this, undefined) + this._current_section = this._root_section + + this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag + this._long_break_matcher = /\n\n\n+/g + } + + // =============================== + // Section and indentation methods + // =============================== + _indent() { + this._current_indent += this._indent_increment + this._level += 1 + } + + _dedent() { + this._current_indent -= this._indent_increment + assert(this._current_indent >= 0, 'Indent decreased below 0.') + this._level -= 1 + } + + _add_item(func, args) { + this._current_section.items.push([ func, args ]) + } + + // ======================== + // Message building methods + // ======================== + start_section(heading) { + this._indent() + let section = this._Section(this, this._current_section, heading) + this._add_item(section.format_help.bind(section), []) + this._current_section = section + } + + end_section() { + this._current_section = this._current_section.parent + this._dedent() + } + + add_text(text) { + if (text !== SUPPRESS && text !== undefined) { + this._add_item(this._format_text.bind(this), [text]) + } + } + + add_usage(usage, actions, groups, prefix = undefined) { + if (usage !== SUPPRESS) { + let args = [ usage, actions, groups, prefix ] + this._add_item(this._format_usage.bind(this), args) + } + } + + add_argument(action) { + if (action.help !== SUPPRESS) { + + // find all invocations + let invocations = [this._format_action_invocation(action)] + for (let subaction of this._iter_indented_subactions(action)) { + invocations.push(this._format_action_invocation(subaction)) + } + + // update the maximum item length + let invocation_length = Math.max(...invocations.map(invocation => invocation.length)) + let action_length = invocation_length + this._current_indent + this._action_max_length = Math.max(this._action_max_length, + action_length) + + // add the item to the list + this._add_item(this._format_action.bind(this), [action]) + } + } + + add_arguments(actions) { + for (let action of actions) { + this.add_argument(action) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_help() { + let help = this._root_section.format_help() + if (help) { + help = help.replace(this._long_break_matcher, '\n\n') + help = help.replace(/^\n+|\n+$/g, '') + '\n' + } + return help + } + + _join_parts(part_strings) { + return part_strings.filter(part => part && part !== SUPPRESS).join('') + } + + _format_usage(usage, actions, groups, prefix) { + if (prefix === undefined) { + prefix = 'usage: ' + } + + // if usage is specified, use that + if (usage !== undefined) { + usage = sub(usage, { prog: this._prog }) + + // if no optionals or positionals are available, usage is just prog + } else if (usage === undefined && !actions.length) { + usage = sub('%(prog)s', { prog: this._prog }) + + // if optionals and positionals are available, calculate usage + } else if (usage === undefined) { + let prog = sub('%(prog)s', { prog: this._prog }) + + // split optionals from positionals + let optionals = [] + let positionals = [] + for (let action of actions) { + if (action.option_strings.length) { + optionals.push(action) + } else { + positionals.push(action) + } + } + + // build full usage string + let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups) + usage = [ prog, action_usage ].map(String).join(' ') + + // wrap the usage parts if it's too long + let text_width = this._width - this._current_indent + if (prefix.length + usage.length > text_width) { + + // break usage into wrappable parts + let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g + let opt_usage = this._format_actions_usage(optionals, groups) + let pos_usage = this._format_actions_usage(positionals, groups) + let opt_parts = opt_usage.match(part_regexp) || [] + let pos_parts = pos_usage.match(part_regexp) || [] + assert(opt_parts.join(' ') === opt_usage) + assert(pos_parts.join(' ') === pos_usage) + + // helper for wrapping lines + let get_lines = (parts, indent, prefix = undefined) => { + let lines = [] + let line = [] + let line_len + if (prefix !== undefined) { + line_len = prefix.length - 1 + } else { + line_len = indent.length - 1 + } + for (let part of parts) { + if (line_len + 1 + part.length > text_width && line) { + lines.push(indent + line.join(' ')) + line = [] + line_len = indent.length - 1 + } + line.push(part) + line_len += part.length + 1 + } + if (line.length) { + lines.push(indent + line.join(' ')) + } + if (prefix !== undefined) { + lines[0] = lines[0].slice(indent.length) + } + return lines + } + + let lines + + // if prog is short, follow it with optionals or positionals + if (prefix.length + prog.length <= 0.75 * text_width) { + let indent = ' '.repeat(prefix.length + prog.length + 1) + if (opt_parts.length) { + lines = get_lines([prog].concat(opt_parts), indent, prefix) + lines = lines.concat(get_lines(pos_parts, indent)) + } else if (pos_parts.length) { + lines = get_lines([prog].concat(pos_parts), indent, prefix) + } else { + lines = [prog] + } + + // if prog is long, put it on its own line + } else { + let indent = ' '.repeat(prefix.length) + let parts = [].concat(opt_parts).concat(pos_parts) + lines = get_lines(parts, indent) + if (lines.length > 1) { + lines = [] + lines = lines.concat(get_lines(opt_parts, indent)) + lines = lines.concat(get_lines(pos_parts, indent)) + } + lines = [prog].concat(lines) + } + + // join lines into usage + usage = lines.join('\n') + } + } + + // prefix with 'usage:' + return sub('%s%s\n\n', prefix, usage) + } + + _format_actions_usage(actions, groups) { + // find group indices and identify actions in groups + let group_actions = new Set() + let inserts = {} + for (let group of groups) { + let start = actions.indexOf(group._group_actions[0]) + if (start === -1) { + continue + } else { + let end = start + group._group_actions.length + if (_array_equal(actions.slice(start, end), group._group_actions)) { + for (let action of group._group_actions) { + group_actions.add(action) + } + if (!group.required) { + if (start in inserts) { + inserts[start] += ' [' + } else { + inserts[start] = '[' + } + if (end in inserts) { + inserts[end] += ']' + } else { + inserts[end] = ']' + } + } else { + if (start in inserts) { + inserts[start] += ' (' + } else { + inserts[start] = '(' + } + if (end in inserts) { + inserts[end] += ')' + } else { + inserts[end] = ')' + } + } + for (let i of range(start + 1, end)) { + inserts[i] = '|' + } + } + } + } + + // collect all actions format strings + let parts = [] + for (let [ i, action ] of Object.entries(actions)) { + + // suppressed arguments are marked with None + // remove | separators for suppressed arguments + if (action.help === SUPPRESS) { + parts.push(undefined) + if (inserts[+i] === '|') { + delete inserts[+i] + } else if (inserts[+i + 1] === '|') { + delete inserts[+i + 1] + } + + // produce all arg strings + } else if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let part = this._format_args(action, default_value) + + // if it's in a group, strip the outer [] + if (group_actions.has(action)) { + if (part[0] === '[' && part[part.length - 1] === ']') { + part = part.slice(1, -1) + } + } + + // add the action string to the list + parts.push(part) + + // produce the first way to invoke the option in brackets + } else { + let option_string = action.option_strings[0] + let part + + // if the Optional doesn't take a value, format is: + // -s or --long + if (action.nargs === 0) { + part = action.format_usage() + + // if the Optional takes a value, format is: + // -s ARGS or --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + part = sub('%s %s', option_string, args_string) + } + + // make it look optional if it's not required or in a group + if (!action.required && !group_actions.has(action)) { + part = sub('[%s]', part) + } + + // add the action string to the list + parts.push(part) + } + } + + // insert things at the necessary indices + for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) { + parts.splice(+i, 0, inserts[+i]) + } + + // join all the action items with spaces + let text = parts.filter(Boolean).join(' ') + + // clean up separators for mutually exclusive groups + text = text.replace(/([\[(]) /g, '$1') + text = text.replace(/ ([\])])/g, '$1') + text = text.replace(/[\[(] *[\])]/g, '') + text = text.replace(/\(([^|]*)\)/g, '$1', text) + text = text.trim() + + // return the text + return text + } + + _format_text(text) { + if (text.includes('%(prog)')) { + text = sub(text, { prog: this._prog }) + } + let text_width = Math.max(this._width - this._current_indent, 11) + let indent = ' '.repeat(this._current_indent) + return this._fill_text(text, text_width, indent) + '\n\n' + } + + _format_action(action) { + // determine the required width and the entry label + let help_position = Math.min(this._action_max_length + 2, + this._max_help_position) + let help_width = Math.max(this._width - help_position, 11) + let action_width = help_position - this._current_indent - 2 + let action_header = this._format_action_invocation(action) + let indent_first + + // no help; start on same line and add a final newline + if (!action.help) { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + + // short action name; start on the same line and pad two spaces + } else if (action_header.length <= action_width) { + let tup = [ this._current_indent, '', action_width, action_header ] + action_header = sub('%*s%-*s ', ...tup) + indent_first = 0 + + // long action name; start on the next line + } else { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + indent_first = help_position + } + + // collect the pieces of the action help + let parts = [action_header] + + // if there was help for the action, add lines of help text + if (action.help) { + let help_text = this._expand_help(action) + let help_lines = this._split_lines(help_text, help_width) + parts.push(sub('%*s%s\n', indent_first, '', help_lines[0])) + for (let line of help_lines.slice(1)) { + parts.push(sub('%*s%s\n', help_position, '', line)) + } + + // or add a newline if the description doesn't end with one + } else if (!action_header.endsWith('\n')) { + parts.push('\n') + } + + // if there are any sub-actions, add their help as well + for (let subaction of this._iter_indented_subactions(action)) { + parts.push(this._format_action(subaction)) + } + + // return a single string + return this._join_parts(parts) + } + + _format_action_invocation(action) { + if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let metavar = this._metavar_formatter(action, default_value)(1)[0] + return metavar + + } else { + let parts = [] + + // if the Optional doesn't take a value, format is: + // -s, --long + if (action.nargs === 0) { + parts = parts.concat(action.option_strings) + + // if the Optional takes a value, format is: + // -s ARGS, --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + for (let option_string of action.option_strings) { + parts.push(sub('%s %s', option_string, args_string)) + } + } + + return parts.join(', ') + } + } + + _metavar_formatter(action, default_metavar) { + let result + if (action.metavar !== undefined) { + result = action.metavar + } else if (action.choices !== undefined) { + let choice_strs = _choices_to_array(action.choices).map(String) + result = sub('{%s}', choice_strs.join(',')) + } else { + result = default_metavar + } + + function format(tuple_size) { + if (Array.isArray(result)) { + return result + } else { + return Array(tuple_size).fill(result) + } + } + return format + } + + _format_args(action, default_metavar) { + let get_metavar = this._metavar_formatter(action, default_metavar) + let result + if (action.nargs === undefined) { + result = sub('%s', ...get_metavar(1)) + } else if (action.nargs === OPTIONAL) { + result = sub('[%s]', ...get_metavar(1)) + } else if (action.nargs === ZERO_OR_MORE) { + let metavar = get_metavar(1) + if (metavar.length === 2) { + result = sub('[%s [%s ...]]', ...metavar) + } else { + result = sub('[%s ...]', ...metavar) + } + } else if (action.nargs === ONE_OR_MORE) { + result = sub('%s [%s ...]', ...get_metavar(2)) + } else if (action.nargs === REMAINDER) { + result = '...' + } else if (action.nargs === PARSER) { + result = sub('%s ...', ...get_metavar(1)) + } else if (action.nargs === SUPPRESS) { + result = '' + } else { + let formats + try { + formats = range(action.nargs).map(() => '%s') + } catch (err) { + throw new TypeError('invalid nargs value') + } + result = sub(formats.join(' '), ...get_metavar(action.nargs)) + } + return result + } + + _expand_help(action) { + let params = Object.assign({ prog: this._prog }, action) + for (let name of Object.keys(params)) { + if (params[name] === SUPPRESS) { + delete params[name] + } + } + for (let name of Object.keys(params)) { + if (params[name] && params[name].name) { + params[name] = params[name].name + } + } + if (params.choices !== undefined) { + let choices_str = _choices_to_array(params.choices).map(String).join(', ') + params.choices = choices_str + } + // LEGACY (v1 compatibility): camelcase + for (let key of Object.keys(params)) { + let old_name = _to_legacy_name(key) + if (old_name !== key) { + params[old_name] = params[key] + } + } + // end + return sub(this._get_help_string(action), params) + } + + * _iter_indented_subactions(action) { + if (typeof action._get_subactions === 'function') { + this._indent() + yield* action._get_subactions() + this._dedent() + } + } + + _split_lines(text, width) { + text = text.replace(this._whitespace_matcher, ' ').trim() + // The textwrap module is used only for formatting help. + // Delay its import for speeding up the common usage of argparse. + let textwrap = require('./lib/textwrap') + return textwrap.wrap(text, { width }) + } + + _fill_text(text, width, indent) { + text = text.replace(this._whitespace_matcher, ' ').trim() + let textwrap = require('./lib/textwrap') + return textwrap.fill(text, { width, + initial_indent: indent, + subsequent_indent: indent }) + } + + _get_help_string(action) { + return action.help + } + + _get_default_metavar_for_optional(action) { + return action.dest.toUpperCase() + } + + _get_default_metavar_for_positional(action) { + return action.dest + } +})) + +HelpFormatter.prototype._Section = _callable(class _Section { + + constructor(formatter, parent, heading = undefined) { + this.formatter = formatter + this.parent = parent + this.heading = heading + this.items = [] + } + + format_help() { + // format the indented section + if (this.parent !== undefined) { + this.formatter._indent() + } + let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args))) + if (this.parent !== undefined) { + this.formatter._dedent() + } + + // return nothing if the section was empty + if (!item_help) { + return '' + } + + // add the heading if the section was non-empty + let heading + if (this.heading !== SUPPRESS && this.heading !== undefined) { + let current_indent = this.formatter._current_indent + heading = sub('%*s%s:\n', current_indent, '', this.heading) + } else { + heading = '' + } + + // join the section-initial newline, the heading and the help + return this.formatter._join_parts(['\n', heading, item_help, '\n']) + } +}) + + +const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter { + /* + * Help message formatter which retains any formatting in descriptions. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _fill_text(text, width, indent) { + return splitlines(text, true).map(line => indent + line).join('') + } +})) + + +const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter { + /* + * Help message formatter which retains formatting of all help text. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _split_lines(text/*, width*/) { + return splitlines(text) + } +})) + + +const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter { + /* + * Help message formatter which adds default values to argument help. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_help_string(action) { + let help = action.help + // LEGACY (v1 compatibility): additional check for defaultValue needed + if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) { + if (action.default !== SUPPRESS) { + let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] + if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) { + help += ' (default: %(default)s)' + } + } + } + return help + } +})) + + +const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter { + /* + * Help message formatter which uses the argument 'type' as the default + * metavar value (instead of the argument 'dest') + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_default_metavar_for_optional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } + + _get_default_metavar_for_positional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } +})) + + +// ===================== +// Options and Arguments +// ===================== +function _get_action_name(argument) { + if (argument === undefined) { + return undefined + } else if (argument.option_strings.length) { + return argument.option_strings.join('/') + } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) { + return argument.metavar + } else if (![ undefined, SUPPRESS ].includes(argument.dest)) { + return argument.dest + } else { + return undefined + } +} + + +const ArgumentError = _callable(class ArgumentError extends Error { + /* + * An error from creating or using an argument (optional or positional). + * + * The string value of this exception is the message, augmented with + * information about the argument that caused it. + */ + + constructor(argument, message) { + super() + this.name = 'ArgumentError' + this._argument_name = _get_action_name(argument) + this._message = message + this.message = this.str() + } + + str() { + let format + if (this._argument_name === undefined) { + format = '%(message)s' + } else { + format = 'argument %(argument_name)s: %(message)s' + } + return sub(format, { message: this._message, + argument_name: this._argument_name }) + } +}) + + +const ArgumentTypeError = _callable(class ArgumentTypeError extends Error { + /* + * An error from trying to convert a command line string to a type. + */ + + constructor(message) { + super(message) + this.name = 'ArgumentTypeError' + } +}) + + +// ============== +// Action classes +// ============== +const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) { + /* + * Information about how to convert command line strings to Python objects. + * + * Action objects are used by an ArgumentParser to represent the information + * needed to parse a single argument from one or more strings from the + * command line. The keyword arguments to the Action constructor are also + * all attributes of Action instances. + * + * Keyword Arguments: + * + * - option_strings -- A list of command-line option strings which + * should be associated with this action. + * + * - dest -- The name of the attribute to hold the created object(s) + * + * - nargs -- The number of command-line arguments that should be + * consumed. By default, one argument will be consumed and a single + * value will be produced. Other values include: + * - N (an integer) consumes N arguments (and produces a list) + * - '?' consumes zero or one arguments + * - '*' consumes zero or more arguments (and produces a list) + * - '+' consumes one or more arguments (and produces a list) + * Note that the difference between the default and nargs=1 is that + * with the default, a single value will be produced, while with + * nargs=1, a list containing a single value will be produced. + * + * - const -- The value to be produced if the option is specified and the + * option uses an action that takes no values. + * + * - default -- The value to be produced if the option is not specified. + * + * - type -- A callable that accepts a single string argument, and + * returns the converted value. The standard Python types str, int, + * float, and complex are useful examples of such callables. If None, + * str is used. + * + * - choices -- A container of values that should be allowed. If not None, + * after a command-line argument has been converted to the appropriate + * type, an exception will be raised if it is not a member of this + * collection. + * + * - required -- True if the action must always be specified at the + * command line. This is only meaningful for optional command-line + * arguments. + * + * - help -- The help string describing the argument. + * + * - metavar -- The name to be used for the option's argument with the + * help string. If None, the 'dest' value will be used as the name. + */ + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + this.option_strings = option_strings + this.dest = dest + this.nargs = nargs + this.const = const_value + this.default = default_value + this.type = type + this.choices = choices + this.required = required + this.help = help + this.metavar = metavar + } + + _get_kwargs() { + let names = [ + 'option_strings', + 'dest', + 'nargs', + 'const', + 'default', + 'type', + 'choices', + 'help', + 'metavar' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + format_usage() { + return this.option_strings[0] + } + + call(/*parser, namespace, values, option_string = undefined*/) { + throw new Error('.call() not defined') + } +})) + + +const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + let _option_strings = [] + for (let option_string of option_strings) { + _option_strings.push(option_string) + + if (option_string.startsWith('--')) { + option_string = '--no-' + option_string.slice(2) + _option_strings.push(option_string) + } + } + + if (help !== undefined && default_value !== undefined) { + help += ` (default: ${default_value})` + } + + super({ + option_strings: _option_strings, + dest, + nargs: 0, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values, option_string = undefined) { + if (this.option_strings.includes(option_string)) { + setattr(namespace, this.dest, !option_string.startsWith('--no-')) + } + } + + format_usage() { + return this.option_strings.join(' | ') + } +})) + + +const _StoreAction = _callable(class _StoreAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for store actions must be != 0; if you ' + + 'have nothing to store, actions such as store ' + + 'true or store const may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + setattr(namespace, this.dest, values) + } +}) + + +const _StoreConstAction = _callable(class _StoreConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help + //, metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + setattr(namespace, this.dest, this.const) + } +}) + + +const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: false, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: true, + default: default_value, + required, + help + }) + } +}) + + +const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: true, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: false, + default: default_value, + required, + help + }) + } +}) + + +const _AppendAction = _callable(class _AppendAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for append actions must be != 0; if arg ' + + 'strings are not supplying the value to append, ' + + 'the append const action may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(values) + setattr(namespace, this.dest, items) + } +}) + + +const _AppendConstAction = _callable(class _AppendConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help, + metavar + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(this.const) + setattr(namespace, this.dest, items) + } +}) + + +const _CountAction = _callable(class _CountAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let count = getattr(namespace, this.dest, undefined) + if (count === undefined) { + count = 0 + } + setattr(namespace, this.dest, count + 1) + } +}) + + +const _HelpAction = _callable(class _HelpAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: SUPPRESS, + default: SUPPRESS, + help: undefined + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + } + + call(parser/*, namespace, values, option_string = undefined*/) { + parser.print_help() + parser.exit() + } +}) + + +const _VersionAction = _callable(class _VersionAction extends Action { + + constructor() { + let [ + option_strings, + version, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + version: undefined, + dest: SUPPRESS, + default: SUPPRESS, + help: "show program's version number and exit" + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + this.version = version + } + + call(parser/*, namespace, values, option_string = undefined*/) { + let version = this.version + if (version === undefined) { + version = parser.version + } + let formatter = parser._get_formatter() + formatter.add_text(version) + parser._print_message(formatter.format_help(), process.stdout) + parser.exit() + } +}) + + +const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action { + + constructor() { + let [ + option_strings, + prog, + parser_class, + dest, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + prog: no_default, + parser_class: no_default, + dest: SUPPRESS, + required: false, + help: undefined, + metavar: undefined + }) + + let name_parser_map = {} + + super({ + option_strings, + dest, + nargs: PARSER, + choices: name_parser_map, + required, + help, + metavar + }) + + this._prog_prefix = prog + this._parser_class = parser_class + this._name_parser_map = name_parser_map + this._choices_actions = [] + } + + add_parser() { + let [ + name, + kwargs + ] = _parse_opts(arguments, { + name: no_default, + '**kwargs': no_default + }) + + // set prog from the existing prefix + if (kwargs.prog === undefined) { + kwargs.prog = sub('%s %s', this._prog_prefix, name) + } + + let aliases = getattr(kwargs, 'aliases', []) + delete kwargs.aliases + + // create a pseudo-action to hold the choice help + if ('help' in kwargs) { + let help = kwargs.help + delete kwargs.help + let choice_action = this._ChoicesPseudoAction(name, aliases, help) + this._choices_actions.push(choice_action) + } + + // create the parser and add it to the map + let parser = new this._parser_class(kwargs) + this._name_parser_map[name] = parser + + // make parser available under aliases also + for (let alias of aliases) { + this._name_parser_map[alias] = parser + } + + return parser + } + + _get_subactions() { + return this._choices_actions + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let parser_name = values[0] + let arg_strings = values.slice(1) + + // set the parser name if requested + if (this.dest !== SUPPRESS) { + setattr(namespace, this.dest, parser_name) + } + + // select the parser + if (hasattr(this._name_parser_map, parser_name)) { + parser = this._name_parser_map[parser_name] + } else { + let args = {parser_name, + choices: this._name_parser_map.join(', ')} + let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args) + throw new ArgumentError(this, msg) + } + + // parse all the remaining options into the namespace + // store any unrecognized options on the object, so that the top + // level parser can decide what to do with them + + // In case this subparser defines new defaults, we parse them + // in a new namespace object and then update the original + // namespace for the relevant parts. + let subnamespace + [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined) + for (let [ key, value ] of Object.entries(subnamespace)) { + setattr(namespace, key, value) + } + + if (arg_strings.length) { + setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, []) + getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings) + } + } +})) + + +_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action { + constructor(name, aliases, help) { + let metavar = name, dest = name + if (aliases.length) { + metavar += sub(' (%s)', aliases.join(', ')) + } + super({ option_strings: [], dest, help, metavar }) + } +}) + + +const _ExtendAction = _callable(class _ExtendAction extends _AppendAction { + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items = items.concat(values) + setattr(namespace, this.dest, items) + } +}) + + +// ============== +// Type classes +// ============== +const FileType = _callable(class FileType extends Function { + /* + * Factory for creating file object types + * + * Instances of FileType are typically passed as type= arguments to the + * ArgumentParser add_argument() method. + * + * Keyword Arguments: + * - mode -- A string indicating how the file is to be opened. Accepts the + * same values as the builtin open() function. + * - bufsize -- The file's desired buffer size. Accepts the same values as + * the builtin open() function. + * - encoding -- The file's encoding. Accepts the same values as the + * builtin open() function. + * - errors -- A string indicating how encoding and decoding errors are to + * be handled. Accepts the same value as the builtin open() function. + */ + + constructor() { + let [ + flags, + encoding, + mode, + autoClose, + emitClose, + start, + end, + highWaterMark, + fs + ] = _parse_opts(arguments, { + flags: 'r', + encoding: undefined, + mode: undefined, // 0o666 + autoClose: undefined, // true + emitClose: undefined, // false + start: undefined, // 0 + end: undefined, // Infinity + highWaterMark: undefined, // 64 * 1024 + fs: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + Object.defineProperty(this, 'name', { + get() { + return sub('FileType(%r)', flags) + } + }) + this._flags = flags + this._options = {} + if (encoding !== undefined) this._options.encoding = encoding + if (mode !== undefined) this._options.mode = mode + if (autoClose !== undefined) this._options.autoClose = autoClose + if (emitClose !== undefined) this._options.emitClose = emitClose + if (start !== undefined) this._options.start = start + if (end !== undefined) this._options.end = end + if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark + if (fs !== undefined) this._options.fs = fs + } + + call(string) { + // the special argument "-" means sys.std{in,out} + if (string === '-') { + if (this._flags.includes('r')) { + return process.stdin + } else if (this._flags.includes('w')) { + return process.stdout + } else { + let msg = sub('argument "-" with mode %r', this._flags) + throw new TypeError(msg) + } + } + + // all other arguments are used as file names + let fd + try { + fd = fs.openSync(string, this._flags, this._options.mode) + } catch (e) { + let args = { filename: string, error: e.message } + let message = "can't open '%(filename)s': %(error)s" + throw new ArgumentTypeError(sub(message, args)) + } + + let options = Object.assign({ fd, flags: this._flags }, this._options) + if (this._flags.includes('r')) { + return fs.createReadStream(undefined, options) + } else if (this._flags.includes('w')) { + return fs.createWriteStream(undefined, options) + } else { + let msg = sub('argument "%s" with mode %r', string, this._flags) + throw new TypeError(msg) + } + } + + [util.inspect.custom]() { + let args = [ this._flags ] + let kwargs = Object.entries(this._options).map(([ k, v ]) => { + if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } } + return [ k, v ] + }) + let args_str = [] + .concat(args.filter(arg => arg !== -1).map(repr)) + .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined) + .map(([kw, arg]) => sub('%s=%r', kw, arg))) + .join(', ') + return sub('%s(%s)', this.constructor.name, args_str) + } + + toString() { + return this[util.inspect.custom]() + } +}) + +// =========================== +// Optional and Positional Parsing +// =========================== +const Namespace = _callable(class Namespace extends _AttributeHolder() { + /* + * Simple object for storing attributes. + * + * Implements equality by attribute names and values, and provides a simple + * string representation. + */ + + constructor(options = {}) { + super() + Object.assign(this, options) + } +}) + +// unset string tag to mimic plain object +Namespace.prototype[Symbol.toStringTag] = undefined + + +const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer { + + constructor() { + let [ + description, + prefix_chars, + argument_default, + conflict_handler + ] = _parse_opts(arguments, { + description: no_default, + prefix_chars: no_default, + argument_default: no_default, + conflict_handler: no_default + }) + + this.description = description + this.argument_default = argument_default + this.prefix_chars = prefix_chars + this.conflict_handler = conflict_handler + + // set up registries + this._registries = {} + + // register actions + this.register('action', undefined, _StoreAction) + this.register('action', 'store', _StoreAction) + this.register('action', 'store_const', _StoreConstAction) + this.register('action', 'store_true', _StoreTrueAction) + this.register('action', 'store_false', _StoreFalseAction) + this.register('action', 'append', _AppendAction) + this.register('action', 'append_const', _AppendConstAction) + this.register('action', 'count', _CountAction) + this.register('action', 'help', _HelpAction) + this.register('action', 'version', _VersionAction) + this.register('action', 'parsers', _SubParsersAction) + this.register('action', 'extend', _ExtendAction) + // LEGACY (v1 compatibility): camelcase variants + ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => { + let new_name = _to_new_name(old_name) + this.register('action', old_name, util.deprecate(this._registry_get('action', new_name), + sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name))) + }) + // end + + // raise an exception if the conflict handler is invalid + this._get_handler() + + // action storage + this._actions = [] + this._option_string_actions = {} + + // groups + this._action_groups = [] + this._mutually_exclusive_groups = [] + + // defaults storage + this._defaults = {} + + // determines whether an "option" looks like a negative number + this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/ + + // whether or not there are any optionals that look like negative + // numbers -- uses a list so it can be shared and edited + this._has_negative_number_optionals = [] + } + + // ==================== + // Registration methods + // ==================== + register(registry_name, value, object) { + let registry = setdefault(this._registries, registry_name, {}) + registry[value] = object + } + + _registry_get(registry_name, value, default_value = undefined) { + return getattr(this._registries[registry_name], value, default_value) + } + + // ================================== + // Namespace default accessor methods + // ================================== + set_defaults(kwargs) { + Object.assign(this._defaults, kwargs) + + // if these defaults match any existing arguments, replace + // the previous default on the object with the new one + for (let action of this._actions) { + if (action.dest in kwargs) { + action.default = kwargs[action.dest] + } + } + } + + get_default(dest) { + for (let action of this._actions) { + if (action.dest === dest && action.default !== undefined) { + return action.default + } + } + return this._defaults[dest] + } + + + // ======================= + // Adding argument actions + // ======================= + add_argument() { + /* + * add_argument(dest, ..., name=value, ...) + * add_argument(option_string, option_string, ..., name=value, ...) + */ + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + // LEGACY (v1 compatibility), old-style add_argument([ args ], { options }) + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + deprecate('argument-array', + sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', { + args: args.map(repr).join(', ') + })) + } + // end + + // if no positional args are supplied or only one is supplied and + // it doesn't look like an option string, parse a positional + // argument + let chars = this.prefix_chars + if (!args.length || args.length === 1 && !chars.includes(args[0][0])) { + if (args.length && 'dest' in kwargs) { + throw new TypeError('dest supplied twice for positional argument') + } + kwargs = this._get_positional_kwargs(...args, kwargs) + + // otherwise, we're adding an optional argument + } else { + kwargs = this._get_optional_kwargs(...args, kwargs) + } + + // if no default was supplied, use the parser-level default + if (!('default' in kwargs)) { + let dest = kwargs.dest + if (dest in this._defaults) { + kwargs.default = this._defaults[dest] + } else if (this.argument_default !== undefined) { + kwargs.default = this.argument_default + } + } + + // create the action object, and add it to the parser + let action_class = this._pop_action_class(kwargs) + if (typeof action_class !== 'function') { + throw new TypeError(sub('unknown action "%s"', action_class)) + } + // eslint-disable-next-line new-cap + let action = new action_class(kwargs) + + // raise an error if the action type is not callable + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + throw new TypeError(sub('%r is not callable', type_func)) + } + + if (type_func === FileType) { + throw new TypeError(sub('%r is a FileType class object, instance of it' + + ' must be passed', type_func)) + } + + // raise an error if the metavar does not match the type + if ('_get_formatter' in this) { + try { + this._get_formatter()._format_args(action, undefined) + } catch (err) { + // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same + if (err instanceof TypeError && err.message !== 'invalid nargs value') { + throw new TypeError('length of metavar tuple does not match nargs') + } else { + throw err + } + } + } + + return this._add_action(action) + } + + add_argument_group() { + let group = _ArgumentGroup(this, ...arguments) + this._action_groups.push(group) + return group + } + + add_mutually_exclusive_group() { + // eslint-disable-next-line no-use-before-define + let group = _MutuallyExclusiveGroup(this, ...arguments) + this._mutually_exclusive_groups.push(group) + return group + } + + _add_action(action) { + // resolve any conflicts + this._check_conflict(action) + + // add to actions list + this._actions.push(action) + action.container = this + + // index the action by any option strings it has + for (let option_string of action.option_strings) { + this._option_string_actions[option_string] = action + } + + // set the flag if any option strings look like negative numbers + for (let option_string of action.option_strings) { + if (this._negative_number_matcher.test(option_string)) { + if (!this._has_negative_number_optionals.length) { + this._has_negative_number_optionals.push(true) + } + } + } + + // return the created action + return action + } + + _remove_action(action) { + _array_remove(this._actions, action) + } + + _add_container_actions(container) { + // collect groups by titles + let title_group_map = {} + for (let group of this._action_groups) { + if (group.title in title_group_map) { + let msg = 'cannot merge actions - two groups are named %r' + throw new TypeError(sub(msg, group.title)) + } + title_group_map[group.title] = group + } + + // map each action to its group + let group_map = new Map() + for (let group of container._action_groups) { + + // if a group with the title exists, use that, otherwise + // create a new group matching the container's group + if (!(group.title in title_group_map)) { + title_group_map[group.title] = this.add_argument_group({ + title: group.title, + description: group.description, + conflict_handler: group.conflict_handler + }) + } + + // map the actions to their new group + for (let action of group._group_actions) { + group_map.set(action, title_group_map[group.title]) + } + } + + // add container's mutually exclusive groups + // NOTE: if add_mutually_exclusive_group ever gains title= and + // description= then this code will need to be expanded as above + for (let group of container._mutually_exclusive_groups) { + let mutex_group = this.add_mutually_exclusive_group({ + required: group.required + }) + + // map the actions to their new mutex group + for (let action of group._group_actions) { + group_map.set(action, mutex_group) + } + } + + // add all actions to this container or their group + for (let action of container._actions) { + group_map.get(action)._add_action(action) + } + } + + _get_positional_kwargs() { + let [ + dest, + kwargs + ] = _parse_opts(arguments, { + dest: no_default, + '**kwargs': no_default + }) + + // make sure required is not specified + if ('required' in kwargs) { + let msg = "'required' is an invalid argument for positionals" + throw new TypeError(msg) + } + + // mark positional arguments as required if at least one is + // always required + if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) { + kwargs.required = true + } + if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) { + kwargs.required = true + } + + // return the keyword arguments with no option strings + return Object.assign(kwargs, { dest, option_strings: [] }) + } + + _get_optional_kwargs() { + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + + // determine short and long option strings + let option_strings = [] + let long_option_strings = [] + let option_string + for (option_string of args) { + // error on strings that don't start with an appropriate prefix + if (!this.prefix_chars.includes(option_string[0])) { + let args = {option: option_string, + prefix_chars: this.prefix_chars} + let msg = 'invalid option string %(option)r: ' + + 'must start with a character %(prefix_chars)r' + throw new TypeError(sub(msg, args)) + } + + // strings starting with two prefix characters are long options + option_strings.push(option_string) + if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) { + long_option_strings.push(option_string) + } + } + + // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' + let dest = kwargs.dest + delete kwargs.dest + if (dest === undefined) { + let dest_option_string + if (long_option_strings.length) { + dest_option_string = long_option_strings[0] + } else { + dest_option_string = option_strings[0] + } + dest = _string_lstrip(dest_option_string, this.prefix_chars) + if (!dest) { + let msg = 'dest= is required for options like %r' + throw new TypeError(sub(msg, option_string)) + } + dest = dest.replace(/-/g, '_') + } + + // return the updated keyword arguments + return Object.assign(kwargs, { dest, option_strings }) + } + + _pop_action_class(kwargs, default_value = undefined) { + let action = getattr(kwargs, 'action', default_value) + delete kwargs.action + return this._registry_get('action', action, action) + } + + _get_handler() { + // determine function from conflict handler string + let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler) + if (typeof this[handler_func_name] === 'function') { + return this[handler_func_name] + } else { + let msg = 'invalid conflict_resolution value: %r' + throw new TypeError(sub(msg, this.conflict_handler)) + } + } + + _check_conflict(action) { + + // find all options that conflict with this option + let confl_optionals = [] + for (let option_string of action.option_strings) { + if (hasattr(this._option_string_actions, option_string)) { + let confl_optional = this._option_string_actions[option_string] + confl_optionals.push([ option_string, confl_optional ]) + } + } + + // resolve any conflicts + if (confl_optionals.length) { + let conflict_handler = this._get_handler() + conflict_handler.call(this, action, confl_optionals) + } + } + + _handle_conflict_error(action, conflicting_actions) { + let message = conflicting_actions.length === 1 ? + 'conflicting option string: %s' : + 'conflicting option strings: %s' + let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ') + throw new ArgumentError(action, sub(message, conflict_string)) + } + + _handle_conflict_resolve(action, conflicting_actions) { + + // remove all conflicting options + for (let [ option_string, action ] of conflicting_actions) { + + // remove the conflicting option + _array_remove(action.option_strings, option_string) + delete this._option_string_actions[option_string] + + // if the option now has no option string, remove it from the + // container holding it + if (!action.option_strings.length) { + action.container._remove_action(action) + } + } + } +})) + + +const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer { + + constructor() { + let [ + container, + title, + description, + kwargs + ] = _parse_opts(arguments, { + container: no_default, + title: undefined, + description: undefined, + '**kwargs': no_default + }) + + // add any missing keyword arguments by checking the container + setdefault(kwargs, 'conflict_handler', container.conflict_handler) + setdefault(kwargs, 'prefix_chars', container.prefix_chars) + setdefault(kwargs, 'argument_default', container.argument_default) + super(Object.assign({ description }, kwargs)) + + // group attributes + this.title = title + this._group_actions = [] + + // share most attributes with the container + this._registries = container._registries + this._actions = container._actions + this._option_string_actions = container._option_string_actions + this._defaults = container._defaults + this._has_negative_number_optionals = + container._has_negative_number_optionals + this._mutually_exclusive_groups = container._mutually_exclusive_groups + } + + _add_action(action) { + action = super._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + super._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup { + + constructor() { + let [ + container, + required + ] = _parse_opts(arguments, { + container: no_default, + required: false + }) + + super(container) + this.required = required + this._container = container + } + + _add_action(action) { + if (action.required) { + let msg = 'mutually exclusive arguments must be optional' + throw new TypeError(msg) + } + action = this._container._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + this._container._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) { + /* + * Object for parsing command line strings into Python objects. + * + * Keyword Arguments: + * - prog -- The name of the program (default: sys.argv[0]) + * - usage -- A usage message (default: auto-generated from arguments) + * - description -- A description of what the program does + * - epilog -- Text following the argument descriptions + * - parents -- Parsers whose arguments should be copied into this one + * - formatter_class -- HelpFormatter class for printing help messages + * - prefix_chars -- Characters that prefix optional arguments + * - fromfile_prefix_chars -- Characters that prefix files containing + * additional arguments + * - argument_default -- The default value for all arguments + * - conflict_handler -- String indicating how to handle conflicts + * - add_help -- Add a -h/-help option + * - allow_abbrev -- Allow long options to be abbreviated unambiguously + * - exit_on_error -- Determines whether or not ArgumentParser exits with + * error info when an error occurs + */ + + constructor() { + let [ + prog, + usage, + description, + epilog, + parents, + formatter_class, + prefix_chars, + fromfile_prefix_chars, + argument_default, + conflict_handler, + add_help, + allow_abbrev, + exit_on_error, + debug, // LEGACY (v1 compatibility), debug mode + version // LEGACY (v1 compatibility), version + ] = _parse_opts(arguments, { + prog: undefined, + usage: undefined, + description: undefined, + epilog: undefined, + parents: [], + formatter_class: HelpFormatter, + prefix_chars: '-', + fromfile_prefix_chars: undefined, + argument_default: undefined, + conflict_handler: 'error', + add_help: true, + allow_abbrev: true, + exit_on_error: true, + debug: undefined, // LEGACY (v1 compatibility), debug mode + version: undefined // LEGACY (v1 compatibility), version + }) + + // LEGACY (v1 compatibility) + if (debug !== undefined) { + deprecate('debug', + 'The "debug" argument to ArgumentParser is deprecated. Please ' + + 'override ArgumentParser.exit function instead.' + ) + } + + if (version !== undefined) { + deprecate('version', + 'The "version" argument to ArgumentParser is deprecated. Please use ' + + "add_argument(..., { action: 'version', version: 'N', ... }) instead." + ) + } + // end + + super({ + description, + prefix_chars, + argument_default, + conflict_handler + }) + + // default setting for prog + if (prog === undefined) { + prog = path.basename(get_argv()[0] || '') + } + + this.prog = prog + this.usage = usage + this.epilog = epilog + this.formatter_class = formatter_class + this.fromfile_prefix_chars = fromfile_prefix_chars + this.add_help = add_help + this.allow_abbrev = allow_abbrev + this.exit_on_error = exit_on_error + // LEGACY (v1 compatibility), debug mode + this.debug = debug + // end + + this._positionals = this.add_argument_group('positional arguments') + this._optionals = this.add_argument_group('optional arguments') + this._subparsers = undefined + + // register types + function identity(string) { + return string + } + this.register('type', undefined, identity) + this.register('type', null, identity) + this.register('type', 'auto', identity) + this.register('type', 'int', function (x) { + let result = Number(x) + if (!Number.isInteger(result)) { + throw new TypeError(sub('could not convert string to int: %r', x)) + } + return result + }) + this.register('type', 'float', function (x) { + let result = Number(x) + if (isNaN(result)) { + throw new TypeError(sub('could not convert string to float: %r', x)) + } + return result + }) + this.register('type', 'str', String) + // LEGACY (v1 compatibility): custom types + this.register('type', 'string', + util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')) + // end + + // add help argument if necessary + // (using explicit default to override global argument_default) + let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0] + if (this.add_help) { + this.add_argument( + default_prefix + 'h', + default_prefix.repeat(2) + 'help', + { + action: 'help', + default: SUPPRESS, + help: 'show this help message and exit' + } + ) + } + // LEGACY (v1 compatibility), version + if (version) { + this.add_argument( + default_prefix + 'v', + default_prefix.repeat(2) + 'version', + { + action: 'version', + default: SUPPRESS, + version: this.version, + help: "show program's version number and exit" + } + ) + } + // end + + // add parent arguments and defaults + for (let parent of parents) { + this._add_container_actions(parent) + Object.assign(this._defaults, parent._defaults) + } + } + + // ======================= + // Pretty __repr__ methods + // ======================= + _get_kwargs() { + let names = [ + 'prog', + 'usage', + 'description', + 'formatter_class', + 'conflict_handler', + 'add_help' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + // ================================== + // Optional/Positional adding methods + // ================================== + add_subparsers() { + let [ + kwargs + ] = _parse_opts(arguments, { + '**kwargs': no_default + }) + + if (this._subparsers !== undefined) { + this.error('cannot have multiple subparser arguments') + } + + // add the parser class to the arguments if it's not present + setdefault(kwargs, 'parser_class', this.constructor) + + if ('title' in kwargs || 'description' in kwargs) { + let title = getattr(kwargs, 'title', 'subcommands') + let description = getattr(kwargs, 'description', undefined) + delete kwargs.title + delete kwargs.description + this._subparsers = this.add_argument_group(title, description) + } else { + this._subparsers = this._positionals + } + + // prog defaults to the usage message of this parser, skipping + // optional arguments and with no "usage:" prefix + if (kwargs.prog === undefined) { + let formatter = this._get_formatter() + let positionals = this._get_positional_actions() + let groups = this._mutually_exclusive_groups + formatter.add_usage(this.usage, positionals, groups, '') + kwargs.prog = formatter.format_help().trim() + } + + // create the parsers action and add it to the positionals list + let parsers_class = this._pop_action_class(kwargs, 'parsers') + // eslint-disable-next-line new-cap + let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs)) + this._subparsers._add_action(action) + + // return the created parsers action + return action + } + + _add_action(action) { + if (action.option_strings.length) { + this._optionals._add_action(action) + } else { + this._positionals._add_action(action) + } + return action + } + + _get_optional_actions() { + return this._actions.filter(action => action.option_strings.length) + } + + _get_positional_actions() { + return this._actions.filter(action => !action.option_strings.length) + } + + // ===================================== + // Command line argument parsing methods + // ===================================== + parse_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_args(args, namespace) + if (argv && argv.length > 0) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_args(args = undefined, namespace = undefined) { + if (args === undefined) { + args = get_argv().slice(1) + } + + // default Namespace built from parser defaults + if (namespace === undefined) { + namespace = new Namespace() + } + + // add any action defaults that aren't present + for (let action of this._actions) { + if (action.dest !== SUPPRESS) { + if (!hasattr(namespace, action.dest)) { + if (action.default !== SUPPRESS) { + setattr(namespace, action.dest, action.default) + } + } + } + } + + // add any parser defaults that aren't present + for (let dest of Object.keys(this._defaults)) { + if (!hasattr(namespace, dest)) { + setattr(namespace, dest, this._defaults[dest]) + } + } + + // parse the arguments and exit if there are any errors + if (this.exit_on_error) { + try { + [ namespace, args ] = this._parse_known_args(args, namespace) + } catch (err) { + if (err instanceof ArgumentError) { + this.error(err.message) + } else { + throw err + } + } + } else { + [ namespace, args ] = this._parse_known_args(args, namespace) + } + + if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) { + args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) + delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) + } + + return [ namespace, args ] + } + + _parse_known_args(arg_strings, namespace) { + // replace arg strings that are file references + if (this.fromfile_prefix_chars !== undefined) { + arg_strings = this._read_args_from_files(arg_strings) + } + + // map all mutually exclusive arguments to the other arguments + // they can't occur with + let action_conflicts = new Map() + for (let mutex_group of this._mutually_exclusive_groups) { + let group_actions = mutex_group._group_actions + for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) { + let conflicts = action_conflicts.get(mutex_action) || [] + conflicts = conflicts.concat(group_actions.slice(0, +i)) + conflicts = conflicts.concat(group_actions.slice(+i + 1)) + action_conflicts.set(mutex_action, conflicts) + } + } + + // find all option indices, and determine the arg_string_pattern + // which has an 'O' if there is an option at an index, + // an 'A' if there is an argument, or a '-' if there is a '--' + let option_string_indices = {} + let arg_string_pattern_parts = [] + let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]() + for (let [ i, arg_string ] of arg_strings_iter) { + + // all args after -- are non-options + if (arg_string === '--') { + arg_string_pattern_parts.push('-') + for ([ i, arg_string ] of arg_strings_iter) { + arg_string_pattern_parts.push('A') + } + + // otherwise, add the arg to the arg strings + // and note the index if it was an option + } else { + let option_tuple = this._parse_optional(arg_string) + let pattern + if (option_tuple === undefined) { + pattern = 'A' + } else { + option_string_indices[i] = option_tuple + pattern = 'O' + } + arg_string_pattern_parts.push(pattern) + } + } + + // join the pieces together to form the pattern + let arg_strings_pattern = arg_string_pattern_parts.join('') + + // converts arg strings to the appropriate and then takes the action + let seen_actions = new Set() + let seen_non_default_actions = new Set() + let extras + + let take_action = (action, argument_strings, option_string = undefined) => { + seen_actions.add(action) + let argument_values = this._get_values(action, argument_strings) + + // error if this argument is not allowed with other previously + // seen arguments, assuming that actions that use the default + // value don't really count as "present" + if (argument_values !== action.default) { + seen_non_default_actions.add(action) + for (let conflict_action of action_conflicts.get(action) || []) { + if (seen_non_default_actions.has(conflict_action)) { + let msg = 'not allowed with argument %s' + let action_name = _get_action_name(conflict_action) + throw new ArgumentError(action, sub(msg, action_name)) + } + } + } + + // take the action if we didn't receive a SUPPRESS value + // (e.g. from a default) + if (argument_values !== SUPPRESS) { + action(this, namespace, argument_values, option_string) + } + } + + // function to convert arg_strings into an optional action + let consume_optional = start_index => { + + // get the optional identified at this index + let option_tuple = option_string_indices[start_index] + let [ action, option_string, explicit_arg ] = option_tuple + + // identify additional optionals in the same arg string + // (e.g. -xyz is the same as -x -y -z if no args are required) + let action_tuples = [] + let stop + for (;;) { + + // if we found no optional action, skip it + if (action === undefined) { + extras.push(arg_strings[start_index]) + return start_index + 1 + } + + // if there is an explicit argument, try to match the + // optional's string arguments to only this + if (explicit_arg !== undefined) { + let arg_count = this._match_argument(action, 'A') + + // if the action is a single-dash option and takes no + // arguments, try to parse more single-dash options out + // of the tail of the option string + let chars = this.prefix_chars + if (arg_count === 0 && !chars.includes(option_string[1])) { + action_tuples.push([ action, [], option_string ]) + let char = option_string[0] + option_string = char + explicit_arg[0] + let new_explicit_arg = explicit_arg.slice(1) || undefined + let optionals_map = this._option_string_actions + if (hasattr(optionals_map, option_string)) { + action = optionals_map[option_string] + explicit_arg = new_explicit_arg + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if the action expect exactly one argument, we've + // successfully matched the option; exit the loop + } else if (arg_count === 1) { + stop = start_index + 1 + let args = [ explicit_arg ] + action_tuples.push([ action, args, option_string ]) + break + + // error if a double-dash option did not use the + // explicit argument + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if there is no explicit argument, try to match the + // optional's string arguments with the following strings + // if successful, exit the loop + } else { + let start = start_index + 1 + let selected_patterns = arg_strings_pattern.slice(start) + let arg_count = this._match_argument(action, selected_patterns) + stop = start + arg_count + let args = arg_strings.slice(start, stop) + action_tuples.push([ action, args, option_string ]) + break + } + } + + // add the Optional to the list and return the index at which + // the Optional's string args stopped + assert(action_tuples.length) + for (let [ action, args, option_string ] of action_tuples) { + take_action(action, args, option_string) + } + return stop + } + + // the list of Positionals left to be parsed; this is modified + // by consume_positionals() + let positionals = this._get_positional_actions() + + // function to convert arg_strings into positional actions + let consume_positionals = start_index => { + // match as many Positionals as possible + let selected_pattern = arg_strings_pattern.slice(start_index) + let arg_counts = this._match_arguments_partial(positionals, selected_pattern) + + // slice off the appropriate arg strings for each Positional + // and add the Positional and its args to the list + for (let i = 0; i < positionals.length && i < arg_counts.length; i++) { + let action = positionals[i] + let arg_count = arg_counts[i] + let args = arg_strings.slice(start_index, start_index + arg_count) + start_index += arg_count + take_action(action, args) + } + + // slice off the Positionals that we just parsed and return the + // index at which the Positionals' string args stopped + positionals = positionals.slice(arg_counts.length) + return start_index + } + + // consume Positionals and Optionals alternately, until we have + // passed the last option string + extras = [] + let start_index = 0 + let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number)) + while (start_index <= max_option_string_index) { + + // consume any Positionals preceding the next option + let next_option_string_index = Math.min( + // eslint-disable-next-line no-loop-func + ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index) + ) + if (start_index !== next_option_string_index) { + let positionals_end_index = consume_positionals(start_index) + + // only try to parse the next optional if we didn't consume + // the option string during the positionals parsing + if (positionals_end_index > start_index) { + start_index = positionals_end_index + continue + } else { + start_index = positionals_end_index + } + } + + // if we consumed all the positionals we could and we're not + // at the index of an option string, there were extra arguments + if (!(start_index in option_string_indices)) { + let strings = arg_strings.slice(start_index, next_option_string_index) + extras = extras.concat(strings) + start_index = next_option_string_index + } + + // consume the next optional and any arguments for it + start_index = consume_optional(start_index) + } + + // consume any positionals following the last Optional + let stop_index = consume_positionals(start_index) + + // if we didn't consume all the argument strings, there were extras + extras = extras.concat(arg_strings.slice(stop_index)) + + // make sure all required actions were present and also convert + // action defaults which were not given as arguments + let required_actions = [] + for (let action of this._actions) { + if (!seen_actions.has(action)) { + if (action.required) { + required_actions.push(_get_action_name(action)) + } else { + // Convert action default now instead of doing it before + // parsing arguments to avoid calling convert functions + // twice (which may fail) if the argument was given, but + // only if it was defined already in the namespace + if (action.default !== undefined && + typeof action.default === 'string' && + hasattr(namespace, action.dest) && + action.default === getattr(namespace, action.dest)) { + setattr(namespace, action.dest, + this._get_value(action, action.default)) + } + } + } + } + + if (required_actions.length) { + this.error(sub('the following arguments are required: %s', + required_actions.join(', '))) + } + + // make sure all required groups had one option present + for (let group of this._mutually_exclusive_groups) { + if (group.required) { + let no_actions_used = true + for (let action of group._group_actions) { + if (seen_non_default_actions.has(action)) { + no_actions_used = false + break + } + } + + // if no actions were used, report the error + if (no_actions_used) { + let names = group._group_actions + .filter(action => action.help !== SUPPRESS) + .map(action => _get_action_name(action)) + let msg = 'one of the arguments %s is required' + this.error(sub(msg, names.join(' '))) + } + } + } + + // return the updated namespace and the extra arguments + return [ namespace, extras ] + } + + _read_args_from_files(arg_strings) { + // expand arguments referencing files + let new_arg_strings = [] + for (let arg_string of arg_strings) { + + // for regular arguments, just add them back into the list + if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) { + new_arg_strings.push(arg_string) + + // replace arguments referencing files with the file content + } else { + try { + let args_file = fs.readFileSync(arg_string.slice(1), 'utf8') + let arg_strings = [] + for (let arg_line of splitlines(args_file)) { + for (let arg of this.convert_arg_line_to_args(arg_line)) { + arg_strings.push(arg) + } + } + arg_strings = this._read_args_from_files(arg_strings) + new_arg_strings = new_arg_strings.concat(arg_strings) + } catch (err) { + this.error(err.message) + } + } + } + + // return the modified argument list + return new_arg_strings + } + + convert_arg_line_to_args(arg_line) { + return [arg_line] + } + + _match_argument(action, arg_strings_pattern) { + // match the pattern for this action to the arg strings + let nargs_pattern = this._get_nargs_pattern(action) + let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern)) + + // raise an exception if we weren't able to find a match + if (match === null) { + let nargs_errors = { + undefined: 'expected one argument', + [OPTIONAL]: 'expected at most one argument', + [ONE_OR_MORE]: 'expected at least one argument' + } + let msg = nargs_errors[action.nargs] + if (msg === undefined) { + msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs) + } + throw new ArgumentError(action, msg) + } + + // return the number of arguments matched + return match[1].length + } + + _match_arguments_partial(actions, arg_strings_pattern) { + // progressively shorten the actions list by slicing off the + // final actions until we find a match + let result = [] + for (let i of range(actions.length, 0, -1)) { + let actions_slice = actions.slice(0, i) + let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('') + let match = arg_strings_pattern.match(new RegExp('^' + pattern)) + if (match !== null) { + result = result.concat(match.slice(1).map(string => string.length)) + break + } + } + + // return the list of arg string counts + return result + } + + _parse_optional(arg_string) { + // if it's an empty string, it was meant to be a positional + if (!arg_string) { + return undefined + } + + // if it doesn't start with a prefix, it was meant to be positional + if (!this.prefix_chars.includes(arg_string[0])) { + return undefined + } + + // if the option string is present in the parser, return the action + if (arg_string in this._option_string_actions) { + let action = this._option_string_actions[arg_string] + return [ action, arg_string, undefined ] + } + + // if it's just a single character, it was meant to be positional + if (arg_string.length === 1) { + return undefined + } + + // if the option string before the "=" is present, return the action + if (arg_string.includes('=')) { + let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1) + if (option_string in this._option_string_actions) { + let action = this._option_string_actions[option_string] + return [ action, option_string, explicit_arg ] + } + } + + // search through all possible prefixes of the option string + // and all actions in the parser for possible interpretations + let option_tuples = this._get_option_tuples(arg_string) + + // if multiple actions match, the option string was ambiguous + if (option_tuples.length > 1) { + let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ') + let args = {option: arg_string, matches: options} + let msg = 'ambiguous option: %(option)s could match %(matches)s' + this.error(sub(msg, args)) + + // if exactly one action matched, this segmentation is good, + // so return the parsed action + } else if (option_tuples.length === 1) { + let [ option_tuple ] = option_tuples + return option_tuple + } + + // if it was not found as an option, but it looks like a negative + // number, it was meant to be positional + // unless there are negative-number-like options + if (this._negative_number_matcher.test(arg_string)) { + if (!this._has_negative_number_optionals.length) { + return undefined + } + } + + // if it contains a space, it was meant to be a positional + if (arg_string.includes(' ')) { + return undefined + } + + // it was meant to be an optional but there is no such option + // in this parser (though it might be a valid option in a subparser) + return [ undefined, arg_string, undefined ] + } + + _get_option_tuples(option_string) { + let result = [] + + // option strings starting with two prefix characters are only + // split at the '=' + let chars = this.prefix_chars + if (chars.includes(option_string[0]) && chars.includes(option_string[1])) { + if (this.allow_abbrev) { + let option_prefix, explicit_arg + if (option_string.includes('=')) { + [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1) + } else { + option_prefix = option_string + explicit_arg = undefined + } + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + } + + // single character options can be concatenated with their arguments + // but multiple character options always have to have their argument + // separate + } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) { + let option_prefix = option_string + let explicit_arg = undefined + let short_option_prefix = option_string.slice(0, 2) + let short_explicit_arg = option_string.slice(2) + + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string === short_option_prefix) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, short_explicit_arg ] + result.push(tup) + } else if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + + // shouldn't ever get here + } else { + this.error(sub('unexpected option string: %s', option_string)) + } + + // return the collected option tuples + return result + } + + _get_nargs_pattern(action) { + // in all examples below, we have to allow for '--' args + // which are represented as '-' in the pattern + let nargs = action.nargs + let nargs_pattern + + // the default (None) is assumed to be a single argument + if (nargs === undefined) { + nargs_pattern = '(-*A-*)' + + // allow zero or one arguments + } else if (nargs === OPTIONAL) { + nargs_pattern = '(-*A?-*)' + + // allow zero or more arguments + } else if (nargs === ZERO_OR_MORE) { + nargs_pattern = '(-*[A-]*)' + + // allow one or more arguments + } else if (nargs === ONE_OR_MORE) { + nargs_pattern = '(-*A[A-]*)' + + // allow any number of options or arguments + } else if (nargs === REMAINDER) { + nargs_pattern = '([-AO]*)' + + // allow one argument followed by any number of options or arguments + } else if (nargs === PARSER) { + nargs_pattern = '(-*A[-AO]*)' + + // suppress action, like nargs=0 + } else if (nargs === SUPPRESS) { + nargs_pattern = '(-*-*)' + + // all others should be integers + } else { + nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*')) + } + + // if this is an optional action, -- is not allowed + if (action.option_strings.length) { + nargs_pattern = nargs_pattern.replace(/-\*/g, '') + nargs_pattern = nargs_pattern.replace(/-/g, '') + } + + // return the pattern + return nargs_pattern + } + + // ======================== + // Alt command line argument parsing, allowing free intermix + // ======================== + + parse_intermixed_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_intermixed_args(args, namespace) + if (argv.length) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_intermixed_args(args = undefined, namespace = undefined) { + // returns a namespace and list of extras + // + // positional can be freely intermixed with optionals. optionals are + // first parsed with all positional arguments deactivated. The 'extras' + // are then parsed. If the parser definition is incompatible with the + // intermixed assumptions (e.g. use of REMAINDER, subparsers) a + // TypeError is raised. + // + // positionals are 'deactivated' by setting nargs and default to + // SUPPRESS. This blocks the addition of that positional to the + // namespace + + let extras + let positionals = this._get_positional_actions() + let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs)) + if (a.length) { + throw new TypeError(sub('parse_intermixed_args: positional arg' + + ' with nargs=%s', a[0].nargs)) + } + + for (let group of this._mutually_exclusive_groups) { + for (let action of group._group_actions) { + if (positionals.includes(action)) { + throw new TypeError('parse_intermixed_args: positional in' + + ' mutuallyExclusiveGroup') + } + } + } + + let save_usage + try { + save_usage = this.usage + let remaining_args + try { + if (this.usage === undefined) { + // capture the full usage for use in error messages + this.usage = this.format_usage().slice(7) + } + for (let action of positionals) { + // deactivate positionals + action.save_nargs = action.nargs + // action.nargs = 0 + action.nargs = SUPPRESS + action.save_default = action.default + action.default = SUPPRESS + } + [ namespace, remaining_args ] = this.parse_known_args(args, + namespace) + for (let action of positionals) { + // remove the empty positional values from namespace + let attr = getattr(namespace, action.dest) + if (Array.isArray(attr) && attr.length === 0) { + // eslint-disable-next-line no-console + console.warn(sub('Do not expect %s in %s', action.dest, namespace)) + delattr(namespace, action.dest) + } + } + } finally { + // restore nargs and usage before exiting + for (let action of positionals) { + action.nargs = action.save_nargs + action.default = action.save_default + } + } + let optionals = this._get_optional_actions() + try { + // parse positionals. optionals aren't normally required, but + // they could be, so make sure they aren't. + for (let action of optionals) { + action.save_required = action.required + action.required = false + } + for (let group of this._mutually_exclusive_groups) { + group.save_required = group.required + group.required = false + } + [ namespace, extras ] = this.parse_known_args(remaining_args, + namespace) + } finally { + // restore parser values before exiting + for (let action of optionals) { + action.required = action.save_required + } + for (let group of this._mutually_exclusive_groups) { + group.required = group.save_required + } + } + } finally { + this.usage = save_usage + } + return [ namespace, extras ] + } + + // ======================== + // Value conversion methods + // ======================== + _get_values(action, arg_strings) { + // for everything but PARSER, REMAINDER args, strip out first '--' + if (![PARSER, REMAINDER].includes(action.nargs)) { + try { + _array_remove(arg_strings, '--') + } catch (err) {} + } + + let value + // optional argument produces a default when not present + if (!arg_strings.length && action.nargs === OPTIONAL) { + if (action.option_strings.length) { + value = action.const + } else { + value = action.default + } + if (typeof value === 'string') { + value = this._get_value(action, value) + this._check_value(action, value) + } + + // when nargs='*' on a positional, if there were no command-line + // args, use the default if it is anything other than None + } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE && + !action.option_strings.length) { + if (action.default !== undefined) { + value = action.default + } else { + value = arg_strings + } + this._check_value(action, value) + + // single argument or optional argument produces a single value + } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) { + let arg_string = arg_strings[0] + value = this._get_value(action, arg_string) + this._check_value(action, value) + + // REMAINDER arguments convert all values, checking none + } else if (action.nargs === REMAINDER) { + value = arg_strings.map(v => this._get_value(action, v)) + + // PARSER arguments convert all values, but check only the first + } else if (action.nargs === PARSER) { + value = arg_strings.map(v => this._get_value(action, v)) + this._check_value(action, value[0]) + + // SUPPRESS argument does not put anything in the namespace + } else if (action.nargs === SUPPRESS) { + value = SUPPRESS + + // all other types of nargs produce a list + } else { + value = arg_strings.map(v => this._get_value(action, v)) + for (let v of value) { + this._check_value(action, v) + } + } + + // return the converted value + return value + } + + _get_value(action, arg_string) { + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + let msg = '%r is not callable' + throw new ArgumentError(action, sub(msg, type_func)) + } + + // convert the value to the appropriate type + let result + try { + try { + result = type_func(arg_string) + } catch (err) { + // Dear TC39, why would you ever consider making es6 classes not callable? + // We had one universal interface, [[Call]], which worked for anything + // (with familiar this-instanceof guard for classes). Now we have two. + if (err instanceof TypeError && + /Class constructor .* cannot be invoked without 'new'/.test(err.message)) { + // eslint-disable-next-line new-cap + result = new type_func(arg_string) + } else { + throw err + } + } + + } catch (err) { + // ArgumentTypeErrors indicate errors + if (err instanceof ArgumentTypeError) { + //let name = getattr(action.type, 'name', repr(action.type)) + let msg = err.message + throw new ArgumentError(action, msg) + + // TypeErrors or ValueErrors also indicate errors + } else if (err instanceof TypeError) { + let name = getattr(action.type, 'name', repr(action.type)) + let args = {type: name, value: arg_string} + let msg = 'invalid %(type)s value: %(value)r' + throw new ArgumentError(action, sub(msg, args)) + } else { + throw err + } + } + + // return the converted value + return result + } + + _check_value(action, value) { + // converted value must be one of the choices (if specified) + if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) { + let args = {value, + choices: _choices_to_array(action.choices).map(repr).join(', ')} + let msg = 'invalid choice: %(value)r (choose from %(choices)s)' + throw new ArgumentError(action, sub(msg, args)) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_usage() { + let formatter = this._get_formatter() + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + return formatter.format_help() + } + + format_help() { + let formatter = this._get_formatter() + + // usage + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + + // description + formatter.add_text(this.description) + + // positionals, optionals and user-defined groups + for (let action_group of this._action_groups) { + formatter.start_section(action_group.title) + formatter.add_text(action_group.description) + formatter.add_arguments(action_group._group_actions) + formatter.end_section() + } + + // epilog + formatter.add_text(this.epilog) + + // determine help from format above + return formatter.format_help() + } + + _get_formatter() { + // eslint-disable-next-line new-cap + return new this.formatter_class({ prog: this.prog }) + } + + // ===================== + // Help-printing methods + // ===================== + print_usage(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_usage(), file) + } + + print_help(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_help(), file) + } + + _print_message(message, file = undefined) { + if (message) { + if (file === undefined) file = process.stderr + file.write(message) + } + } + + // =============== + // Exiting methods + // =============== + exit(status = 0, message = undefined) { + if (message) { + this._print_message(message, process.stderr) + } + process.exit(status) + } + + error(message) { + /* + * error(message: string) + * + * Prints a usage message incorporating the message to stderr and + * exits. + * + * If you override this in a subclass, it should not return -- it + * should either exit or raise an exception. + */ + + // LEGACY (v1 compatibility), debug mode + if (this.debug === true) throw new Error(message) + // end + this.print_usage(process.stderr) + let args = {prog: this.prog, message: message} + this.exit(2, sub('%(prog)s: error: %(message)s\n', args)) + } +})) + + +module.exports = { + ArgumentParser, + ArgumentError, + ArgumentTypeError, + BooleanOptionalAction, + FileType, + HelpFormatter, + ArgumentDefaultsHelpFormatter, + RawDescriptionHelpFormatter, + RawTextHelpFormatter, + MetavarTypeHelpFormatter, + Namespace, + Action, + ONE_OR_MORE, + OPTIONAL, + PARSER, + REMAINDER, + SUPPRESS, + ZERO_OR_MORE +} + +// LEGACY (v1 compatibility), Const alias +Object.defineProperty(module.exports, 'Const', { + get() { + let result = {} + Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n)) + return v + } + }) + }) + Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n)) + return v + } + }) + }) + return result + }, + enumerable: false +}) +// end diff --git a/node_modules/@eslint/eslintrc/node_modules/argparse/lib/sub.js b/node_modules/@eslint/eslintrc/node_modules/argparse/lib/sub.js new file mode 100644 index 000000000..e3eb3215f --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/lib/sub.js @@ -0,0 +1,67 @@ +// Limited implementation of python % string operator, supports only %s and %r for now +// (other formats are not used here, but may appear in custom templates) + +'use strict' + +const { inspect } = require('util') + + +module.exports = function sub(pattern, ...values) { + let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g + + let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) { + if (is_literal) return '%' + + let padded_count = 0 + if (is_padded) { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + padded_count = values.shift() + if (!Number.isInteger(padded_count)) throw new TypeError('* wants int') + } + + let str + if (name !== undefined) { + let dict = values[0] + if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping') + if (!(name in dict)) throw new TypeError(`no such key: '${name}'`) + str = dict[name] + } else { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + str = values.shift() + } + + switch (format) { + case 's': + str = String(str) + break + case 'r': + str = inspect(str) + break + case 'd': + case 'i': + if (typeof str !== 'number') { + throw new TypeError(`%${format} format: a number is required, not ${typeof str}`) + } + str = String(str.toFixed(0)) + break + default: + throw new TypeError(`unsupported format character '${format}'`) + } + + if (padded_count > 0) { + return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count) + } else { + return str + } + }) + + if (values.length) { + if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) { + // mapping + } else { + throw new TypeError('not all arguments converted during string formatting') + } + } + + return result +} diff --git a/node_modules/@eslint/eslintrc/node_modules/argparse/lib/textwrap.js b/node_modules/@eslint/eslintrc/node_modules/argparse/lib/textwrap.js new file mode 100644 index 000000000..23d51cdb9 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/lib/textwrap.js @@ -0,0 +1,440 @@ +// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions): +// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py + +'use strict' + +/* + * Text wrapping and filling. + */ + +// Copyright (C) 1999-2001 Gregory P. Ward. +// Copyright (C) 2002, 2003 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors +// Originally written by Greg Ward + +// Hardcode the recognized whitespace characters to the US-ASCII +// whitespace characters. The main reason for doing this is that +// some Unicode spaces (like \u00a0) are non-breaking whitespaces. +// +// This less funky little regex just split on recognized spaces. E.g. +// "Hello there -- you goof-ball, use the -b option!" +// splits into +// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/ +const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/ + +class TextWrapper { + /* + * Object for wrapping/filling text. The public interface consists of + * the wrap() and fill() methods; the other methods are just there for + * subclasses to override in order to tweak the default behaviour. + * If you want to completely replace the main wrapping algorithm, + * you'll probably have to override _wrap_chunks(). + * + * Several instance attributes control various aspects of wrapping: + * width (default: 70) + * the maximum width of wrapped lines (unless break_long_words + * is false) + * initial_indent (default: "") + * string that will be prepended to the first line of wrapped + * output. Counts towards the line's width. + * subsequent_indent (default: "") + * string that will be prepended to all lines save the first + * of wrapped output; also counts towards each line's width. + * expand_tabs (default: true) + * Expand tabs in input text to spaces before further processing. + * Each tab will become 0 .. 'tabsize' spaces, depending on its position + * in its line. If false, each tab is treated as a single character. + * tabsize (default: 8) + * Expand tabs in input text to 0 .. 'tabsize' spaces, unless + * 'expand_tabs' is false. + * replace_whitespace (default: true) + * Replace all whitespace characters in the input text by spaces + * after tab expansion. Note that if expand_tabs is false and + * replace_whitespace is true, every tab will be converted to a + * single space! + * fix_sentence_endings (default: false) + * Ensure that sentence-ending punctuation is always followed + * by two spaces. Off by default because the algorithm is + * (unavoidably) imperfect. + * break_long_words (default: true) + * Break words longer than 'width'. If false, those words will not + * be broken, and some lines might be longer than 'width'. + * break_on_hyphens (default: true) + * Allow breaking hyphenated words. If true, wrapping will occur + * preferably on whitespaces and right after hyphens part of + * compound words. + * drop_whitespace (default: true) + * Drop leading and trailing whitespace from lines. + * max_lines (default: None) + * Truncate wrapped lines. + * placeholder (default: ' [...]') + * Append to the last line of truncated text. + */ + + constructor(options = {}) { + let { + width = 70, + initial_indent = '', + subsequent_indent = '', + expand_tabs = true, + replace_whitespace = true, + fix_sentence_endings = false, + break_long_words = true, + drop_whitespace = true, + break_on_hyphens = true, + tabsize = 8, + max_lines = undefined, + placeholder=' [...]' + } = options + + this.width = width + this.initial_indent = initial_indent + this.subsequent_indent = subsequent_indent + this.expand_tabs = expand_tabs + this.replace_whitespace = replace_whitespace + this.fix_sentence_endings = fix_sentence_endings + this.break_long_words = break_long_words + this.drop_whitespace = drop_whitespace + this.break_on_hyphens = break_on_hyphens + this.tabsize = tabsize + this.max_lines = max_lines + this.placeholder = placeholder + } + + + // -- Private methods ----------------------------------------------- + // (possibly useful for subclasses to override) + + _munge_whitespace(text) { + /* + * _munge_whitespace(text : string) -> string + * + * Munge whitespace in text: expand tabs and convert all other + * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" + * becomes " foo bar baz". + */ + if (this.expand_tabs) { + text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js + } + if (this.replace_whitespace) { + text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ') + } + return text + } + + _split(text) { + /* + * _split(text : string) -> [string] + * + * Split the text to wrap into indivisible chunks. Chunks are + * not quite the same as words; see _wrap_chunks() for full + * details. As an example, the text + * Look, goof-ball -- use the -b option! + * breaks into the following chunks: + * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', 'option!' + * if break_on_hyphens is True, or in: + * 'Look,', ' ', 'goof-ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', option!' + * otherwise. + */ + let chunks = text.split(wordsep_simple_re) + chunks = chunks.filter(Boolean) + return chunks + } + + _handle_long_word(reversed_chunks, cur_line, cur_len, width) { + /* + * _handle_long_word(chunks : [string], + * cur_line : [string], + * cur_len : int, width : int) + * + * Handle a chunk of text (most likely a word, not whitespace) that + * is too long to fit in any line. + */ + // Figure out when indent is larger than the specified width, and make + // sure at least one character is stripped off on every pass + let space_left + if (width < 1) { + space_left = 1 + } else { + space_left = width - cur_len + } + + // If we're allowed to break long words, then do so: put as much + // of the next chunk onto the current line as will fit. + if (this.break_long_words) { + cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left)) + reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left) + + // Otherwise, we have to preserve the long word intact. Only add + // it to the current line if there's nothing already there -- + // that minimizes how much we violate the width constraint. + } else if (!cur_line) { + cur_line.push(...reversed_chunks.pop()) + } + + // If we're not allowed to break long words, and there's already + // text on the current line, do nothing. Next time through the + // main loop of _wrap_chunks(), we'll wind up here again, but + // cur_len will be zero, so the next line will be entirely + // devoted to the long word that we can't handle right now. + } + + _wrap_chunks(chunks) { + /* + * _wrap_chunks(chunks : [string]) -> [string] + * + * Wrap a sequence of text chunks and return a list of lines of + * length 'self.width' or less. (If 'break_long_words' is false, + * some lines may be longer than this.) Chunks correspond roughly + * to words and the whitespace between them: each chunk is + * indivisible (modulo 'break_long_words'), but a line break can + * come between any two chunks. Chunks should not have internal + * whitespace; ie. a chunk is either all whitespace or a "word". + * Whitespace chunks will be removed from the beginning and end of + * lines, but apart from that whitespace is preserved. + */ + let lines = [] + let indent + if (this.width <= 0) { + throw Error(`invalid width ${this.width} (must be > 0)`) + } + if (this.max_lines !== undefined) { + if (this.max_lines > 1) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + if (indent.length + this.placeholder.trimStart().length > this.width) { + throw Error('placeholder too large for max width') + } + } + + // Arrange in reverse order so items can be efficiently popped + // from a stack of chucks. + chunks = chunks.reverse() + + while (chunks.length > 0) { + + // Start the list of chunks that will make up the current line. + // cur_len is just the length of all the chunks in cur_line. + let cur_line = [] + let cur_len = 0 + + // Figure out which static string will prefix this line. + let indent + if (lines) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + + // Maximum width for this line. + let width = this.width - indent.length + + // First chunk on line is whitespace -- drop it, unless this + // is the very beginning of the text (ie. no lines started yet). + if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) { + chunks.pop() + } + + while (chunks.length > 0) { + let l = chunks[chunks.length - 1].length + + // Can at least squeeze this chunk onto the current line. + if (cur_len + l <= width) { + cur_line.push(chunks.pop()) + cur_len += l + + // Nope, this line is full. + } else { + break + } + } + + // The current line is full, and the next chunk is too big to + // fit on *any* line (not just this one). + if (chunks.length && chunks[chunks.length - 1].length > width) { + this._handle_long_word(chunks, cur_line, cur_len, width) + cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0) + } + + // If the last chunk on this line is all whitespace, drop it. + if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') { + cur_len -= cur_line[cur_line.length - 1].length + cur_line.pop() + } + + if (cur_line) { + if (this.max_lines === undefined || + lines.length + 1 < this.max_lines || + (chunks.length === 0 || + this.drop_whitespace && + chunks.length === 1 && + !chunks[0].trim()) && cur_len <= width) { + // Convert current line back to a string and store it in + // list of all lines (return value). + lines.push(indent + cur_line.join('')) + } else { + let had_break = false + while (cur_line) { + if (cur_line[cur_line.length - 1].trim() && + cur_len + this.placeholder.length <= width) { + cur_line.push(this.placeholder) + lines.push(indent + cur_line.join('')) + had_break = true + break + } + cur_len -= cur_line[-1].length + cur_line.pop() + } + if (!had_break) { + if (lines) { + let prev_line = lines[lines.length - 1].trimEnd() + if (prev_line.length + this.placeholder.length <= + this.width) { + lines[lines.length - 1] = prev_line + this.placeholder + break + } + } + lines.push(indent + this.placeholder.lstrip()) + } + break + } + } + } + + return lines + } + + _split_chunks(text) { + text = this._munge_whitespace(text) + return this._split(text) + } + + // -- Public interface ---------------------------------------------- + + wrap(text) { + /* + * wrap(text : string) -> [string] + * + * Reformat the single paragraph in 'text' so it fits in lines of + * no more than 'self.width' columns, and return a list of wrapped + * lines. Tabs in 'text' are expanded with string.expandtabs(), + * and all other whitespace characters (including newline) are + * converted to space. + */ + let chunks = this._split_chunks(text) + // not implemented in js + //if (this.fix_sentence_endings) { + // this._fix_sentence_endings(chunks) + //} + return this._wrap_chunks(chunks) + } + + fill(text) { + /* + * fill(text : string) -> string + * + * Reformat the single paragraph in 'text' to fit in lines of no + * more than 'self.width' columns, and return a new string + * containing the entire wrapped paragraph. + */ + return this.wrap(text).join('\n') + } +} + + +// -- Convenience interface --------------------------------------------- + +function wrap(text, options = {}) { + /* + * Wrap a single paragraph of text, returning a list of wrapped lines. + * + * Reformat the single paragraph in 'text' so it fits in lines of no + * more than 'width' columns, and return a list of wrapped lines. By + * default, tabs in 'text' are expanded with string.expandtabs(), and + * all other whitespace characters (including newline) are converted to + * space. See TextWrapper class for available keyword args to customize + * wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.wrap(text) +} + +function fill(text, options = {}) { + /* + * Fill a single paragraph of text, returning a new string. + * + * Reformat the single paragraph in 'text' to fit in lines of no more + * than 'width' columns, and return a new string containing the entire + * wrapped paragraph. As with wrap(), tabs are expanded and other + * whitespace characters converted to space. See TextWrapper class for + * available keyword args to customize wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.fill(text) +} + +// -- Loosely related functionality ------------------------------------- + +let _whitespace_only_re = /^[ \t]+$/mg +let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg + +function dedent(text) { + /* + * Remove any common leading whitespace from every line in `text`. + * + * This can be used to make triple-quoted strings line up with the left + * edge of the display, while still presenting them in the source code + * in indented form. + * + * Note that tabs and spaces are both treated as whitespace, but they + * are not equal: the lines " hello" and "\\thello" are + * considered to have no common leading whitespace. + * + * Entirely blank lines are normalized to a newline character. + */ + // Look for the longest leading string of spaces and tabs common to + // all lines. + let margin = undefined + text = text.replace(_whitespace_only_re, '') + let indents = text.match(_leading_whitespace_re) || [] + for (let indent of indents) { + indent = indent.slice(0, -1) + + if (margin === undefined) { + margin = indent + + // Current line more deeply indented than previous winner: + // no change (previous winner is still on top). + } else if (indent.startsWith(margin)) { + // pass + + // Current line consistent with and no deeper than previous winner: + // it's the new winner. + } else if (margin.startsWith(indent)) { + margin = indent + + // Find the largest common whitespace between current line and previous + // winner. + } else { + for (let i = 0; i < margin.length && i < indent.length; i++) { + if (margin[i] !== indent[i]) { + margin = margin.slice(0, i) + break + } + } + } + } + + if (margin) { + text = text.replace(new RegExp('^' + margin, 'mg'), '') + } + return text +} + +module.exports = { wrap, fill, dedent } diff --git a/node_modules/@eslint/eslintrc/node_modules/argparse/package.json b/node_modules/@eslint/eslintrc/node_modules/argparse/package.json new file mode 100644 index 000000000..647d2aff1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/argparse/package.json @@ -0,0 +1,31 @@ +{ + "name": "argparse", + "description": "CLI arguments parser. Native port of python's argparse.", + "version": "2.0.1", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "main": "argparse.js", + "files": [ + "argparse.js", + "lib/" + ], + "license": "Python-2.0", + "repository": "nodeca/argparse", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && nyc mocha", + "coverage": "npm run test && nyc report --reporter html" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.11.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", + "eslint": "^7.5.0", + "mocha": "^8.0.1", + "nyc": "^15.1.0" + } +} diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/globals.json b/node_modules/@eslint/eslintrc/node_modules/globals/globals.json index b85dc3f80..c8460073c 100644 --- a/node_modules/@eslint/eslintrc/node_modules/globals/globals.json +++ b/node_modules/@eslint/eslintrc/node_modules/globals/globals.json @@ -1,5 +1,6 @@ { "builtin": { + "AggregateError": false, "Array": false, "ArrayBuffer": false, "Atomics": false, @@ -18,6 +19,7 @@ "escape": false, "eval": false, "EvalError": false, + "FinalizationRegistry": false, "Float32Array": false, "Float64Array": false, "Function": false, @@ -62,6 +64,7 @@ "URIError": false, "valueOf": false, "WeakMap": false, + "WeakRef": false, "WeakSet": false }, "es5": { @@ -224,6 +227,139 @@ "WeakMap": false, "WeakSet": false }, + "es2020": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2021": { + "AggregateError": false, + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "FinalizationRegistry": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakRef": false, + "WeakSet": false + }, "browser": { "AbortController": false, "AbortSignal": false, @@ -252,7 +388,7 @@ "AudioParam": false, "AudioProcessingEvent": false, "AudioScheduledSourceNode": false, - "AudioWorkletGlobalScope ": false, + "AudioWorkletGlobalScope": false, "AudioWorkletNode": false, "AudioWorkletProcessor": false, "BarProp": false, @@ -283,6 +419,7 @@ "clearTimeout": false, "clientInformation": false, "ClipboardEvent": false, + "ClipboardItem": false, "close": false, "closed": false, "CloseEvent": false, @@ -306,15 +443,24 @@ "CSSImportRule": false, "CSSKeyframeRule": false, "CSSKeyframesRule": false, + "CSSMatrixComponent": false, "CSSMediaRule": false, "CSSNamespaceRule": false, "CSSPageRule": false, + "CSSPerspective": false, + "CSSRotate": false, "CSSRule": false, "CSSRuleList": false, + "CSSScale": false, + "CSSSkew": false, + "CSSSkewX": false, + "CSSSkewY": false, "CSSStyleDeclaration": false, "CSSStyleRule": false, "CSSStyleSheet": false, "CSSSupportsRule": false, + "CSSTransformValue": false, + "CSSTranslate": false, "CustomElementRegistry": false, "customElements": false, "CustomEvent": false, @@ -342,6 +488,7 @@ "DOMPointReadOnly": false, "DOMQuad": false, "DOMRect": false, + "DOMRectList": false, "DOMRectReadOnly": false, "DOMStringList": false, "DOMStringMap": false, @@ -365,6 +512,7 @@ "FontFace": false, "FontFaceSetLoadEvent": false, "FormData": false, + "FormDataEvent": false, "frameElement": false, "frames": false, "GainNode": false, @@ -500,6 +648,7 @@ "MediaKeyStatusMap": false, "MediaKeySystemAccess": false, "MediaList": false, + "MediaMetadata": false, "MediaQueryList": false, "MediaQueryListEvent": false, "MediaRecorder": false, @@ -536,6 +685,7 @@ "NavigationPreloadManager": false, "navigator": false, "Navigator": false, + "NavigatorUAData": false, "NetworkInformation": false, "Node": false, "NodeFilter": false, @@ -546,6 +696,7 @@ "OfflineAudioContext": false, "offscreenBuffering": false, "OffscreenCanvas": true, + "OffscreenCanvasRenderingContext2D": false, "onabort": true, "onafterprint": true, "onanimationend": true, @@ -650,6 +801,7 @@ "OscillatorNode": false, "outerHeight": false, "outerWidth": false, + "OverconstrainedError": false, "PageTransitionEvent": false, "pageXOffset": false, "pageYOffset": false, @@ -706,6 +858,7 @@ "registerProcessor": false, "RemotePlayback": false, "removeEventListener": false, + "reportError": false, "Request": false, "requestAnimationFrame": false, "requestIdleCallback": false, @@ -768,9 +921,11 @@ "Storage": false, "StorageEvent": false, "StorageManager": false, + "structuredClone": false, "styleMedia": false, "StyleSheet": false, "StyleSheetList": false, + "SubmitEvent": false, "SubtleCrypto": false, "SVGAElement": false, "SVGAngle": false, @@ -887,6 +1042,7 @@ "TouchEvent": false, "TouchList": false, "TrackEvent": false, + "TransformStream": false, "TransitionEvent": false, "TreeWalker": false, "UIEvent": false, @@ -944,6 +1100,9 @@ "clearTimeout": false, "close": true, "console": false, + "CustomEvent": false, + "ErrorEvent": false, + "Event": false, "fetch": false, "FileReaderSync": false, "FormData": false, @@ -964,6 +1123,7 @@ "indexedDB": false, "location": false, "MessageChannel": false, + "MessageEvent": false, "MessagePort": false, "name": false, "navigator": false, @@ -989,6 +1149,7 @@ "Promise": false, "queueMicrotask": false, "removeEventListener": false, + "reportError": false, "Request": false, "Response": false, "self": true, @@ -1007,39 +1168,73 @@ "node": { "__dirname": false, "__filename": false, + "AbortController": false, + "AbortSignal": false, + "atob": false, + "btoa": false, "Buffer": false, "clearImmediate": false, "clearInterval": false, "clearTimeout": false, "console": false, + "DOMException": false, + "Event": false, + "EventTarget": false, "exports": true, + "fetch": false, + "FormData": false, "global": false, + "Headers": false, "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, "module": false, + "performance": false, "process": false, "queueMicrotask": false, + "Request": false, "require": false, + "Response": false, "setImmediate": false, "setInterval": false, "setTimeout": false, + "structuredClone": false, "TextDecoder": false, "TextEncoder": false, "URL": false, "URLSearchParams": false }, "nodeBuiltin": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "btoa": false, "Buffer": false, "clearImmediate": false, "clearInterval": false, "clearTimeout": false, "console": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "FormData": false, "global": false, + "Headers": false, "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "performance": false, "process": false, "queueMicrotask": false, + "Request": false, + "Response": false, "setImmediate": false, "setInterval": false, "setTimeout": false, + "structuredClone": false, "TextDecoder": false, "TextEncoder": false, "URL": false, @@ -1203,20 +1398,19 @@ "quit": false }, "wsh": { - "ActiveXObject": true, - "CollectGarbage": true, - "Debug": true, - "Enumerator": true, - "GetObject": true, - "RuntimeObject": true, - "ScriptEngine": true, - "ScriptEngineBuildVersion": true, - "ScriptEngineMajorVersion": true, - "ScriptEngineMinorVersion": true, - "VBArray": true, - "WScript": true, - "WSH": true, - "XDomainRequest": true + "ActiveXObject": false, + "CollectGarbage": false, + "Debug": false, + "Enumerator": false, + "GetObject": false, + "RuntimeObject": false, + "ScriptEngine": false, + "ScriptEngineBuildVersion": false, + "ScriptEngineMajorVersion": false, + "ScriptEngineMinorVersion": false, + "VBArray": false, + "WScript": false, + "WSH": false }, "jquery": { "$": false, @@ -1299,7 +1493,6 @@ "Try": false }, "meteor": { - "_": false, "$": false, "Accounts": false, "AccountsClient": false, @@ -1405,6 +1598,9 @@ "Clients": false, "close": true, "console": false, + "CustomEvent": false, + "ErrorEvent": false, + "Event": false, "ExtendableEvent": false, "ExtendableMessageEvent": false, "fetch": false, @@ -1428,6 +1624,7 @@ "indexedDB": false, "location": false, "MessageChannel": false, + "MessageEvent": false, "MessagePort": false, "name": false, "navigator": false, @@ -1485,6 +1682,7 @@ }, "atomtest": { "advanceClock": false, + "atom": false, "fakeClearInterval": false, "fakeClearTimeout": false, "fakeSetInterval": false, @@ -1520,11 +1718,32 @@ "protractor": false }, "shared-node-browser": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "btoa": false, "clearInterval": false, "clearTimeout": false, "console": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "FormData": false, + "Headers": false, + "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "performance": false, + "queueMicrotask": false, + "Request": false, + "Response": false, "setInterval": false, "setTimeout": false, + "structuredClone": false, + "TextDecoder": false, + "TextEncoder": false, "URL": false, "URLSearchParams": false }, @@ -1538,18 +1757,27 @@ "createObjectIn": false, "exportFunction": false, "GM": false, + "GM_addElement": false, "GM_addStyle": false, + "GM_addValueChangeListener": false, "GM_deleteValue": false, + "GM_download": false, "GM_getResourceText": false, "GM_getResourceURL": false, + "GM_getTab": false, + "GM_getTabs": false, "GM_getValue": false, "GM_info": false, "GM_listValues": false, "GM_log": false, + "GM_notification": false, "GM_openInTab": false, "GM_registerMenuCommand": false, + "GM_removeValueChangeListener": false, + "GM_saveTab": false, "GM_setClipboard": false, "GM_setValue": false, + "GM_unregisterMenuCommand": false, "GM_xmlhttpRequest": false, "unsafeWindow": false }, diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/package.json b/node_modules/@eslint/eslintrc/node_modules/globals/package.json index dc4f3f1ca..17cc85afb 100644 --- a/node_modules/@eslint/eslintrc/node_modules/globals/package.json +++ b/node_modules/@eslint/eslintrc/node_modules/globals/package.json @@ -1,84 +1,55 @@ { - "_from": "globals@^12.1.0", - "_id": "globals@12.4.0", - "_inBundle": false, - "_integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "_location": "/@eslint/eslintrc/globals", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "globals@^12.1.0", - "name": "globals", - "escapedName": "globals", - "rawSpec": "^12.1.0", - "saveSpec": null, - "fetchSpec": "^12.1.0" - }, - "_requiredBy": [ - "/@eslint/eslintrc" - ], - "_resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "_shasum": "a18813576a41b00a24a97e7f815918c2e19925f8", - "_spec": "globals@^12.1.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/@eslint/eslintrc", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/globals/issues" - }, - "bundleDependencies": false, - "dependencies": { - "type-fest": "^0.8.1" - }, - "deprecated": false, - "description": "Global identifiers from different JavaScript environments", - "devDependencies": { - "ava": "^2.2.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts", - "globals.json" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/globals#readme", - "keywords": [ - "globals", - "global", - "identifiers", - "variables", - "vars", - "jshint", - "eslint", - "environments" - ], - "license": "MIT", - "name": "globals", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/globals.git" - }, - "scripts": { - "test": "xo && ava" - }, - "tsd": { - "compilerOptions": { - "resolveJsonModule": true - } - }, - "version": "12.4.0", - "xo": { - "ignores": [ - "get-browser-globals.js" - ] - } + "name": "globals", + "version": "13.20.0", + "description": "Global identifiers from different JavaScript environments", + "license": "MIT", + "repository": "sindresorhus/globals", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "dependencies": { + "type-fest": "^0.20.2" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.14.0", + "xo": "^0.36.1" + }, + "xo": { + "ignores": [ + "get-browser-globals.js" + ], + "rules": { + "node/no-unsupported-features/es-syntax": "off" + } + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + } } diff --git a/node_modules/@eslint/eslintrc/node_modules/globals/readme.md b/node_modules/@eslint/eslintrc/node_modules/globals/readme.md index fdcfa087a..0ef22c304 100644 --- a/node_modules/@eslint/eslintrc/node_modules/globals/readme.md +++ b/node_modules/@eslint/eslintrc/node_modules/globals/readme.md @@ -1,12 +1,12 @@ -# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals) +# globals > Global identifiers from different JavaScript environments -Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. +It's just a [JSON file](globals.json), so use it in any environment. -It's just a [JSON file](globals.json), so use it in whatever environment you like. +This package is used by ESLint. -**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** +**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** ## Install diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/CHANGELOG.md b/node_modules/@eslint/eslintrc/node_modules/js-yaml/CHANGELOG.md new file mode 100644 index 000000000..ff2375e05 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/CHANGELOG.md @@ -0,0 +1,616 @@ +# 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). + + +## [4.1.0] - 2021-04-15 +### Added +- Types are now exported as `yaml.types.XXX`. +- Every type now has `options` property with original arguments kept as they were + (see `yaml.types.int.options` as an example). + +### Changed +- `Schema.extend()` now keeps old type order in case of conflicts + (e.g. Schema.extend([ a, b, c ]).extend([ b, a, d ]) is now ordered as `abcd` instead of `cbad`). + + +## [4.0.0] - 2021-01-03 +### Changed +- Check [migration guide](migrate_v3_to_v4.md) to see details for all breaking changes. +- Breaking: "unsafe" tags `!!js/function`, `!!js/regexp`, `!!js/undefined` are + moved to [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) package. +- Breaking: removed `safe*` functions. Use `load`, `loadAll`, `dump` + instead which are all now safe by default. +- `yaml.DEFAULT_SAFE_SCHEMA` and `yaml.DEFAULT_FULL_SCHEMA` are removed, use + `yaml.DEFAULT_SCHEMA` instead. +- `yaml.Schema.create(schema, tags)` is removed, use `schema.extend(tags)` instead. +- `!!binary` now always mapped to `Uint8Array` on load. +- Reduced nesting of `/lib` folder. +- Parse numbers according to YAML 1.2 instead of YAML 1.1 (`01234` is now decimal, + `0o1234` is octal, `1:23` is parsed as string instead of base60). +- `dump()` no longer quotes `:`, `[`, `]`, `(`, `)` except when necessary, #470, #557. +- Line and column in exceptions are now formatted as `(X:Y)` instead of + `at line X, column Y` (also present in compact format), #332. +- Code snippet created in exceptions now contains multiple lines with line numbers. +- `dump()` now serializes `undefined` as `null` in collections and removes keys with + `undefined` in mappings, #571. +- `dump()` with `skipInvalid=true` now serializes invalid items in collections as null. +- Custom tags starting with `!` are now dumped as `!tag` instead of `!`, #576. +- Custom tags starting with `tag:yaml.org,2002:` are now shorthanded using `!!`, #258. + +### Added +- Added `.mjs` (es modules) support. +- Added `quotingType` and `forceQuotes` options for dumper to configure + string literal style, #290, #529. +- Added `styles: { '!!null': 'empty' }` option for dumper + (serializes `{ foo: null }` as "`foo: `"), #570. +- Added `replacer` option (similar to option in JSON.stringify), #339. +- Custom `Tag` can now handle all tags or multiple tags with the same prefix, #385. + +### Fixed +- Astral characters are no longer encoded by `dump()`, #587. +- "duplicate mapping key" exception now points at the correct column, #452. +- Extra commas in flow collections (e.g. `[foo,,bar]`) now throw an exception + instead of producing null, #321. +- `__proto__` key no longer overrides object prototype, #164. +- Removed `bower.json`. +- Tags are now url-decoded in `load()` and url-encoded in `dump()` + (previously usage of custom non-ascii tags may have led to invalid YAML that can't be parsed). +- Anchors now work correctly with empty nodes, #301. +- Fix incorrect parsing of invalid block mapping syntax, #418. +- Throw an error if block sequence/mapping indent contains a tab, #80. + + +## [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 + + +[4.1.0]: https://github.com/nodeca/js-yaml/compare/4.0.0...4.1.0 +[4.0.0]: https://github.com/nodeca/js-yaml/compare/3.14.0...4.0.0 +[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/functional-red-black-tree/LICENSE b/node_modules/@eslint/eslintrc/node_modules/js-yaml/LICENSE similarity index 94% rename from node_modules/functional-red-black-tree/LICENSE rename to node_modules/@eslint/eslintrc/node_modules/js-yaml/LICENSE index 8ce206a84..09d3a29e9 100644 --- a/node_modules/functional-red-black-tree/LICENSE +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/LICENSE @@ -1,7 +1,6 @@ +(The MIT License) -The MIT License (MIT) - -Copyright (c) 2013 Mikola Lysenko +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 diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md b/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md new file mode 100644 index 000000000..3cbc4bd2d --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md @@ -0,0 +1,246 @@ +JS-YAML - YAML 1.2 parser / writer for JavaScript +================================================= + +[![CI](https://github.com/nodeca/js-yaml/workflows/CI/badge.svg?branch=master)](https://github.com/nodeca/js-yaml/actions) +[![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 +``` + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [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.load(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### load (string [ , options ]) + +Parses `string` as single YAML document. Returns either a +plain object, a string, a number, `null` or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. + +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_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_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. + + +### loadAll (string [, iterator] [, options ]) + +Same as `load()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.loadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### dump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_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_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. Set `-1` for unlimited 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. +- `quotingType` _(`'` or `"`, default: `'`)_ - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. +- `forceQuotes` _(default: `false`)_ - if `true`, all non-key strings will be quoted even if they normally don't need to. +- `replacer` - callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). + +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" -> "0o1", "0o52", "0o16172" + "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 +dump(object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScript 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** + +See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for +extra types. + + +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/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js new file mode 100755 index 000000000..a182f1afb --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,126 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +var fs = require('fs'); +var argparse = require('argparse'); +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + add_help: true +}); + +cli.add_argument('-v', '--version', { + action: 'version', + version: require('../package.json').version +}); + +cli.add_argument('-c', '--compact', { + help: 'Display errors in compact mode', + action: 'store_true' +}); + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.add_argument('-j', '--to-json', { + help: argparse.SUPPRESS, + dest: 'json', + action: 'store_true' +}); + +cli.add_argument('-t', '--trace', { + help: 'Show stack trace on error', + action: 'store_true' +}); + +cli.add_argument('file', { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + default: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parse_args(); + + +//////////////////////////////////////////////////////////////////////////////// + +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/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 000000000..4cc0ddf6d --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,3874 @@ + +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jsyaml = {})); +}(this, (function (exports) { 'use strict'; + + function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); + } + + + function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); + } + + + function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; + } + + + function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; + } + + + function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; + } + + + function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); + } + + + var isNothing_1 = isNothing; + var isObject_1 = isObject; + var toArray_1 = toArray; + var repeat_1 = repeat; + var isNegativeZero_1 = isNegativeZero; + var extend_1 = extend; + + var common = { + isNothing: isNothing_1, + isObject: isObject_1, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 + }; + + // YAML error class. http://stackoverflow.com/questions/8458984 + + + function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; + } + + + function YAMLException$1(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // 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$1.prototype = Object.create(Error.prototype); + YAMLException$1.prototype.constructor = YAMLException$1; + + + YAMLException$1.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); + }; + + + var exception = YAMLException$1; + + // get snippet for a single line, respecting maxLength + function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; + } + + + function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; + } + + + function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); + } + + + var snippet = makeSnippet; + + var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + '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$1(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + 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.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } + } + + var type = Type$1; + + /*eslint-disable max-len*/ + + + + + + function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; + } + + + function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + 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$1(definition) { + return this.extend(definition); + } + + + Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema$1.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; + }; + + + var schema = Schema$1; + + var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } + }); + + var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } + }); + + var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } + }); + + var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] + }); + + 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; + } + + var _null = 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'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' + }); + + 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]'; + } + + var bool = 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' + }); + + 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 !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + 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) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; + } + + function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + 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.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); + } + + function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); + } + + var int = 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 ? '0o' + obj.toString(8) : '-0o' + 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' ] + } + }); + + var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[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; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + 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; + } + 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)); + } + + var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' + }); + + var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] + }); + + var core = json; + + 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(); + } + + var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp + }); + + function resolveYamlMerge(data) { + return data === '<<' || data === null; + } + + var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge + }); + + /*eslint-disable no-bitwise*/ + + + + + + // [ 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); + } + + return new Uint8Array(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(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; + } + + var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary + }); + + var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; + var _toString$2 = 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$2.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty$3.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 : []; + } + + var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap + }); + + var _toString$1 = 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$1.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; + } + + var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs + }); + + var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + + function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; + } + + function constructYamlSet(data) { + return data !== null ? data : {}; + } + + var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet + }); + + var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] + }); + + /*eslint-disable max-len,no-use-before-define*/ + + + + + + + + var _hasOwnProperty$1 = 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$1(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + 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; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + + } + + + function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = snippet(mark); + + return new exception(message, mark); + } + + 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$1.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'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + 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$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } + } + + function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, 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$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _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; + state.firstTabInLine = -1; + } + + function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + 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, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + 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'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + 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; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + 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, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } 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; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + 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, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // 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, _keyLine, _keyLineStart, _keyPos); + 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 { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + 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, _keyLine, _keyLineStart, _keyPos); + 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`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + 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, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + 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 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, _keyLine, _keyLineStart, _keyPos); + } + + // 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); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.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$1.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) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else 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 (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + 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.tag)) { // `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, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + 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 = Object.create(null); + state.anchorMap = Object.create(null); + + 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$1.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$1(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$1(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$1(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 exception('expected a single document in the stream, but found more'); + } + + + var loadAll_1 = loadAll$1; + var load_1 = load$1; + + var loader = { + loadAll: loadAll_1, + load: load_1 + }; + + /*eslint-disable no-use-before-define*/ + + + + + + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + + var CHAR_BOM = 0xFEFF; + var CHAR_TAB = 0x09; /* Tab */ + var CHAR_LINE_FEED = 0x0A; /* LF */ + var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ + var CHAR_SPACE = 0x20; /* Space */ + var CHAR_EXCLAMATION = 0x21; /* ! */ + var CHAR_DOUBLE_QUOTE = 0x22; /* " */ + var CHAR_SHARP = 0x23; /* # */ + var CHAR_PERCENT = 0x25; /* % */ + var CHAR_AMPERSAND = 0x26; /* & */ + var CHAR_SINGLE_QUOTE = 0x27; /* ' */ + var CHAR_ASTERISK = 0x2A; /* * */ + var CHAR_COMMA = 0x2C; /* , */ + var CHAR_MINUS = 0x2D; /* - */ + var CHAR_COLON = 0x3A; /* : */ + var CHAR_EQUALS = 0x3D; /* = */ + var CHAR_GREATER_THAN = 0x3E; /* > */ + 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' + ]; + + var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + + 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 exception('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; + } + + + var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + + function State(options) { + this.schema = options['schema'] || _default; + 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.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + 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 !== CHAR_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 + // Including s-white (for some reason, examples doesn't match specs in this aspect) + // ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark + function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; + } + + // [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out + // c = flow-in ⇒ ns-plain-safe-in + // c = block-key ⇒ ns-plain-safe-out + // c = flow-key ⇒ ns-plain-safe-in + // [128] ns-plain-safe-out ::= ns-char + // [129] ns-plain-safe-in ::= ns-char - c-flow-indicator + // [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) + // | ( /* An ns-char preceding */ “#” ) + // | ( “:” /* Followed by an ns-plain-safe(c) */ ) + function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - 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 + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' + } + + // 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. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !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; + } + + // Simplified test for values allowed as the last character in plain style. + function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; + } + + // Same as 'string'.codePointAt(pos), but works in older browsers. + function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; + } + + // 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, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + 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(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, 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; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = 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. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : 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. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + + // 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, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + 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, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + 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) + '"'; + default: + throw new exception('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 = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; + } + + function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _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, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _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 (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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 exception('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.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 exception('!<' + 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, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + 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]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + 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$1(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; + } + + var dump_1 = dump$1; + + var dumper = { + dump: dump_1 + }; + + function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; + } + + + var Type = type; + var Schema = schema; + var FAILSAFE_SCHEMA = failsafe; + var JSON_SCHEMA = json; + var CORE_SCHEMA = core; + var DEFAULT_SCHEMA = _default; + var load = loader.load; + var loadAll = loader.loadAll; + var dump = dumper.dump; + var YAMLException = exception; + + // Re-export all types in case user wants to create custom schema + var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str + }; + + // Removed functions from JS-YAML 3.0.x + var safeLoad = renamed('safeLoad', 'load'); + var safeLoadAll = renamed('safeLoadAll', 'loadAll'); + var safeDump = renamed('safeDump', 'dump'); + + var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump + }; + + exports.CORE_SCHEMA = CORE_SCHEMA; + exports.DEFAULT_SCHEMA = DEFAULT_SCHEMA; + exports.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA; + exports.JSON_SCHEMA = JSON_SCHEMA; + exports.Schema = Schema; + exports.Type = Type; + exports.YAMLException = YAMLException; + exports.default = jsYaml; + exports.dump = dump; + exports.load = load; + exports.loadAll = loadAll; + exports.safeDump = safeDump; + exports.safeLoad = safeLoad; + exports.safeLoadAll = safeLoadAll; + exports.types = types; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 000000000..bdd8eef54 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1,2 @@ +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsyaml={})}(this,(function(e){"use strict";function t(e){return null==e}var n={isNothing:t,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:t(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;nl&&(t=i-l+(o=" ... ").length),n-i>l&&(n=i+l-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+o.length}}function l(e,t){return n.repeat(" ",t-e.length)+e}var c=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var i,r=/\r?\n|\r|\0/g,o=[0],c=[],s=-1;i=r.exec(e.buffer);)c.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=o.length-2);s<0&&(s=o.length-1);var u,p,f="",d=Math.min(e.line+t.linesAfter,c.length).toString().length,h=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)p=a(e.buffer,o[s-u],c[s-u],e.position-(o[s]-o[s-u]),h),f=n.repeat(" ",t.indent)+l((e.line-u+1).toString(),d)+" | "+p.str+"\n"+f;for(p=a(e.buffer,o[s],c[s],e.position,h),f+=n.repeat(" ",t.indent)+l((e.line+1).toString(),d)+" | "+p.str+"\n",f+=n.repeat("-",t.indent+d+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(s+u>=c.length);u++)p=a(e.buffer,o[s+u],c[s+u],e.position-(o[s]-o[s+u]),h),f+=n.repeat(" ",t.indent)+l((e.line+u+1).toString(),d)+" | "+p.str+"\n";return f.replace(/\n$/,"")},s=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],u=["scalar","sequence","mapping"];var p=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===s.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===u.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function f(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function d(e){return this.extend(e)}d.prototype.extend=function(e){var t=[],n=[];if(e instanceof p)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new o("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof p))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");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.");if(e.multi)throw new o("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof p))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(d.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=f(i,"implicit"),i.compiledExplicit=f(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),x=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var I=/^[-+]?[0-9]+e/;var S=new p("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!x.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||n.isNegativeZero(e))},represent:function(e,t){var i;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(n.isNegativeZero(e))return"-0.0";return i=e.toString(10),I.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),O=b.extend({implicit:[A,v,C,S]}),j=O,T=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),N=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var F=new p("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==T.exec(e)||null!==N.exec(e))},construct:function(e){var t,n,i,r,o,a,l,c,s=0,u=null;if(null===(t=T.exec(e))&&(t=N.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],l=+t[6],t[7]){for(s=t[7].slice(0,3);s.length<3;)s+="0";s=+s}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,i,r,o,a,l,s)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var E=new p("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var L=new p("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=M;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=M,a=0,l=[];for(t=0;t>16&255),l.push(a>>8&255),l.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0===(n=r%4*6)?(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)):18===n?(l.push(a>>10&255),l.push(a>>2&255)):12===n&&l.push(a>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=M;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),_=Object.prototype.hasOwnProperty,D=Object.prototype.toString;var U=new p("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=[],l=e;for(t=0,n=l.length;t>10),56320+(e-65536&1023))}for(var ie=new Array(256),re=new Array(256),oe=0;oe<256;oe++)ie[oe]=te(oe)?1:0,re[oe]=te(oe);function ae(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||K,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function le(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=c(n),new o(t,n)}function ce(e,t){throw le(e,t)}function se(e,t){e.onWarning&&e.onWarning.call(null,le(e,t))}var ue={YAML:function(e,t,n){var i,r,o;null!==e.version&&ce(e,"duplication of %YAML directive"),1!==n.length&&ce(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ce(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&ce(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&se(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&ce(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],G.test(i)||ce(e,"ill-formed tag handle (first argument) of the TAG directive"),P.call(e.tagMap,i)&&ce(e,'there is a previously declared suffix for "'+i+'" tag handle'),V.test(r)||ce(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){ce(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function pe(e,t,n,i){var r,o,a,l;if(t1&&(e.result+=n.repeat("\n",t-1))}function be(e,t){var n,i,r=e.tag,o=e.anchor,a=[],l=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),45===i)&&z(e.input.charCodeAt(e.position+1));)if(l=!0,e.position++,ge(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,we(e,t,3,!1,!0),a.push(e.result),ge(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)ce(e,"bad indentation of a sequence entry");else if(e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt)&&(y&&(a=e.line,l=e.lineStart,c=e.position),we(e,t,4,!0,r)&&(y?g=e.result:m=e.result),y||(de(e,f,d,h,g,m,a,l,c),h=g=m=null),ge(e,!0,-1),s=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==s)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===o?ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ce(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(Q(a)){do{a=e.input.charCodeAt(++e.position)}while(Q(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!J(a)&&0!==a)}for(;0!==a;){for(he(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),J(a))f++;else{if(e.lineIndent0){for(r=a,o=0;r>0;r--)(a=ee(l=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:ce(e,"expected hexadecimal character");e.result+=ne(o),e.position++}else ce(e,"unknown escape sequence");n=i=e.position}else J(l)?(pe(e,n,i,!0),ye(e,ge(e,!1,t)),n=i=e.position):e.position===e.lineStart&&me(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?y=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!z(i)&&!X(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),P.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,l,c,s,u,p=e.kind,f=e.result;if(z(u=e.input.charCodeAt(e.position))||X(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(z(i=e.input.charCodeAt(e.position+1))||n&&X(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(z(i=e.input.charCodeAt(e.position+1))||n&&X(i))break}else if(35===u){if(z(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&me(e)||n&&X(u))break;if(J(u)){if(l=e.line,c=e.lineStart,s=e.lineIndent,ge(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=l,e.lineStart=c,e.lineIndent=s;break}}a&&(pe(e,r,o,!1),ye(e,e.line-l),r=o=e.position,a=!1),Q(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return pe(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===i)&&(y=!0,null===e.tag&&(e.tag="?")):(y=!0,null===e.tag&&null===e.anchor||ce(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(y=c&&be(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ce(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),s=0,u=e.implicitTypes.length;s"),null!==e.result&&f.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function ke(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(ge(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&ce(e,"directive name must not be less than one character in length");0!==r;){for(;Q(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!J(r));break}if(J(r))break;for(t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&he(e),P.call(ue,n)?ue[n](e,n,i):se(e,'unknown document directive "'+n+'"')}ge(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ge(e,!0,-1)):a&&ce(e,"directives end mark is expected"),we(e,e.lineIndent-1,4,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&H.test(e.input.slice(o,e.position))&&se(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&me(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ge(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function Re(e){return/^\n* /.test(e)}function Be(e,t,n,i,r,o,a,l){var c,s,u=0,p=null,f=!1,d=!1,h=-1!==i,g=-1,m=De(s=Ye(e,0))&&s!==Oe&&!_e(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&61!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&function(e){return!_e(e)&&58!==e}(Ye(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!De(u=Ye(e,c)))return 5;m=m&&qe(u,p,l),p=u}else{for(c=0;c=65536?c+=2:c++){if(10===(u=Ye(e,c)))f=!0,h&&(d=d||c-g-1>i&&" "!==e[g+1],g=c);else if(!De(u))return 5;m=m&&qe(u,p,l),p=u}d=d||h&&c-g-1>i&&" "!==e[g+1]}return f||d?n>9&&Re(e)?5:a?2===o?5:2:d?4:3:!m||a||r(e)?2===o?5:2:1}function Ke(e,t,n,i,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Te.indexOf(t)||Ne.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),l=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=i||e.flowLevel>-1&&n>=e.flowLevel;switch(Be(t,c,e.indent,l,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+Pe(t,e.indent)+We(Me(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(l=e.indexOf("\n"),l=-1!==l?l:e.length,r.lastIndex=l,He(e.slice(0,l),t)),a="\n"===e[0]||" "===e[0];var l;for(;i=r.exec(e);){var c=i[1],s=i[2];n=" "===s[0],o+=c+(a||n||""===s?"":"\n")+He(s,t),a=n}return o}(t,l),a));case 5:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=Ye(e,r),!(t=je[i])&&De(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Fe(i);return n}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function Pe(e,t){var n=Re(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function We(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function He(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,l=0,c="";n=r.exec(e);)(l=n.index)-o>t&&(i=a>o?a:l,c+="\n"+e.slice(o,i),o=i+1),a=l;return c+="\n",e.length-o>t&&a>o?c+=e.slice(o,a)+"\n"+e.slice(a+1):c+=e.slice(o),c.slice(1)}function $e(e,t,n,i){var r,o,a,l="",c=e.tag;for(r=0,o=n.length;r tag resolver accepts not "'+s+'" style');i=c.represent[s](t,s)}e.dump=i}return!0}return!1}function Ve(e,t,n,i,r,a,l){e.tag=null,e.dump=n,Ge(e,n,!1)||Ge(e,n,!0);var c,s=Ie.call(e.dump),u=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var p,f,d="[object Object]"===s||"[object Array]"===s;if(d&&(f=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(r=!1),f&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(d&&f&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===s)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,a,l,c,s,u,p="",f=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(r=0,a=d.length;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,s&&(u+=Le(e,t)),Ve(e,t+1,c,!0,s)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a,l,c="",s=e.tag,u=Object.keys(n);for(i=0,r=u.length;i1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ve(e,t,a,!1,!1)&&(c+=l+=e.dump));e.tag=s,e.dump="{"+c+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===s)i&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?$e(e,t-1,e.dump,r):$e(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a="",l=e.tag;for(i=0,r=n.length;i",e.dump=c+" "+e.dump)}return!0}function Ze(e,t){var n,i,r=[],o=[];for(Je(e,r,o),n=0,i=o.length;n maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +var snippet = makeSnippet; + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + '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$1(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + 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.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +var type = Type$1; + +/*eslint-disable max-len*/ + + + + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + 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$1(definition) { + return this.extend(definition); +} + + +Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema$1.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +var schema = Schema$1; + +var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] +}); + +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; +} + +var _null = 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'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); + +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]'; +} + +var bool = 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' +}); + +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 !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + 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) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + 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.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +var int = 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 ? '0o' + obj.toString(8) : '-0o' + 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' ] + } +}); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[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; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + 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; + } + 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)); +} + +var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] +}); + +var core = json; + +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(); +} + +var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +/*eslint-disable no-bitwise*/ + + + + + +// [ 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); + } + + return new Uint8Array(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(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; +var _toString$2 = 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$2.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty$3.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 : []; +} + +var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +var _toString$1 = 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$1.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; +} + +var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] +}); + +/*eslint-disable max-len,no-use-before-define*/ + + + + + + + +var _hasOwnProperty$1 = 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$1(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + 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; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = snippet(mark); + + return new exception(message, mark); +} + +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$1.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'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + 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$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, 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$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _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; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + 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, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + 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'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + 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; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + 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, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } 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; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + 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, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // 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, _keyLine, _keyLineStart, _keyPos); + 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 { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + 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, _keyLine, _keyLineStart, _keyPos); + 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`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + 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, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + 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 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, _keyLine, _keyLineStart, _keyPos); + } + + // 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); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.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$1.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) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else 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 (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + 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.tag)) { // `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, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + 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 = Object.create(null); + state.anchorMap = Object.create(null); + + 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$1.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$1(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$1(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$1(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 exception('expected a single document in the stream, but found more'); +} + + +var loadAll_1 = loadAll$1; +var load_1 = load$1; + +var loader = { + loadAll: loadAll_1, + load: load_1 +}; + +/*eslint-disable no-use-before-define*/ + + + + + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +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' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +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 exception('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || _default; + 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.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + 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 !== CHAR_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 +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - 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 + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// 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. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !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; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// 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, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + 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(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, 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; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = 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. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : 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. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// 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, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + 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, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + 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) + '"'; + default: + throw new exception('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 = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _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, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _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 (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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 exception('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.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 exception('!<' + 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, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + 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]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + 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$1(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +var dump_1 = dump$1; + +var dumper = { + dump: dump_1 +}; + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +var Type = type; +var Schema = schema; +var FAILSAFE_SCHEMA = failsafe; +var JSON_SCHEMA = json; +var CORE_SCHEMA = core; +var DEFAULT_SCHEMA = _default; +var load = loader.load; +var loadAll = loader.loadAll; +var dump = dumper.dump; +var YAMLException = exception; + +// Re-export all types in case user wants to create custom schema +var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str +}; + +// Removed functions from JS-YAML 3.0.x +var safeLoad = renamed('safeLoad', 'load'); +var safeLoadAll = renamed('safeLoadAll', 'loadAll'); +var safeDump = renamed('safeDump', 'dump'); + +var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump +}; + +export default jsYaml; +export { CORE_SCHEMA, DEFAULT_SCHEMA, FAILSAFE_SCHEMA, JSON_SCHEMA, Schema, Type, YAMLException, dump, load, loadAll, safeDump, safeLoad, safeLoadAll, types }; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js new file mode 100644 index 000000000..bcb7eba7a --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js @@ -0,0 +1,47 @@ +'use strict'; + + +var loader = require('./lib/loader'); +var dumper = require('./lib/dumper'); + + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +module.exports.Type = require('./lib/type'); +module.exports.Schema = require('./lib/schema'); +module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe'); +module.exports.JSON_SCHEMA = require('./lib/schema/json'); +module.exports.CORE_SCHEMA = require('./lib/schema/core'); +module.exports.DEFAULT_SCHEMA = require('./lib/schema/default'); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.dump = dumper.dump; +module.exports.YAMLException = require('./lib/exception'); + +// Re-export all types in case user wants to create custom schema +module.exports.types = { + binary: require('./lib/type/binary'), + float: require('./lib/type/float'), + map: require('./lib/type/map'), + null: require('./lib/type/null'), + pairs: require('./lib/type/pairs'), + set: require('./lib/type/set'), + timestamp: require('./lib/type/timestamp'), + bool: require('./lib/type/bool'), + int: require('./lib/type/int'), + merge: require('./lib/type/merge'), + omap: require('./lib/type/omap'), + seq: require('./lib/type/seq'), + str: require('./lib/type/str') +}; + +// Removed functions from JS-YAML 3.0.x +module.exports.safeLoad = renamed('safeLoad', 'load'); +module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll'); +module.exports.safeDump = renamed('safeDump', 'dump'); diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/common.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/common.js new file mode 100644 index 000000000..25ef7d8e4 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/common.js @@ -0,0 +1,59 @@ +'use strict'; + + +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} + + +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/dumper.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/dumper.js new file mode 100644 index 000000000..f357a6aee --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/dumper.js @@ -0,0 +1,965 @@ +'use strict'; + +/*eslint-disable no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var DEFAULT_SCHEMA = require('./schema/default'); + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +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' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +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; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || DEFAULT_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.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + 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 !== CHAR_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 +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - 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 + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// 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. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !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; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// 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, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + 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(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, 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; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = 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. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : 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. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// 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, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + 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, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + 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 = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _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, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _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 (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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 || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.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, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + 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]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + 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); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +module.exports.dump = dump; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/exception.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/exception.js new file mode 100644 index 000000000..7f62daaef --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/exception.js @@ -0,0 +1,55 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + + +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; +} + + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // 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) { + return this.name + ': ' + formatError(this, compact); +}; + + +module.exports = YAMLException; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/loader.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/loader.js new file mode 100644 index 000000000..39f13f561 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/loader.js @@ -0,0 +1,1727 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var makeSnippet = require('./snippet'); +var DEFAULT_SCHEMA = require('./schema/default'); + + +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_SCHEMA; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + 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; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = makeSnippet(mark); + + return new YAMLException(message, mark); +} + +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'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + 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, startLineStart, 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.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _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; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + 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, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + 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'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + 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; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + 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, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } 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; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + 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, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // 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, _keyLine, _keyLineStart, _keyPos); + 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 { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + 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, _keyLine, _keyLineStart, _keyPos); + 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`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + 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, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + 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 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, _keyLine, _keyLineStart, _keyPos); + } + + // 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); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + 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) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else 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 (state.tag !== '!') { + if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + 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.tag)) { // `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, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + 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 = Object.create(null); + state.anchorMap = Object.create(null); + + 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'); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema.js new file mode 100644 index 000000000..65b41f401 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema.js @@ -0,0 +1,121 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + 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) { + return this.extend(definition); +} + + +Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof Type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + 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.'); + } + + if (type.multi) { + throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +module.exports = Schema; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/core.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/core.js new file mode 100644 index 000000000..608b26de2 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/core.js @@ -0,0 +1,11 @@ +// 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'; + + +module.exports = require('./json'); diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/default.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/default.js new file mode 100644 index 000000000..3af0520d5 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/default.js @@ -0,0 +1,22 @@ +// 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'; + + +module.exports = require('./core').extend({ + 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/@eslint/eslintrc/node_modules/js-yaml/lib/schema/failsafe.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/failsafe.js new file mode 100644 index 000000000..b7a33eb7a --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/schema/json.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/json.js new file mode 100644 index 000000000..b73df78e5 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/schema/json.js @@ -0,0 +1,19 @@ +// 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'; + + +module.exports = require('./failsafe').extend({ + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/snippet.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/snippet.js new file mode 100644 index 000000000..00e2133c0 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/snippet.js @@ -0,0 +1,101 @@ +'use strict'; + + +var common = require('./common'); + + +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +module.exports = makeSnippet; diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type.js new file mode 100644 index 000000000..5e57877fe --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type.js @@ -0,0 +1,66 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + '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.options = options; // keep original options in case user wants to extend this type later + 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.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + 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/@eslint/eslintrc/node_modules/js-yaml/lib/type/binary.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/binary.js new file mode 100644 index 000000000..e1523513d --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/binary.js @@ -0,0 +1,125 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + + +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); + } + + return new Uint8Array(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(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/bool.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/bool.js new file mode 100644 index 000000000..cb7745930 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/float.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/float.js new file mode 100644 index 000000000..74d77ec2e --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/float.js @@ -0,0 +1,97 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[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; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + 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; + } + 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/@eslint/eslintrc/node_modules/js-yaml/lib/type/int.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/int.js new file mode 100644 index 000000000..3fe3a4437 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/int.js @@ -0,0 +1,156 @@ +'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 !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + 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) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + 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.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + 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 ? '0o' + obj.toString(8) : '-0o' + 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/@eslint/eslintrc/node_modules/js-yaml/lib/type/map.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/map.js new file mode 100644 index 000000000..f327beebd --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/merge.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/merge.js new file mode 100644 index 000000000..ae08a8644 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/null.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/null.js new file mode 100644 index 000000000..315ca4e23 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/null.js @@ -0,0 +1,35 @@ +'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'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/omap.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/omap.js new file mode 100644 index 000000000..b2b5323bd --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/pairs.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/pairs.js new file mode 100644 index 000000000..74b52403f --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/seq.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/seq.js new file mode 100644 index 000000000..be8f77f28 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/set.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/set.js new file mode 100644 index 000000000..f885a329c --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/str.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/str.js new file mode 100644 index 000000000..27acc106c --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/lib/type/timestamp.js b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/type/timestamp.js new file mode 100644 index 000000000..8fa9c5865 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/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/@eslint/eslintrc/node_modules/js-yaml/package.json b/node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json new file mode 100644 index 000000000..17574da80 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json @@ -0,0 +1,66 @@ +{ + "name": "js-yaml", + "version": "4.1.0", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "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" + }, + "module": "./dist/js-yaml.mjs", + "exports": { + ".": { + "import": "./dist/js-yaml.mjs", + "require": "./index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "lint": "eslint .", + "test": "npm run lint && mocha", + "coverage": "npm run lint && nyc mocha && nyc report --reporter html", + "demo": "npm run lint && node support/build_demo.js", + "gh-demo": "npm run demo && gh-pages -d demo -f", + "browserify": "rollup -c support/rollup.config.js", + "prepublishOnly": "npm run gh-demo" + }, + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", + "dependencies": { + "argparse": "^2.0.1" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-node-resolve": "^11.0.0", + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^2.8.0", + "gh-pages": "^3.1.0", + "mocha": "^8.2.1", + "nyc": "^15.1.0", + "rollup": "^2.34.1", + "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^7.0.2", + "shelljs": "^0.8.4" + } +} diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/base.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/base.d.ts new file mode 100644 index 000000000..9005ef9fc --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/base.d.ts @@ -0,0 +1,38 @@ +// Types that are compatible with all supported TypeScript versions. +// It's shared between all TypeScript version-specific definitions. + +// Basic +export * from './source/basic'; + +// Utilities +export {Except} from './source/except'; +export {Mutable} from './source/mutable'; +export {Merge} from './source/merge'; +export {MergeExclusive} from './source/merge-exclusive'; +export {RequireAtLeastOne} from './source/require-at-least-one'; +export {RequireExactlyOne} from './source/require-exactly-one'; +export {PartialDeep} from './source/partial-deep'; +export {ReadonlyDeep} from './source/readonly-deep'; +export {LiteralUnion} from './source/literal-union'; +export {Promisable} from './source/promisable'; +export {Opaque} from './source/opaque'; +export {SetOptional} from './source/set-optional'; +export {SetRequired} from './source/set-required'; +export {ValueOf} from './source/value-of'; +export {PromiseValue} from './source/promise-value'; +export {AsyncReturnType} from './source/async-return-type'; +export {ConditionalExcept} from './source/conditional-except'; +export {ConditionalKeys} from './source/conditional-keys'; +export {ConditionalPick} from './source/conditional-pick'; +export {UnionToIntersection} from './source/union-to-intersection'; +export {Stringified} from './source/stringified'; +export {FixedLengthArray} from './source/fixed-length-array'; +export {IterableElement} from './source/iterable-element'; +export {Entry} from './source/entry'; +export {Entries} from './source/entries'; +export {SetReturnType} from './source/set-return-type'; +export {Asyncify} from './source/asyncify'; + +// Miscellaneous +export {PackageJson} from './source/package-json'; +export {TsConfigJson} from './source/tsconfig-json'; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/index.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/index.d.ts new file mode 100644 index 000000000..206261c21 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/index.d.ts @@ -0,0 +1,2 @@ +// These are all the basic types that's compatible with all supported TypeScript versions. +export * from './base'; diff --git a/node_modules/astral-regex/license b/node_modules/@eslint/eslintrc/node_modules/type-fest/license similarity index 92% rename from node_modules/astral-regex/license rename to node_modules/@eslint/eslintrc/node_modules/type-fest/license index db6bc32cc..3e4c85ab7 100644 --- a/node_modules/astral-regex/license +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Kevin Mårtensson (github.com/kevva) +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: diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/package.json b/node_modules/@eslint/eslintrc/node_modules/type-fest/package.json new file mode 100644 index 000000000..3ab9e4d92 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/package.json @@ -0,0 +1,58 @@ +{ + "name": "type-fest", + "version": "0.20.2", + "description": "A collection of essential TypeScript types", + "license": "(MIT OR CC0-1.0)", + "repository": "sindresorhus/type-fest", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "//test": "xo && tsd && tsc", + "test": "xo && tsc" + }, + "files": [ + "index.d.ts", + "base.d.ts", + "source", + "ts41" + ], + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "devDependencies": { + "@sindresorhus/tsconfig": "~0.7.0", + "tsd": "^0.13.1", + "typescript": "^4.1.2", + "xo": "^0.35.0" + }, + "types": "./index.d.ts", + "typesVersions": { + ">=4.1": { + "*": [ + "ts41/*" + ] + } + }, + "xo": { + "rules": { + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/indent": "off", + "node/no-unsupported-features/es-builtins": "off" + } + } +} diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/readme.md b/node_modules/@eslint/eslintrc/node_modules/type-fest/readme.md new file mode 100644 index 000000000..714df7868 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/readme.md @@ -0,0 +1,658 @@ +
+
+
+ type-fest +
+
+ A collection of essential TypeScript types +
+
+
+
+
+ +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i) + + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.4* + +## Usage + +```ts +import {Except} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Except; +//=> {unicorn: string} +``` + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). +- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. +- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. +- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). +- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. +- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). +- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. +- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. +- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from. +- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`. +- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`. +- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type. +- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type. +- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type. +- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type. +- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type. +- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length. +- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. +- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection. +- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection. +- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type. +- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type. + +### Template literal types + +*Note:* These require [TypeScript 4.1 or newer](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types). + +- [`CamelCase`](ts41/camel-case.d.ts) – Convert a string literal to camel-case (`fooBar`). +- [`KebabCase`](ts41/kebab-case.d.ts) – Convert a string literal to kebab-case (`foo-bar`). +- [`PascalCase`](ts41/pascal-case.d.ts) – Converts a string literal to pascal-case (`FooBar`) +- [`SnakeCase`](ts41/snake-case.d.ts) – Convert a string literal to snake-case (`foo_bar`). +- [`DelimiterCase`](ts41/delimiter-case.d.ts) – Convert a string literal to a custom string delimiter casing. + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). +- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. +- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. +- [`SubType`](https://github.com/sindresorhus/type-fest/issues/22) - The type is powerful, but lacks good use-cases and is prone to misuse. +- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies. + +## Tips + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +
+ + Example + + + [Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA) + + ```ts + interface NodeConfig { + appName: string; + port: number; + } + + class NodeAppBuilder { + private configuration: NodeConfig = { + appName: 'NodeApp', + port: 3000 + }; + + private updateConfig(key: Key, value: NodeConfig[Key]) { + this.configuration[key] = value; + } + + config(config: Partial) { + type NodeConfigKey = keyof NodeConfig; + + for (const key of Object.keys(config) as NodeConfigKey[]) { + const updateValue = config[key]; + + if (updateValue === undefined) { + continue; + } + + this.updateConfig(key, updateValue); + } + + return this; + } + } + + // `Partial`` allows us to provide only a part of the + // NodeConfig interface. + new NodeAppBuilder().config({appName: 'ToDoApp'}); + ``` +
+ +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) + + ```ts + interface ContactForm { + email?: string; + message?: string; + } + + function submitContactForm(formData: Required) { + // Send the form data to the server. + } + + submitContactForm({ + email: 'ex@mple.com', + message: 'Hi! Could you tell me more about…', + }); + + // TypeScript error: missing property 'message' + submitContactForm({ + email: 'ex@mple.com', + }); + ``` +
+ +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) + + ```ts + enum LogLevel { + Off, + Debug, + Error, + Fatal + }; + + interface LoggerConfig { + name: string; + level: LogLevel; + } + + class Logger { + config: Readonly; + + constructor({name, level}: LoggerConfig) { + this.config = {name, level}; + Object.freeze(this.config); + } + } + + const config: LoggerConfig = { + name: 'MyApp', + level: LogLevel.Debug + }; + + const logger = new Logger(config); + + // TypeScript Error: cannot assign to read-only property. + logger.config.level = LogLevel.Error; + + // We are able to edit config variable as we please. + config.level = LogLevel.Error; + ``` +
+ +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) + + ```ts + interface Article { + title: string; + thumbnail: string; + content: string; + } + + // Creates new type out of the `Article` interface composed + // from the Articles' two properties: `title` and `thumbnail`. + // `ArticlePreview = {title: string; thumbnail: string}` + type ArticlePreview = Pick; + + // Render a list of articles using only title and description. + function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { + const articles = document.createElement('div'); + + for (const preview of previews) { + // Append preview to the articles. + } + + return articles; + } + + const articles = renderArticlePreviews([ + { + title: 'TypeScript tutorial!', + thumbnail: '/assets/ts.jpg' + } + ]); + ``` +
+ +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) + + ```ts + // Positions of employees in our company. + type MemberPosition = 'intern' | 'developer' | 'tech-lead'; + + // Interface describing properties of a single employee. + interface Employee { + firstName: string; + lastName: string; + yearsOfExperience: number; + } + + // Create an object that has all possible `MemberPosition` values set as keys. + // Those keys will store a collection of Employees of the same position. + const team: Record = { + intern: [], + developer: [], + 'tech-lead': [], + }; + + // Our team has decided to help John with his dream of becoming Software Developer. + team.intern.push({ + firstName: 'John', + lastName: 'Doe', + yearsOfExperience: 0 + }); + + // `Record` forces you to initialize all of the property keys. + // TypeScript Error: "tech-lead" property is missing + const teamEmpty: Record = { + intern: null, + developer: null, + }; + ``` +
+ +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) + + ```ts + interface ServerConfig { + port: null | string | number; + } + + type RequestHandler = (request: Request, response: Response) => void; + + // Exclude `null` type from `null | string | number`. + // In case the port is equal to `null`, we will use default value. + function getPortValue(port: Exclude): number { + if (typeof port === 'string') { + return parseInt(port, 10); + } + + return port; + } + + function startServer(handler: RequestHandler, config: ServerConfig): void { + const server = require('http').createServer(handler); + + const port = config.port === null ? 3000 : getPortValue(config.port); + server.listen(port); + } + ``` +
+ +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) + + ```ts + declare function uniqueId(): number; + + const ID = Symbol('ID'); + + interface Person { + [ID]: number; + name: string; + age: number; + } + + // Allows changing the person data as long as the property key is of string type. + function changePersonData< + Obj extends Person, + Key extends Extract, + Value extends Obj[Key] + > (obj: Obj, key: Key, value: Value): void { + obj[key] = value; + } + + // Tiny Andrew was born. + const andrew = { + [ID]: uniqueId(), + name: 'Andrew', + age: 0, + }; + + // Cool, we're fine with that. + changePersonData(andrew, 'name', 'Pony'); + + // Goverment didn't like the fact that you wanted to change your identity. + changePersonData(andrew, ID, uniqueId()); + ``` +
+ +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +
+ + Example + + Works with strictNullChecks set to true. (Read more here) + + [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) + + ```ts + type PortNumber = string | number | null; + + /** Part of a class definition that is used to build a server */ + class ServerBuilder { + portNumber!: NonNullable; + + port(this: ServerBuilder, port: PortNumber): ServerBuilder { + if (port == null) { + this.portNumber = 8000; + } else { + this.portNumber = port; + } + + return this; + } + } + + const serverBuilder = new ServerBuilder(); + + serverBuilder + .port('8000') // portNumber = '8000' + .port(null) // portNumber = 8000 + .port(3000); // portNumber = 3000 + + // TypeScript error + serverBuilder.portNumber = null; + ``` +
+ +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) + + ```ts + function shuffle(input: any[]): void { + // Mutate array randomly changing its' elements indexes. + } + + function callNTimes any> (func: Fn, callCount: number) { + // Type that represents the type of the received function parameters. + type FunctionParameters = Parameters; + + return function (...args: FunctionParameters) { + for (let i = 0; i < callCount; i++) { + func(...args); + } + } + } + + const shuffleTwice = callNTimes(shuffle, 2); + ``` +
+ +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) + + ```ts + class ArticleModel { + title: string; + content?: string; + + constructor(title: string) { + this.title = title; + } + } + + class InstanceCache any)> { + private ClassConstructor: T; + private cache: Map> = new Map(); + + constructor (ctr: T) { + this.ClassConstructor = ctr; + } + + getInstance (...args: ConstructorParameters): InstanceType { + const hash = this.calculateArgumentsHash(...args); + + const existingInstance = this.cache.get(hash); + if (existingInstance !== undefined) { + return existingInstance; + } + + return new this.ClassConstructor(...args); + } + + private calculateArgumentsHash(...args: any[]): string { + // Calculate hash. + return 'hash'; + } + } + + const articleCache = new InstanceCache(ArticleModel); + const amazonArticle = articleCache.getInstance('Amazon forests burining!'); + ``` +
+ +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ + function mapIter< + Elem, + Func extends (elem: Elem) => any, + Ret extends ReturnType + >(iter: Iterable, callback: Func): Ret[] { + const mapped: Ret[] = []; + + for (const elem of iter) { + mapped.push(callback(elem)); + } + + return mapped; + } + + const setObject: Set = new Set(); + const mapObject: Map = new Map(); + + mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] + + mapIter(mapObject, ([key, value]: [number, string]) => { + return key % 2 === 0 ? value : 'Odd'; + }); // string[] + ``` +
+ +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + class IdleService { + doNothing (): void {} + } + + class News { + title: string; + content: string; + + constructor(title: string, content: string) { + this.title = title; + this.content = content; + } + } + + const instanceCounter: Map = new Map(); + + interface Constructor { + new(...args: any[]): any; + } + + // Keep track how many instances of `Constr` constructor have been created. + function getInstance< + Constr extends Constructor, + Args extends ConstructorParameters + >(constructor: Constr, ...args: Args): InstanceType { + let count = instanceCounter.get(constructor) || 0; + + const instance = new constructor(...args); + + instanceCounter.set(constructor, count + 1); + + console.log(`Created ${count + 1} instances of ${Constr.name} class`); + + return instance; + } + + + const idleService = getInstance(IdleService); + // Will log: `Created 1 instances of IdleService class` + const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); + // Will log: `Created 1 instances of News class` + ``` +
+ +- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) + + ```ts + interface Animal { + imageUrl: string; + species: string; + images: string[]; + paragraphs: string[]; + } + + // Creates new type with all properties of the `Animal` interface + // except 'images' and 'paragraphs' properties. We can use this + // type to render small hover tooltip for a wiki entry list. + type AnimalShortInfo = Omit; + + function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { + const container = document.createElement('div'); + // Internal implementation. + return container; + } + ``` +
+ +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) +- [Pelle Wessman](https://github.com/voxpelli) + +## License + +(MIT OR CC0-1.0) + +--- + +
+ + 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/@eslint/eslintrc/node_modules/type-fest/source/async-return-type.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/async-return-type.d.ts new file mode 100644 index 000000000..79ec1e961 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/async-return-type.d.ts @@ -0,0 +1,23 @@ +import {PromiseValue} from './promise-value'; + +type AsyncFunction = (...args: any[]) => Promise; + +/** +Unwrap the return type of a function that returns a `Promise`. + +There has been [discussion](https://github.com/microsoft/TypeScript/pull/35998) about implementing this type in TypeScript. + +@example +```ts +import {AsyncReturnType} from 'type-fest'; +import {asyncFunction} from 'api'; + +// This type resolves to the unwrapped return type of `asyncFunction`. +type Value = AsyncReturnType; + +async function doSomething(value: Value) {} + +asyncFunction().then(value => doSomething(value)); +``` +*/ +export type AsyncReturnType = PromiseValue>; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/asyncify.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/asyncify.d.ts new file mode 100644 index 000000000..455f2ebda --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/asyncify.d.ts @@ -0,0 +1,31 @@ +import {PromiseValue} from './promise-value'; +import {SetReturnType} from './set-return-type'; + +/** +Create an async version of the given function type, by boxing the return type in `Promise` while keeping the same parameter types. + +Use-case: You have two functions, one synchronous and one asynchronous that do the same thing. Instead of having to duplicate the type definition, you can use `Asyncify` to reuse the synchronous type. + +@example +``` +import {Asyncify} from 'type-fest'; + +// Synchronous function. +function getFooSync(someArg: SomeType): Foo { + // … +} + +type AsyncifiedFooGetter = Asyncify; +//=> type AsyncifiedFooGetter = (someArg: SomeType) => Promise; + +// Same as `getFooSync` but asynchronous. +const getFooAsync: AsyncifiedFooGetter = (someArg) => { + // TypeScript now knows that `someArg` is `SomeType` automatically. + // It also knows that this function must return `Promise`. + // If you have `@typescript-eslint/promise-function-async` linter rule enabled, it will even report that "Functions that return promises must be async.". + + // … +} +``` +*/ +export type Asyncify any> = SetReturnType>>>; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/basic.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/basic.d.ts new file mode 100644 index 000000000..d380c8b91 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/basic.d.ts @@ -0,0 +1,67 @@ +/// + +// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out. +/** +Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +*/ +export type Primitive = + | null + | undefined + | string + | number + | boolean + | symbol + | bigint; + +// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default +/** +Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +*/ +export type Class = new(...arguments_: Arguments) => T; + +/** +Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +*/ +export type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; + +/** +Matches a JSON object. + +This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. +*/ +export type JsonObject = {[Key in string]?: JsonValue}; + +/** +Matches a JSON array. +*/ +export interface JsonArray extends Array {} + +/** +Matches any valid JSON value. +*/ +export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; + +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). +*/ +export interface ObservableLike { + subscribe(observer: (value: unknown) => void): void; + [Symbol.observable](): ObservableLike; +} diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-except.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-except.d.ts new file mode 100644 index 000000000..ac506ccf1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-except.d.ts @@ -0,0 +1,43 @@ +import {Except} from './except'; +import {ConditionalKeys} from './conditional-keys'; + +/** +Exclude keys from a shape that matches the given `Condition`. + +This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties. + +@example +``` +import {Primitive, ConditionalExcept} from 'type-fest'; + +class Awesome { + name: string; + successes: number; + failures: bigint; + + run() {} +} + +type ExceptPrimitivesFromAwesome = ConditionalExcept; +//=> {run: () => void} +``` + +@example +``` +import {ConditionalExcept} from 'type-fest'; + +interface Example { + a: string; + b: string | number; + c: () => void; + d: {}; +} + +type NonStringKeysOnly = ConditionalExcept; +//=> {b: string | number; c: () => void; d: {}} +``` +*/ +export type ConditionalExcept = Except< + Base, + ConditionalKeys +>; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-keys.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-keys.d.ts new file mode 100644 index 000000000..eb074dc5d --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-keys.d.ts @@ -0,0 +1,43 @@ +/** +Extract the keys from a type where the value type of the key extends the given `Condition`. + +Internally this is used for the `ConditionalPick` and `ConditionalExcept` types. + +@example +``` +import {ConditionalKeys} from 'type-fest'; + +interface Example { + a: string; + b: string | number; + c?: string; + d: {}; +} + +type StringKeysOnly = ConditionalKeys; +//=> 'a' +``` + +To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below. + +@example +``` +type StringKeysAndUndefined = ConditionalKeys; +//=> 'a' | 'c' +``` +*/ +export type ConditionalKeys = NonNullable< + // Wrap in `NonNullable` to strip away the `undefined` type from the produced union. + { + // Map through all the keys of the given base type. + [Key in keyof Base]: + // Pick only keys with types extending the given `Condition` type. + Base[Key] extends Condition + // Retain this key since the condition passes. + ? Key + // Discard this key since the condition fails. + : never; + + // Convert the produced object into a union type of the keys which passed the conditional test. + }[keyof Base] +>; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-pick.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-pick.d.ts new file mode 100644 index 000000000..cecc3df14 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/conditional-pick.d.ts @@ -0,0 +1,42 @@ +import {ConditionalKeys} from './conditional-keys'; + +/** +Pick keys from the shape that matches the given `Condition`. + +This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type. + +@example +``` +import {Primitive, ConditionalPick} from 'type-fest'; + +class Awesome { + name: string; + successes: number; + failures: bigint; + + run() {} +} + +type PickPrimitivesFromAwesome = ConditionalPick; +//=> {name: string; successes: number; failures: bigint} +``` + +@example +``` +import {ConditionalPick} from 'type-fest'; + +interface Example { + a: string; + b: string | number; + c: () => void; + d: {}; +} + +type StringKeysOnly = ConditionalPick; +//=> {a: string} +``` +*/ +export type ConditionalPick = Pick< + Base, + ConditionalKeys +>; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/entries.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/entries.d.ts new file mode 100644 index 000000000..e02237a92 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/entries.d.ts @@ -0,0 +1,57 @@ +import {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry'; + +type ArrayEntries = Array>; +type MapEntries = Array>; +type ObjectEntries = Array>; +type SetEntries> = Array>; + +/** +Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries. + +For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. + +@see `Entry` if you want to just access the type of a single entry. + +@example +``` +import {Entries} from 'type-fest'; + +interface Example { + someKey: number; +} + +const manipulatesEntries = (examples: Entries) => examples.map(example => [ + // Does some arbitrary processing on the key (with type information available) + example[0].toUpperCase(), + + // Does some arbitrary processing on the value (with type information available) + example[1].toFixed() +]); + +const example: Example = {someKey: 1}; +const entries = Object.entries(example) as Entries; +const output = manipulatesEntries(entries); + +// Objects +const objectExample = {a: 1}; +const objectEntries: Entries = [['a', 1]]; + +// Arrays +const arrayExample = ['a', 1]; +const arrayEntries: Entries = [[0, 'a'], [1, 1]]; + +// Maps +const mapExample = new Map([['a', 1]]); +const mapEntries: Entries = [['a', 1]]; + +// Sets +const setExample = new Set(['a', 1]); +const setEntries: Entries = [['a', 'a'], [1, 1]]; +``` +*/ +export type Entries = + BaseType extends Map ? MapEntries + : BaseType extends Set ? SetEntries + : BaseType extends unknown[] ? ArrayEntries + : BaseType extends object ? ObjectEntries + : never; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/entry.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/entry.d.ts new file mode 100644 index 000000000..41a13a979 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/entry.d.ts @@ -0,0 +1,60 @@ +type MapKey = BaseType extends Map ? KeyType : never; +type MapValue = BaseType extends Map ? ValueType : never; + +export type ArrayEntry = [number, BaseType[number]]; +export type MapEntry = [MapKey, MapValue]; +export type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]]; +export type SetEntry = BaseType extends Set ? [ItemType, ItemType] : never; + +/** +Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry. + +For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. + +@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method). + +@example +``` +import {Entry} from 'type-fest'; + +interface Example { + someKey: number; +} + +const manipulatesEntry = (example: Entry) => [ + // Does some arbitrary processing on the key (with type information available) + example[0].toUpperCase(), + + // Does some arbitrary processing on the value (with type information available) + example[1].toFixed(), +]; + +const example: Example = {someKey: 1}; +const entry = Object.entries(example)[0] as Entry; +const output = manipulatesEntry(entry); + +// Objects +const objectExample = {a: 1}; +const objectEntry: Entry = ['a', 1]; + +// Arrays +const arrayExample = ['a', 1]; +const arrayEntryString: Entry = [0, 'a']; +const arrayEntryNumber: Entry = [1, 1]; + +// Maps +const mapExample = new Map([['a', 1]]); +const mapEntry: Entry = ['a', 1]; + +// Sets +const setExample = new Set(['a', 1]); +const setEntryString: Entry = ['a', 'a']; +const setEntryNumber: Entry = [1, 1]; +``` +*/ +export type Entry = + BaseType extends Map ? MapEntry + : BaseType extends Set ? SetEntry + : BaseType extends unknown[] ? ArrayEntry + : BaseType extends object ? ObjectEntry + : never; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/except.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/except.d.ts new file mode 100644 index 000000000..7dedbaa4a --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/except.d.ts @@ -0,0 +1,22 @@ +/** +Create a type from an object type without certain keys. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/30825) if you want to have the stricter version as a built-in in TypeScript. + +@example +``` +import {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; + c: boolean; +}; + +type FooWithoutA = Except; +//=> {b: string}; +``` +*/ +export type Except = Pick>; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/fixed-length-array.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/fixed-length-array.d.ts new file mode 100644 index 000000000..e3bc0f473 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/fixed-length-array.d.ts @@ -0,0 +1,38 @@ +/** +Methods to exclude. +*/ +type ArrayLengthMutationKeys = 'splice' | 'push' | 'pop' | 'shift' | 'unshift'; + +/** +Create a type that represents an array of the given type and length. The array's length and the `Array` prototype methods that manipulate its length are excluded in the resulting type. + +Please participate in [this issue](https://github.com/microsoft/TypeScript/issues/26223) if you want to have a similiar type built into TypeScript. + +Use-cases: +- Declaring fixed-length tuples or arrays with a large number of items. +- Creating a range union (for example, `0 | 1 | 2 | 3 | 4` from the keys of such a type) without having to resort to recursive types. +- Creating an array of coordinates with a static length, for example, length of 3 for a 3D vector. + +@example +``` +import {FixedLengthArray} from 'type-fest'; + +type FencingTeam = FixedLengthArray; + +const guestFencingTeam: FencingTeam = ['Josh', 'Michael', 'Robert']; + +const homeFencingTeam: FencingTeam = ['George', 'John']; +//=> error TS2322: Type string[] is not assignable to type 'FencingTeam' + +guestFencingTeam.push('Sam'); +//=> error TS2339: Property 'push' does not exist on type 'FencingTeam' +``` +*/ +export type FixedLengthArray = Pick< + ArrayPrototype, + Exclude +> & { + [index: number]: Element; + [Symbol.iterator]: () => IterableIterator; + readonly length: Length; +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/iterable-element.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/iterable-element.d.ts new file mode 100644 index 000000000..174cfbf4b --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/iterable-element.d.ts @@ -0,0 +1,46 @@ +/** +Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. + +This can be useful, for example, if you want to get the type that is yielded in a generator function. Often the return type of those functions are not specified. + +This type works with both `Iterable`s and `AsyncIterable`s, so it can be use with synchronous and asynchronous generators. + +Here is an example of `IterableElement` in action with a generator function: + +@example +``` +function * iAmGenerator() { + yield 1; + yield 2; +} + +type MeNumber = IterableElement> +``` + +And here is an example with an async generator: + +@example +``` +async function * iAmGeneratorAsync() { + yield 'hi'; + yield true; +} + +type MeStringOrBoolean = IterableElement> +``` + +Many types in JavaScript/TypeScript are iterables. This type works on all types that implement those interfaces. For example, `Array`, `Set`, `Map`, `stream.Readable`, etc. + +An example with an array of strings: + +@example +``` +type MeString = IterableElement +``` +*/ +export type IterableElement = + TargetIterable extends Iterable ? + ElementType : + TargetIterable extends AsyncIterable ? + ElementType : + never; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/literal-union.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/literal-union.d.ts new file mode 100644 index 000000000..8debd93d0 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/literal-union.d.ts @@ -0,0 +1,33 @@ +import {Primitive} from './basic'; + +/** +Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. + +Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. + +This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. + +@example +``` +import {LiteralUnion} from 'type-fest'; + +// Before + +type Pet = 'dog' | 'cat' | string; + +const pet: Pet = ''; +// Start typing in your TypeScript-enabled IDE. +// You **will not** get auto-completion for `dog` and `cat` literals. + +// After + +type Pet2 = LiteralUnion<'dog' | 'cat', string>; + +const pet: Pet2 = ''; +// You **will** get auto-completion for `dog` and `cat` literals. +``` + */ +export type LiteralUnion< + LiteralType, + BaseType extends Primitive +> = LiteralType | (BaseType & {_?: never}); diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge-exclusive.d.ts new file mode 100644 index 000000000..059bd2cbe --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge-exclusive.d.ts @@ -0,0 +1,39 @@ +// Helper type. Not useful on its own. +type Without = {[KeyType in Exclude]?: never}; + +/** +Create a type that has mutually exclusive keys. + +This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604). + +This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`. + +@example +``` +import {MergeExclusive} from 'type-fest'; + +interface ExclusiveVariation1 { + exclusive1: boolean; +} + +interface ExclusiveVariation2 { + exclusive2: string; +} + +type ExclusiveOptions = MergeExclusive; + +let exclusiveOptions: ExclusiveOptions; + +exclusiveOptions = {exclusive1: true}; +//=> Works +exclusiveOptions = {exclusive2: 'hi'}; +//=> Works +exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; +//=> Error +``` +*/ +export type MergeExclusive = + (FirstType | SecondType) extends object ? + (Without & SecondType) | (Without & FirstType) : + FirstType | SecondType; + diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge.d.ts new file mode 100644 index 000000000..4b3920b7a --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/merge.d.ts @@ -0,0 +1,22 @@ +import {Except} from './except'; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import {Merge} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type Bar = { + b: number; +}; + +const ab: Merge = {a: 1, b: 2}; +``` +*/ +export type Merge = Except> & SecondType; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/mutable.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/mutable.d.ts new file mode 100644 index 000000000..03d0dda7f --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/mutable.d.ts @@ -0,0 +1,22 @@ +/** +Convert an object with `readonly` keys into a mutable object. Inverse of `Readonly`. + +This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509). + +@example +``` +import {Mutable} from 'type-fest'; + +type Foo = { + readonly a: number; + readonly b: string; +}; + +const mutableFoo: Mutable = {a: 1, b: '2'}; +mutableFoo.a = 3; +``` +*/ +export type Mutable = { + // For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the key. + -readonly [KeyType in keyof ObjectType]: ObjectType[KeyType]; +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/opaque.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/opaque.d.ts new file mode 100644 index 000000000..20ab964e2 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/opaque.d.ts @@ -0,0 +1,65 @@ +/** +Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly. + +The generic type parameter can be anything. It doesn't have to be an object. + +[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/) + +There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward: + - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408) + - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807) + +@example +``` +import {Opaque} from 'type-fest'; + +type AccountNumber = Opaque; +type AccountBalance = Opaque; + +// The Token parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures: +type ThingOne = Opaque; +type ThingTwo = Opaque; + +// To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`. +// To avoid this behaviour, you would instead pass the "Token" parameter, like so. +type NewThingOne = Opaque; +type NewThingTwo = Opaque; + +// Now they're completely separate types, so the following will fail to compile. +function createNewThingOne (): NewThingOne { + // As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa. + return 'new thing one' as NewThingOne; +} + +// This will fail to compile, as they are fundamentally different types. +const thingTwo = createNewThingOne() as NewThingTwo; + +// Here's another example of opaque typing. +function createAccountNumber(): AccountNumber { + return 2 as AccountNumber; +} + +function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance { + return 4 as AccountBalance; +} + +// This will compile successfully. +getMoneyForAccount(createAccountNumber()); + +// But this won't, because it has to be explicitly passed as an `AccountNumber` type. +getMoneyForAccount(2); + +// You can use opaque values like they aren't opaque too. +const accountNumber = createAccountNumber(); + +// This will not compile successfully. +const newAccountNumber = accountNumber + 2; + +// As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type. +type Person = { + id: Opaque; + name: string; +}; +``` +*/ +export type Opaque = Type & {readonly __opaque__: Token}; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/package-json.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/package-json.d.ts new file mode 100644 index 000000000..cf355d03a --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/package-json.d.ts @@ -0,0 +1,611 @@ +import {LiteralUnion} from './literal-union'; + +declare namespace PackageJson { + /** + A person who has been involved in creating or maintaining the package. + */ + export type Person = + | string + | { + name: string; + url?: string; + email?: string; + }; + + export type BugsLocation = + | string + | { + /** + The URL to the package's issue tracker. + */ + url?: string; + + /** + The email address to which issues should be reported. + */ + email?: string; + }; + + export interface DirectoryLocations { + [directoryType: string]: unknown; + + /** + Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. + */ + bin?: string; + + /** + Location for Markdown files. + */ + doc?: string; + + /** + Location for example scripts. + */ + example?: string; + + /** + Location for the bulk of the library. + */ + lib?: string; + + /** + Location for man pages. Sugar to generate a `man` array by walking the folder. + */ + man?: string; + + /** + Location for test files. + */ + test?: string; + } + + export type Scripts = { + /** + Run **before** the package is published (Also run on local `npm install` without any arguments). + */ + prepublish?: string; + + /** + Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. + */ + prepare?: string; + + /** + Run **before** the package is prepared and packed, **only** on `npm publish`. + */ + prepublishOnly?: string; + + /** + Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). + */ + prepack?: string; + + /** + Run **after** the tarball has been generated and moved to its final destination. + */ + postpack?: string; + + /** + Run **after** the package is published. + */ + publish?: string; + + /** + Run **after** the package is published. + */ + postpublish?: string; + + /** + Run **before** the package is installed. + */ + preinstall?: string; + + /** + Run **after** the package is installed. + */ + install?: string; + + /** + Run **after** the package is installed and after `install`. + */ + postinstall?: string; + + /** + Run **before** the package is uninstalled and before `uninstall`. + */ + preuninstall?: string; + + /** + Run **before** the package is uninstalled. + */ + uninstall?: string; + + /** + Run **after** the package is uninstalled. + */ + postuninstall?: string; + + /** + Run **before** bump the package version and before `version`. + */ + preversion?: string; + + /** + Run **before** bump the package version. + */ + version?: string; + + /** + Run **after** bump the package version. + */ + postversion?: string; + + /** + Run with the `npm test` command, before `test`. + */ + pretest?: string; + + /** + Run with the `npm test` command. + */ + test?: string; + + /** + Run with the `npm test` command, after `test`. + */ + posttest?: string; + + /** + Run with the `npm stop` command, before `stop`. + */ + prestop?: string; + + /** + Run with the `npm stop` command. + */ + stop?: string; + + /** + Run with the `npm stop` command, after `stop`. + */ + poststop?: string; + + /** + Run with the `npm start` command, before `start`. + */ + prestart?: string; + + /** + Run with the `npm start` command. + */ + start?: string; + + /** + Run with the `npm start` command, after `start`. + */ + poststart?: string; + + /** + Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + prerestart?: string; + + /** + Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + restart?: string; + + /** + Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + postrestart?: string; + } & Record; + + /** + Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. + */ + export type Dependency = Record; + + /** + Conditions which provide a way to resolve a package entry point based on the environment. + */ + export type ExportCondition = LiteralUnion< + | 'import' + | 'require' + | 'node' + | 'deno' + | 'browser' + | 'electron' + | 'react-native' + | 'default', + string + >; + + /** + Entry points of a module, optionally with conditions and subpath exports. + */ + export type Exports = + | string + | {[key in ExportCondition]: Exports} + | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style + + export interface NonStandardEntryPoints { + /** + An ECMAScript module ID that is the primary entry point to the program. + */ + module?: string; + + /** + A module ID with untranspiled code that is the primary entry point to the program. + */ + esnext?: + | string + | { + [moduleName: string]: string | undefined; + main?: string; + browser?: string; + }; + + /** + A hint to JavaScript bundlers or component tools when packaging modules for client side use. + */ + browser?: + | string + | Record; + + /** + Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused. + + [Read more.](https://webpack.js.org/guides/tree-shaking/) + */ + sideEffects?: boolean | string[]; + } + + export interface TypeScriptConfiguration { + /** + Location of the bundled TypeScript declaration file. + */ + types?: string; + + /** + Location of the bundled TypeScript declaration file. Alias of `types`. + */ + typings?: string; + } + + /** + An alternative configuration for Yarn workspaces. + */ + export interface WorkspaceConfig { + /** + An array of workspace pattern strings which contain the workspace packages. + */ + packages?: WorkspacePattern[]; + + /** + Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns. + + [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) + */ + nohoist?: WorkspacePattern[]; + } + + /** + A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process. + + The patterns are handled with [minimatch](https://github.com/isaacs/minimatch). + + @example + `docs` → Include the docs directory and install its dependencies. + `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`. + */ + type WorkspacePattern = string; + + export interface YarnConfiguration { + /** + Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). + + Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass. + + Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. + */ + workspaces?: WorkspacePattern[] | WorkspaceConfig; + + /** + If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`. + + Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. + */ + flat?: boolean; + + /** + Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. + */ + resolutions?: Dependency; + } + + export interface JSPMConfiguration { + /** + JSPM configuration. + */ + jspm?: PackageJson; + } + + /** + Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties. + */ + export interface PackageJsonStandard { + /** + The name of the package. + */ + name?: string; + + /** + Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). + */ + version?: string; + + /** + Package description, listed in `npm search`. + */ + description?: string; + + /** + Keywords associated with package, listed in `npm search`. + */ + keywords?: string[]; + + /** + The URL to the package's homepage. + */ + homepage?: LiteralUnion<'.', string>; + + /** + The URL to the package's issue tracker and/or the email address to which issues should be reported. + */ + bugs?: BugsLocation; + + /** + The license for the package. + */ + license?: string; + + /** + The licenses for the package. + */ + licenses?: Array<{ + type?: string; + url?: string; + }>; + + author?: Person; + + /** + A list of people who contributed to the package. + */ + contributors?: Person[]; + + /** + A list of people who maintain the package. + */ + maintainers?: Person[]; + + /** + The files included in the package. + */ + files?: string[]; + + /** + Resolution algorithm for importing ".js" files from the package's scope. + + [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field) + */ + type?: 'module' | 'commonjs'; + + /** + The module ID that is the primary entry point to the program. + */ + main?: string; + + /** + Standard entry points of the package, with enhanced support for ECMAScript Modules. + + [Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points) + */ + exports?: Exports; + + /** + The executable files that should be installed into the `PATH`. + */ + bin?: + | string + | Record; + + /** + Filenames to put in place for the `man` program to find. + */ + man?: string | string[]; + + /** + Indicates the structure of the package. + */ + directories?: DirectoryLocations; + + /** + Location for the code repository. + */ + repository?: + | string + | { + type: string; + url: string; + + /** + Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo). + + [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md) + */ + directory?: string; + }; + + /** + Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. + */ + scripts?: Scripts; + + /** + Is used to set configuration parameters used in package scripts that persist across upgrades. + */ + config?: Record; + + /** + The dependencies of the package. + */ + dependencies?: Dependency; + + /** + Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. + */ + devDependencies?: Dependency; + + /** + Dependencies that are skipped if they fail to install. + */ + optionalDependencies?: Dependency; + + /** + Dependencies that will usually be required by the package user directly or via another dependency. + */ + peerDependencies?: Dependency; + + /** + Indicate peer dependencies that are optional. + */ + peerDependenciesMeta?: Record; + + /** + Package names that are bundled when the package is published. + */ + bundledDependencies?: string[]; + + /** + Alias of `bundledDependencies`. + */ + bundleDependencies?: string[]; + + /** + Engines that this package runs on. + */ + engines?: { + [EngineName in 'npm' | 'node' | string]: string; + }; + + /** + @deprecated + */ + engineStrict?: boolean; + + /** + Operating systems the module runs on. + */ + os?: Array>; + + /** + CPU architectures the module runs on. + */ + cpu?: Array>; + + /** + If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. + + @deprecated + */ + preferGlobal?: boolean; + + /** + If set to `true`, then npm will refuse to publish it. + */ + private?: boolean; + + /** + A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. + */ + publishConfig?: Record; + + /** + Describes and notifies consumers of a package's monetary support information. + + [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md) + */ + funding?: string | { + /** + The type of funding. + */ + type?: LiteralUnion< + | 'github' + | 'opencollective' + | 'patreon' + | 'individual' + | 'foundation' + | 'corporation', + string + >; + + /** + The URL to the funding page. + */ + url: string; + }; + } +} + +/** +Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. +*/ +export type PackageJson = +PackageJson.PackageJsonStandard & +PackageJson.NonStandardEntryPoints & +PackageJson.TypeScriptConfiguration & +PackageJson.YarnConfiguration & +PackageJson.JSPMConfiguration; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/partial-deep.d.ts new file mode 100644 index 000000000..b962b84eb --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/partial-deep.d.ts @@ -0,0 +1,72 @@ +import {Primitive} from './basic'; + +/** +Create a type from another type with all keys and nested keys set to optional. + +Use-cases: +- Merging a default settings/config object with another object, the second object would be a deep partial of the default object. +- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. + +@example +``` +import {PartialDeep} from 'type-fest'; + +const settings: Settings = { + textEditor: { + fontSize: 14; + fontColor: '#000000'; + fontWeight: 400; + } + autocomplete: false; + autosave: true; +}; + +const applySavedSettings = (savedSettings: PartialDeep) => { + return {...settings, ...savedSettings}; +} + +settings = applySavedSettings({textEditor: {fontWeight: 500}}); +``` +*/ +export type PartialDeep = T extends Primitive + ? Partial + : T extends Map + ? PartialMapDeep + : T extends Set + ? PartialSetDeep + : T extends ReadonlyMap + ? PartialReadonlyMapDeep + : T extends ReadonlySet + ? PartialReadonlySetDeep + : T extends ((...arguments: any[]) => unknown) + ? T | undefined + : T extends object + ? PartialObjectDeep + : unknown; + +/** +Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialMapDeep extends Map, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialSetDeep extends Set> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlyMapDeep extends ReadonlyMap, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlySetDeep extends ReadonlySet> {} + +/** +Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. +*/ +type PartialObjectDeep = { + [KeyType in keyof ObjectType]?: PartialDeep +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/promisable.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/promisable.d.ts new file mode 100644 index 000000000..71242a5db --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/promisable.d.ts @@ -0,0 +1,23 @@ +/** +Create a type that represents either the value or the value wrapped in `PromiseLike`. + +Use-cases: +- A function accepts a callback that may either return a value synchronously or may return a promised value. +- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. + +@example +``` +import {Promisable} from 'type-fest'; + +async function logger(getLogEntry: () => Promisable): Promise { + const entry = await getLogEntry(); + console.log(entry); +} + +logger(() => 'foo'); +logger(() => Promise.resolve('bar')); +``` +*/ +export type Promisable = T | PromiseLike; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/promise-value.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/promise-value.d.ts new file mode 100644 index 000000000..642ddebcc --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/promise-value.d.ts @@ -0,0 +1,27 @@ +/** +Returns the type that is wrapped inside a `Promise` type. +If the type is a nested Promise, it is unwrapped recursively until a non-Promise type is obtained. +If the type is not a `Promise`, the type itself is returned. + +@example +``` +import {PromiseValue} from 'type-fest'; + +type AsyncData = Promise; +let asyncData: PromiseValue = Promise.resolve('ABC'); + +type Data = PromiseValue; +let data: Data = await asyncData; + +// Here's an example that shows how this type reacts to non-Promise types. +type SyncData = PromiseValue; +let syncData: SyncData = getSyncData(); + +// Here's an example that shows how this type reacts to recursive Promise types. +type RecursiveAsyncData = Promise >; +let recursiveAsyncData: PromiseValue = Promise.resolve(Promise.resolve('ABC')); +``` +*/ +export type PromiseValue = PromiseType extends Promise + ? { 0: PromiseValue; 1: Value }[PromiseType extends Promise ? 0 : 1] + : Otherwise; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/readonly-deep.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/readonly-deep.d.ts new file mode 100644 index 000000000..b8c04de25 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/readonly-deep.d.ts @@ -0,0 +1,59 @@ +import {Primitive} from './basic'; + +/** +Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. + +This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + "foo": ["bar"] +} + +// main.ts +import {ReadonlyDeep} from 'type-fest'; +import dataJson = require('./data.json'); + +const data: ReadonlyDeep = dataJson; + +export default data; + +// test.ts +import data from './main'; + +data.foo.push('bar'); +//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' +``` +*/ +export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) + ? T + : T extends ReadonlyMap + ? ReadonlyMapDeep + : T extends ReadonlySet + ? ReadonlySetDeep + : T extends object + ? ReadonlyObjectDeep + : unknown; + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlyMapDeep + extends ReadonlyMap, ReadonlyDeep> {} + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlySetDeep + extends ReadonlySet> {} + +/** +Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +type ReadonlyObjectDeep = { + readonly [KeyType in keyof ObjectType]: ReadonlyDeep +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-at-least-one.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-at-least-one.d.ts new file mode 100644 index 000000000..b3b871917 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-at-least-one.d.ts @@ -0,0 +1,33 @@ +import {Except} from './except'; + +/** +Create a type that requires at least one of the given keys. The remaining keys are kept as is. + +@example +``` +import {RequireAtLeastOne} from 'type-fest'; + +type Responder = { + text?: () => string; + json?: () => string; + + secure?: boolean; +}; + +const responder: RequireAtLeastOne = { + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireAtLeastOne< + ObjectType, + KeysType extends keyof ObjectType = keyof ObjectType +> = { + // For each `Key` in `KeysType` make a mapped type: + [Key in KeysType]-?: Required> & // 1. Make `Key`'s type required + // 2. Make all other keys in `KeysType` optional + Partial>>; +}[KeysType] & + // 3. Add the remaining keys not in `KeysType` + Except; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-exactly-one.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-exactly-one.d.ts new file mode 100644 index 000000000..c3e7e7ead --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/require-exactly-one.d.ts @@ -0,0 +1,35 @@ +// TODO: Remove this when we target TypeScript >=3.5. +type _Omit = Pick>; + +/** +Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is. + +Use-cases: +- Creating interfaces for components that only need one of the keys to display properly. +- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`. + +The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about. + +@example +``` +import {RequireExactlyOne} from 'type-fest'; + +type Responder = { + text: () => string; + json: () => string; + secure: boolean; +}; + +const responder: RequireExactlyOne = { + // Adding a `text` key here would cause a compile error. + + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireExactlyOne = + {[Key in KeysType]: ( + Required> & + Partial, never>> + )}[KeysType] & _Omit; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-optional.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-optional.d.ts new file mode 100644 index 000000000..35398992b --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-optional.d.ts @@ -0,0 +1,34 @@ +import {Except} from './except'; + +/** +Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional. + +@example +``` +import {SetOptional} from 'type-fest'; + +type Foo = { + a: number; + b?: string; + c: boolean; +} + +type SomeOptional = SetOptional; +// type SomeOptional = { +// a: number; +// b?: string; // Was already optional and still is. +// c?: boolean; // Is now optional. +// } +``` +*/ +export type SetOptional = + // Pick just the keys that are not optional from the base type. + Except & + // Pick the keys that should be optional from the base type and make them optional. + Partial> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-required.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-required.d.ts new file mode 100644 index 000000000..0a7233077 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-required.d.ts @@ -0,0 +1,34 @@ +import {Except} from './except'; + +/** +Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. + +@example +``` +import {SetRequired} from 'type-fest'; + +type Foo = { + a?: number; + b: string; + c?: boolean; +} + +type SomeRequired = SetRequired; +// type SomeRequired = { +// a?: number; +// b: string; // Was already required and still is. +// c: boolean; // Is now required. +// } +``` +*/ +export type SetRequired = + // Pick just the keys that are not required from the base type. + Except & + // Pick the keys that should be required from the base type and make them required. + Required> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-return-type.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-return-type.d.ts new file mode 100644 index 000000000..98766b103 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/set-return-type.d.ts @@ -0,0 +1,29 @@ +type IsAny = 0 extends (1 & T) ? true : false; // https://stackoverflow.com/a/49928360/3406963 +type IsNever = [T] extends [never] ? true : false; +type IsUnknown = IsNever extends false ? T extends unknown ? unknown extends T ? IsAny extends false ? true : false : false : false : false; + +/** +Create a function type with a return type of your choice and the same parameters as the given function type. + +Use-case: You want to define a wrapped function that returns something different while receiving the same parameters. For example, you might want to wrap a function that can throw an error into one that will return `undefined` instead. + +@example +``` +import {SetReturnType} from 'type-fest'; + +type MyFunctionThatCanThrow = (foo: SomeType, bar: unknown) => SomeOtherType; + +type MyWrappedFunction = SetReturnType; +//=> type MyWrappedFunction = (foo: SomeType, bar: unknown) => SomeOtherType | undefined; +``` +*/ +export type SetReturnType any, TypeToReturn> = + // Just using `Parameters` isn't ideal because it doesn't handle the `this` fake parameter. + Fn extends (this: infer ThisArg, ...args: infer Arguments) => any ? ( + // If a function did not specify the `this` fake parameter, it will be inferred to `unknown`. + // We want to detect this situation just to display a friendlier type upon hovering on an IntelliSense-powered IDE. + IsUnknown extends true ? (...args: Arguments) => TypeToReturn : (this: ThisArg, ...args: Arguments) => TypeToReturn + ) : ( + // This part should be unreachable, but we make it meaningful just in case… + (...args: Parameters) => TypeToReturn + ); diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/stringified.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/stringified.d.ts new file mode 100644 index 000000000..9688b6740 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/stringified.d.ts @@ -0,0 +1,21 @@ +/** +Create a type with the keys of the given type changed to `string` type. + +Use-case: Changing interface values to strings in order to use them in a form model. + +@example +``` +import {Stringified} from 'type-fest'; + +type Car { + model: string; + speed: number; +} + +const carForm: Stringified = { + model: 'Foo', + speed: '101' +}; +``` +*/ +export type Stringified = {[KeyType in keyof ObjectType]: string}; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/tsconfig-json.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/tsconfig-json.d.ts new file mode 100644 index 000000000..89f6e9dd4 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/tsconfig-json.d.ts @@ -0,0 +1,870 @@ +declare namespace TsConfigJson { + namespace CompilerOptions { + export type JSX = + | 'preserve' + | 'react' + | 'react-native'; + + export type Module = + | 'CommonJS' + | 'AMD' + | 'System' + | 'UMD' + | 'ES6' + | 'ES2015' + | 'ESNext' + | 'None' + // Lowercase alternatives + | 'commonjs' + | 'amd' + | 'system' + | 'umd' + | 'es6' + | 'es2015' + | 'esnext' + | 'none'; + + export type NewLine = + | 'CRLF' + | 'LF' + // Lowercase alternatives + | 'crlf' + | 'lf'; + + export type Target = + | 'ES3' + | 'ES5' + | 'ES6' + | 'ES2015' + | 'ES2016' + | 'ES2017' + | 'ES2018' + | 'ES2019' + | 'ES2020' + | 'ESNext' + // Lowercase alternatives + | 'es3' + | 'es5' + | 'es6' + | 'es2015' + | 'es2016' + | 'es2017' + | 'es2018' + | 'es2019' + | 'es2020' + | 'esnext'; + + export type Lib = + | 'ES5' + | 'ES6' + | 'ES7' + | 'ES2015' + | 'ES2015.Collection' + | 'ES2015.Core' + | 'ES2015.Generator' + | 'ES2015.Iterable' + | 'ES2015.Promise' + | 'ES2015.Proxy' + | 'ES2015.Reflect' + | 'ES2015.Symbol.WellKnown' + | 'ES2015.Symbol' + | 'ES2016' + | 'ES2016.Array.Include' + | 'ES2017' + | 'ES2017.Intl' + | 'ES2017.Object' + | 'ES2017.SharedMemory' + | 'ES2017.String' + | 'ES2017.TypedArrays' + | 'ES2018' + | 'ES2018.AsyncIterable' + | 'ES2018.Intl' + | 'ES2018.Promise' + | 'ES2018.Regexp' + | 'ES2019' + | 'ES2019.Array' + | 'ES2019.Object' + | 'ES2019.String' + | 'ES2019.Symbol' + | 'ES2020' + | 'ES2020.String' + | 'ES2020.Symbol.WellKnown' + | 'ESNext' + | 'ESNext.Array' + | 'ESNext.AsyncIterable' + | 'ESNext.BigInt' + | 'ESNext.Intl' + | 'ESNext.Symbol' + | 'DOM' + | 'DOM.Iterable' + | 'ScriptHost' + | 'WebWorker' + | 'WebWorker.ImportScripts' + // Lowercase alternatives + | 'es5' + | 'es6' + | 'es7' + | 'es2015' + | 'es2015.collection' + | 'es2015.core' + | 'es2015.generator' + | 'es2015.iterable' + | 'es2015.promise' + | 'es2015.proxy' + | 'es2015.reflect' + | 'es2015.symbol.wellknown' + | 'es2015.symbol' + | 'es2016' + | 'es2016.array.include' + | 'es2017' + | 'es2017.intl' + | 'es2017.object' + | 'es2017.sharedmemory' + | 'es2017.string' + | 'es2017.typedarrays' + | 'es2018' + | 'es2018.asynciterable' + | 'es2018.intl' + | 'es2018.promise' + | 'es2018.regexp' + | 'es2019' + | 'es2019.array' + | 'es2019.object' + | 'es2019.string' + | 'es2019.symbol' + | 'es2020' + | 'es2020.string' + | 'es2020.symbol.wellknown' + | 'esnext' + | 'esnext.array' + | 'esnext.asynciterable' + | 'esnext.bigint' + | 'esnext.intl' + | 'esnext.symbol' + | 'dom' + | 'dom.iterable' + | 'scripthost' + | 'webworker' + | 'webworker.importscripts'; + + export interface Plugin { + [key: string]: unknown; + /** + Plugin name. + */ + name?: string; + } + } + + export interface CompilerOptions { + /** + The character set of the input files. + + @default 'utf8' + */ + charset?: string; + + /** + Enables building for project references. + + @default true + */ + composite?: boolean; + + /** + Generates corresponding d.ts files. + + @default false + */ + declaration?: boolean; + + /** + Specify output directory for generated declaration files. + + Requires TypeScript version 2.0 or later. + */ + declarationDir?: string; + + /** + Show diagnostic information. + + @default false + */ + diagnostics?: boolean; + + /** + Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. + + @default false + */ + emitBOM?: boolean; + + /** + Only emit `.d.ts` declaration files. + + @default false + */ + emitDeclarationOnly?: boolean; + + /** + Enable incremental compilation. + + @default `composite` + */ + incremental?: boolean; + + /** + Specify file to store incremental compilation information. + + @default '.tsbuildinfo' + */ + tsBuildInfoFile?: string; + + /** + Emit a single file with source maps instead of having a separate file. + + @default false + */ + inlineSourceMap?: boolean; + + /** + Emit the source alongside the sourcemaps within a single file. + + Requires `--inlineSourceMap` to be set. + + @default false + */ + inlineSources?: boolean; + + /** + Specify JSX code generation: `'preserve'`, `'react'`, or `'react-native'`. + + @default 'preserve' + */ + jsx?: CompilerOptions.JSX; + + /** + Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. + + @default 'React' + */ + reactNamespace?: string; + + /** + Print names of files part of the compilation. + + @default false + */ + listFiles?: boolean; + + /** + Specifies the location where debugger should locate map files instead of generated locations. + */ + mapRoot?: string; + + /** + Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. + + @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' + */ + module?: CompilerOptions.Module; + + /** + Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). + + Default: Platform specific + */ + newLine?: CompilerOptions.NewLine; + + /** + Do not emit output. + + @default false + */ + noEmit?: boolean; + + /** + Do not generate custom helper functions like `__extends` in compiled output. + + @default false + */ + noEmitHelpers?: boolean; + + /** + Do not emit outputs if any type checking errors were reported. + + @default false + */ + noEmitOnError?: boolean; + + /** + Warn on expressions and declarations with an implied 'any' type. + + @default false + */ + noImplicitAny?: boolean; + + /** + Raise error on 'this' expressions with an implied any type. + + @default false + */ + noImplicitThis?: boolean; + + /** + Report errors on unused locals. + + Requires TypeScript version 2.0 or later. + + @default false + */ + noUnusedLocals?: boolean; + + /** + Report errors on unused parameters. + + Requires TypeScript version 2.0 or later. + + @default false + */ + noUnusedParameters?: boolean; + + /** + Do not include the default library file (lib.d.ts). + + @default false + */ + noLib?: boolean; + + /** + Do not add triple-slash references or module import targets to the list of compiled files. + + @default false + */ + noResolve?: boolean; + + /** + Disable strict checking of generic signatures in function types. + + @default false + */ + noStrictGenericChecks?: boolean; + + /** + @deprecated use `skipLibCheck` instead. + */ + skipDefaultLibCheck?: boolean; + + /** + Skip type checking of declaration files. + + Requires TypeScript version 2.0 or later. + + @default false + */ + skipLibCheck?: boolean; + + /** + Concatenate and emit output to single file. + */ + outFile?: string; + + /** + Redirect output structure to the directory. + */ + outDir?: string; + + /** + Do not erase const enum declarations in generated code. + + @default false + */ + preserveConstEnums?: boolean; + + /** + Do not resolve symlinks to their real path; treat a symlinked file like a real one. + + @default false + */ + preserveSymlinks?: boolean; + + /** + Keep outdated console output in watch mode instead of clearing the screen. + + @default false + */ + preserveWatchOutput?: boolean; + + /** + Stylize errors and messages using color and context (experimental). + + @default true // Unless piping to another program or redirecting output to a file. + */ + pretty?: boolean; + + /** + Do not emit comments to output. + + @default false + */ + removeComments?: boolean; + + /** + Specifies the root directory of input files. + + Use to control the output directory structure with `--outDir`. + */ + rootDir?: string; + + /** + Unconditionally emit imports for unresolved files. + + @default false + */ + isolatedModules?: boolean; + + /** + Generates corresponding '.map' file. + + @default false + */ + sourceMap?: boolean; + + /** + Specifies the location where debugger should locate TypeScript files instead of source locations. + */ + sourceRoot?: string; + + /** + Suppress excess property checks for object literals. + + @default false + */ + suppressExcessPropertyErrors?: boolean; + + /** + Suppress noImplicitAny errors for indexing objects lacking index signatures. + + @default false + */ + suppressImplicitAnyIndexErrors?: boolean; + + /** + Do not emit declarations for code that has an `@internal` annotation. + */ + stripInternal?: boolean; + + /** + Specify ECMAScript target version. + + @default 'es3' + */ + target?: CompilerOptions.Target; + + /** + Watch input files. + + @default false + */ + watch?: boolean; + + /** + Enables experimental support for ES7 decorators. + + @default false + */ + experimentalDecorators?: boolean; + + /** + Emit design-type metadata for decorated declarations in source. + + @default false + */ + emitDecoratorMetadata?: boolean; + + /** + Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). + + @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' + */ + moduleResolution?: 'classic' | 'node'; + + /** + Do not report errors on unused labels. + + @default false + */ + allowUnusedLabels?: boolean; + + /** + Report error when not all code paths in function return a value. + + @default false + */ + noImplicitReturns?: boolean; + + /** + Report errors for fallthrough cases in switch statement. + + @default false + */ + noFallthroughCasesInSwitch?: boolean; + + /** + Do not report errors on unreachable code. + + @default false + */ + allowUnreachableCode?: boolean; + + /** + Disallow inconsistently-cased references to the same file. + + @default false + */ + forceConsistentCasingInFileNames?: boolean; + + /** + Base directory to resolve non-relative module names. + */ + baseUrl?: string; + + /** + Specify path mapping to be computed relative to baseUrl option. + */ + paths?: Record; + + /** + List of TypeScript language server plugins to load. + + Requires TypeScript version 2.3 or later. + */ + plugins?: CompilerOptions.Plugin[]; + + /** + Specify list of root directories to be used when resolving modules. + */ + rootDirs?: string[]; + + /** + Specify list of directories for type definition files to be included. + + Requires TypeScript version 2.0 or later. + */ + typeRoots?: string[]; + + /** + Type declaration files to be included in compilation. + + Requires TypeScript version 2.0 or later. + */ + types?: string[]; + + /** + Enable tracing of the name resolution process. + + @default false + */ + traceResolution?: boolean; + + /** + Allow javascript files to be compiled. + + @default false + */ + allowJs?: boolean; + + /** + Do not truncate error messages. + + @default false + */ + noErrorTruncation?: boolean; + + /** + Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + + @default module === 'system' || esModuleInterop + */ + allowSyntheticDefaultImports?: boolean; + + /** + Do not emit `'use strict'` directives in module output. + + @default false + */ + noImplicitUseStrict?: boolean; + + /** + Enable to list all emitted files. + + Requires TypeScript version 2.0 or later. + + @default false + */ + listEmittedFiles?: boolean; + + /** + Disable size limit for JavaScript project. + + Requires TypeScript version 2.0 or later. + + @default false + */ + disableSizeLimit?: boolean; + + /** + List of library files to be included in the compilation. + + Requires TypeScript version 2.0 or later. + */ + lib?: CompilerOptions.Lib[]; + + /** + Enable strict null checks. + + Requires TypeScript version 2.0 or later. + + @default false + */ + strictNullChecks?: boolean; + + /** + The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. + + @default 0 + */ + maxNodeModuleJsDepth?: number; + + /** + Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. + + Requires TypeScript version 2.1 or later. + + @default false + */ + importHelpers?: boolean; + + /** + Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. + + Requires TypeScript version 2.1 or later. + + @default 'React.createElement' + */ + jsxFactory?: string; + + /** + Parse in strict mode and emit `'use strict'` for each source file. + + Requires TypeScript version 2.1 or later. + + @default false + */ + alwaysStrict?: boolean; + + /** + Enable all strict type checking options. + + Requires TypeScript version 2.3 or later. + + @default false + */ + strict?: boolean; + + /** + Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. + + @default false + */ + strictBindCallApply?: boolean; + + /** + Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. + + Requires TypeScript version 2.3 or later. + + @default false + */ + downlevelIteration?: boolean; + + /** + Report errors in `.js` files. + + Requires TypeScript version 2.3 or later. + + @default false + */ + checkJs?: boolean; + + /** + Disable bivariant parameter checking for function types. + + Requires TypeScript version 2.6 or later. + + @default false + */ + strictFunctionTypes?: boolean; + + /** + Ensure non-undefined class properties are initialized in the constructor. + + Requires TypeScript version 2.7 or later. + + @default false + */ + strictPropertyInitialization?: boolean; + + /** + Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. + + Requires TypeScript version 2.7 or later. + + @default false + */ + esModuleInterop?: boolean; + + /** + Allow accessing UMD globals from modules. + + @default false + */ + allowUmdGlobalAccess?: boolean; + + /** + Resolve `keyof` to string valued property names only (no numbers or symbols). + + Requires TypeScript version 2.9 or later. + + @default false + */ + keyofStringsOnly?: boolean; + + /** + Emit ECMAScript standard class fields. + + Requires TypeScript version 3.7 or later. + + @default false + */ + useDefineForClassFields?: boolean; + + /** + Generates a sourcemap for each corresponding `.d.ts` file. + + Requires TypeScript version 2.9 or later. + + @default false + */ + declarationMap?: boolean; + + /** + Include modules imported with `.json` extension. + + Requires TypeScript version 2.9 or later. + + @default false + */ + resolveJsonModule?: boolean; + } + + /** + Auto type (.d.ts) acquisition options for this project. + + Requires TypeScript version 2.1 or later. + */ + export interface TypeAcquisition { + /** + Enable auto type acquisition. + */ + enable?: boolean; + + /** + Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. + */ + include?: string[]; + + /** + Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. + */ + exclude?: string[]; + } + + export interface References { + /** + A normalized path on disk. + */ + path: string; + + /** + The path as the user originally wrote it. + */ + originalPath?: string; + + /** + True if the output of this reference should be prepended to the output of this project. + + Only valid for `--outFile` compilations. + */ + prepend?: boolean; + + /** + True if it is intended that this reference form a circularity. + */ + circular?: boolean; + } +} + +export interface TsConfigJson { + /** + Instructs the TypeScript compiler how to compile `.ts` files. + */ + compilerOptions?: TsConfigJson.CompilerOptions; + + /** + Auto type (.d.ts) acquisition options for this project. + + Requires TypeScript version 2.1 or later. + */ + typeAcquisition?: TsConfigJson.TypeAcquisition; + + /** + Enable Compile-on-Save for this project. + */ + compileOnSave?: boolean; + + /** + Path to base configuration file to inherit from. + + Requires TypeScript version 2.1 or later. + */ + extends?: string; + + /** + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. + */ + files?: string[]; + + /** + Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. + + Glob patterns require TypeScript version 2.0 or later. + */ + exclude?: string[]; + + /** + Specifies a list of glob patterns that match files to be included in compilation. + + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. + + Requires TypeScript version 2.0 or later. + */ + include?: string[]; + + /** + Referenced projects. + + Requires TypeScript version 3.0 or later. + */ + references?: TsConfigJson.References[]; +} diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/union-to-intersection.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/union-to-intersection.d.ts new file mode 100644 index 000000000..5f9837f3b --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/union-to-intersection.d.ts @@ -0,0 +1,58 @@ +/** +Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). + +Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153). + +@example +``` +import {UnionToIntersection} from 'type-fest'; + +type Union = {the(): void} | {great(arg: string): void} | {escape: boolean}; + +type Intersection = UnionToIntersection; +//=> {the(): void; great(arg: string): void; escape: boolean}; +``` + +A more applicable example which could make its way into your library code follows. + +@example +``` +import {UnionToIntersection} from 'type-fest'; + +class CommandOne { + commands: { + a1: () => undefined, + b1: () => undefined, + } +} + +class CommandTwo { + commands: { + a2: (argA: string) => undefined, + b2: (argB: string) => undefined, + } +} + +const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands); +type Union = typeof union; +//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void} + +type Intersection = UnionToIntersection; +//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void} +``` +*/ +export type UnionToIntersection = ( + // `extends unknown` is always going to be the case and is used to convert the + // `Union` into a [distributive conditional + // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). + Union extends unknown + // The union type is used as the only argument to a function since the union + // of function arguments is an intersection. + ? (distributedUnion: Union) => void + // This won't happen. + : never + // Infer the `Intersection` type since TypeScript represents the positional + // arguments of unions of functions as an intersection of the union. + ) extends ((mergedIntersection: infer Intersection) => void) + ? Intersection + : never; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/utilities.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/utilities.d.ts new file mode 100644 index 000000000..0bd75e667 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/utilities.d.ts @@ -0,0 +1,3 @@ +export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'; + +export type WordSeparators = '-' | '_' | ' '; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/source/value-of.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/value-of.d.ts new file mode 100644 index 000000000..12793733b --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/source/value-of.d.ts @@ -0,0 +1,40 @@ +/** +Create a union of the given object's values, and optionally specify which keys to get the values from. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + 'foo': 1, + 'bar': 2, + 'biz': 3 +} + +// main.ts +import {ValueOf} from 'type-fest'; +import data = require('./data.json'); + +export function getData(name: string): ValueOf { + return data[name]; +} + +export function onlyBar(name: string): ValueOf { + return data[name]; +} + +// file.ts +import {getData, onlyBar} from './main'; + +getData('foo'); +//=> 1 + +onlyBar('foo'); +//=> TypeError ... + +onlyBar('bar'); +//=> 2 +``` +*/ +export type ValueOf = ObjectType[ValueType]; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/camel-case.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/camel-case.d.ts new file mode 100644 index 000000000..4476fd302 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/camel-case.d.ts @@ -0,0 +1,72 @@ +import {WordSeparators} from '../source/utilities'; + +/** +Recursively split a string literal into two parts on the first occurence of the given string, returning an array literal of all the separate parts. +*/ +export type Split = + string extends S ? string[] : + S extends '' ? [] : + S extends `${infer T}${D}${infer U}` ? [T, ...Split] : + [S]; + +/** +Step by step takes the first item in an array literal, formats it and adds it to a string literal, and then recursively appends the remainder. + +Only to be used by `CamelCaseStringArray<>`. + +@see CamelCaseStringArray +*/ +type InnerCamelCaseStringArray = + Parts extends [`${infer FirstPart}`, ...infer RemainingParts] + ? FirstPart extends undefined + ? '' + : FirstPart extends '' + ? InnerCamelCaseStringArray + : `${PreviousPart extends '' ? FirstPart : Capitalize}${InnerCamelCaseStringArray}` + : ''; + +/** +Starts fusing the output of `Split<>`, an array literal of strings, into a camel-cased string literal. + +It's separate from `InnerCamelCaseStringArray<>` to keep a clean API outwards to the rest of the code. + +@see Split +*/ +type CamelCaseStringArray = + Parts extends [`${infer FirstPart}`, ...infer RemainingParts] + ? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray}`> + : never; + +/** +Convert a string literal to camel-case. + +This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result. + +@example +``` +import {CamelCase} from 'type-fest'; + +// Simple + +const someVariable: CamelCase<'foo-bar'> = 'fooBar'; + +// Advanced + +type CamelCasedProps = { + [K in keyof T as CamelCase]: T[K] +}; + +interface RawOptions { + 'dry-run': boolean; + 'full_family_name': string; + foo: number; +} + +const dbResult: CamelCasedProps = { + dryRun: true, + fullFamilyName: 'bar.js', + foo: 123 +}; +``` +*/ +export type CamelCase = K extends string ? CamelCaseStringArray> : K; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/delimiter-case.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/delimiter-case.d.ts new file mode 100644 index 000000000..52f4eb992 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/delimiter-case.d.ts @@ -0,0 +1,85 @@ +import {UpperCaseCharacters, WordSeparators} from '../source/utilities'; + +/** +Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters. +*/ +export type SplitIncludingDelimiters = + Source extends '' ? [] : + Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ? + ( + Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}` + ? UsedDelimiter extends Delimiter + ? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}` + ? [...SplitIncludingDelimiters, UsedDelimiter, ...SplitIncludingDelimiters] + : never + : never + : never + ) : + [Source]; + +/** +Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing. + +@see StringArrayToDelimiterCase +*/ +type StringPartToDelimiterCase = + StringPart extends UsedWordSeparators ? Delimiter : + StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase}` : + StringPart; + +/** +Takes the result of a splitted string literal and recursively concatenates it together into the desired casing. + +It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated. + +@see SplitIncludingDelimiters +*/ +type StringArrayToDelimiterCase = + Parts extends [`${infer FirstPart}`, ...infer RemainingParts] + ? `${StringPartToDelimiterCase}${StringArrayToDelimiterCase}` + : ''; + +/** +Convert a string literal to a custom string delimiter casing. + +This can be useful when, for example, converting a camel-cased object property to an oddly cased one. + +@see KebabCase +@see SnakeCase + +@example +``` +import {DelimiterCase} from 'type-fest'; + +// Simple + +const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar'; + +// Advanced + +type OddlyCasedProps = { + [K in keyof T as DelimiterCase]: T[K] +}; + +interface SomeOptions { + dryRun: boolean; + includeFile: string; + foo: number; +} + +const rawCliOptions: OddlyCasedProps = { + 'dry#run': true, + 'include#file': 'bar.js', + foo: 123 +}; +``` +*/ + +export type DelimiterCase = Value extends string + ? StringArrayToDelimiterCase< + SplitIncludingDelimiters, + WordSeparators, + UpperCaseCharacters, + Delimiter + > + : Value; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/index.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/index.d.ts new file mode 100644 index 000000000..fbaec82e2 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/index.d.ts @@ -0,0 +1,9 @@ +// These are all the basic types that's compatible with all supported TypeScript versions. +export * from '../base'; + +// These are special types that require at least TypeScript 4.1. +export {CamelCase} from './camel-case'; +export {KebabCase} from './kebab-case'; +export {PascalCase} from './pascal-case'; +export {SnakeCase} from './snake-case'; +export {DelimiterCase} from './delimiter-case'; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/kebab-case.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/kebab-case.d.ts new file mode 100644 index 000000000..ba6a99d1f --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/kebab-case.d.ts @@ -0,0 +1,36 @@ +import {DelimiterCase} from './delimiter-case'; + +/** +Convert a string literal to kebab-case. + +This can be useful when, for example, converting a camel-cased object property to a kebab-cased CSS class name or a command-line flag. + +@example +``` +import {KebabCase} from 'type-fest'; + +// Simple + +const someVariable: KebabCase<'fooBar'> = 'foo-bar'; + +// Advanced + +type KebabCasedProps = { + [K in keyof T as KebabCase]: T[K] +}; + +interface CliOptions { + dryRun: boolean; + includeFile: string; + foo: number; +} + +const rawCliOptions: KebabCasedProps = { + 'dry-run': true, + 'include-file': 'bar.js', + foo: 123 +}; +``` +*/ + +export type KebabCase = DelimiterCase; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/pascal-case.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/pascal-case.d.ts new file mode 100644 index 000000000..bfb2a3627 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/pascal-case.d.ts @@ -0,0 +1,36 @@ +import {CamelCase} from './camel-case'; + +/** +Converts a string literal to pascal-case. + +@example +``` +import {PascalCase} from 'type-fest'; + +// Simple + +const someVariable: PascalCase<'foo-bar'> = 'FooBar'; + +// Advanced + +type PascalCaseProps = { + [K in keyof T as PascalCase]: T[K] +}; + +interface RawOptions { + 'dry-run': boolean; + 'full_family_name': string; + foo: number; +} + +const dbResult: CamelCasedProps = { + DryRun: true, + FullFamilyName: 'bar.js', + Foo: 123 +}; +``` +*/ + +export type PascalCase = CamelCase extends string + ? Capitalize> + : CamelCase; diff --git a/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/snake-case.d.ts b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/snake-case.d.ts new file mode 100644 index 000000000..272b3d359 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/type-fest/ts41/snake-case.d.ts @@ -0,0 +1,35 @@ +import {DelimiterCase} from './delimiter-case'; + +/** +Convert a string literal to snake-case. + +This can be useful when, for example, converting a camel-cased object property to a snake-cased SQL column name. + +@example +``` +import {SnakeCase} from 'type-fest'; + +// Simple + +const someVariable: SnakeCase<'fooBar'> = 'foo_bar'; + +// Advanced + +type SnakeCasedProps = { + [K in keyof T as SnakeCase]: T[K] +}; + +interface ModelProps { + isHappy: boolean; + fullFamilyName: string; + foo: number; +} + +const dbResult: SnakeCasedProps = { + 'is_happy': true, + 'full_family_name': 'Carla Smith', + foo: 123 +}; +``` +*/ +export type SnakeCase = DelimiterCase; diff --git a/node_modules/@eslint/eslintrc/package.json b/node_modules/@eslint/eslintrc/package.json index a7319e6d5..486624975 100644 --- a/node_modules/@eslint/eslintrc/package.json +++ b/node_modules/@eslint/eslintrc/package.json @@ -1,95 +1,82 @@ { - "_from": "@eslint/eslintrc@^0.4.0", - "_id": "@eslint/eslintrc@0.4.0", - "_inBundle": false, - "_integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", - "_location": "/@eslint/eslintrc", - "_phantomChildren": { - "type-fest": "0.8.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "@eslint/eslintrc@^0.4.0", - "name": "@eslint/eslintrc", - "escapedName": "@eslint%2feslintrc", - "scope": "@eslint", - "rawSpec": "^0.4.0", - "saveSpec": null, - "fetchSpec": "^0.4.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "_shasum": "99cc0a0584d72f1df38b900fb062ba995f395547", - "_spec": "@eslint/eslintrc@^0.4.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Nicholas C. Zakas" - }, - "bugs": { - "url": "https://github.com/eslint/eslintrc/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "deprecated": false, + "name": "@eslint/eslintrc", + "version": "2.0.1", "description": "The legacy ESLintRC config file format for ESLint", - "devDependencies": { - "chai": "^4.2.0", - "eslint": "^7.7.0", - "eslint-config-eslint": "^6.0.0", - "eslint-plugin-jsdoc": "^22.1.0", - "eslint-plugin-node": "^11.1.0", - "eslint-release": "^3.1.2", - "fs-teardown": "^0.1.0", - "mocha": "^8.1.1", - "shelljs": "^0.8.4", - "sinon": "^9.2.0", - "temp-dir": "^2.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" + "type": "module", + "main": "./dist/eslintrc.cjs", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./dist/eslintrc.cjs" + }, + "./package.json": "./package.json", + "./universal": { + "import": "./lib/index-universal.js", + "require": "./dist/eslintrc-universal.cjs" + } }, "files": [ "lib", "conf", - "LICENSE" + "LICENSE", + "dist", + "universal.js" ], - "homepage": "https://github.com/eslint/eslintrc#readme", + "publishConfig": { + "access": "public" + }, + "scripts": { + "prepare": "npm run build", + "build": "rollup -c", + "lint": "eslint . --report-unused-disable-directives", + "fix": "npm run lint -- --fix", + "test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslintrc", + "funding": "https://opencollective.com/eslint", "keywords": [ "ESLint", "ESLintRC", "Configuration" ], + "author": "Nicholas C. Zakas", "license": "MIT", - "main": "lib/index.js", - "name": "@eslint/eslintrc", - "publishConfig": { - "access": "public" + "bugs": { + "url": "https://github.com/eslint/eslintrc/issues" }, - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslintrc.git" + "homepage": "https://github.com/eslint/eslintrc#readme", + "devDependencies": { + "c8": "^7.7.3", + "chai": "^4.3.4", + "eslint": "^7.31.0", + "eslint-config-eslint": "^7.0.0", + "eslint-plugin-jsdoc": "^35.4.1", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^3.2.0", + "fs-teardown": "^0.1.3", + "mocha": "^9.0.3", + "rollup": "^2.70.1", + "shelljs": "^0.8.4", + "sinon": "^11.1.2", + "temp-dir": "^2.0.0" }, - "scripts": { - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint .", - "publish-release": "eslint-publish-release", - "test": "mocha -R progress -c 'tests/lib/**/*.js'" + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.5.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, - "version": "0.4.0" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } } diff --git a/node_modules/@eslint/eslintrc/universal.js b/node_modules/@eslint/eslintrc/universal.js new file mode 100644 index 000000000..4e1846ee6 --- /dev/null +++ b/node_modules/@eslint/eslintrc/universal.js @@ -0,0 +1,9 @@ +// Jest (and probably some other runtimes with custom implementations of +// `require`) doesn't support `exports` in `package.json`, so this file is here +// to help them load this module. Note that it is also `.js` and not `.cjs` for +// the same reason - `cjs` files requires to be loaded with an extension, but +// since Jest doesn't respect `module` outside of ESM mode it still works in +// this case (and the `require` in _this_ file does specify the extension). + +// eslint-disable-next-line no-undef +module.exports = require("./dist/eslintrc-universal.cjs"); diff --git a/node_modules/enquirer/LICENSE b/node_modules/@eslint/js/LICENSE similarity index 93% rename from node_modules/enquirer/LICENSE rename to node_modules/@eslint/js/LICENSE index 681d1bf72..b607bb36e 100644 --- a/node_modules/enquirer/LICENSE +++ b/node_modules/@eslint/js/LICENSE @@ -1,6 +1,4 @@ -The MIT License (MIT) - -Copyright (c) 2016-present, Jon Schlinkert. +Copyright OpenJS Foundation and other contributors, Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/@eslint/js/README.md b/node_modules/@eslint/js/README.md new file mode 100644 index 000000000..a8121c3a7 --- /dev/null +++ b/node_modules/@eslint/js/README.md @@ -0,0 +1,57 @@ +[![npm version](https://img.shields.io/npm/v/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js) + +# ESLint JavaScript Plugin + +[Website](https://eslint.org) | [Configure ESLint](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Chatroom](https://eslint.org/chat) + +The beginnings of separating out JavaScript-specific functionality from ESLint. + +Right now, this plugin contains two configurations: + +* `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`) +* `all` - enables all ESLint rules (the replacement for `"eslint:all"`) + +## Installation + +```shell +npm install @eslint/js -D +``` + +## Usage + +Use in your `eslint.config.js` file anytime you want to extend one of the configs: + +```js +import js from "@eslint/js"; + +export default [ + + // apply recommended rules to JS files + { + files: ["**/*.js"], + rules: js.configs.recommended.rules + }, + + // apply recommended rules to JS files with an override + { + files: ["**/*.js"], + rules: { + ...js.configs.recommended.rules, + "no-unused-vars": "warn" + } + }, + + // apply all rules to JS files + { + files: ["**/*.js"], + rules: { + ...js.configs.all.rules, + "no-unused-vars": "warn" + } + } +] +``` + +## License + +MIT diff --git a/node_modules/@eslint/js/package.json b/node_modules/@eslint/js/package.json new file mode 100644 index 000000000..7dfa6130e --- /dev/null +++ b/node_modules/@eslint/js/package.json @@ -0,0 +1,31 @@ +{ + "name": "@eslint/js", + "version": "8.36.0", + "description": "ESLint JavaScript language implementation", + "main": "./src/index.js", + "scripts": {}, + "files": [ + "LICENSE", + "README.md", + "src" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/eslint/eslint.git", + "directory": "packages/js" + }, + "homepage": "https://eslint.org", + "bugs": "https://github.com/eslint/eslint/issues/", + "keywords": [ + "javascript", + "eslint-plugin", + "eslint" + ], + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } +} diff --git a/node_modules/@eslint/js/src/configs/eslint-all.js b/node_modules/@eslint/js/src/configs/eslint-all.js new file mode 100644 index 000000000..f3a415cce --- /dev/null +++ b/node_modules/@eslint/js/src/configs/eslint-all.js @@ -0,0 +1,279 @@ +/* + * WARNING: This file is autogenerated using the tools/update-eslint-all.js + * script. Do not edit manually. + */ +"use strict"; + +/* eslint quote-props: off -- autogenerated so don't lint */ + +module.exports = Object.freeze({ + "rules": { + "accessor-pairs": "error", + "array-bracket-newline": "error", + "array-bracket-spacing": "error", + "array-callback-return": "error", + "array-element-newline": "error", + "arrow-body-style": "error", + "arrow-parens": "error", + "arrow-spacing": "error", + "block-scoped-var": "error", + "block-spacing": "error", + "brace-style": "error", + "camelcase": "error", + "capitalized-comments": "error", + "class-methods-use-this": "error", + "comma-dangle": "error", + "comma-spacing": "error", + "comma-style": "error", + "complexity": "error", + "computed-property-spacing": "error", + "consistent-return": "error", + "consistent-this": "error", + "constructor-super": "error", + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "default-param-last": "error", + "dot-location": "error", + "dot-notation": "error", + "eol-last": "error", + "eqeqeq": "error", + "for-direction": "error", + "func-call-spacing": "error", + "func-name-matching": "error", + "func-names": "error", + "func-style": "error", + "function-call-argument-newline": "error", + "function-paren-newline": "error", + "generator-star-spacing": "error", + "getter-return": "error", + "grouped-accessor-pairs": "error", + "guard-for-in": "error", + "id-denylist": "error", + "id-length": "error", + "id-match": "error", + "implicit-arrow-linebreak": "error", + "indent": "error", + "init-declarations": "error", + "jsx-quotes": "error", + "key-spacing": "error", + "keyword-spacing": "error", + "line-comment-position": "error", + "linebreak-style": "error", + "lines-around-comment": "error", + "lines-between-class-members": "error", + "logical-assignment-operators": "error", + "max-classes-per-file": "error", + "max-depth": "error", + "max-len": "error", + "max-lines": "error", + "max-lines-per-function": "error", + "max-nested-callbacks": "error", + "max-params": "error", + "max-statements": "error", + "max-statements-per-line": "error", + "multiline-comment-style": "error", + "multiline-ternary": "error", + "new-cap": "error", + "new-parens": "error", + "newline-per-chained-call": "error", + "no-alert": "error", + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-await-in-loop": "error", + "no-bitwise": "error", + "no-caller": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-confusing-arrow": "error", + "no-console": "error", + "no-const-assign": "error", + "no-constant-binary-expression": "error", + "no-constant-condition": "error", + "no-constructor-return": "error", + "no-continue": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-div-regex": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": "error", + "no-else-return": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-function": "error", + "no-empty-pattern": "error", + "no-empty-static-block": "error", + "no-eq-null": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-boolean-cast": "error", + "no-extra-label": "error", + "no-extra-parens": "error", + "no-extra-semi": "error", + "no-fallthrough": "error", + "no-floating-decimal": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implicit-coercion": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-import-assign": "error", + "no-inline-comments": "error", + "no-inner-declarations": "error", + "no-invalid-regexp": "error", + "no-invalid-this": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-loop-func": "error", + "no-loss-of-precision": "error", + "no-magic-numbers": "error", + "no-misleading-character-class": "error", + "no-mixed-operators": "error", + "no-mixed-spaces-and-tabs": "error", + "no-multi-assign": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-negated-condition": "error", + "no-nested-ternary": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-native-nonconstructor": "error", + "no-new-object": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-nonoctal-decimal-escape": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-param-reassign": "error", + "no-plusplus": "error", + "no-promise-executor-return": "error", + "no-proto": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-restricted-exports": "error", + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-properties": "error", + "no-restricted-syntax": "error", + "no-return-assign": "error", + "no-return-await": "error", + "no-script-url": "error", + "no-self-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-setter-return": "error", + "no-shadow": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-ternary": "error", + "no-this-before-super": "error", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-undef-init": "error", + "no-undefined": "error", + "no-underscore-dangle": "error", + "no-unexpected-multiline": "error", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unreachable": "error", + "no-unreachable-loop": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-unused-private-class-members": "error", + "no-unused-vars": "error", + "no-use-before-define": "error", + "no-useless-backreference": "error", + "no-useless-call": "error", + "no-useless-catch": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-var": "error", + "no-void": "error", + "no-warning-comments": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "nonblock-statement-body-position": "error", + "object-curly-newline": "error", + "object-curly-spacing": "error", + "object-property-newline": "error", + "object-shorthand": "error", + "one-var": "error", + "one-var-declaration-per-line": "error", + "operator-assignment": "error", + "operator-linebreak": "error", + "padded-blocks": "error", + "padding-line-between-statements": "error", + "prefer-arrow-callback": "error", + "prefer-const": "error", + "prefer-destructuring": "error", + "prefer-exponentiation-operator": "error", + "prefer-named-capture-group": "error", + "prefer-numeric-literals": "error", + "prefer-object-has-own": "error", + "prefer-object-spread": "error", + "prefer-promise-reject-errors": "error", + "prefer-regex-literals": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "quote-props": "error", + "quotes": "error", + "radix": "error", + "require-atomic-updates": "error", + "require-await": "error", + "require-unicode-regexp": "error", + "require-yield": "error", + "rest-spread-spacing": "error", + "semi": "error", + "semi-spacing": "error", + "semi-style": "error", + "sort-imports": "error", + "sort-keys": "error", + "sort-vars": "error", + "space-before-blocks": "error", + "space-before-function-paren": "error", + "space-in-parens": "error", + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": "error", + "strict": "error", + "switch-colon-spacing": "error", + "symbol-description": "error", + "template-curly-spacing": "error", + "template-tag-spacing": "error", + "unicode-bom": "error", + "use-isnan": "error", + "valid-typeof": "error", + "vars-on-top": "error", + "wrap-iife": "error", + "wrap-regex": "error", + "yield-star-spacing": "error", + "yoda": "error" + } +}); diff --git a/node_modules/eslint/conf/eslint-recommended.js b/node_modules/@eslint/js/src/configs/eslint-recommended.js similarity index 87% rename from node_modules/eslint/conf/eslint-recommended.js rename to node_modules/@eslint/js/src/configs/eslint-recommended.js index 2137685fb..248c613ca 100644 --- a/node_modules/eslint/conf/eslint-recommended.js +++ b/node_modules/@eslint/js/src/configs/eslint-recommended.js @@ -6,11 +6,11 @@ "use strict"; -/* eslint sort-keys: ["error", "asc"] */ +/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */ /** @type {import("../lib/shared/types").ConfigData} */ -module.exports = { - rules: { +module.exports = Object.freeze({ + rules: Object.freeze({ "constructor-super": "error", "for-direction": "error", "getter-return": "error", @@ -42,9 +42,11 @@ module.exports = { "no-inner-declarations": "error", "no-invalid-regexp": "error", "no-irregular-whitespace": "error", + "no-loss-of-precision": "error", "no-misleading-character-class": "error", "no-mixed-spaces-and-tabs": "error", "no-new-symbol": "error", + "no-nonoctal-decimal-escape": "error", "no-obj-calls": "error", "no-octal": "error", "no-prototype-builtins": "error", @@ -60,13 +62,15 @@ module.exports = { "no-unreachable": "error", "no-unsafe-finally": "error", "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", "no-unused-labels": "error", "no-unused-vars": "error", + "no-useless-backreference": "error", "no-useless-catch": "error", "no-useless-escape": "error", "no-with": "error", "require-yield": "error", "use-isnan": "error", "valid-typeof": "error" - } -}; + }) +}); diff --git a/node_modules/@eslint/js/src/index.js b/node_modules/@eslint/js/src/index.js new file mode 100644 index 000000000..0d4be486a --- /dev/null +++ b/node_modules/@eslint/js/src/index.js @@ -0,0 +1,17 @@ +/** + * @fileoverview Main package entrypoint. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + configs: { + all: require("./configs/eslint-all"), + recommended: require("./configs/eslint-recommended") + } +}; diff --git a/node_modules/@humanwhocodes/config-array/CHANGELOG.md b/node_modules/@humanwhocodes/config-array/CHANGELOG.md new file mode 100644 index 000000000..8abea92eb --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/CHANGELOG.md @@ -0,0 +1,198 @@ +# Changelog + +## [0.11.8](https://github.com/humanwhocodes/config-array/compare/v0.11.7...v0.11.8) (2022-12-14) + + +### Bug Fixes + +* Ensure gitignore-style directory ignores ([#74](https://github.com/humanwhocodes/config-array/issues/74)) ([8e17f4a](https://github.com/humanwhocodes/config-array/commit/8e17f4a7378cb0b417e1103d60ef397b26d2f917)) + +## [0.11.7](https://github.com/humanwhocodes/config-array/compare/v0.11.6...v0.11.7) (2022-10-28) + + +### Bug Fixes + +* **deps:** Update minimatch to secure version ([3219294](https://github.com/humanwhocodes/config-array/commit/3219294bf9170c500ee9e212b59e17ef205b7c3c)) + +## [0.11.6](https://github.com/humanwhocodes/config-array/compare/v0.11.5...v0.11.6) (2022-10-21) + + +### Bug Fixes + +* Only apply universal patterns if others match. ([e69c8fd](https://github.com/humanwhocodes/config-array/commit/e69c8fdbb7696b406821bc723b86b4c5304c4260)) + +## [0.11.5](https://github.com/humanwhocodes/config-array/compare/v0.11.4...v0.11.5) (2022-10-17) + + +### Bug Fixes + +* Unignoring of directories should work ([e1c9dcd](https://github.com/humanwhocodes/config-array/commit/e1c9dcd05534619effe258596191ea9dc5bb37af)) + +## [0.11.4](https://github.com/humanwhocodes/config-array/compare/v0.11.3...v0.11.4) (2022-10-14) + + +### Bug Fixes + +* Ensure subdirectories of ignored directories are ignored ([0df450e](https://github.com/humanwhocodes/config-array/commit/0df450eabeb595ae22fe680ce3320dc47edb1e66)) + +## [0.11.3](https://github.com/humanwhocodes/config-array/compare/v0.11.2...v0.11.3) (2022-10-13) + + +### Bug Fixes + +* Ensure directories can be unignored. ([206404c](https://github.com/humanwhocodes/config-array/commit/206404c490d354a4f39ef9b4a6d0ceaec119abc5)) + +## [0.11.2](https://github.com/humanwhocodes/config-array/compare/v0.11.1...v0.11.2) (2022-10-03) + + +### Bug Fixes + +* Error conditions for isDirectoryIgnored ([0bd81f5](https://github.com/humanwhocodes/config-array/commit/0bd81f53b7c217d561f70709057c7d77f17e8c6d)) +* isDirectoryIgnored should match on relative path. ([3d1eaf6](https://github.com/humanwhocodes/config-array/commit/3d1eaf6389056215e27793cde9c2954c01c78df8)) +* isFileIgnored should call isDirectoryIgnored ([270d359](https://github.com/humanwhocodes/config-array/commit/270d359295f376edb0c73905f62a848284d34053)) + + +### Performance Improvements + +* Cache isDirectoryIgnored calls ([c5e6720](https://github.com/humanwhocodes/config-array/commit/c5e67208618e253c08bd320efeae4b1f63641e63)) + +## [0.11.1](https://github.com/humanwhocodes/config-array/compare/v0.11.0...v0.11.1) (2022-09-30) + + +### Bug Fixes + +* isDirectoryIgnored should not test negated patterns ([f6cdb68](https://github.com/humanwhocodes/config-array/commit/f6cdb688784901970fda72eb688eb1a00c44b09a)) + +## [0.11.0](https://github.com/humanwhocodes/config-array/compare/v0.10.7...v0.11.0) (2022-09-30) + + +### Features + +* Add isDirectoryIgnored; deprecated isIgnored ([e6942f2](https://github.com/humanwhocodes/config-array/commit/e6942f2ce075007d39f23530593b7adb19178a52)) + +## [0.10.7](https://github.com/humanwhocodes/config-array/compare/v0.10.6...v0.10.7) (2022-09-29) + + +### Bug Fixes + +* Cache negated patterns separately ([fef617b](https://github.com/humanwhocodes/config-array/commit/fef617b6999f9a4b5871d4525c82c4181bc96fb7)) + +## [0.10.6](https://github.com/humanwhocodes/config-array/compare/v0.10.5...v0.10.6) (2022-09-28) + + +### Performance Improvements + +* Cache Minimatch instances ([5cf9af7](https://github.com/humanwhocodes/config-array/commit/5cf9af7ecaf227d2106be0cebd92d7f5148867e6)) + +## [0.10.5](https://github.com/humanwhocodes/config-array/compare/v0.10.4...v0.10.5) (2022-09-21) + + +### Bug Fixes + +* Improve caching to improve performance ([#50](https://github.com/humanwhocodes/config-array/issues/50)) ([8a7e8ab](https://github.com/humanwhocodes/config-array/commit/8a7e8ab499bcbb10d7cbdd676197fc686966a64e)) + +### [0.10.4](https://www.github.com/humanwhocodes/config-array/compare/v0.10.3...v0.10.4) (2022-07-29) + + +### Bug Fixes + +* Global ignores only when no other keys ([1f6b6ae](https://www.github.com/humanwhocodes/config-array/commit/1f6b6ae89152c1ebe118f55e7ea05c37e7c960dc)) +* Re-introduce ignores fixes ([b3ec560](https://www.github.com/humanwhocodes/config-array/commit/b3ec560c485bec2f7420fd63a939448b49a073e3)) + +### [0.10.3](https://www.github.com/humanwhocodes/config-array/compare/v0.10.2...v0.10.3) (2022-07-20) + + +### Bug Fixes + +* Ensure preprocess method has correct 'this' value. ([f86933a](https://www.github.com/humanwhocodes/config-array/commit/f86933a072e5a4069bab2c1ce284dedf0efa715d)) + +### [0.10.2](https://www.github.com/humanwhocodes/config-array/compare/v0.10.1...v0.10.2) (2022-03-18) + + +### Bug Fixes + +* Files outside of basePath should be ignored ([fc4d7b2](https://www.github.com/humanwhocodes/config-array/commit/fc4d7b2e851959ab9ab84305f6c78c52e9cc2c3c)) + +### [0.10.1](https://www.github.com/humanwhocodes/config-array/compare/v0.10.0...v0.10.1) (2022-03-03) + + +### Bug Fixes + +* Explicit matching is required against files field ([ab4e428](https://www.github.com/humanwhocodes/config-array/commit/ab4e4282ecea994ef88d273dc47aa24bf3c6972e)) + +## [0.10.0](https://www.github.com/humanwhocodes/config-array/compare/v0.9.5...v0.10.0) (2022-03-01) + + +### Features + +* Add isExplicitMatch() method ([9ecd90e](https://www.github.com/humanwhocodes/config-array/commit/9ecd90e2a3e984633f535daa4da3cbfb96964fdd)) + +### [0.9.5](https://www.github.com/humanwhocodes/config-array/compare/v0.9.4...v0.9.5) (2022-02-23) + + +### Bug Fixes + +* Ensure dot directories are matched correctly ([6e8d180](https://www.github.com/humanwhocodes/config-array/commit/6e8d180f43cedf3c2072d8a1229470e9fafabf5b)) +* preprocessConfig should have correct 'this' value ([9641540](https://www.github.com/humanwhocodes/config-array/commit/96415402cf0012ccf8e4af6c7b934dfc1a058986)) + +### [0.9.4](https://www.github.com/humanwhocodes/config-array/compare/v0.9.3...v0.9.4) (2022-01-27) + + +### Bug Fixes + +* Negated patterns to work when files match ([398c811](https://www.github.com/humanwhocodes/config-array/commit/398c8119d359493dc7b82b40df4d92ea6528375f)) + +### [0.9.3](https://www.github.com/humanwhocodes/config-array/compare/v0.9.2...v0.9.3) (2022-01-26) + + +### Bug Fixes + +* Make negated ignore patterns work like gitignore ([4ee8e99](https://www.github.com/humanwhocodes/config-array/commit/4ee8e998436e2c4538b06476e0bead8a44fe5a1b)) + +### [0.9.2](https://www.github.com/humanwhocodes/config-array/compare/v0.9.1...v0.9.2) (2021-11-02) + + +### Bug Fixes + +* Object merging error by upgrading object-schema ([377d06d](https://www.github.com/humanwhocodes/config-array/commit/377d06d2a44d781b0bec70b3389c48b3d5a63f94)) + +### [0.9.1](https://www.github.com/humanwhocodes/config-array/compare/v0.9.0...v0.9.1) (2021-10-05) + + +### Bug Fixes + +* Properly build package for release ([168155f](https://www.github.com/humanwhocodes/config-array/commit/168155f3fed91ab35566c452efd28debf8ec2b85)) + +## [0.9.0](https://www.github.com/humanwhocodes/config-array/compare/v0.8.0...v0.9.0) (2021-10-04) + + +### Features + +* getConfig() now returns undefined when no configs match. ([a563b82](https://www.github.com/humanwhocodes/config-array/commit/a563b8255d4eb2bb7745314e3f00ef53792b343f)) + +## [0.8.0](https://www.github.com/humanwhocodes/config-array/compare/v0.7.0...v0.8.0) (2021-10-01) + + +### Features + +* Add isIgnored() method ([343e5a0](https://www.github.com/humanwhocodes/config-array/commit/343e5a0a9e32028bfc6c0bf1ec0c6badf74f47f9)) + + +### Bug Fixes + +* Ensure global ignores are honored ([343e5a0](https://www.github.com/humanwhocodes/config-array/commit/343e5a0a9e32028bfc6c0bf1ec0c6badf74f47f9)) + +## [0.7.0](https://www.github.com/humanwhocodes/config-array/compare/v0.6.0...v0.7.0) (2021-09-24) + + +### Features + +* Only object configs by default ([5645f24](https://www.github.com/humanwhocodes/config-array/commit/5645f241b2412a3263a02ef9e3a9bd19cc86035d)) + +## [0.6.0](https://www.github.com/humanwhocodes/config-array/compare/v0.5.0...v0.6.0) (2021-04-20) + + +### Features + +* Add the normalizeSync() method ([3e347f9](https://www.github.com/humanwhocodes/config-array/commit/3e347f9d77c5ca2b15995e75ff7bc4fb96b7d66e)) +* Allow async config functions ([a9def0f](https://www.github.com/humanwhocodes/config-array/commit/a9def0faf579c223349dfe08d2486756840538c3)) diff --git a/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE b/node_modules/@humanwhocodes/config-array/LICENSE similarity index 99% rename from node_modules/espree/node_modules/eslint-visitor-keys/LICENSE rename to node_modules/@humanwhocodes/config-array/LICENSE index 17a25538d..261eeb9e9 100644 --- a/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE +++ b/node_modules/@humanwhocodes/config-array/LICENSE @@ -178,7 +178,7 @@ 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 "{}" + 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 @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright contributors + 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. diff --git a/node_modules/@humanwhocodes/config-array/README.md b/node_modules/@humanwhocodes/config-array/README.md new file mode 100644 index 000000000..d64784c17 --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/README.md @@ -0,0 +1,342 @@ +# Config Array + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Description + +A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename. + +## Background + +In 2019, I submitted an [ESLint RFC](https://github.com/eslint/rfcs/pull/9) proposing a new way of configuring ESLint. The goal was to streamline what had become an increasingly complicated configuration process. Over several iterations, this proposal was eventually born. + +The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example: + +```js +export default [ + + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler + } +]; +``` + +In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins). + +## Installation + +You can install the package using npm or Yarn: + +```bash +npm install @humanwhocodes/config-array --save + +# or + +yarn add @humanwhocodes/config-array +``` + +## Usage + +First, import the `ConfigArray` constructor: + +```js +import { ConfigArray } from "@humanwhocodes/config-array"; + +// or using CommonJS + +const { ConfigArray } = require("@humanwhocodes/config-array"); +``` + +When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); +const configs = new ConfigArray(rawConfigs, { + + // the path to match filenames from + basePath: process.cwd(), + + // additional items in each config + schema: mySchema +}); +``` + +This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directory in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, and `name`. + +### Specifying a Schema + +The `schema` option is required for you to use additional properties in config objects. The schema is an object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@humanwhocodes/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); + +const mySchema = { + + // define the handler key in configs + handler: { + required: true, + merge(a, b) { + if (!b) return a; + if (!a) return b; + }, + validate(value) { + if (typeof value !== "function") { + throw new TypeError("Function expected."); + } + } + } +}; + +const configs = new ConfigArray(rawConfigs, { + + // the path to match filenames from + basePath: process.cwd(), + + // additional item schemas in each config + schema: mySchema, + + // additional config types supported (default: []) + extraConfigTypes: ["array", "function"]; +}); +``` + +### Config Arrays + +Config arrays can be multidimensional, so it's possible for a config array to contain another config array when `extraConfigTypes` contains `"array"`, such as: + +```js +export default [ + + // JS config + { + files: ["**/*.js"], + handler: jsHandler + }, + + // JSON configs + [ + + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler + } + ], + + // filename must match function + { + files: [ filePath => filePath.endsWith(".md") ], + handler: markdownHandler + }, + + // filename must match all patterns in subarray + { + files: [ ["*.test.*", "*.js"] ], + handler: jsTestHandler + }, + + // filename must not match patterns beginning with ! + { + name: "Non-JS files", + files: ["!*.js"], + settings: { + js: false + } + } +]; +``` + +In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same. + +If the `files` array contains a function, then that function is called with the absolute path of the file and is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.) + +If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used. + +If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically get a `settings.js` property set to `false`. + +You can also specify an `ignores` key that will force files matching those patterns to not be included. If the `ignores` key is in a config object without any other keys, then those ignores will always be applied; otherwise those ignores act as exclusions. Here's an example: + +```js +export default [ + + // Always ignored + { + ignores: ["**/.git/**", "**/node_modules/**"] + }, + + // .eslintrc.js file is ignored only when .js file matches + { + files: ["**/*.js"], + ignores: [".eslintrc.js"] + handler: jsHandler + } +]; +``` + +You can use negated patterns in `ignores` to exclude a file that was already ignored, such as: + +```js +export default [ + + // Ignore all JSON files except tsconfig.json + { + files: ["**/*"], + ignores: ["**/*.json", "!tsconfig.json"] + }, + +]; +``` + +### Config Functions + +Config arrays can also include config functions when `extraConfigTypes` contains `"function"`. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example: + +```js +export default [ + + // JS config + { + files: ["**/*.js"], + handler: jsHandler + }, + + // JSON configs + function (context) { + return [ + + // match all JSON files + { + name: context.name + " JSON Handler", + files: ["**/*.json"], + handler: jsonHandler + }, + + // match only package.json + { + name: context.name + " package.json Handler", + files: ["package.json"], + handler: packageJsonHandler + } + ]; + } +]; +``` + +When a config array is normalized, each function is executed and replaced in the config array with the return value. + +**Note:** Config functions can also be async. + +### Normalizing Config Arrays + +Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values. + +To normalize a config array, call the `normalize()` method and pass in a context object: + +```js +await configs.normalize({ + name: "MyApp" +}); +``` + +The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable. + +If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise: + +```js +await configs.normalizeSync({ + name: "MyApp" +}); +``` + +**Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy. + +### Getting Config for a File + +To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for: + +```js +// pass in absolute filename +const fileConfig = configs.getConfig(path.resolve(process.cwd(), "package.json")); +``` + +The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed. + +A few things to keep in mind: + +* You must pass in the absolute filename to get a config for. +* The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified. +* The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. +* A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry ending with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches. + +## Determining Ignored Paths + +You can determine if a file is ignored by using the `isFileIgnored()` method and passing in the absolute path of any file, as in this example: + +```js +const ignored = configs.isFileIgnored('/foo/bar/baz.txt'); +``` + +A file is considered ignored if any of the following is true: + +* **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored. +* **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored. +* **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +* **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +* **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. + +For directories, use the `isDirectoryIgnored()` method and pass in the absolute path of any directory, as in this example: + +```js +const ignored = configs.isDirectoryIgnored('/foo/bar/'); +``` + +A directory is considered ignored if any of the following is true: + +* **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored. +* **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored. +* **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +* **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +* **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. + +**Important:** A pattern such as `foo/**` means that `foo` and `foo/` are *not* ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`. + +## Caching Mechanisms + +Each `ConfigArray` aggressively caches configuration objects to avoid unnecessary work. This caching occurs in two ways: + +1. **File-based Caching.** For each filename that is passed into a method, the resulting config is cached against that filename so you're always guaranteed to get the same object returned from `getConfig()` whenever you pass the same filename in. +2. **Index-based Caching.** Whenever a config is calculated, the config elements that were used to create the config are also cached. So if a given filename matches elements 1, 5, and 7, the resulting config is cached with a key of `1,5,7`. That way, if another file is passed that matches the same config elements, the result is already known and doesn't have to be recalculated. That means two files that match all the same elements will return the same config from `getConfig()`. + +## Acknowledgements + +The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from: + +* Teddy Katz (@not-an-aardvark) +* Toru Nagashima (@mysticatea) +* Kai Cataldo (@kaicataldo) + +## License + +Apache 2.0 diff --git a/node_modules/@humanwhocodes/config-array/api.js b/node_modules/@humanwhocodes/config-array/api.js new file mode 100644 index 000000000..a67ad0cf7 --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/api.js @@ -0,0 +1,979 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var path = _interopDefault(require('path')); +var minimatch = _interopDefault(require('minimatch')); +var createDebug = _interopDefault(require('debug')); +var objectSchema = require('@humanwhocodes/object-schema'); + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Assets that a given value is an array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array. + */ +function assertIsArray(value) { + if (!Array.isArray(value)) { + throw new TypeError('Expected value to be an array.'); + } +} + +/** + * Assets that a given value is an array containing only strings and functions. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array of strings and functions. + */ +function assertIsArrayOfStringsAndFunctions(value, name) { + assertIsArray(value); + + if (value.some(item => typeof item !== 'string' && typeof item !== 'function')) { + throw new TypeError('Expected array to only contain strings.'); + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The base schema that every ConfigArray uses. + * @type Object + */ +const baseSchema = Object.freeze({ + name: { + required: false, + merge() { + return undefined; + }, + validate(value) { + if (typeof value !== 'string') { + throw new TypeError('Property must be a string.'); + } + } + }, + files: { + required: false, + merge() { + return undefined; + }, + validate(value) { + + // first check if it's an array + assertIsArray(value); + + // then check each member + value.forEach(item => { + if (Array.isArray(item)) { + assertIsArrayOfStringsAndFunctions(item); + } else if (typeof item !== 'string' && typeof item !== 'function') { + throw new TypeError('Items must be a string, a function, or an array of strings and functions.'); + } + }); + + } + }, + ignores: { + required: false, + merge() { + return undefined; + }, + validate: assertIsArrayOfStringsAndFunctions + } +}); + +/** + * @fileoverview ConfigArray + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const Minimatch = minimatch.Minimatch; +const minimatchCache = new Map(); +const negatedMinimatchCache = new Map(); +const debug = createDebug('@hwc/config-array'); + +const MINIMATCH_OPTIONS = { + // matchBase: true, + dot: true +}; + +const CONFIG_TYPES = new Set(['array', 'function']); + +/** + * Shorthand for checking if a value is a string. + * @param {any} value The value to check. + * @returns {boolean} True if a string, false if not. + */ +function isString(value) { + return typeof value === 'string'; +} + +/** + * Asserts that the files key of a config object is a nonempty array. + * @param {object} config The config object to check. + * @returns {void} + * @throws {TypeError} If the files key isn't a nonempty array. + */ +function assertNonEmptyFilesArray(config) { + if (!Array.isArray(config.files) || config.files.length === 0) { + throw new TypeError('The files key must be a non-empty array.'); + } +} + +/** + * Wrapper around minimatch that caches minimatch patterns for + * faster matching speed over multiple file path evaluations. + * @param {string} filepath The file path to match. + * @param {string} pattern The glob pattern to match against. + * @param {object} options The minimatch options to use. + * @returns + */ +function doMatch(filepath, pattern, options = {}) { + + let cache = minimatchCache; + + if (options.flipNegate) { + cache = negatedMinimatchCache; + } + + let matcher = cache.get(pattern); + + if (!matcher) { + matcher = new Minimatch(pattern, Object.assign({}, MINIMATCH_OPTIONS, options)); + cache.set(pattern, matcher); + } + + return matcher.match(filepath); +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Promise} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +async function normalize(items, context, extraConfigTypes) { + + const allowFunctions = extraConfigTypes.includes('function'); + const allowArrays = extraConfigTypes.includes('array'); + + async function* flatTraverse(array) { + for (let item of array) { + if (typeof item === 'function') { + if (!allowFunctions) { + throw new TypeError('Unexpected function.'); + } + + item = item(context); + if (item.then) { + item = await item; + } + } + + if (Array.isArray(item)) { + if (!allowArrays) { + throw new TypeError('Unexpected array.'); + } + yield* flatTraverse(item); + } else if (typeof item === 'function') { + throw new TypeError('A config function can only return an object or array.'); + } else { + yield item; + } + } + } + + /* + * Async iterables cannot be used with the spread operator, so we need to manually + * create the array to return. + */ + const asyncIterable = await flatTraverse(items); + const configs = []; + + for await (const config of asyncIterable) { + configs.push(config); + } + + return configs; +} + +/** + * Normalizes a `ConfigArray` by flattening it and executing any functions + * that are found inside. + * @param {Array} items The items in a `ConfigArray`. + * @param {Object} context The context object to pass into any function + * found. + * @param {Array} extraConfigTypes The config types to check. + * @returns {Array} A flattened array containing only config objects. + * @throws {TypeError} When a config function returns a function. + */ +function normalizeSync(items, context, extraConfigTypes) { + + const allowFunctions = extraConfigTypes.includes('function'); + const allowArrays = extraConfigTypes.includes('array'); + + function* flatTraverse(array) { + for (let item of array) { + if (typeof item === 'function') { + + if (!allowFunctions) { + throw new TypeError('Unexpected function.'); + } + + item = item(context); + if (item.then) { + throw new TypeError('Async config functions are not supported.'); + } + } + + if (Array.isArray(item)) { + + if (!allowArrays) { + throw new TypeError('Unexpected array.'); + } + + yield* flatTraverse(item); + } else if (typeof item === 'function') { + throw new TypeError('A config function can only return an object or array.'); + } else { + yield item; + } + } + } + + return [...flatTraverse(items)]; +} + +/** + * Determines if a given file path should be ignored based on the given + * matcher. + * @param {Array boolean>} ignores The ignore patterns to check. + * @param {string} filePath The absolute path of the file to check. + * @param {string} relativeFilePath The relative path of the file to check. + * @returns {boolean} True if the path should be ignored and false if not. + */ +function shouldIgnorePath(ignores, filePath, relativeFilePath) { + + // all files outside of the basePath are ignored + if (relativeFilePath.startsWith('..')) { + return true; + } + + return ignores.reduce((ignored, matcher) => { + + if (!ignored) { + + if (typeof matcher === 'function') { + return matcher(filePath); + } + + // don't check negated patterns because we're not ignored yet + if (!matcher.startsWith('!')) { + return doMatch(relativeFilePath, matcher); + } + + // otherwise we're still not ignored + return false; + + } + + // only need to check negated patterns because we're ignored + if (typeof matcher === 'string' && matcher.startsWith('!')) { + return !doMatch(relativeFilePath, matcher, { + flipNegate: true + }); + } + + return ignored; + + }, false); + +} + +/** + * Determines if a given file path is matched by a config. If the config + * has no `files` field, then it matches; otherwise, if a `files` field + * is present then we match the globs in `files` and exclude any globs in + * `ignores`. + * @param {string} filePath The absolute file path to check. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatches(filePath, basePath, config) { + + /* + * For both files and ignores, functions are passed the absolute + * file path while strings are compared against the relative + * file path. + */ + const relativeFilePath = path.relative(basePath, filePath); + + // if files isn't an array, throw an error + assertNonEmptyFilesArray(config); + + // match both strings and functions + const match = pattern => { + + if (isString(pattern)) { + return doMatch(relativeFilePath, pattern); + } + + if (typeof pattern === 'function') { + return pattern(filePath); + } + + throw new TypeError(`Unexpected matcher type ${pattern}.`); + }; + + // check for all matches to config.files + let filePathMatchesPattern = config.files.some(pattern => { + if (Array.isArray(pattern)) { + return pattern.every(match); + } + + return match(pattern); + }); + + /* + * If the file path matches the config.files patterns, then check to see + * if there are any files to ignore. + */ + if (filePathMatchesPattern && config.ignores) { + filePathMatchesPattern = !shouldIgnorePath(config.ignores, filePath, relativeFilePath); + } + + return filePathMatchesPattern; +} + +/** + * Ensures that a ConfigArray has been normalized. + * @param {ConfigArray} configArray The ConfigArray to check. + * @returns {void} + * @throws {Error} When the `ConfigArray` is not normalized. + */ +function assertNormalized(configArray) { + // TODO: Throw more verbose error + if (!configArray.isNormalized()) { + throw new Error('ConfigArray must be normalized to perform this operation.'); + } +} + +/** + * Ensures that config types are valid. + * @param {Array} extraConfigTypes The config types to check. + * @returns {void} + * @throws {Error} When the config types array is invalid. + */ +function assertExtraConfigTypes(extraConfigTypes) { + if (extraConfigTypes.length > 2) { + throw new TypeError('configTypes must be an array with at most two items.'); + } + + for (const configType of extraConfigTypes) { + if (!CONFIG_TYPES.has(configType)) { + throw new TypeError(`Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`); + } + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const ConfigArraySymbol = { + isNormalized: Symbol('isNormalized'), + configCache: Symbol('configCache'), + schema: Symbol('schema'), + finalizeConfig: Symbol('finalizeConfig'), + preprocessConfig: Symbol('preprocessConfig') +}; + +// used to store calculate data for faster lookup +const dataCache = new WeakMap(); + +/** + * Represents an array of config objects and provides method for working with + * those config objects. + */ +class ConfigArray extends Array { + + /** + * Creates a new instance of ConfigArray. + * @param {Iterable|Function|Object} configs An iterable yielding config + * objects, or a config function, or a config object. + * @param {string} [options.basePath=""] The path of the config file + * @param {boolean} [options.normalized=false] Flag indicating if the + * configs have already been normalized. + * @param {Object} [options.schema] The additional schema + * definitions to use for the ConfigArray schema. + * @param {Array} [options.configTypes] List of config types supported. + */ + constructor(configs, { + basePath = '', + normalized = false, + schema: customSchema, + extraConfigTypes = [] + } = {} + ) { + super(); + + /** + * Tracks if the array has been normalized. + * @property isNormalized + * @type boolean + * @private + */ + this[ConfigArraySymbol.isNormalized] = normalized; + + /** + * The schema used for validating and merging configs. + * @property schema + * @type ObjectSchema + * @private + */ + this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema( + Object.assign({}, customSchema, baseSchema) + ); + + /** + * The path of the config file that this array was loaded from. + * This is used to calculate filename matches. + * @property basePath + * @type string + */ + this.basePath = basePath; + + assertExtraConfigTypes(extraConfigTypes); + + /** + * The supported config types. + * @property configTypes + * @type Array + */ + this.extraConfigTypes = Object.freeze([...extraConfigTypes]); + + /** + * A cache to store calculated configs for faster repeat lookup. + * @property configCache + * @type Map + * @private + */ + this[ConfigArraySymbol.configCache] = new Map(); + + // init cache + dataCache.set(this, { + explicitMatches: new Map(), + directoryMatches: new Map(), + files: undefined, + ignores: undefined + }); + + // load the configs into this array + if (Array.isArray(configs)) { + this.push(...configs); + } else { + this.push(configs); + } + + } + + /** + * Prevent normal array methods from creating a new `ConfigArray` instance. + * This is to ensure that methods such as `slice()` won't try to create a + * new instance of `ConfigArray` behind the scenes as doing so may throw + * an error due to the different constructor signature. + * @returns {Function} The `Array` constructor. + */ + static get [Symbol.species]() { + return Array; + } + + /** + * Returns the `files` globs from every config object in the array. + * This can be used to determine which files will be matched by a + * config array or to use as a glob pattern when no patterns are provided + * for a command line interface. + * @returns {Array} An array of matchers. + */ + get files() { + + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.files) { + return cache.files; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + if (config.files) { + config.files.forEach(filePattern => { + result.push(filePattern); + }); + } + } + + // store result + cache.files = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Returns ignore matchers that should always be ignored regardless of + * the matching `files` fields in any configs. This is necessary to mimic + * the behavior of things like .gitignore and .eslintignore, allowing a + * globbing operation to be faster. + * @returns {string[]} An array of string patterns and functions to be ignored. + */ + get ignores() { + + assertNormalized(this); + + // if this data has been cached, retrieve it + const cache = dataCache.get(this); + + if (cache.ignores) { + return cache.ignores; + } + + // otherwise calculate it + + const result = []; + + for (const config of this) { + + /* + * We only count ignores if there are no other keys in the object. + * In this case, it acts list a globally ignored pattern. If there + * are additional keys, then ignores act like exclusions. + */ + if (config.ignores && Object.keys(config).length === 1) { + + /* + * If there are directory ignores, then we need to double up + * the patterns to be ignored. For instance, `foo` will also + * need `foo/**` in order to account for subdirectories. + */ + config.ignores.forEach(ignore => { + + result.push(ignore); + + if (typeof ignore === 'string') { + + // unignoring files won't work unless we unignore directories too + if (ignore.startsWith('!')) { + + if (ignore.endsWith('/**')) { + result.push(ignore.slice(0, ignore.length - 3)); + } else if (ignore.endsWith('/*')) { + result.push(ignore.slice(0, ignore.length - 2)); + } + } + + // directories should work with or without a trailing slash + if (ignore.endsWith('/')) { + result.push(ignore.slice(0, ignore.length - 1)); + result.push(ignore + '**'); + } else if (!ignore.endsWith('*')) { + result.push(ignore + '/**'); + } + + } + }); + } + } + + // store result + cache.ignores = result; + dataCache.set(this, cache); + + return result; + } + + /** + * Indicates if the config array has been normalized. + * @returns {boolean} True if the config array is normalized, false if not. + */ + isNormalized() { + return this[ConfigArraySymbol.isNormalized]; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {ConfigContext} context The context object for config functions. + * @returns {Promise} The current ConfigArray instance. + */ + async normalize(context = {}) { + + if (!this.isNormalized()) { + const normalizedConfigs = await normalize(this, context, this.extraConfigTypes); + this.length = 0; + this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /** + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {ConfigContext} context The context object for config functions. + * @returns {ConfigArray} The current ConfigArray instance. + */ + normalizeSync(context = {}) { + + if (!this.isNormalized()) { + const normalizedConfigs = normalizeSync(this, context, this.extraConfigTypes); + this.length = 0; + this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); + this[ConfigArraySymbol.isNormalized] = true; + + // prevent further changes + Object.freeze(this); + } + + return this; + } + + /** + * Finalizes the state of a config before being cached and returned by + * `getConfig()`. Does nothing by default but is provided to be + * overridden by subclasses as necessary. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + */ + [ConfigArraySymbol.finalizeConfig](config) { + return config; + } + + /** + * Preprocesses a config during the normalization process. This is the + * method to override if you want to convert an array item before it is + * validated for the first time. For example, if you want to replace a + * string with an object, this is the method to override. + * @param {Object} config The config to preprocess. + * @returns {Object} The config to use in place of the argument. + */ + [ConfigArraySymbol.preprocessConfig](config) { + return config; + } + + /** + * Determines if a given file path explicitly matches a `files` entry + * and also doesn't match an `ignores` entry. Configs that don't have + * a `files` property are not considered an explicit match. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the file path matches a `files` entry + * or false if not. + */ + isExplicitMatch(filePath) { + + assertNormalized(this); + + const cache = dataCache.get(this); + + // first check the cache to avoid duplicate work + let result = cache.explicitMatches.get(filePath); + + if (typeof result == 'boolean') { + return result; + } + + // TODO: Maybe move elsewhere? Maybe combine with getConfig() logic? + const relativeFilePath = path.relative(this.basePath, filePath); + + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath}`); + + // cache and return result + cache.explicitMatches.set(filePath, false); + return false; + } + + // filePath isn't automatically ignored, so try to find a match + + for (const config of this) { + + if (!config.files) { + continue; + } + + if (pathMatches(filePath, this.basePath, config)) { + debug(`Matching config found for ${filePath}`); + cache.explicitMatches.set(filePath, true); + return true; + } + } + + return false; + } + + /** + * Returns the config object for a given file path. + * @param {string} filePath The complete path of a file to get a config for. + * @returns {Object} The config object for this file. + */ + getConfig(filePath) { + + assertNormalized(this); + + const cache = this[ConfigArraySymbol.configCache]; + + // first check the cache for a filename match to avoid duplicate work + let finalConfig = cache.get(filePath); + + if (finalConfig) { + return finalConfig; + } + + // next check to see if the file should be ignored + + // check if this should be ignored due to its directory + if (this.isDirectoryIgnored(path.dirname(filePath))) { + debug(`Ignoring ${filePath} based on directory pattern`); + + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; + } + + // TODO: Maybe move elsewhere? + const relativeFilePath = path.relative(this.basePath, filePath); + + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath} based on file pattern`); + + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; + } + + // filePath isn't automatically ignored, so try to construct config + + const matchingConfigIndices = []; + let matchFound = false; + const universalPattern = /\/\*{1,2}$/; + + this.forEach((config, index) => { + + if (!config.files) { + debug(`Anonymous universal config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + assertNonEmptyFilesArray(config); + + /* + * If a config has a files pattern ending in /** or /*, and the + * filePath only matches those patterns, then the config is only + * applied if there is another config where the filePath matches + * a file with a specific extensions such as *.js. + */ + + const universalFiles = config.files.filter( + pattern => universalPattern.test(pattern) + ); + + // universal patterns were found so we need to check the config twice + if (universalFiles.length) { + + debug('Universal files patterns found. Checking carefully.'); + + const nonUniversalFiles = config.files.filter( + pattern => !universalPattern.test(pattern) + ); + + // check that the config matches without the non-universal files first + if ( + nonUniversalFiles.length && + pathMatches( + filePath, this.basePath, + { files: nonUniversalFiles, ignores: config.ignores } + ) + ) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + return; + } + + // if there wasn't a match then check if it matches with universal files + if ( + universalFiles.length && + pathMatches( + filePath, this.basePath, + { files: universalFiles, ignores: config.ignores } + ) + ) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + // if we make here, then there was no match + return; + } + + // the normal case + if (pathMatches(filePath, this.basePath, config)) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + return; + } + + }); + + // if matching both files and ignores, there will be no config to create + if (!matchFound) { + debug(`No matching configs found for ${filePath}`); + + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; + } + + // check to see if there is a config cached by indices + finalConfig = cache.get(matchingConfigIndices.toString()); + + if (finalConfig) { + + // also store for filename for faster lookup next time + cache.set(filePath, finalConfig); + + return finalConfig; + } + + // otherwise construct the config + + finalConfig = matchingConfigIndices.reduce((result, index) => { + return this[ConfigArraySymbol.schema].merge(result, this[index]); + }, {}, this); + + finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig); + + cache.set(filePath, finalConfig); + cache.set(matchingConfigIndices.toString(), finalConfig); + + return finalConfig; + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + * @deprecated Use `isFileIgnored` instead. + */ + isIgnored(filePath) { + return this.isFileIgnored(filePath); + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + */ + isFileIgnored(filePath) { + return this.getConfig(filePath) === undefined; + } + + /** + * Determines if the given directory is ignored based on the configs. + * This checks only default `ignores` that don't have `files` in the + * same config. A pattern such as `/foo` be considered to ignore the directory + * while a pattern such as `/foo/**` is not considered to ignore the + * directory because it is matching files. + * @param {string} directoryPath The complete path of a directory to check. + * @returns {boolean} True if the directory is ignored, false if not. Will + * return true for any directory that is not inside of `basePath`. + * @throws {Error} When the `ConfigArray` is not normalized. + */ + isDirectoryIgnored(directoryPath) { + + assertNormalized(this); + + const relativeDirectoryPath = path.relative(this.basePath, directoryPath) + .replace(/\\/g, '/'); + + if (relativeDirectoryPath.startsWith('..')) { + return true; + } + + // first check the cache + const cache = dataCache.get(this).directoryMatches; + + if (cache.has(relativeDirectoryPath)) { + return cache.get(relativeDirectoryPath); + } + + const directoryParts = relativeDirectoryPath.split('/'); + let relativeDirectoryToCheck = ''; + let result = false; + + /* + * In order to get the correct gitignore-style ignores, where an + * ignored parent directory cannot have any descendants unignored, + * we need to check every directory starting at the parent all + * the way down to the actual requested directory. + * + * We aggressively cache all of this info to make sure we don't + * have to recalculate everything for every call. + */ + do { + + relativeDirectoryToCheck += directoryParts.shift() + '/'; + + result = shouldIgnorePath( + this.ignores, + path.join(this.basePath, relativeDirectoryToCheck), + relativeDirectoryToCheck + ); + + cache.set(relativeDirectoryToCheck, result); + + } while (!result && directoryParts.length); + + // also cache the result for the requested path + cache.set(relativeDirectoryPath, result); + + return result; + } + +} + +exports.ConfigArray = ConfigArray; +exports.ConfigArraySymbol = ConfigArraySymbol; diff --git a/node_modules/@humanwhocodes/config-array/package.json b/node_modules/@humanwhocodes/config-array/package.json new file mode 100644 index 000000000..e76c1ad56 --- /dev/null +++ b/node_modules/@humanwhocodes/config-array/package.json @@ -0,0 +1,61 @@ +{ + "name": "@humanwhocodes/config-array", + "version": "0.11.8", + "description": "Glob-based configuration matching.", + "author": "Nicholas C. Zakas", + "main": "api.js", + "files": [ + "api.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/config-array.git" + }, + "bugs": { + "url": "https://github.com/humanwhocodes/config-array/issues" + }, + "homepage": "https://github.com/humanwhocodes/config-array#readme", + "scripts": { + "build": "rollup -c", + "format": "nitpik", + "lint": "eslint *.config.js src/*.js tests/*.js", + "lint:fix": "eslint --fix *.config.js src/*.js tests/*.js", + "prepublish": "npm run build", + "test:coverage": "nyc --include src/*.js npm run test", + "test": "mocha -r esm tests/ --recursive" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix --ignore-pattern '!.eslintrc.js'" + ] + }, + "keywords": [ + "configuration", + "configarray", + "config file" + ], + "license": "Apache-2.0", + "engines": { + "node": ">=10.10.0" + }, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "devDependencies": { + "@nitpik/javascript": "0.4.0", + "@nitpik/node": "0.0.5", + "chai": "4.3.7", + "eslint": "8.29.0", + "esm": "3.2.25", + "lint-staged": "13.1.0", + "mocha": "6.2.3", + "nyc": "14.1.1", + "rollup": "1.16.6", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@humanwhocodes/module-importer/CHANGELOG.md b/node_modules/@humanwhocodes/module-importer/CHANGELOG.md new file mode 100644 index 000000000..1b442a195 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18) + + +### Bug Fixes + +* Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6) + +## 1.0.0 (2022-08-17) + + +### Features + +* Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563)) diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE b/node_modules/@humanwhocodes/module-importer/LICENSE similarity index 99% rename from node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE rename to node_modules/@humanwhocodes/module-importer/LICENSE index 17a25538d..261eeb9e9 100644 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE +++ b/node_modules/@humanwhocodes/module-importer/LICENSE @@ -178,7 +178,7 @@ 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 "{}" + 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 @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright contributors + 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. diff --git a/node_modules/@humanwhocodes/module-importer/README.md b/node_modules/@humanwhocodes/module-importer/README.md new file mode 100644 index 000000000..3de07a7fb --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/README.md @@ -0,0 +1,80 @@ +# ModuleImporter + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Description + +A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues. + +The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/module-importer + +# or + +yarn add @humanwhocodes/module-importer +``` + +Import into your Node.js project: + +```js +// CommonJS +const { ModuleImporter } = require("@humanwhocodes/module-importer"); + +// ESM +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/module-importer +``` + +Import into your Bun project: + +```js +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +## API + +After importing, create a new instance of `ModuleImporter` to start emitting events: + +```js +// cwd can be omitted to use process.cwd() +const importer = new ModuleImporter(cwd); + +// you can resolve the location of any package +const location = importer.resolve("./some-file.cjs"); + +// you can also import directly +const module = importer.import("./some-file.cjs"); +``` + +For both `resolve()` and `import()`, you can pass in package names and filenames. + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +## License + +Apache 2.0 + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs b/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs new file mode 100644 index 000000000..779e0cf6f --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var module$1 = require('module'); +var url = require('url'); +var path = require('path'); + +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('module-importer.cjs', document.baseURI).href))); +const __dirname$1 = path.dirname(__filename$1); +const require$1 = module$1.createRequire(__dirname$1 + "/"); +const { ModuleImporter } = require$1("./module-importer.cjs"); + +exports.ModuleImporter = ModuleImporter; diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts new file mode 100644 index 000000000..a1acbb6d3 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts @@ -0,0 +1,27 @@ +export class ModuleImporter { + /** + * Creates a new instance. + * @param {string} [cwd] The current working directory to resolve from. + */ + constructor(cwd?: string); + /** + * The base directory from which paths should be resolved. + * @type {string} + */ + cwd: string; + /** + * Resolves a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {string|undefined} The location of the import. + * @throws {Error} If specifier cannot be located. + */ + resolve(specifier: string): string | undefined; + /** + * Imports a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {Promise} The module's object. + */ + import(specifier: string): Promise; +} diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts new file mode 100644 index 000000000..498f0a246 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts @@ -0,0 +1,2 @@ +export { ModuleImporter }; +import { ModuleImporter } from "./module-importer.cjs"; diff --git a/node_modules/@humanwhocodes/module-importer/dist/module-importer.js b/node_modules/@humanwhocodes/module-importer/dist/module-importer.js new file mode 100644 index 000000000..26e052da1 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/dist/module-importer.js @@ -0,0 +1,18 @@ +import { createRequire } from 'module'; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; + +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const require = createRequire(__dirname + "/"); +const { ModuleImporter } = require("./module-importer.cjs"); + +export { ModuleImporter }; diff --git a/node_modules/@humanwhocodes/module-importer/package.json b/node_modules/@humanwhocodes/module-importer/package.json new file mode 100644 index 000000000..8ece071e9 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/package.json @@ -0,0 +1,65 @@ +{ + "name": "@humanwhocodes/module-importer", + "version": "1.0.1", + "description": "Universal module importer for Node.js", + "main": "src/module-importer.cjs", + "module": "src/module-importer.js", + "type": "module", + "types": "dist/module-importer.d.ts", + "exports": { + "require": "./src/module-importer.cjs", + "import": "./src/module-importer.js" + }, + "files": [ + "dist", + "src" + ], + "publishConfig": { + "access": "public" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix" + ] + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + }, + "scripts": { + "build": "rollup -c && tsc", + "prepare": "npm run build", + "lint": "eslint src/ tests/", + "test:unit": "c8 mocha tests/module-importer.test.js", + "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs", + "test": "npm run test:unit && npm run test:build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/module-importer.git" + }, + "keywords": [ + "modules", + "esm", + "commonjs" + ], + "engines": { + "node": ">=12.22" + }, + "author": "Nicholas C. Zaks", + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^18.7.6", + "c8": "7.12.0", + "chai": "4.3.6", + "eslint": "8.22.0", + "lint-staged": "13.0.3", + "mocha": "9.2.2", + "rollup": "2.78.0", + "typescript": "4.7.4", + "yorkie": "2.0.0" + } +} diff --git a/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs b/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs new file mode 100644 index 000000000..3efb095e1 --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs @@ -0,0 +1,81 @@ +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +const { createRequire } = require("module"); +const { pathToFileURL } = require("url"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const SLASHES = new Set(["/", "\\"]); + +/** + * Normalizes directories to have a trailing slash. + * Resolve is pretty finicky -- if the directory name doesn't have + * a trailing slash then it tries to look in the parent directory. + * i.e., if the directory is "/usr/nzakas/foo" it will start the + * search in /usr/nzakas. However, if the directory is "/user/nzakas/foo/", + * then it will start the search in /user/nzakas/foo. + * @param {string} directory The directory to check. + * @returns {string} The normalized directory. + */ +function normalizeDirectory(directory) { + if (!SLASHES.has(directory[directory.length-1])) { + return directory + "/"; + } + + return directory; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Class for importing both CommonJS and ESM modules in Node.js. + */ +exports.ModuleImporter = class ModuleImporter { + + /** + * Creates a new instance. + * @param {string} [cwd] The current working directory to resolve from. + */ + constructor(cwd = process.cwd()) { + + /** + * The base directory from which paths should be resolved. + * @type {string} + */ + this.cwd = normalizeDirectory(cwd); + } + + /** + * Resolves a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {string|undefined} The location of the import. + * @throws {Error} If specifier cannot be located. + */ + resolve(specifier) { + const require = createRequire(this.cwd); + return require.resolve(specifier); + } + + /** + * Imports a module based on its name or location. + * @param {string} specifier Either an npm package name or + * relative file path. + * @returns {Promise} The module's object. + */ + import(specifier) { + const location = this.resolve(specifier); + return import(pathToFileURL(location).href); + } + +} diff --git a/node_modules/@humanwhocodes/module-importer/src/module-importer.js b/node_modules/@humanwhocodes/module-importer/src/module-importer.js new file mode 100644 index 000000000..f5464e18d --- /dev/null +++ b/node_modules/@humanwhocodes/module-importer/src/module-importer.js @@ -0,0 +1,22 @@ +/** + * @fileoverview Universal module importer + */ + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +import { createRequire } from "module"; +import { fileURLToPath } from "url"; +import { dirname } from "path"; + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const require = createRequire(__dirname + "/"); +const { ModuleImporter } = require("./module-importer.cjs"); + +export { ModuleImporter }; diff --git a/node_modules/@humanwhocodes/object-schema/.eslintrc.js b/node_modules/@humanwhocodes/object-schema/.eslintrc.js new file mode 100644 index 000000000..4934076c4 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/.eslintrc.js @@ -0,0 +1,29 @@ +module.exports = { + "env": { + "commonjs": true, + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + "indent": [ + "error", + 4 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ] + } +}; \ No newline at end of file diff --git a/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml b/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml new file mode 100644 index 000000000..8ea195146 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml @@ -0,0 +1,27 @@ +name: Node CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-latest, macOS-latest, ubuntu-latest] + node: [8.x, 10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm test + env: + CI: true diff --git a/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml b/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml new file mode 100644 index 000000000..42f75f73c --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml @@ -0,0 +1,39 @@ +on: + push: + branches: + - main +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + id: release + with: + release-type: node + package-name: test-release-please + # The logic below handles the npm publication: + - uses: actions/checkout@v2 + # these if statements ensure that a publication only occurs when + # a new release is created: + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - run: npm ci + if: ${{ steps.release.outputs.release_created }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} + + # Tweets out release announcement + - run: 'npx @humanwhocodes/tweet "Object Schema v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released!\n\n${{ github.event.release.html_url }}"' + if: ${{ steps.release.outputs.release_created }} + env: + TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} + TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} + TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} diff --git a/node_modules/@humanwhocodes/object-schema/CHANGELOG.md b/node_modules/@humanwhocodes/object-schema/CHANGELOG.md new file mode 100644 index 000000000..bb63f5fea --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +### [1.2.1](https://www.github.com/humanwhocodes/object-schema/compare/v1.2.0...v1.2.1) (2021-11-02) + + +### Bug Fixes + +* Never return original object from individual config ([5463c5c](https://www.github.com/humanwhocodes/object-schema/commit/5463c5c6d2cb35a7b7948dffc37c899a41d1775f)) diff --git a/node_modules/@humanwhocodes/object-schema/LICENSE b/node_modules/@humanwhocodes/object-schema/LICENSE new file mode 100644 index 000000000..a5e3ae46f --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Human Who Codes +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@humanwhocodes/object-schema/README.md b/node_modules/@humanwhocodes/object-schema/README.md new file mode 100644 index 000000000..2163797f8 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/README.md @@ -0,0 +1,234 @@ +# JavaScript ObjectSchema Package + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Overview + +A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. + +## Installation + +You can install using either npm: + +``` +npm install @humanwhocodes/object-schema +``` + +Or Yarn: + +``` +yarn add @humanwhocodes/object-schema +``` + +## Usage + +Use CommonJS to get access to the `ObjectSchema` constructor: + +```js +const { ObjectSchema } = require("@humanwhocodes/object-schema"); + +const schema = new ObjectSchema({ + + // define a definition for the "downloads" key + downloads: { + required: true, + merge(value1, value2) { + return value1 + value2; + }, + validate(value) { + if (typeof value !== "number") { + throw new Error("Expected downloads to be a number."); + } + } + }, + + // define a strategy for the "versions" key + version: { + required: true, + merge(value1, value2) { + return value1.concat(value2); + }, + validate(value) { + if (!Array.isArray(value)) { + throw new Error("Expected versions to be an array."); + } + } + } +}); + +const record1 = { + downloads: 25, + versions: [ + "v1.0.0", + "v1.1.0", + "v1.2.0" + ] +}; + +const record2 = { + downloads: 125, + versions: [ + "v2.0.0", + "v2.1.0", + "v3.0.0" + ] +}; + +// make sure the records are valid +schema.validate(record1); +schema.validate(record2); + +// merge together (schema.merge() accepts any number of objects) +const result = schema.merge(record1, record2); + +// result looks like this: + +const result = { + downloads: 75, + versions: [ + "v1.0.0", + "v1.1.0", + "v1.2.0", + "v2.0.0", + "v2.1.0", + "v3.0.0" + ] +}; +``` + +## Tips and Tricks + +### Named merge strategies + +Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy: + +* `"assign"` - use `Object.assign()` to merge the two values into one object. +* `"overwrite"` - the second value always replaces the first. +* `"replace"` - the second value replaces the first if the second is not `undefined`. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate() {} + } +}); +``` + +### Named validation strategies + +Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy: + +* `"array"` - value must be an array. +* `"boolean"` - value must be a boolean. +* `"number"` - value must be a number. +* `"object"` - value must be an object. +* `"object?"` - value must be an object or null. +* `"string"` - value must be a string. +* `"string!"` - value must be a non-empty string. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate: "string" + } +}); +``` + +### Subschemas + +If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, assign a `schema` key that contains a schema definition, like this: + +```js +const schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } +}); + +schema.validate({ + name: { + first: "n", + last: "z" + } +}); +``` + +### Remove Keys During Merge + +If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example: + +```js +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + } + } +}); + +const object1 = { date: "5/5/2005" }; +const object2 = { date: "6/6/2006" }; + +const result = schema.merge(object1, object2); + +console.log("date" in result); // false +``` + +### Requiring Another Key Be Present + +If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example: + +```js +const schema = new ObjectSchema(); + +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + } + }, + time: { + requires: ["date"], + merge(first, second) { + return second; + }, + validate(value) { + // ... + } + } +}); + +// throws error: Key "time" requires keys "date" +schema.validate({ + time: "13:45" +}); +``` + +In this example, even though `date` is an optional key, it is required to be present whenever `time` is present. + +## License + +BSD 3-Clause diff --git a/node_modules/@humanwhocodes/object-schema/package.json b/node_modules/@humanwhocodes/object-schema/package.json new file mode 100644 index 000000000..9fc90bf3f --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/package.json @@ -0,0 +1,33 @@ +{ + "name": "@humanwhocodes/object-schema", + "version": "1.2.1", + "description": "An object schema merger/validator", + "main": "src/index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "mocha tests/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/humanwhocodes/object-schema.git" + }, + "keywords": [ + "object", + "validation", + "schema", + "merge" + ], + "author": "Nicholas C. Zakas", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/humanwhocodes/object-schema/issues" + }, + "homepage": "https://github.com/humanwhocodes/object-schema#readme", + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^5.13.0", + "mocha": "^5.2.0" + } +} diff --git a/node_modules/@humanwhocodes/object-schema/src/index.js b/node_modules/@humanwhocodes/object-schema/src/index.js new file mode 100644 index 000000000..b2bc4fb96 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/index.js @@ -0,0 +1,7 @@ +/** + * @filedescription Object Schema Package + */ + +exports.ObjectSchema = require("./object-schema").ObjectSchema; +exports.MergeStrategy = require("./merge-strategy").MergeStrategy; +exports.ValidationStrategy = require("./validation-strategy").ValidationStrategy; diff --git a/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js b/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js new file mode 100644 index 000000000..821744927 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js @@ -0,0 +1,53 @@ +/** + * @filedescription Merge Strategy + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different merge strategies. + */ +class MergeStrategy { + + /** + * Merges two keys by overwriting the first with the second. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value. + */ + static overwrite(value1, value2) { + return value2; + } + + /** + * Merges two keys by replacing the first with the second only if the + * second is defined. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} The second value if it is defined. + */ + static replace(value1, value2) { + if (typeof value2 !== "undefined") { + return value2; + } + + return value1; + } + + /** + * Merges two properties by assigning properties from the second to the first. + * @param {*} value1 The value from the first object key. + * @param {*} value2 The value from the second object key. + * @returns {*} A new object containing properties from both value1 and + * value2. + */ + static assign(value1, value2) { + return Object.assign({}, value1, value2); + } +} + +exports.MergeStrategy = MergeStrategy; diff --git a/node_modules/@humanwhocodes/object-schema/src/object-schema.js b/node_modules/@humanwhocodes/object-schema/src/object-schema.js new file mode 100644 index 000000000..b66323653 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/object-schema.js @@ -0,0 +1,235 @@ +/** + * @filedescription Object Schema + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { MergeStrategy } = require("./merge-strategy"); +const { ValidationStrategy } = require("./validation-strategy"); + +//----------------------------------------------------------------------------- +// Private +//----------------------------------------------------------------------------- + +const strategies = Symbol("strategies"); +const requiredKeys = Symbol("requiredKeys"); + +/** + * Validates a schema strategy. + * @param {string} name The name of the key this strategy is for. + * @param {Object} strategy The strategy for the object key. + * @param {boolean} [strategy.required=true] Whether the key is required. + * @param {string[]} [strategy.requires] Other keys that are required when + * this key is present. + * @param {Function} strategy.merge A method to call when merging two objects + * with the same key. + * @param {Function} strategy.validate A method to call when validating an + * object with the key. + * @returns {void} + * @throws {Error} When the strategy is missing a name. + * @throws {Error} When the strategy is missing a merge() method. + * @throws {Error} When the strategy is missing a validate() method. + */ +function validateDefinition(name, strategy) { + + let hasSchema = false; + if (strategy.schema) { + if (typeof strategy.schema === "object") { + hasSchema = true; + } else { + throw new TypeError("Schema must be an object."); + } + } + + if (typeof strategy.merge === "string") { + if (!(strategy.merge in MergeStrategy)) { + throw new TypeError(`Definition for key "${name}" missing valid merge strategy.`); + } + } else if (!hasSchema && typeof strategy.merge !== "function") { + throw new TypeError(`Definition for key "${name}" must have a merge property.`); + } + + if (typeof strategy.validate === "string") { + if (!(strategy.validate in ValidationStrategy)) { + throw new TypeError(`Definition for key "${name}" missing valid validation strategy.`); + } + } else if (!hasSchema && typeof strategy.validate !== "function") { + throw new TypeError(`Definition for key "${name}" must have a validate() method.`); + } +} + + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Represents an object validation/merging schema. + */ +class ObjectSchema { + + /** + * Creates a new instance. + */ + constructor(definitions) { + + if (!definitions) { + throw new Error("Schema definitions missing."); + } + + /** + * Track all strategies in the schema by key. + * @type {Map} + * @property strategies + */ + this[strategies] = new Map(); + + /** + * Separately track any keys that are required for faster validation. + * @type {Map} + * @property requiredKeys + */ + this[requiredKeys] = new Map(); + + // add in all strategies + for (const key of Object.keys(definitions)) { + validateDefinition(key, definitions[key]); + + // normalize merge and validate methods if subschema is present + if (typeof definitions[key].schema === "object") { + const schema = new ObjectSchema(definitions[key].schema); + definitions[key] = { + ...definitions[key], + merge(first = {}, second = {}) { + return schema.merge(first, second); + }, + validate(value) { + ValidationStrategy.object(value); + schema.validate(value); + } + }; + } + + // normalize the merge method in case there's a string + if (typeof definitions[key].merge === "string") { + definitions[key] = { + ...definitions[key], + merge: MergeStrategy[definitions[key].merge] + }; + }; + + // normalize the validate method in case there's a string + if (typeof definitions[key].validate === "string") { + definitions[key] = { + ...definitions[key], + validate: ValidationStrategy[definitions[key].validate] + }; + }; + + this[strategies].set(key, definitions[key]); + + if (definitions[key].required) { + this[requiredKeys].set(key, definitions[key]); + } + } + } + + /** + * Determines if a strategy has been registered for the given object key. + * @param {string} key The object key to find a strategy for. + * @returns {boolean} True if the key has a strategy registered, false if not. + */ + hasKey(key) { + return this[strategies].has(key); + } + + /** + * Merges objects together to create a new object comprised of the keys + * of the all objects. Keys are merged based on the each key's merge + * strategy. + * @param {...Object} objects The objects to merge. + * @returns {Object} A new object with a mix of all objects' keys. + * @throws {Error} If any object is invalid. + */ + merge(...objects) { + + // double check arguments + if (objects.length < 2) { + throw new Error("merge() requires at least two arguments."); + } + + if (objects.some(object => (object == null || typeof object !== "object"))) { + throw new Error("All arguments must be objects."); + } + + return objects.reduce((result, object) => { + + this.validate(object); + + for (const [key, strategy] of this[strategies]) { + try { + if (key in result || key in object) { + const value = strategy.merge.call(this, result[key], object[key]); + if (value !== undefined) { + result[key] = value; + } + } + } catch (ex) { + ex.message = `Key "${key}": ` + ex.message; + throw ex; + } + } + return result; + }, {}); + } + + /** + * Validates an object's keys based on the validate strategy for each key. + * @param {Object} object The object to validate. + * @returns {void} + * @throws {Error} When the object is invalid. + */ + validate(object) { + + // check existing keys first + for (const key of Object.keys(object)) { + + // check to see if the key is defined + if (!this.hasKey(key)) { + throw new Error(`Unexpected key "${key}" found.`); + } + + // validate existing keys + const strategy = this[strategies].get(key); + + // first check to see if any other keys are required + if (Array.isArray(strategy.requires)) { + if (!strategy.requires.every(otherKey => otherKey in object)) { + throw new Error(`Key "${key}" requires keys "${strategy.requires.join("\", \"")}".`); + } + } + + // now apply remaining validation strategy + try { + strategy.validate.call(strategy, object[key]); + } catch (ex) { + ex.message = `Key "${key}": ` + ex.message; + throw ex; + } + } + + // ensure required keys aren't missing + for (const [key] of this[requiredKeys]) { + if (!(key in object)) { + throw new Error(`Missing required key "${key}".`); + } + } + + } +} + +exports.ObjectSchema = ObjectSchema; diff --git a/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js b/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js new file mode 100644 index 000000000..ecf918bdd --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js @@ -0,0 +1,102 @@ +/** + * @filedescription Validation Strategy + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +/** + * Container class for several different validation strategies. + */ +class ValidationStrategy { + + /** + * Validates that a value is an array. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static array(value) { + if (!Array.isArray(value)) { + throw new TypeError("Expected an array."); + } + } + + /** + * Validates that a value is a boolean. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static boolean(value) { + if (typeof value !== "boolean") { + throw new TypeError("Expected a Boolean."); + } + } + + /** + * Validates that a value is a number. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static number(value) { + if (typeof value !== "number") { + throw new TypeError("Expected a number."); + } + } + + /** + * Validates that a value is a object. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static object(value) { + if (!value || typeof value !== "object") { + throw new TypeError("Expected an object."); + } + } + + /** + * Validates that a value is a object or null. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "object?"(value) { + if (typeof value !== "object") { + throw new TypeError("Expected an object or null."); + } + } + + /** + * Validates that a value is a string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static string(value) { + if (typeof value !== "string") { + throw new TypeError("Expected a string."); + } + } + + /** + * Validates that a value is a non-empty string. + * @param {*} value The value to validate. + * @returns {void} + * @throws {TypeError} If the value is invalid. + */ + static "string!"(value) { + if (typeof value !== "string" || value.length === 0) { + throw new TypeError("Expected a non-empty string."); + } + } + +} + +exports.ValidationStrategy = ValidationStrategy; diff --git a/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js b/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js new file mode 100644 index 000000000..84032d7e8 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js @@ -0,0 +1,66 @@ +/** + * @filedescription Merge Strategy Tests + */ +/* global it, describe, beforeEach */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("chai").assert; +const { MergeStrategy } = require("../src/"); + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +describe("MergeStrategy", () => { + + + describe("overwrite()", () => { + + it("should overwrite the first value with the second when the second is defined", () => { + const result = MergeStrategy.overwrite(1, 2); + assert.strictEqual(result, 2); + }); + + it("should overwrite the first value with the second when the second is undefined", () => { + const result = MergeStrategy.overwrite(1, undefined); + assert.strictEqual(result, undefined); + }); + + }); + + describe("replace()", () => { + + it("should overwrite the first value with the second when the second is defined", () => { + const result = MergeStrategy.replace(1, 2); + assert.strictEqual(result, 2); + }); + + it("should return the first value when the second is undefined", () => { + const result = MergeStrategy.replace(1, undefined); + assert.strictEqual(result, 1); + }); + + }); + + describe("assign()", () => { + + it("should merge properties from two objects when called", () => { + + const object1 = { foo: 1, bar: 3 }; + const object2 = { foo: 2 }; + + const result = MergeStrategy.assign(object1, object2); + assert.deepStrictEqual(result, { + foo: 2, + bar: 3 + }); + }); + + }); + +}); diff --git a/node_modules/@humanwhocodes/object-schema/tests/object-schema.js b/node_modules/@humanwhocodes/object-schema/tests/object-schema.js new file mode 100644 index 000000000..d86ef6e97 --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/tests/object-schema.js @@ -0,0 +1,611 @@ +/** + * @filedescription Object Schema Tests + */ +/* global it, describe, beforeEach */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("chai").assert; +const { ObjectSchema } = require("../src/"); + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +describe("ObjectSchema", () => { + + let schema; + + describe("new ObjectSchema()", () => { + + it("should add a new key when a strategy is passed", () => { + schema = new ObjectSchema({ + foo: { + merge() {}, + validate() {} + } + }); + + assert.isTrue(schema.hasKey("foo")); + }); + + it("should throw an error when a strategy is missing a merge() method", () => { + assert.throws(() => { + schema = new ObjectSchema({ + foo: { + validate() { } + } + }); + }, /Definition for key "foo" must have a merge property/); + }); + + it("should throw an error when a strategy is missing a merge() method", () => { + assert.throws(() => { + schema = new ObjectSchema(); + }, /Schema definitions missing/); + }); + + it("should throw an error when a strategy is missing a validate() method", () => { + assert.throws(() => { + schema = new ObjectSchema({ + foo: { + merge() { }, + } + }); + }, /Definition for key "foo" must have a validate\(\) method/); + }); + + it("should throw an error when merge is an invalid string", () => { + assert.throws(() => { + new ObjectSchema({ + foo: { + merge: "bar", + validate() { } + } + }); + }, /key "foo" missing valid merge strategy/); + }); + + it("should throw an error when validate is an invalid string", () => { + assert.throws(() => { + new ObjectSchema({ + foo: { + merge: "assign", + validate: "s" + } + }); + }, /key "foo" missing valid validation strategy/); + }); + + }); + + + describe("merge()", () => { + + it("should throw an error when an unexpected key is found", () => { + let schema = new ObjectSchema({}); + + assert.throws(() => { + schema.merge({ foo: true }, { foo: true }); + }, /Unexpected key "foo"/); + }); + + it("should throw an error when merge() throws an error", () => { + let schema = new ObjectSchema({ + foo: { + merge() { + throw new Error("Boom!"); + }, + validate() {} + } + }); + + assert.throws(() => { + schema.merge({ foo: true }, { foo: true }); + }, /Key "foo": Boom!/); + + }); + + it("should call the merge() strategy for one key when called", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() {} + } + }); + + const result = schema.merge({ foo: true }, { foo: false }); + assert.propertyVal(result, "foo", "bar"); + }); + + it("should not call the merge() strategy when both objects don't contain the key", () => { + + let called = false; + + schema = new ObjectSchema({ + foo: { + merge() { + called = true; + }, + validate() {} + } + }); + + schema.merge({}, {}); + assert.isFalse(called, "The merge() strategy should not have been called."); + }); + + it("should omit returning the key when the merge() strategy returns undefined", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return undefined; + }, + validate() { } + } + }); + + const result = schema.merge({ foo: true }, { foo: false }); + assert.notProperty(result, "foo"); + }); + + it("should call the merge() strategy for two keys when called", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + bar: { + merge() { + return "baz"; + }, + validate() {} + } + }); + + const result = schema.merge({ foo: true, bar: 1 }, { foo: true, bar: 2 }); + assert.propertyVal(result, "foo", "bar"); + assert.propertyVal(result, "bar", "baz"); + }); + + it("should call the merge() strategy for two keys when called on three objects", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + bar: { + merge() { + return "baz"; + }, + validate() { } + } + }); + + const result = schema.merge( + { foo: true, bar: 1 }, + { foo: true, bar: 3 }, + { foo: false, bar: 2 } + ); + assert.propertyVal(result, "foo", "bar"); + assert.propertyVal(result, "bar", "baz"); + }); + + it("should call the merge() strategy when defined as 'overwrite'", () => { + schema = new ObjectSchema({ + foo: { + merge: "overwrite", + validate() { } + } + }); + + const result = schema.merge( + { foo: true }, + { foo: false } + ); + assert.propertyVal(result, "foo", false); + }); + + it("should call the merge() strategy when defined as 'assign'", () => { + schema = new ObjectSchema({ + foo: { + merge: "assign", + validate() { } + } + }); + + const result = schema.merge( + { foo: { bar: true } }, + { foo: { baz: false } } + ); + + assert.strictEqual(result.foo.bar, true); + assert.strictEqual(result.foo.baz, false); + }); + + it("should call the merge strategy when there's a subschema", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + const result = schema.merge({ + name: { + first: "n", + last: "z" + } + }, { + name: { + first: "g" + } + }); + + assert.strictEqual(result.name.first, "g"); + assert.strictEqual(result.name.last, "z"); + }); + + it("should return separate objects when using subschema", () => { + + schema = new ObjectSchema({ + age: { + merge: "replace", + validate: "number" + }, + address: { + schema: { + street: { + schema: { + number: { + merge: "replace", + validate: "number" + }, + streetName: { + merge: "replace", + validate: "string" + } + } + }, + state: { + merge: "replace", + validate: "string" + } + } + } + }); + + const baseObject = { + address: { + street: { + number: 100, + streetName: "Foo St" + }, + state: "HA" + } + }; + + const result = schema.merge(baseObject, { + age: 29 + }); + + assert.notStrictEqual(result.address.street, baseObject.address.street); + assert.deepStrictEqual(result.address, baseObject.address); + }); + + it("should not error when calling the merge strategy when there's a subschema and no matching key in second object", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + const result = schema.merge({ + name: { + first: "n", + last: "z" + } + }, { + }); + + assert.strictEqual(result.name.first, "n"); + assert.strictEqual(result.name.last, "z"); + }); + + it("should not error when calling the merge strategy when there's multiple subschemas and no matching key in second object", () => { + + schema = new ObjectSchema({ + user: { + schema: { + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + + } + } + }); + + const result = schema.merge({ + user: { + name: { + first: "n", + last: "z" + } + } + }, { + }); + + assert.strictEqual(result.user.name.first, "n"); + assert.strictEqual(result.user.name.last, "z"); + }); + + + }); + + describe("validate()", () => { + + it("should throw an error when an unexpected key is found", () => { + let schema = new ObjectSchema({}); + assert.throws(() => { + schema.validate({ foo: true }); + }, /Unexpected key "foo"/); + }); + + it("should not throw an error when an expected key is found", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() {} + } + }); + + schema.validate({ foo: true }); + }); + + it("should pass the property value into validate() when key is found", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate(value) { + assert.isTrue(value); + } + } + }); + + schema.validate({ foo: true }); + }); + + it("should not throw an error when expected keys are found", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() {} + }, + bar: { + merge() { + return "baz"; + }, + validate() {} + } + }); + + schema.validate({ foo: true, bar: true }); + }); + + it("should not throw an error when expected keys are found with required keys", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + bar: { + requires: ["foo"], + merge() { + return "baz"; + }, + validate() { } + } + }); + + schema.validate({ foo: true, bar: true }); + }); + + it("should throw an error when expected keys are found without required keys", () => { + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { } + }, + baz: { + merge() { + return "baz"; + }, + validate() { } + }, + bar: { + name: "bar", + requires: ["foo", "baz"], + merge() { }, + validate() { } + } + }); + + assert.throws(() => { + schema.validate({ bar: true }); + }, /Key "bar" requires keys "foo", "baz"./); + }); + + + it("should throw an error when an expected key is found but is invalid", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate() { + throw new Error("Invalid key."); + } + } + }); + + assert.throws(() => { + schema.validate({ foo: true }); + }, /Key "foo": Invalid key/); + }); + + it("should throw an error when an expected key is found but is invalid with a string validator", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate: "string" + } + }); + + assert.throws(() => { + schema.validate({ foo: true }); + }, /Key "foo": Expected a string/); + }); + + it("should throw an error when an expected key is found but is invalid with a number validator", () => { + + schema = new ObjectSchema({ + foo: { + merge() { + return "bar"; + }, + validate: "number" + } + }); + + assert.throws(() => { + schema.validate({ foo: true }); + }, /Key "foo": Expected a number/); + }); + + it("should throw an error when a required key is missing", () => { + + schema = new ObjectSchema({ + foo: { + required: true, + merge() { + return "bar"; + }, + validate() {} + } + }); + + assert.throws(() => { + schema.validate({}); + }, /Missing required key "foo"/); + }); + + it("should throw an error when a subschema is provided and the value doesn't validate", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + assert.throws(() => { + schema.validate({ + name: { + first: 123, + last: "z" + } + }); + + }, /Key "name": Key "first": Expected a string/); + }); + + it("should not throw an error when a subschema is provided and the value validates", () => { + + schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string" + }, + last: { + merge: "replace", + validate: "string" + } + } + } + }); + + schema.validate({ + name: { + first: "n", + last: "z" + } + }); + + }); + + }); + +}); diff --git a/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js b/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js new file mode 100644 index 000000000..5d3e4a24d --- /dev/null +++ b/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js @@ -0,0 +1,186 @@ +/** + * @filedescription Merge Strategy Tests + */ +/* global it, describe, beforeEach */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("chai").assert; +const { ValidationStrategy } = require("../src/"); + +//----------------------------------------------------------------------------- +// Class +//----------------------------------------------------------------------------- + +describe("ValidationStrategy", () => { + + describe("boolean", () => { + it("should not throw an error when the value is a boolean", () => { + ValidationStrategy.boolean(true); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.boolean(null); + }, /Expected a Boolean/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.boolean("foo"); + }, /Expected a Boolean/); + }); + + it("should throw an error when the value is a number", () => { + assert.throws(() => { + ValidationStrategy.boolean(123); + }, /Expected a Boolean/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.boolean({}); + }, /Expected a Boolean/); + }); + }); + + describe("number", () => { + it("should not throw an error when the value is a number", () => { + ValidationStrategy.number(25); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.number(null); + }, /Expected a number/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.number("foo"); + }, /Expected a number/); + }); + + it("should throw an error when the value is a boolean", () => { + assert.throws(() => { + ValidationStrategy.number(true); + }, /Expected a number/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.number({}); + }, /Expected a number/); + }); + }); + + describe("object", () => { + it("should not throw an error when the value is an object", () => { + ValidationStrategy.object({}); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.object(null); + }, /Expected an object/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.object(""); + }, /Expected an object/); + }); + }); + + describe("array", () => { + it("should not throw an error when the value is an array", () => { + ValidationStrategy.array([]); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.array(null); + }, /Expected an array/); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy.array(""); + }, /Expected an array/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.array({}); + }, /Expected an array/); + }); + }); + + describe("object?", () => { + it("should not throw an error when the value is an object", () => { + ValidationStrategy["object?"]({}); + }); + + it("should not throw an error when the value is null", () => { + ValidationStrategy["object?"](null); + }); + + it("should throw an error when the value is a string", () => { + assert.throws(() => { + ValidationStrategy["object?"](""); + }, /Expected an object/); + }); + }); + + describe("string", () => { + it("should not throw an error when the value is a string", () => { + ValidationStrategy.string("foo"); + }); + + it("should not throw an error when the value is an empty string", () => { + ValidationStrategy.string(""); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy.string(null); + }, /Expected a string/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy.string({}); + }, /Expected a string/); + }); + }); + + describe("string!", () => { + it("should not throw an error when the value is an string", () => { + ValidationStrategy["string!"]("foo"); + }); + + it("should throw an error when the value is an empty string", () => { + assert.throws(() => { + ValidationStrategy["string!"](""); + }, /Expected a non-empty string/); + }); + + it("should throw an error when the value is null", () => { + assert.throws(() => { + ValidationStrategy["string!"](null); + }, /Expected a non-empty string/); + }); + + it("should throw an error when the value is an object", () => { + assert.throws(() => { + ValidationStrategy["string!"]({}); + }, /Expected a non-empty string/); + }); + }); + + +}); diff --git a/node_modules/v8-compile-cache/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE similarity index 96% rename from node_modules/v8-compile-cache/LICENSE rename to node_modules/@nodelib/fs.scandir/LICENSE index b72b67018..65a999460 100644 --- a/node_modules/v8-compile-cache/LICENSE +++ b/node_modules/@nodelib/fs.scandir/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Andres Suarez +Copyright (c) Denis Malinochkin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md new file mode 100644 index 000000000..e0b218b9f --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/README.md @@ -0,0 +1,171 @@ +# @nodelib/fs.scandir + +> List files and directories inside the specified directory. + +## :bulb: Highlights + +The package is aimed at obtaining information about entries in the directory. + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.scandir +``` + +## Usage + +```ts +import * as fsScandir from '@nodelib/fs.scandir'; + +fsScandir.scandir('path', (error, stats) => { /* … */ }); +``` + +## API + +### .scandir(path, [optionsOrSettings], callback) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. + +```ts +fsScandir.scandir('path', (error, entries) => { /* … */ }); +fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); +fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); +``` + +### .scandirSync(path, [optionsOrSettings]) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. + +```ts +const entries = fsScandir.scandirSync('path'); +const entries = fsScandir.scandirSync('path', {}); +const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsScandir.Settings({ followSymbolicLinks: false }); + +const entries = fsScandir.scandirSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. +* `stats` (optional) — An instance of `fs.Stats` class. + +For example, the `scandir` call for `tools` directory with one directory inside: + +```ts +{ + dirent: Dirent { name: 'typedoc', /* … */ }, + name: 'typedoc', + path: 'tools/typedoc' +} +``` + +## Options + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} + +const settings = new fsScandir.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## `old` and `modern` mode + +This package has two modes that are used depending on the environment and parameters of use. + +### old + +* Node.js below `10.10` or when the `stats` option is enabled + +When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). + +### modern + +* Node.js 10.10+ and the `stats` option is disabled + +In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. + +This mode makes fewer calls to the file system. It's faster. + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts new file mode 100644 index 000000000..827f1db09 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts @@ -0,0 +1,20 @@ +import type * as fsStat from '@nodelib/fs.stat'; +import type { Dirent, ErrnoException } from '../types'; +export interface ReaddirAsynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; + (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; +} +export interface ReaddirSynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }): Dirent[]; + (filepath: string): string[]; +} +export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { + readdir: ReaddirAsynchronousMethod; + readdirSync: ReaddirSynchronousMethod; +}; +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js new file mode 100644 index 000000000..f0fe02202 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts new file mode 100644 index 000000000..33f17497d --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.d.ts @@ -0,0 +1,4 @@ +/** + * IS `true` for Node.js 10.10 and greater. + */ +export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js new file mode 100644 index 000000000..7e3d4411f --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts new file mode 100644 index 000000000..b9da83ed1 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Dirent, Entry } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function scandir(path: string, callback: AsyncCallback): void; +declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace scandir { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; +export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js new file mode 100644 index 000000000..99c70d3d6 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.scandirSync = exports.scandir = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.scandirSync = scandirSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts new file mode 100644 index 000000000..5829676df --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts @@ -0,0 +1,7 @@ +/// +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; +export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js new file mode 100644 index 000000000..e8e2f0a9c --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const rpl = require("run-parallel"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); +} +exports.read = read; +function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); +} +exports.readdir = readdir; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts new file mode 100644 index 000000000..2b4d08b57 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts @@ -0,0 +1 @@ +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js new file mode 100644 index 000000000..8724cb59a --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = void 0; +function joinPathSegments(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts new file mode 100644 index 000000000..e05c8f072 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts @@ -0,0 +1,5 @@ +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare function read(directory: string, settings: Settings): Entry[]; +export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; +export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js new file mode 100644 index 000000000..146db3434 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); +} +exports.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); +} +exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts new file mode 100644 index 000000000..a0db11559 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.d.ts @@ -0,0 +1,20 @@ +import * as fsStat from '@nodelib/fs.stat'; +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLinks: boolean; + readonly fs: fs.FileSystemAdapter; + readonly pathSegmentSeparator: string; + readonly stats: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + readonly fsStatSettings: fsStat.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js new file mode 100644 index 000000000..15a3e8cde --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsStat = require("@nodelib/fs.stat"); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts new file mode 100644 index 000000000..f326c5e5e --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts @@ -0,0 +1,20 @@ +/// +import type * as fs from 'fs'; +export interface Entry { + dirent: Dirent; + name: string; + path: string; + stats?: Stats; +} +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; +export interface Dirent { + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isDirectory: () => boolean; + isFIFO: () => boolean; + isFile: () => boolean; + isSocket: () => boolean; + isSymbolicLink: () => boolean; + name: string; +} diff --git a/node_modules/table/node_modules/ajv/dist/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js similarity index 70% rename from node_modules/table/node_modules/ajv/dist/types/index.js rename to node_modules/@nodelib/fs.scandir/out/types/index.js index aa219d8f2..c8ad2e549 100644 --- a/node_modules/table/node_modules/ajv/dist/types/index.js +++ b/node_modules/@nodelib/fs.scandir/out/types/index.js @@ -1,3 +1,2 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts new file mode 100644 index 000000000..bb863f157 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts @@ -0,0 +1,2 @@ +import type { Dirent, Stats } from '../types'; +export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js new file mode 100644 index 000000000..ace7c74d6 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts new file mode 100644 index 000000000..1b41954e7 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts @@ -0,0 +1,2 @@ +import * as fs from './fs'; +export { fs }; diff --git a/node_modules/table/node_modules/ajv/dist/types/json-schema.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js similarity index 53% rename from node_modules/table/node_modules/ajv/dist/types/json-schema.js rename to node_modules/@nodelib/fs.scandir/out/utils/index.js index 2d8f98dc5..f5de129f4 100644 --- a/node_modules/table/node_modules/ajv/dist/types/json-schema.js +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.js @@ -1,3 +1,5 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=json-schema.js.map \ No newline at end of file +exports.fs = void 0; +const fs = require("./fs"); +exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json new file mode 100644 index 000000000..d3a89241b --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.scandir", + "version": "2.1.5", + "description": "List files and directories inside the specified directory", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "scandir", + "readdir", + "dirent" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4", + "@types/run-parallel": "^1.1.0" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 000000000..686f0471d --- /dev/null +++ b/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts new file mode 100644 index 000000000..3af759c95 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts @@ -0,0 +1,13 @@ +/// +import * as fs from 'fs'; +import type { ErrnoException } from '../types'; +export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; +export declare type StatSynchronousMethod = (path: string) => fs.Stats; +export interface FileSystemAdapter { + lstat: StatAsynchronousMethod; + stat: StatAsynchronousMethod; + lstatSync: StatSynchronousMethod; + statSync: StatSynchronousMethod; +} +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js new file mode 100644 index 000000000..8dc08c8ca --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts new file mode 100644 index 000000000..f95db995c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Stats } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function stat(path: string, callback: AsyncCallback): void; +declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace stat { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; +export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js new file mode 100644 index 000000000..b23f7510d --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.statSync = exports.stat = exports.Settings = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function stat(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.stat = stat; +function statSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.statSync = statSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts new file mode 100644 index 000000000..85423ce11 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts @@ -0,0 +1,4 @@ +import type Settings from '../settings'; +import type { ErrnoException, Stats } from '../types'; +export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; +export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js new file mode 100644 index 000000000..983ff0e6c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); +} +exports.read = read; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts new file mode 100644 index 000000000..428c3d792 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts @@ -0,0 +1,3 @@ +import type Settings from '../settings'; +import type { Stats } from '../types'; +export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js new file mode 100644 index 000000000..1521c3616 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } +} +exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts new file mode 100644 index 000000000..f4b3d4443 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.d.ts @@ -0,0 +1,16 @@ +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLink?: boolean; + fs?: Partial; + markSymbolicLink?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLink: boolean; + readonly fs: fs.FileSystemAdapter; + readonly markSymbolicLink: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js new file mode 100644 index 000000000..111ec09ca --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts new file mode 100644 index 000000000..74c08ed2f --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.d.ts @@ -0,0 +1,4 @@ +/// +import type * as fs from 'fs'; +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js b/node_modules/@nodelib/fs.stat/out/types/index.js similarity index 69% rename from node_modules/table/node_modules/ajv/dist/vocabularies/errors.js rename to node_modules/@nodelib/fs.stat/out/types/index.js index d4d3fba00..c8ad2e549 100644 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js +++ b/node_modules/@nodelib/fs.stat/out/types/index.js @@ -1,3 +1,2 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 000000000..f2540c289 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nodelib/fs.stat", + "version": "2.0.5", + "description": "Get the status of a file with some features", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md new file mode 100644 index 000000000..6ccc08db4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/README.md @@ -0,0 +1,215 @@ +# @nodelib/fs.walk + +> A library for efficiently walking a directory recursively. + +## :bulb: Highlights + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). +* :gear: Built-in directories/files and error filtering system. +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.walk +``` + +## Usage + +```ts +import * as fsWalk from '@nodelib/fs.walk'; + +fsWalk.walk('path', (error, entries) => { /* … */ }); +``` + +## API + +### .walk(path, [optionsOrSettings], callback) + +Reads the directory recursively and asynchronously. Requires a callback function. + +> :book: If you want to use the Promise API, use `util.promisify`. + +```ts +fsWalk.walk('path', (error, entries) => { /* … */ }); +fsWalk.walk('path', {}, (error, entries) => { /* … */ }); +fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); +``` + +### .walkStream(path, [optionsOrSettings]) + +Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. + +```ts +const stream = fsWalk.walkStream('path'); +const stream = fsWalk.walkStream('path', {}); +const stream = fsWalk.walkStream('path', new fsWalk.Settings()); +``` + +### .walkSync(path, [optionsOrSettings]) + +Reads the directory recursively and synchronously. Returns an array of entries. + +```ts +const entries = fsWalk.walkSync('path'); +const entries = fsWalk.walkSync('path', {}); +const entries = fsWalk.walkSync('path', new fsWalk.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsWalk.Settings({ followSymbolicLinks: true }); + +const entries = fsWalk.walkSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. +* [`stats`] — An instance of `fs.Stats` class. + +## Options + +### basePath + +* Type: `string` +* Default: `undefined` + +By default, all paths are built relative to the root path. You can use this option to set custom root path. + +In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. + +```ts +fsWalk.walkSync('root'); // → ['root/file.txt'] +fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] +``` + +### concurrency + +* Type: `number` +* Default: `Infinity` + +The maximum number of concurrent calls to `fs.readdir`. + +> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). + +### deepFilter + +* Type: [`DeepFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the directory will be read deep or not. + +```ts +// Skip all directories that starts with `node_modules` +const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); +``` + +### entryFilter + +* Type: [`EntryFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the entry will be included to results or not. + +```ts +// Exclude all `.js` files from results +const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); +``` + +### errorFilter + +* Type: [`ErrorFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that allows you to skip errors that occur when reading directories. + +For example, you can skip `ENOENT` errors if required: + +```ts +// Skip all ENOENT errors +const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; +``` + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: `FileSystemAdapter` +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat: typeof fs.lstat; + stat: typeof fs.stat; + lstatSync: typeof fs.lstatSync; + statSync: typeof fs.statSync; + readdir: typeof fs.readdir; + readdirSync: typeof fs.readdirSync; +} + +const settings = new fsWalk.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts new file mode 100644 index 000000000..8864c7bff --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.d.ts @@ -0,0 +1,14 @@ +/// +import type { Readable } from 'stream'; +import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; +import { AsyncCallback } from './providers/async'; +import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; +import type { Entry } from './types'; +declare function walk(directory: string, callback: AsyncCallback): void; +declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace walk { + function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; +declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; +export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js new file mode 100644 index 000000000..15207874a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = require("./providers/async"); +const stream_1 = require("./providers/stream"); +const sync_1 = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts new file mode 100644 index 000000000..0f6717d78 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts @@ -0,0 +1,12 @@ +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; +export default class AsyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + private readonly _storage; + constructor(_root: string, _settings: Settings); + read(callback: AsyncCallback): void; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js new file mode 100644 index 000000000..51d3be51a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const async_1 = require("../readers/async"); +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } +} +exports.default = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, entries) { + callback(null, entries); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts new file mode 100644 index 000000000..874f60c5a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts @@ -0,0 +1,4 @@ +import AsyncProvider from './async'; +import StreamProvider from './stream'; +import SyncProvider from './sync'; +export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js new file mode 100644 index 000000000..4c2529ce8 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; +const async_1 = require("./async"); +exports.AsyncProvider = async_1.default; +const stream_1 = require("./stream"); +exports.StreamProvider = stream_1.default; +const sync_1 = require("./sync"); +exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts new file mode 100644 index 000000000..294185f85 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts @@ -0,0 +1,12 @@ +/// +import { Readable } from 'stream'; +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +export default class StreamProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + protected readonly _stream: Readable; + constructor(_root: string, _settings: Settings); + read(): Readable; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js new file mode 100644 index 000000000..51298b0f5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const async_1 = require("../readers/async"); +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts new file mode 100644 index 000000000..551c42e41 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts @@ -0,0 +1,10 @@ +import SyncReader from '../readers/sync'; +import type Settings from '../settings'; +import type { Entry } from '../types'; +export default class SyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: SyncReader; + constructor(_root: string, _settings: Settings); + read(): Entry[]; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js new file mode 100644 index 000000000..faab6ca2a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = require("../readers/sync"); +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } +} +exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts new file mode 100644 index 000000000..9acf4e6c2 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts @@ -0,0 +1,30 @@ +/// +import { EventEmitter } from 'events'; +import * as fsScandir from '@nodelib/fs.scandir'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +import Reader from './reader'; +declare type EntryEventCallback = (entry: Entry) => void; +declare type ErrorEventCallback = (error: Errno) => void; +declare type EndEventCallback = () => void; +export default class AsyncReader extends Reader { + protected readonly _settings: Settings; + protected readonly _scandir: typeof fsScandir.scandir; + protected readonly _emitter: EventEmitter; + private readonly _queue; + private _isFatalError; + private _isDestroyed; + constructor(_root: string, _settings: Settings); + read(): EventEmitter; + get isDestroyed(): boolean; + destroy(): void; + onEntry(callback: EntryEventCallback): void; + onError(callback: ErrorEventCallback): void; + onEnd(callback: EndEventCallback): void; + private _pushToQueue; + private _worker; + private _handleError; + private _handleEntry; + private _emitEntry; +} +export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js new file mode 100644 index 000000000..ebe8dd573 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("events"); +const fsScandir = require("@nodelib/fs.scandir"); +const fastq = require("fastq"); +const common = require("./common"); +const reader_1 = require("./reader"); +class AsyncReader extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } +} +exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts new file mode 100644 index 000000000..5985f97c4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts @@ -0,0 +1,7 @@ +import type { FilterFunction } from '../settings'; +import type Settings from '../settings'; +import type { Errno } from '../types'; +export declare function isFatalError(settings: Settings, error: Errno): boolean; +export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; +export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js new file mode 100644 index 000000000..a93572f48 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); +} +exports.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +exports.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +exports.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts new file mode 100644 index 000000000..e1f383b25 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts @@ -0,0 +1,6 @@ +import type Settings from '../settings'; +export default class Reader { + protected readonly _root: string; + protected readonly _settings: Settings; + constructor(_root: string, _settings: Settings); +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js new file mode 100644 index 000000000..782f07cbf --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common = require("./common"); +class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +} +exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts new file mode 100644 index 000000000..af4103353 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts @@ -0,0 +1,15 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry } from '../types'; +import Reader from './reader'; +export default class SyncReader extends Reader { + protected readonly _scandir: typeof fsScandir.scandirSync; + private readonly _storage; + private readonly _queue; + read(): Entry[]; + private _pushToQueue; + private _handleQueue; + private _handleDirectory; + private _handleError; + private _handleEntry; + private _pushToStorage; +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js new file mode 100644 index 000000000..9a8d5a6f1 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsScandir = require("@nodelib/fs.scandir"); +const common = require("./common"); +const reader_1 = require("./reader"); +class SyncReader extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts new file mode 100644 index 000000000..d1c4b45f6 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.d.ts @@ -0,0 +1,30 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry, Errno } from './types'; +export declare type FilterFunction = (value: T) => boolean; +export declare type DeepFilterFunction = FilterFunction; +export declare type EntryFilterFunction = FilterFunction; +export declare type ErrorFilterFunction = FilterFunction; +export interface Options { + basePath?: string; + concurrency?: number; + deepFilter?: DeepFilterFunction; + entryFilter?: EntryFilterFunction; + errorFilter?: ErrorFilterFunction; + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly basePath?: string; + readonly concurrency: number; + readonly deepFilter: DeepFilterFunction | null; + readonly entryFilter: EntryFilterFunction | null; + readonly errorFilter: ErrorFilterFunction | null; + readonly pathSegmentSeparator: string; + readonly fsScandirSettings: fsScandir.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js new file mode 100644 index 000000000..d7a85c81e --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsScandir = require("@nodelib/fs.scandir"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts new file mode 100644 index 000000000..6ee9bd3f9 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.d.ts @@ -0,0 +1,8 @@ +/// +import type * as scandir from '@nodelib/fs.scandir'; +export declare type Entry = scandir.Entry; +export declare type Errno = NodeJS.ErrnoException; +export interface QueueItem { + directory: string; + base?: string; +} diff --git a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js b/node_modules/@nodelib/fs.walk/out/types/index.js similarity index 66% rename from node_modules/table/node_modules/ajv/dist/types/jtd-schema.js rename to node_modules/@nodelib/fs.walk/out/types/index.js index 11338aa8a..c8ad2e549 100644 --- a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js +++ b/node_modules/@nodelib/fs.walk/out/types/index.js @@ -1,3 +1,2 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json new file mode 100644 index 000000000..86bfce48b --- /dev/null +++ b/node_modules/@nodelib/fs.walk/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.walk", + "version": "1.2.8", + "description": "A library for efficiently walking a directory recursively", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "walk", + "scanner", + "crawler" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*", + "!out/**/tests/**" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" +} diff --git a/node_modules/acorn-jsx/index.d.ts b/node_modules/acorn-jsx/index.d.ts new file mode 100644 index 000000000..f37b1df4c --- /dev/null +++ b/node_modules/acorn-jsx/index.d.ts @@ -0,0 +1,12 @@ +import { Parser } from 'acorn' + +declare const jsx: (options?: jsx.Options) => (BaseParser: typeof Parser) => typeof Parser; + +declare namespace jsx { + interface Options { + allowNamespacedObjects?: boolean; + allowNamespaces?: boolean; + } +} + +export = jsx; diff --git a/node_modules/acorn-jsx/package.json b/node_modules/acorn-jsx/package.json index c6fec8508..6debde9ca 100644 --- a/node_modules/acorn-jsx/package.json +++ b/node_modules/acorn-jsx/package.json @@ -1,55 +1,27 @@ { - "_from": "acorn-jsx@^5.3.1", - "_id": "acorn-jsx@5.3.1", - "_inBundle": false, - "_integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "_location": "/acorn-jsx", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "acorn-jsx@^5.3.1", - "name": "acorn-jsx", - "escapedName": "acorn-jsx", - "rawSpec": "^5.3.1", - "saveSpec": null, - "fetchSpec": "^5.3.1" - }, - "_requiredBy": [ - "/espree" - ], - "_resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "_shasum": "fc8661e11b7ac1539c47dbfea2e72b3af34d267b", - "_spec": "acorn-jsx@^5.3.1", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/espree", - "bugs": { - "url": "https://github.com/acornjs/acorn-jsx/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "acorn-jsx", "description": "Modern, fast React.js JSX parser", - "devDependencies": { - "acorn": "^8.0.1" - }, "homepage": "https://github.com/acornjs/acorn-jsx", - "license": "MIT", + "version": "5.3.2", "maintainers": [ { "name": "Ingvar Stepanyan", "email": "me@rreverser.com", - "url": "http://rreverser.com/" + "web": "http://rreverser.com/" } ], - "name": "acorn-jsx", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, "repository": { "type": "git", - "url": "git+https://github.com/acornjs/acorn-jsx.git" + "url": "https://github.com/acornjs/acorn-jsx" }, + "license": "MIT", "scripts": { "test": "node test/run.js" }, - "version": "5.3.1" + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "devDependencies": { + "acorn": "^8.0.1" + } } diff --git a/node_modules/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md index 02f69e7ac..ac78102da 100644 --- a/node_modules/acorn/CHANGELOG.md +++ b/node_modules/acorn/CHANGELOG.md @@ -1,3 +1,143 @@ +## 8.8.2 (2023-01-23) + +### Bug fixes + +Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`. + +Fix an exception when passing no option object to `parse` or `new Parser`. + +Fix incorrect parse error on `if (0) let\n[astral identifier char]`. + +## 8.8.1 (2022-10-24) + +### Bug fixes + +Make type for `Comment` compatible with estree types. + +## 8.8.0 (2022-07-21) + +### Bug fixes + +Allow parentheses around spread args in destructuring object assignment. + +Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them. + +### New features + +Support hashbang comments by default in ECMAScript 2023 and later. + +## 8.7.1 (2021-04-26) + +### Bug fixes + +Stop handling `"use strict"` directives in ECMAScript versions before 5. + +Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked. + +Add missing type for `tokTypes`. + +## 8.7.0 (2021-12-27) + +### New features + +Support quoted export names. + +Upgrade to Unicode 14. + +Add support for Unicode 13 properties in regular expressions. + +### Bug fixes + +Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code. + +## 8.6.0 (2021-11-18) + +### Bug fixes + +Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment. + +### New features + +Support class private fields with the `in` operator. + +## 8.5.0 (2021-09-06) + +### Bug fixes + +Improve context-dependent tokenization in a number of corner cases. + +Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number). + +Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators. + +Fix wrong end locations stored on SequenceExpression nodes. + +Implement restriction that `for`/`of` loop LHS can't start with `let`. + +### New features + +Add support for ES2022 class static blocks. + +Allow multiple input files to be passed to the CLI tool. + +## 8.4.1 (2021-06-24) + +### Bug fixes + +Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources. + +## 8.4.0 (2021-06-11) + +### New features + +A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context. + +## 8.3.0 (2021-05-31) + +### New features + +Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher. + +Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag. + +## 8.2.4 (2021-05-04) + +### Bug fixes + +Fix spec conformity in corner case 'for await (async of ...)'. + +## 8.2.3 (2021-05-04) + +### Bug fixes + +Fix an issue where the library couldn't parse 'for (async of ...)'. + +Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances. + +## 8.2.2 (2021-04-29) + +### Bug fixes + +Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield. + +## 8.2.1 (2021-04-24) + +### Bug fixes + +Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse. + +## 8.2.0 (2021-04-24) + +### New features + +Add support for ES2022 class fields and private methods. + +## 8.1.1 (2021-04-12) + +### Various + +Stop shipping source maps in the NPM package. + ## 8.1.0 (2021-03-09) ### Bug fixes diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE index d6be6db2c..9d71cc63a 100644 --- a/node_modules/acorn/LICENSE +++ b/node_modules/acorn/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2012-2020 by various contributors (see AUTHORS) +Copyright (C) 2012-2022 by various contributors (see AUTHORS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/acorn/README.md b/node_modules/acorn/README.md index f93dcc2bd..61e7dd35e 100644 --- a/node_modules/acorn/README.md +++ b/node_modules/acorn/README.md @@ -54,9 +54,10 @@ required): - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019), - 11 (2020), or 12 (2021, partial support), or `"latest"` (the latest - the library supports). This influences support for strict mode, the - set of reserved words, and support for new syntax features. + 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the + latest the library supports). This influences support for strict + mode, the set of reserved words, and support for new syntax + features. **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being implemented by Acorn. Other proposed new features must be @@ -94,14 +95,18 @@ required): and also allows `import.meta` expressions to appear in scripts (when `sourceType` is not `"module"`). -- **allowAwaitOutsideFunction**: By default, `await` expressions can - only appear inside `async` functions. Setting this option to +- **allowAwaitOutsideFunction**: If `false`, `await` expressions can + only appear inside `async` functions. Defaults to `true` for + `ecmaVersion` 2022 and later, `false` for lower versions. Setting this option to `true` allows to have top-level `await` expressions. They are still not allowed in non-`async` functions, though. -- **allowHashBang**: When this is enabled (off by default), if the - code starts with the characters `#!` (as in a shellscript), the - first line will be treated as a comment. +- **allowSuperOutsideMethod**: By default, `super` outside a method + raises an error. Set this to `true` to accept such code. + +- **allowHashBang**: When this is enabled, if the code starts with the + characters `#!` (as in a shellscript), the first line will be + treated as a comment. Defaults to true when `ecmaVersion` >= 2023. - **locations**: When `true`, each node has a `loc` object attached with `start` and `end` subobjects, each of which contains the @@ -266,10 +271,3 @@ The utility spits out the syntax tree as JSON data. ## Existing plugins - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) - -Plugins for ECMAScript proposals: - - - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: - - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) - - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) - - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn index cf7df4689..3ef3c124b 100755 --- a/node_modules/acorn/bin/acorn +++ b/node_modules/acorn/bin/acorn @@ -1,4 +1,4 @@ #!/usr/bin/env node -'use strict'; +"use strict" -require('../dist/bin.js'); +require("../dist/bin.js") diff --git a/node_modules/acorn/dist/acorn.d.ts b/node_modules/acorn/dist/acorn.d.ts index f788637e8..870d59d81 100644 --- a/node_modules/acorn/dist/acorn.d.ts +++ b/node_modules/acorn/dist/acorn.d.ts @@ -11,8 +11,10 @@ declare namespace acorn { [Symbol.iterator](): Iterator } + type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 'latest' + interface Options { - ecmaVersion: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 'latest' + ecmaVersion: ecmaVersion sourceType?: 'script' | 'module' onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void @@ -20,6 +22,7 @@ declare namespace acorn { allowReturnOutsideFunction?: boolean allowImportExportEverywhere?: boolean allowAwaitOutsideFunction?: boolean + allowSuperOutsideMethod?: boolean allowHashBang?: boolean locations?: boolean onToken?: ((token: Token) => any) | Token[] @@ -35,8 +38,41 @@ declare namespace acorn { } class Parser { + // state.js + lineStart: number; + options: Options; + curLine: number; + start: number; + end: number; + input: string; + type: TokenType; + + // state.js constructor(options: Options, input: string, startPos?: number) parse(this: Parser): Node + + // tokenize.js + next(): void; + nextToken(): void; + + // statement.js + parseTopLevel(node: Node): Node; + + // node.js + finishNode(node: Node, type: string): Node; + finishNodeAt(node: Node, type: string, pos: number, loc: Position): Node; + + // location.js + raise(pos: number, message: string) : void; + raiseRecoverable?(pos: number, message: string) : void; + + // parseutils.js + unexpected(pos: number) : void; + + // index.js + static acorn: typeof acorn; + + // state.js static parse(this: typeof Parser, input: string, options: Options): Node static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node static tokenizer(this: typeof Parser, input: string, options: Options): { @@ -88,6 +124,7 @@ declare namespace acorn { regexp: TokenType string: TokenType name: TokenType + privateId: TokenType eof: TokenType bracketL: TokenType bracketR: TokenType @@ -100,8 +137,10 @@ declare namespace acorn { colon: TokenType dot: TokenType question: TokenType + questionDot: TokenType arrow: TokenType template: TokenType + invalidTemplate: TokenType ellipsis: TokenType backQuote: TokenType dollarBraceL: TokenType @@ -122,6 +161,7 @@ declare namespace acorn { star: TokenType slash: TokenType starstar: TokenType + coalesce: TokenType _break: TokenType _case: TokenType _catch: TokenType @@ -171,6 +211,9 @@ declare namespace acorn { p_expr: TokContext q_tmpl: TokContext f_expr: TokContext + f_stat: TokContext + f_expr_gen: TokContext + f_gen: TokContext } function isIdentifierStart(code: number, astral?: boolean): boolean @@ -181,7 +224,7 @@ declare namespace acorn { } interface Comment extends AbstractToken { - type: string + type: 'Line' | 'Block' value: string start: number end: number diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js index 26b385f6d..f623ebc9e 100644 --- a/node_modules/acorn/dist/acorn.js +++ b/node_modules/acorn/dist/acorn.js @@ -1,8 +1,22 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.acorn = {})); -}(this, (function (exports) { 'use strict'; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {})); +})(this, (function (exports) { 'use strict'; + + // This file was generated. Do not modify manually! + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + + // This file was generated. Do not modify manually! + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; + + // This file was generated. Do not modify manually! + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + + // This file was generated. Do not modify manually! + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + + // These are a run-length and offset encoded representation of the // Reserved word lists for various dialects of the language @@ -18,7 +32,7 @@ var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; - var keywords = { + var keywords$1 = { 5: ecma5AndLessKeywords, "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" @@ -28,31 +42,9 @@ // ## Character categories - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - // Generated by `bin/generate-identifier-regex.js`. - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; - - // These are a run-length and offset encoded representation of the - // >0xffff code points that are a valid part of identifiers. The - // offset starts at 0x10000, and each pair of numbers represents an - // offset to the next range, and then a size of the range. They were - // generated by bin/generate-identifier-regex.js - - // eslint-disable-next-line comma-spacing - var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; - - // eslint-disable-next-line comma-spacing - var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; - // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. @@ -64,6 +56,7 @@ pos += set[i + 1]; if (pos >= code) { return true } } + return false } // Test whether a given character code starts an identifier. @@ -137,21 +130,22 @@ // Map keyword names to token types. - var keywords$1 = {}; + var keywords = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; - return keywords$1[name] = new TokenType(name, options) + return keywords[name] = new TokenType(name, options) } - var types = { + var types$1 = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), eof: new TokenType("eof"), // Punctuation token types. @@ -251,8 +245,19 @@ var lineBreak = /\r\n?|\n|\u2028|\u2029/; var lineBreakG = new RegExp(lineBreak.source, "g"); - function isNewLine(code, ecma2019String) { - return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) + function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 + } + + function nextLineBreak(code, from, end) { + if ( end === void 0 ) end = code.length; + + for (var i = from; i < end; i++) { + var next = code.charCodeAt(i); + if (isNewLine(next)) + { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } + } + return -1 } var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; @@ -263,11 +268,9 @@ var hasOwnProperty = ref.hasOwnProperty; var toString = ref.toString; - // Checks if an object has a property. - - function has(obj, propName) { - return hasOwnProperty.call(obj, propName) - } + var hasOwn = Object.hasOwn || (function (obj, propName) { return ( + hasOwnProperty.call(obj, propName) + ); }); var isArray = Array.isArray || (function (obj) { return ( toString.call(obj) === "[object Array]" @@ -277,6 +280,15 @@ return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } + function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xFFFF) { return String.fromCharCode(code) } + code -= 0x10000; + return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) + } + + var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. @@ -303,14 +315,10 @@ function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur) - } + var nextBreak = nextLineBreak(input, cur, offset); + if (nextBreak < 0) { return new Position(line, offset - cur) } + ++line; + cur = nextBreak; } } @@ -320,9 +328,10 @@ var defaultOptions = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 - // (2019), 11 (2020), 12 (2021), or `"latest"` (the latest version - // the library supports). This influences support for strict mode, - // the set of reserved words, and support for new syntax features. + // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` + // (the latest version the library supports). This influences + // support for strict mode, the set of reserved words, and support + // for new syntax features. ecmaVersion: null, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global @@ -349,11 +358,16 @@ // appearing at the top of the program, and an import.meta expression // in a script isn't considered an error. allowImportExportEverywhere: false, + // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. // When enabled, await identifiers are allowed to appear at the top-level scope, // but they are still not allowed in non-async functions. - allowAwaitOutsideFunction: false, - // When enabled, hashbang directive in the beginning of file - // is allowed and treated as a line comment. + allowAwaitOutsideFunction: null, + // When enabled, super identifiers are not constrained to + // appearing in methods and do not raise an error when they appear elsewhere. + allowSuperOutsideMethod: null, + // When enabled, hashbang directive in the beginning of file is + // allowed and treated as a line comment. Enabled by default when + // `ecmaVersion` >= 2023. allowHashBang: false, // When `locations` is on, `loc` properties holding objects with // `start` and `end` properties in `{line, column}` form (with @@ -411,7 +425,7 @@ var options = {}; for (var opt in defaultOptions) - { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion === "latest") { options.ecmaVersion = 1e8; @@ -428,6 +442,9 @@ if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } + if (!opts || opts.allowHashBang == null) + { options.allowHashBang = options.ecmaVersion >= 14; } + if (isArray(options.onToken)) { var tokens = options.onToken; options.onToken = function (token) { return tokens.push(token); }; @@ -458,13 +475,14 @@ var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, - SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, - SCOPE_DIRECT_SUPER = 128; + SCOPE_DIRECT_SUPER = 128, + SCOPE_CLASS_STATIC_BLOCK = 256, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; function functionFlags(async, generator) { return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) @@ -482,7 +500,7 @@ var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; @@ -513,7 +531,7 @@ // Properties of the current token: // Its type - this.type = types.eof; + this.type = types$1.eof; // For tokens that include more information than their type, the value this.value = null; // Its start and end offset @@ -538,6 +556,7 @@ // Used to signify the start of a potential arrow function this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; // Positions to delayed-check that yield/await does not exist in default parameters. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; @@ -556,9 +575,14 @@ // For RegExp validation this.regexpState = null; + + // The stack of private names. + // Each element has two properties: 'declared' and 'used'. + // When it exited from the outermost class definition, all used private names must be declared. + this.privateNameStack = []; }; - var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },inNonArrowFunction: { configurable: true } }; + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } }; Parser.prototype.parse = function parse () { var node = this.options.program || this.startNode(); @@ -567,12 +591,41 @@ }; prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; - prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; - prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; - prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; + + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; + + prototypeAccessors.canAwait.get = function () { + for (var i = this.scopeStack.length - 1; i >= 0; i--) { + var scope = this.scopeStack[i]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false } + if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 } + } + return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction + }; + + prototypeAccessors.allowSuper.get = function () { + var ref = this.currentThisScope(); + var flags = ref.flags; + var inClassFieldInit = ref.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod + }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; - prototypeAccessors.inNonArrowFunction.get = function () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; + + prototypeAccessors.allowNewDotTarget.get = function () { + var ref = this.currentThisScope(); + var flags = ref.flags; + var inClassFieldInit = ref.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit + }; + + prototypeAccessors.inClassStaticBlock.get = function () { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 + }; Parser.extend = function extend () { var plugins = [], len = arguments.length; @@ -599,12 +652,13 @@ Object.defineProperties( Parser.prototype, prototypeAccessors ); - var pp = Parser.prototype; + var pp$9 = Parser.prototype; // ## Parser utilities var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp.strictDirective = function(start) { + pp$9.strictDirective = function(start) { + if (this.options.ecmaVersion < 5) { return false } for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; @@ -632,7 +686,7 @@ // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. - pp.eat = function(type) { + pp$9.eat = function(type) { if (this.type === type) { this.next(); return true @@ -643,13 +697,13 @@ // Tests whether parsed token is a contextual keyword. - pp.isContextual = function(name) { - return this.type === types.name && this.value === name && !this.containsEsc + pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc }; // Consumes contextual keyword if possible. - pp.eatContextual = function(name) { + pp$9.eatContextual = function(name) { if (!this.isContextual(name)) { return false } this.next(); return true @@ -657,19 +711,19 @@ // Asserts that following token is given contextual keyword. - pp.expectContextual = function(name) { + pp$9.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; // Test whether a semicolon can be inserted at the current position. - pp.canInsertSemicolon = function() { - return this.type === types.eof || - this.type === types.braceR || + pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || + this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; - pp.insertSemicolon = function() { + pp$9.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } @@ -680,11 +734,11 @@ // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. - pp.semicolon = function() { - if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } }; - pp.afterTrailingComma = function(tokType, notNext) { + pp$9.afterTrailingComma = function(tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } @@ -697,34 +751,34 @@ // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. - pp.expect = function(type) { + pp$9.expect = function(type) { this.eat(type) || this.unexpected(); }; // Raise an unexpected token error. - pp.unexpected = function(pos) { + pp$9.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; - function DestructuringErrors() { + var DestructuringErrors = function DestructuringErrors() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; - } + }; - pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return } if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } + if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); } }; - pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false } var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; @@ -735,20 +789,20 @@ { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; - pp.checkYieldAwaitInDefaultParams = function() { + pp$9.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; - pp.isSimpleAssignTarget = function(expr) { + pp$9.isSimpleAssignTarget = function(expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression) } return expr.type === "Identifier" || expr.type === "MemberExpression" }; - var pp$1 = Parser.prototype; + var pp$8 = Parser.prototype; // ### Statement parsing @@ -757,10 +811,10 @@ // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. - pp$1.parseTopLevel = function(node) { + pp$8.parseTopLevel = function(node) { var exports = Object.create(null); if (!node.body) { node.body = []; } - while (this.type !== types.eof) { + while (this.type !== types$1.eof) { var stmt = this.parseStatement(null, true, exports); node.body.push(stmt); } @@ -779,7 +833,7 @@ var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - pp$1.isLet = function(context) { + pp$8.isLet = function(context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); @@ -788,13 +842,14 @@ // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. - if (nextCh === 91) { return true } // '[' + if (nextCh === 91 || nextCh === 92) { return true } // '[', '/' if (context) { return false } - if (nextCh === 123) { return true } // '{' + if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral if (isIdentifierStart(nextCh, true)) { var pos = next + 1; - while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } + if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } var ident = this.input.slice(next, pos); if (!keywordRelationalOperator.test(ident)) { return true } } @@ -804,16 +859,17 @@ // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. - pp$1.isAsyncFunction = function() { + pp$8.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length; + var next = this.pos + skip[0].length, after; return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && - (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + (next + 8 === this.input.length || + !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)) }; // Parse a single statement. @@ -823,11 +879,11 @@ // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. - pp$1.parseStatement = function(context, topLevel, exports) { + pp$8.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { - starttype = types._var; + starttype = types$1._var; kind = "let"; } @@ -836,35 +892,35 @@ // complexity. switch (starttype) { - case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types._debugger: return this.parseDebuggerStatement(node) - case types._do: return this.parseDoStatement(node) - case types._for: return this.parseForStatement(node) - case types._function: + case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types$1._debugger: return this.parseDebuggerStatement(node) + case types$1._do: return this.parseDoStatement(node) + case types$1._for: return this.parseForStatement(node) + case types$1._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole // body of an if statement. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false, !context) - case types._class: + case types$1._class: if (context) { this.unexpected(); } return this.parseClass(node, true) - case types._if: return this.parseIfStatement(node) - case types._return: return this.parseReturnStatement(node) - case types._switch: return this.parseSwitchStatement(node) - case types._throw: return this.parseThrowStatement(node) - case types._try: return this.parseTryStatement(node) - case types._const: case types._var: + case types$1._if: return this.parseIfStatement(node) + case types$1._return: return this.parseReturnStatement(node) + case types$1._switch: return this.parseSwitchStatement(node) + case types$1._throw: return this.parseThrowStatement(node) + case types$1._try: return this.parseTryStatement(node) + case types$1._const: case types$1._var: kind = kind || this.value; if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) - case types._while: return this.parseWhileStatement(node) - case types._with: return this.parseWithStatement(node) - case types.braceL: return this.parseBlock(true, node) - case types.semi: return this.parseEmptyStatement(node) - case types._export: - case types._import: - if (this.options.ecmaVersion > 10 && starttype === types._import) { + case types$1._while: return this.parseWhileStatement(node) + case types$1._with: return this.parseWithStatement(node) + case types$1.braceL: return this.parseBlock(true, node) + case types$1.semi: return this.parseEmptyStatement(node) + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); @@ -878,7 +934,7 @@ if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We @@ -893,17 +949,17 @@ } var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; - pp$1.parseBreakContinueStatement = function(node, keyword) { + pp$8.parseBreakContinueStatement = function(node, keyword) { var isBreak = keyword === "break"; this.next(); - if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types.name) { this.unexpected(); } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types$1.name) { this.unexpected(); } else { node.label = this.parseIdent(); this.semicolon(); @@ -923,21 +979,21 @@ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") }; - pp$1.parseDebuggerStatement = function(node) { + pp$8.parseDebuggerStatement = function(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement") }; - pp$1.parseDoStatement = function(node) { + pp$8.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); node.body = this.parseStatement("do"); this.labels.pop(); - this.expect(types._while); + this.expect(types$1._while); node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) - { this.eat(types.semi); } + { this.eat(types$1.semi); } else { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") @@ -951,25 +1007,25 @@ // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. - pp$1.parseForStatement = function(node) { + pp$8.parseForStatement = function(node) { this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); - this.expect(types.parenL); - if (this.type === types.semi) { + this.expect(types$1.parenL); + if (this.type === types$1.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, null) } var isLet = this.isLet(); - if (this.type === types._var || this.type === types._const || isLet) { + if (this.type === types$1._var || this.type === types$1._const || isLet) { var init$1 = this.startNode(), kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } @@ -978,14 +1034,16 @@ if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init$1) } + var startsWithLet = this.isContextual("let"), isForOf = false; var refDestructuringErrors = new DestructuringErrors; - var init = this.parseExpression(true, refDestructuringErrors); - if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } + if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } this.toAssignable(init, false, refDestructuringErrors); this.checkLValPattern(init); return this.parseForIn(node, init) @@ -996,21 +1054,21 @@ return this.parseFor(node, init) }; - pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; - pp$1.parseIfStatement = function(node) { + pp$8.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; - pp$1.parseReturnStatement = function(node) { + pp$8.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } this.next(); @@ -1019,16 +1077,16 @@ // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. - if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") }; - pp$1.parseSwitchStatement = function(node) { + pp$8.parseSwitchStatement = function(node) { this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; - this.expect(types.braceL); + this.expect(types$1.braceL); this.labels.push(switchLabel); this.enterScope(0); @@ -1037,9 +1095,9 @@ // adding statements to. var cur; - for (var sawDefault = false; this.type !== types.braceR;) { - if (this.type === types._case || this.type === types._default) { - var isCase = this.type === types._case; + for (var sawDefault = false; this.type !== types$1.braceR;) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; if (cur) { this.finishNode(cur, "SwitchCase"); } node.cases.push(cur = this.startNode()); cur.consequent = []; @@ -1051,7 +1109,7 @@ sawDefault = true; cur.test = null; } - this.expect(types.colon); + this.expect(types$1.colon); } else { if (!cur) { this.unexpected(); } cur.consequent.push(this.parseStatement(null)); @@ -1064,7 +1122,7 @@ return this.finishNode(node, "SwitchStatement") }; - pp$1.parseThrowStatement = function(node) { + pp$8.parseThrowStatement = function(node) { this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } @@ -1075,21 +1133,21 @@ // Reused empty array added for node fields that are always empty. - var empty = []; + var empty$1 = []; - pp$1.parseTryStatement = function(node) { + pp$8.parseTryStatement = function(node) { this.next(); node.block = this.parseBlock(); node.handler = null; - if (this.type === types._catch) { + if (this.type === types$1._catch) { var clause = this.startNode(); this.next(); - if (this.eat(types.parenL)) { + if (this.eat(types$1.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types.parenR); + this.expect(types$1.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; @@ -1099,20 +1157,20 @@ this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") }; - pp$1.parseVarStatement = function(node, kind) { + pp$8.parseVarStatement = function(node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration") }; - pp$1.parseWhileStatement = function(node) { + pp$8.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); @@ -1121,7 +1179,7 @@ return this.finishNode(node, "WhileStatement") }; - pp$1.parseWithStatement = function(node) { + pp$8.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); @@ -1129,12 +1187,12 @@ return this.finishNode(node, "WithStatement") }; - pp$1.parseEmptyStatement = function(node) { + pp$8.parseEmptyStatement = function(node) { this.next(); return this.finishNode(node, "EmptyStatement") }; - pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; @@ -1142,7 +1200,7 @@ if (label.name === maybeName) { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } - var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this.labels[i]; if (label$1.statementStart === node.start) { @@ -1158,7 +1216,7 @@ return this.finishNode(node, "LabeledStatement") }; - pp$1.parseExpressionStatement = function(node, expr) { + pp$8.parseExpressionStatement = function(node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement") @@ -1168,14 +1226,14 @@ // strict"` declarations when `allowStrict` is true (used for // function bodies). - pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { + pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; if ( node === void 0 ) node = this.startNode(); node.body = []; - this.expect(types.braceL); + this.expect(types$1.braceL); if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types.braceR) { + while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } @@ -1189,13 +1247,13 @@ // `parseStatement` will already have parsed the init statement or // expression. - pp$1.parseFor = function(node, init) { + pp$8.parseFor = function(node, init) { node.init = init; - this.expect(types.semi); - node.test = this.type === types.semi ? null : this.parseExpression(); - this.expect(types.semi); - node.update = this.type === types.parenR ? null : this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1205,8 +1263,8 @@ // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. - pp$1.parseForIn = function(node, init) { - var isForIn = this.type === types._in; + pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; this.next(); if ( @@ -1227,7 +1285,7 @@ } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types.parenR); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1236,28 +1294,28 @@ // Parse a list of variable declarations. - pp$1.parseVar = function(node, isFor, kind) { + pp$8.parseVar = function(node, isFor, kind) { node.declarations = []; node.kind = kind; for (;;) { var decl = this.startNode(); this.parseVarId(decl, kind); - if (this.eat(types.eq)) { + if (this.eat(types$1.eq)) { decl.init = this.parseMaybeAssign(isFor); - } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); } else { decl.init = null; } node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) { break } + if (!this.eat(types$1.comma)) { break } } return node }; - pp$1.parseVarId = function(decl, kind) { + pp$8.parseVarId = function(decl, kind) { decl.id = this.parseBindingAtom(); this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; @@ -1268,18 +1326,18 @@ // `statement & FUNC_STATEMENT`). // Remove `allowExpressionBody` for 7.0.0, as it is only called with false - pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) { this.unexpected(); } - node.generator = this.eat(types.star); + node.generator = this.eat(types$1.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding @@ -1295,10 +1353,10 @@ this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types.name ? this.parseIdent() : null; } + { node.id = this.type === types$1.name ? this.parseIdent() : null; } this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; @@ -1306,16 +1364,16 @@ return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; - pp$1.parseFunctionParams = function(node) { - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); }; // Parse a class declaration or literal (depending on the // `isStatement` parameter). - pp$1.parseClass = function(node, isStatement) { + pp$8.parseClass = function(node, isStatement) { this.next(); // ecma-262 14.6 Class Definitions @@ -1325,90 +1383,190 @@ this.parseClassId(node, isStatement); this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); var classBody = this.startNode(); var hadConstructor = false; classBody.body = []; - this.expect(types.braceL); - while (this.type !== types.braceR) { + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { var element = this.parseClassElement(node.superClass !== null); if (element) { classBody.body.push(element); if (element.type === "MethodDefinition" && element.kind === "constructor") { if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared")); } } } this.strict = oldStrict; this.next(); node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; - pp$1.parseClassElement = function(constructorAllowsSuper) { - var this$1 = this; + pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { return null } - if (this.eat(types.semi)) { return null } + var ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + + if (this.eatContextual("static")) { + // Parse static init block + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } - var method = this.startNode(); - var tryContextual = function (k, noLineBreak) { - if ( noLineBreak === void 0 ) noLineBreak = false; + // Parse element name + if (keyName) { + // 'async', 'get', 'set', or 'static' were not a keyword contextually. + // The last token is any of those. Make it the element name. + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } - var start = this$1.start, startLoc = this$1.startLoc; - if (!this$1.eatContextual(k)) { return false } - if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } - if (method.key) { this$1.unexpected(); } - method.computed = false; - method.key = this$1.startNodeAt(start, startLoc); - method.key.name = k; - this$1.finishNode(method.key, "Identifier"); - return false - }; + // Parse element value + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. + if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } - method.kind = "method"; - method.static = tryContextual("static"); - var isGenerator = this.eat(types.star); - var isAsync = false; - if (!isGenerator) { - if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); - } else if (tryContextual("get")) { - method.kind = "get"; - } else if (tryContextual("set")) { - method.kind = "set"; + return node + }; + + pp$8.isClassElementNameStart = function() { + return ( + this.type === types$1.name || + this.type === types$1.privateId || + this.type === types$1.num || + this.type === types$1.string || + this.type === types$1.bracketL || + this.type.keyword + ) + }; + + pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); } - if (!method.key) { this.parsePropertyName(method); } + }; + + pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + // Check key and flags var key = method.key; - var allowsDirectSuper = false; - if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || - key.type === "Literal" && key.value === "constructor")) { - if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (method.kind === "constructor") { if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } - method.kind = "constructor"; - allowsDirectSuper = constructorAllowsSuper; - } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + } else if (method.static && checkKeyName(method, "prototype")) { this.raise(key.start, "Classes may not have a static property named prototype"); } - this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); - if (method.kind === "get" && method.value.params.length !== 0) - { this.raiseRecoverable(method.value.start, "getter should have no params"); } - if (method.kind === "set" && method.value.params.length !== 1) - { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } - if (method.kind === "set" && method.value.params[0].type === "RestElement") - { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } - return method - }; - pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + // Parse value + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + + // Check value + if (method.kind === "get" && value.params.length !== 0) + { this.raiseRecoverable(value.start, "getter should have no params"); } + if (method.kind === "set" && value.params.length !== 1) + { this.raiseRecoverable(value.start, "setter should have exactly one param"); } + if (method.kind === "set" && value.params[0].type === "RestElement") + { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } + return this.finishNode(method, "MethodDefinition") }; - pp$1.parseClassId = function(node, isStatement) { - if (this.type === types.name) { + pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + + if (this.eat(types$1.eq)) { + // To raise SyntaxError if 'arguments' exists in the initializer. + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + + return this.finishNode(field, "PropertyDefinition") + }; + + pp$8.parseClassStaticBlock = function(node) { + node.body = []; + + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + + return this.finishNode(node, "StaticBlock") + }; + + pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { node.id = this.parseIdent(); if (isStatement) { this.checkLValSimple(node.id, BIND_LEXICAL, false); } @@ -1419,39 +1577,98 @@ } }; - pp$1.parseClassSuper = function(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; + pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; + }; + + pp$8.enterClassBody = function() { + var element = {declared: Object.create(null), used: []}; + this.privateNameStack.push(element); + return element.declared + }; + + pp$8.exitClassBody = function() { + var ref = this.privateNameStack.pop(); + var declared = ref.declared; + var used = ref.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i = 0; i < used.length; ++i) { + var id = used[i]; + if (!hasOwn(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class")); + } + } + } }; + function isPrivateNameConflicted(privateNameMap, element) { + var name = element.key.name; + var curr = privateNameMap[name]; + + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + + // `class { get #a(){}; static set #a(_){} }` is also conflict. + if ( + curr === "iget" && next === "iset" || + curr === "iset" && next === "iget" || + curr === "sget" && next === "sset" || + curr === "sset" && next === "sget" + ) { + privateNameMap[name] = "true"; + return false + } else if (!curr) { + privateNameMap[name] = next; + return false + } else { + return true + } + } + + function checkKeyName(node, name) { + var computed = node.computed; + var key = node.key; + return !computed && ( + key.type === "Identifier" && key.name === name || + key.type === "Literal" && key.value === name + ) + } + // Parses module export declaration. - pp$1.parseExport = function(node, exports) { + pp$8.parseExport = function(node, exports) { this.next(); // export * from '...' - if (this.eat(types.star)) { + if (this.eat(types$1.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { - node.exported = this.parseIdent(true); - this.checkExport(exports, node.exported.name, this.lastTokStart); + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } - if (this.eat(types._default)) { // export default ... + if (this.eat(types$1._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; - if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); - } else if (this.type === types._class) { + } else if (this.type === types$1._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { @@ -1466,14 +1683,14 @@ if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else - { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + { this.checkExport(exports, node.declaration.id, node.declaration.id.start); } node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { @@ -1483,6 +1700,10 @@ this.checkUnreserved(spec.local); // check if export is defined this.checkLocalExport(spec.local); + + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } } node.source = null; @@ -1492,17 +1713,19 @@ return this.finishNode(node, "ExportNamedDeclaration") }; - pp$1.checkExport = function(exports, name, pos) { + pp$8.checkExport = function(exports, name, pos) { if (!exports) { return } - if (has(exports, name)) + if (typeof name !== "string") + { name = name.type === "Identifier" ? name.name : name.value; } + if (hasOwn(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports[name] = true; }; - pp$1.checkPatternExport = function(exports, pat) { + pp$8.checkPatternExport = function(exports, pat) { var type = pat.type; if (type === "Identifier") - { this.checkExport(exports, pat.name, pat.start); } + { this.checkExport(exports, pat, pat.start); } else if (type === "ObjectPattern") { for (var i = 0, list = pat.properties; i < list.length; i += 1) { @@ -1526,7 +1749,7 @@ { this.checkPatternExport(exports, pat.expression); } }; - pp$1.checkVariableExport = function(exports, decls) { + pp$8.checkVariableExport = function(exports, decls) { if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { @@ -1536,7 +1759,7 @@ } }; - pp$1.shouldParseExportStatement = function() { + pp$8.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || @@ -1547,20 +1770,24 @@ // Parses a comma-separated list of module exports. - pp$1.parseExportSpecifiers = function(exports) { + pp$8.parseExportSpecifiers = function(exports) { var nodes = [], first = true; // export { x, y as z } [from '...'] - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node = this.startNode(); - node.local = this.parseIdent(true); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - this.checkExport(exports, node.exported.name, node.exported.start); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); nodes.push(this.finishNode(node, "ExportSpecifier")); } return nodes @@ -1568,16 +1795,16 @@ // Parses import declaration. - pp$1.parseImport = function(node) { + pp$8.parseImport = function(node) { this.next(); // import '...' - if (this.type === types.string) { - node.specifiers = empty; + if (this.type === types$1.string) { + node.specifiers = empty$1; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); - node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration") @@ -1585,17 +1812,17 @@ // Parses a comma-separated list of module imports. - pp$1.parseImportSpecifiers = function() { + pp$8.parseImportSpecifiers = function() { var nodes = [], first = true; - if (this.type === types.name) { + if (this.type === types$1.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); this.checkLValSimple(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types.comma)) { return nodes } + if (!this.eat(types$1.comma)) { return nodes } } - if (this.type === types.star) { + if (this.type === types$1.star) { var node$1 = this.startNode(); this.next(); this.expectContextual("as"); @@ -1604,15 +1831,15 @@ nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node$2 = this.startNode(); - node$2.imported = this.parseIdent(true); + node$2.imported = this.parseModuleExportName(); if (this.eatContextual("as")) { node$2.local = this.parseIdent(); } else { @@ -1625,14 +1852,26 @@ return nodes }; + pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral + } + return this.parseIdent(true) + }; + // Set `ExpressionStatement#directive` property for directive prologues. - pp$1.adaptDirectivePrologue = function(statements) { + pp$8.adaptDirectivePrologue = function(statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; - pp$1.isDirectiveCandidate = function(statement) { + pp$8.isDirectiveCandidate = function(statement) { return ( + this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && @@ -1641,12 +1880,12 @@ ) }; - var pp$2 = Parser.prototype; + var pp$7 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. - pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { case "Identifier": @@ -1727,7 +1966,7 @@ // Convert list of expression atoms to binding list. - pp$2.toAssignableList = function(exprList, isBinding) { + pp$7.toAssignableList = function(exprList, isBinding) { var end = exprList.length; for (var i = 0; i < end; i++) { var elt = exprList[i]; @@ -1743,19 +1982,19 @@ // Parses spread element. - pp$2.parseSpread = function(refDestructuringErrors) { + pp$7.parseSpread = function(refDestructuringErrors) { var node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") }; - pp$2.parseRestBinding = function() { + pp$7.parseRestBinding = function() { var node = this.startNode(); this.next(); // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types.name) + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); @@ -1765,36 +2004,36 @@ // Parses lvalue (assignable) atom. - pp$2.parseBindingAtom = function() { + pp$7.parseBindingAtom = function() { if (this.options.ecmaVersion >= 6) { switch (this.type) { - case types.bracketL: + case types$1.bracketL: var node = this.startNode(); this.next(); - node.elements = this.parseBindingList(types.bracketR, true, true); + node.elements = this.parseBindingList(types$1.bracketR, true, true); return this.finishNode(node, "ArrayPattern") - case types.braceL: + case types$1.braceL: return this.parseObj(true) } } return this.parseIdent() }; - pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var elts = [], first = true; while (!this.eat(close)) { if (first) { first = false; } - else { this.expect(types.comma); } - if (allowEmpty && this.type === types.comma) { + else { this.expect(types$1.comma); } + if (allowEmpty && this.type === types$1.comma) { elts.push(null); } else if (allowTrailingComma && this.afterTrailingComma(close)) { break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { var rest = this.parseRestBinding(); this.parseBindingListItem(rest); elts.push(rest); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } this.expect(close); break } else { @@ -1806,15 +2045,15 @@ return elts }; - pp$2.parseBindingListItem = function(param) { + pp$7.parseBindingListItem = function(param) { return param }; // Parses assignment pattern around given atom if possible. - pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + pp$7.parseMaybeDefault = function(startPos, startLoc, left) { left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); @@ -1885,7 +2124,7 @@ // duplicate argument names. checkClashes is ignored if the provided construct // is an assignment (i.e., bindingType is BIND_NONE). - pp$2.checkLValSimple = function(expr, bindingType, checkClashes) { + pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; var isBind = bindingType !== BIND_NONE; @@ -1898,7 +2137,7 @@ if (bindingType === BIND_LEXICAL && expr.name === "let") { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } if (checkClashes) { - if (has(checkClashes, expr.name)) + if (hasOwn(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } checkClashes[expr.name] = true; } @@ -1923,7 +2162,7 @@ } }; - pp$2.checkLValPattern = function(expr, bindingType, checkClashes) { + pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { @@ -1948,7 +2187,7 @@ } }; - pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { @@ -1970,16 +2209,171 @@ } }; + // The algorithm used to determine whether a regexp can appear at a + + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + + var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; + + var pp$6 = Parser.prototype; + + pp$6.initialContext = function() { + return [types.b_stat] + }; + + pp$6.curContext = function() { + return this.context[this.context.length - 1] + }; + + pp$6.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types.f_expr || parent === types.f_stat) + { return true } + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) + { return true } + if (prevType === types$1.braceL) + { return parent === types.b_stat } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) + { return false } + return !this.exprAllowed + }; + + pp$6.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } + } + return false + }; + + pp$6.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$1.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; + + // Used to handle egde cases when token context could not be inferred correctly during tokenization phase + + pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } + }; + + // Token-specific context update code + + types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + + types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; + }; + + types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); + this.exprAllowed = true; + }; + + types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; + }; + + types$1.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; + + types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && + !(prevType === types$1.semi && this.curContext() !== types.p_stat) && + !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) + { this.context.push(types.f_expr); } + else + { this.context.push(types.f_stat); } + this.exprAllowed = false; + }; + + types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types.q_tmpl); } + this.exprAllowed = false; + }; + + types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index = this.context.length - 1; + if (this.context[index] === types.f_expr) + { this.context[index] = types.f_expr_gen; } + else + { this.context[index] = types.f_gen; } + } + this.exprAllowed = true; + }; + + types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; + }; + // A recursive descent parser operates by defining functions for all - var pp$3 = Parser.prototype; + var pp$5 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. - pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) @@ -1996,10 +2390,12 @@ if (name === "__proto__" && kind === "init") { if (propHash.proto) { if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) - { refDestructuringErrors.doubleProto = key.start; } - // Backwards-compat kludge. Can be removed in version 6.0 - } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } } propHash.proto = true; } @@ -2041,13 +2437,13 @@ // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). - pp$3.parseExpression = function(noIn, refDestructuringErrors) { + pp$5.parseExpression = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); - if (this.type === types.comma) { + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; - while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } + while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr @@ -2056,18 +2452,19 @@ // Parse an assignment expression. This includes applications of // operators like `+=`. - pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { - if (this.inGenerator) { return this.parseYield(noIn) } + if (this.inGenerator) { return this.parseYield(forInit) } // The tokenizer will assume an expression is allowed after // `yield`, but this isn't that kind of yield else { this.exprAllowed = false; } } - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; } else { refDestructuringErrors = new DestructuringErrors; @@ -2075,27 +2472,30 @@ } var startPos = this.start, startLoc = this.startLoc; - if (this.type === types.parenL || this.type === types.name) - { this.potentialArrowAt = this.start; } - var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; - if (this.type === types.eq) + if (this.type === types$1.eq) { left = this.toAssignable(left, false, refDestructuringErrors); } if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - if (this.type === types.eq) + if (this.type === types$1.eq) { this.checkLValPattern(left); } else { this.checkLValSimple(left); } node.left = left; this.next(); - node.right = this.parseMaybeAssign(noIn); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } return this.finishNode(node, "AssignmentExpression") } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } @@ -2107,16 +2507,16 @@ // Parse a ternary conditional (`?:`) operator. - pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprOps(noIn, refDestructuringErrors); + var expr = this.parseExprOps(forInit, refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types.question)) { + if (this.eat(types$1.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; node.consequent = this.parseMaybeAssign(); - this.expect(types.colon); - node.alternate = this.parseMaybeAssign(noIn); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); return this.finishNode(node, "ConditionalExpression") } return expr @@ -2124,11 +2524,11 @@ // Start the precedence parser. - pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + pp$5.parseExprOps = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors, false); + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit) }; // Parse binary operators with the operator precedence parsing @@ -2137,32 +2537,33 @@ // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. - pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { var prec = this.type.binop; - if (prec != null && (!noIn || this.type !== types._in)) { + if (prec != null && (!forInit || this.type !== types$1._in)) { if (prec > minPrec) { - var logical = this.type === types.logicalOR || this.type === types.logicalAND; - var coalesce = this.type === types.coalesce; + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; if (coalesce) { // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types.logicalAND.binop; + prec = types$1.logicalAND.binop; } var op = this.value; this.next(); var startPos = this.start, startLoc = this.startLoc; - var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { + if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) } } return left }; - pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; @@ -2172,26 +2573,33 @@ // Parse unary operators, both prefix and postfix. - pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { var startPos = this.start, startLoc = this.startLoc, expr; - if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { - expr = this.parseAwait(); + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); sawUnary = true; } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types.incDec; + var node = this.startNode(), update = this.type === types$1.incDec; node.operator = this.value; node.prefix = true; this.next(); - node.argument = this.parseMaybeUnary(null, true); + node.argument = this.parseMaybeUnary(null, true, update, forInit); this.checkExpressionErrors(refDestructuringErrors, true); if (update) { this.checkLValSimple(node.argument); } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) + { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } else { sawUnary = true; } expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } + expr = this.parsePrivateIdent(); + // only could be private fields in 'in', such as #x in obj + if (this.type !== types$1._in) { this.unexpected(); } } else { - expr = this.parseExprSubscripts(refDestructuringErrors); + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } while (this.type.postfix && !this.canInsertSemicolon()) { var node$1 = this.startNodeAt(startPos, startLoc); @@ -2204,20 +2612,31 @@ } } - if (!sawUnary && this.eat(types.starstar)) - { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } - else - { return expr } + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) + { this.unexpected(this.lastTokStart); } + else + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) } + } else { + return expr + } }; + function isPrivateFieldAccess(node) { + return ( + node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || + node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) + ) + } + // Parse call, dot, and `[]`-subscript expressions. - pp$3.parseExprSubscripts = function(refDestructuringErrors) { + pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors); + var expr = this.parseExprAtom(refDestructuringErrors, forInit); if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { return expr } - var result = this.parseSubscripts(expr, startPos, startLoc); + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); if (refDestructuringErrors && result.type === "MemberExpression") { if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } @@ -2226,14 +2645,14 @@ return result }; - pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; var optionalChained = false; while (true) { - var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained); + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); if (element.optional) { optionalChained = true; } if (element === base || element.type === "ArrowFunctionExpression") { @@ -2249,29 +2668,35 @@ } }; - pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) { + pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types.questionDot); + var optional = optionalSupported && this.eat(types$1.questionDot); if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - var computed = this.eat(types.bracketL); - if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { + var computed = this.eat(types$1.bracketL); + if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; - node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } node.computed = !!computed; - if (computed) { this.expect(types.bracketR); } if (optionalSupported) { node.optional = optional; } base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types.parenL)) { + } else if (!noCalls && this.eat(types$1.parenL)) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) @@ -2279,7 +2704,7 @@ this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; @@ -2292,7 +2717,7 @@ node$1.optional = optional; } base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types.backQuote) { + } else if (this.type === types$1.backQuote) { if (optional || optionalChained) { this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } @@ -2309,19 +2734,19 @@ // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. - pp$3.parseExprAtom = function(refDestructuringErrors) { + pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types.slash) { this.readRegexp(); } + if (this.type === types$1.slash) { this.readRegexp(); } var node, canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { - case types._super: + case types$1._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } node = this.startNode(); this.next(); - if (this.type === types.parenL && !this.allowDirectSuper) + if (this.type === types$1.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); } // The `super` keyword can appear at below: // SuperProperty: @@ -2329,50 +2754,53 @@ // super . IdentifierName // SuperCall: // super ( Arguments ) - if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { this.unexpected(); } return this.finishNode(node, "Super") - case types._this: + case types$1._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression") - case types.name: + case types$1.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) - { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) + } if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types.arrow)) - { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + if (this.eat(types$1.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && + (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types.arrow)) + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { this.unexpected(); } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) } } return id - case types.regexp: + case types$1.regexp: var value = this.value; node = this.parseLiteral(value.value); node.regex = {pattern: value.pattern, flags: value.flags}; return node - case types.num: case types.string: + case types$1.num: case types$1.string: return this.parseLiteral(this.value) - case types._null: case types._true: case types._false: + case types$1._null: case types$1._true: case types$1._false: node = this.startNode(); - node.value = this.type === types._null ? null : this.type === types._true; + node.value = this.type === types$1._null ? null : this.type === types$1._true; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal") - case types.parenL: - var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + case types$1.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { refDestructuringErrors.parenthesizedAssign = start; } @@ -2381,30 +2809,31 @@ } return expr - case types.bracketL: + case types$1.bracketL: node = this.startNode(); this.next(); - node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") - case types.braceL: + case types$1.braceL: + this.overrideContext(types.b_expr); return this.parseObj(false, refDestructuringErrors) - case types._function: + case types$1._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0) - case types._class: + case types$1._class: return this.parseClass(this.startNode(), false) - case types._new: + case types$1._new: return this.parseNew() - case types.backQuote: + case types$1.backQuote: return this.parseTemplate() - case types._import: + case types$1._import: if (this.options.ecmaVersion >= 11) { return this.parseExprImport() } else { @@ -2416,7 +2845,7 @@ } }; - pp$3.parseExprImport = function() { + pp$5.parseExprImport = function() { var node = this.startNode(); // Consume `import` as an identifier for `import.meta`. @@ -2425,9 +2854,9 @@ var meta = this.parseIdent(true); switch (this.type) { - case types.parenL: + case types$1.parenL: return this.parseDynamicImport(node) - case types.dot: + case types$1.dot: node.meta = meta; return this.parseImportMeta(node) default: @@ -2435,16 +2864,16 @@ } }; - pp$3.parseDynamicImport = function(node) { + pp$5.parseDynamicImport = function(node) { this.next(); // skip `(` // Parse node.source. node.source = this.parseMaybeAssign(); // Verify ending. - if (!this.eat(types.parenR)) { + if (!this.eat(types$1.parenR)) { var errorPos = this.start; - if (this.eat(types.comma) && this.eat(types.parenR)) { + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); } else { this.unexpected(errorPos); @@ -2454,7 +2883,7 @@ return this.finishNode(node, "ImportExpression") }; - pp$3.parseImportMeta = function(node) { + pp$5.parseImportMeta = function(node) { this.next(); // skip `.` var containsEsc = this.containsEsc; @@ -2470,7 +2899,7 @@ return this.finishNode(node, "MetaProperty") }; - pp$3.parseLiteral = function(value) { + pp$5.parseLiteral = function(value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); @@ -2479,14 +2908,14 @@ return this.finishNode(node, "Literal") }; - pp$3.parseParenExpression = function() { - this.expect(types.parenL); + pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); var val = this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.parenR); return val }; - pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); @@ -2497,29 +2926,29 @@ this.yieldPos = 0; this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types.parenR) { - first ? first = false : this.expect(types.comma); - if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { lastIsComma = true; break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { spreadStart = this.start; exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } break } else { exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } - var innerEndPos = this.start, innerEndLoc = this.startLoc; - this.expect(types.parenR); + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList) + return this.parseParenArrowList(startPos, startLoc, exprList, forInit) } if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } @@ -2548,12 +2977,12 @@ } }; - pp$3.parseParenItem = function(item) { + pp$5.parseParenItem = function(item) { return item }; - pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) + pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) }; // New's precedence is slightly tricky. It must allow its argument to @@ -2562,13 +2991,13 @@ // argument to parseSubscripts to prevent it from consuming the // argument list. - var empty$1 = []; + var empty = []; - pp$3.parseNew = function() { + pp$5.parseNew = function() { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } var node = this.startNode(); var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); @@ -2576,27 +3005,27 @@ { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } if (containsEsc) { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } - if (!this.inNonArrowFunction) - { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); } + if (!this.allowNewDotTarget) + { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); if (isImport && node.callee.type === "ImportExpression") { this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty$1; } + if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty; } return this.finishNode(node, "NewExpression") }; // Parse template expression. - pp$3.parseTemplateElement = function(ref) { + pp$5.parseTemplateElement = function(ref) { var isTagged = ref.isTagged; var elem = this.startNode(); - if (this.type === types.invalidTemplate) { + if (this.type === types$1.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } @@ -2611,11 +3040,11 @@ }; } this.next(); - elem.tail = this.type === types.backQuote; + elem.tail = this.type === types$1.backQuote; return this.finishNode(elem, "TemplateElement") }; - pp$3.parseTemplate = function(ref) { + pp$5.parseTemplate = function(ref) { if ( ref === void 0 ) ref = {}; var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; @@ -2625,32 +3054,32 @@ var curElt = this.parseTemplateElement({isTagged: isTagged}); node.quasis = [curElt]; while (!curElt.tail) { - if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types.dollarBraceL); + if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types$1.dollarBraceL); node.expressions.push(this.parseExpression()); - this.expect(types.braceR); + this.expect(types$1.braceR); node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); } this.next(); return this.finishNode(node, "TemplateLiteral") }; - pp$3.isAsyncProp = function(prop) { + pp$5.isAsyncProp = function(prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; // Parse an object literal or binding pattern. - pp$3.parseObj = function(isPattern, refDestructuringErrors) { + pp$5.parseObj = function(isPattern, refDestructuringErrors) { var node = this.startNode(), first = true, propHash = {}; node.properties = []; this.next(); - while (!this.eat(types.braceR)) { + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var prop = this.parseProperty(isPattern, refDestructuringErrors); @@ -2660,29 +3089,20 @@ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") }; - pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + pp$5.parseProperty = function(isPattern, refDestructuringErrors) { var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); - if (this.type === types.comma) { + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } return this.finishNode(prop, "RestElement") } - // To disallow parenthesized identifier via `this.toAssignable()`. - if (this.type === types.parenL && refDestructuringErrors) { - if (refDestructuringErrors.parenthesizedAssign < 0) { - refDestructuringErrors.parenthesizedAssign = this.start; - } - if (refDestructuringErrors.parenthesizedBind < 0) { - refDestructuringErrors.parenthesizedBind = this.start; - } - } // Parse argument. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } // Finish @@ -2696,14 +3116,14 @@ startLoc = this.startLoc; } if (!isPattern) - { isGenerator = this.eat(types.star); } + { isGenerator = this.eat(types$1.star); } } var containsEsc = this.containsEsc; this.parsePropertyName(prop); if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); - this.parsePropertyName(prop, refDestructuringErrors); + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); + this.parsePropertyName(prop); } else { isAsync = false; } @@ -2711,14 +3131,14 @@ return this.finishNode(prop, "Property") }; - pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types.colon) + pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { this.unexpected(); } - if (this.eat(types.colon)) { + if (this.eat(types$1.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { if (isPattern) { this.unexpected(); } prop.kind = "init"; prop.method = true; @@ -2726,7 +3146,7 @@ } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { + (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { if (isGenerator || isAsync) { this.unexpected(); } prop.kind = prop.key.name; this.parsePropertyName(prop); @@ -2750,7 +3170,7 @@ prop.kind = "init"; if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else if (this.type === types.eq && refDestructuringErrors) { + } else if (this.type === types$1.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); @@ -2761,23 +3181,23 @@ } else { this.unexpected(); } }; - pp$3.parsePropertyName = function(prop) { + pp$5.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { - if (this.eat(types.bracketL)) { + if (this.eat(types$1.bracketL)) { prop.computed = true; prop.key = this.parseMaybeAssign(); - this.expect(types.bracketR); + this.expect(types$1.bracketR); return prop.key } else { prop.computed = false; } } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. - pp$3.initFunction = function(node) { + pp$5.initFunction = function(node) { node.id = null; if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } if (this.options.ecmaVersion >= 8) { node.async = false; } @@ -2785,7 +3205,7 @@ // Parse object or class method. - pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); @@ -2799,10 +3219,10 @@ this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true); + this.parseFunctionBody(node, false, true, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; @@ -2812,7 +3232,7 @@ // Parse arrow function expression with given parameters. - pp$3.parseArrowExpression = function(node, params, isAsync) { + pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); @@ -2824,7 +3244,7 @@ this.awaitIdentPos = 0; node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false); + this.parseFunctionBody(node, true, false, forInit); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; @@ -2834,12 +3254,12 @@ // Parse function body and check parameters. - pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { - var isExpression = isArrowFunction && this.type !== types.braceL; + pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; var oldStrict = this.strict, useStrict = false; if (isExpression) { - node.body = this.parseMaybeAssign(); + node.body = this.parseMaybeAssign(forInit); node.expression = true; this.checkParams(node, false); } else { @@ -2871,7 +3291,7 @@ this.exitScope(); }; - pp$3.isSimpleParamList = function(params) { + pp$5.isSimpleParamList = function(params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; @@ -2884,7 +3304,7 @@ // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. - pp$3.checkParams = function(node, allowDuplicates) { + pp$5.checkParams = function(node, allowDuplicates) { var nameHash = Object.create(null); for (var i = 0, list = node.params; i < list.length; i += 1) { @@ -2900,20 +3320,20 @@ // nothing in between them to be parsed as `null` (which is needed // for array literals). - pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var elts = [], first = true; while (!this.eat(close)) { if (!first) { - this.expect(types.comma); + this.expect(types$1.comma); if (allowTrailingComma && this.afterTrailingComma(close)) { break } } else { first = false; } var elt = (void 0); - if (allowEmpty && this.type === types.comma) + if (allowEmpty && this.type === types$1.comma) { elt = null; } - else if (this.type === types.ellipsis) { + else if (this.type === types$1.ellipsis) { elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } } else { elt = this.parseMaybeAssign(false, refDestructuringErrors); @@ -2923,7 +3343,7 @@ return elts }; - pp$3.checkUnreserved = function(ref) { + pp$5.checkUnreserved = function(ref) { var start = ref.start; var end = ref.end; var name = ref.name; @@ -2932,6 +3352,10 @@ { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } if (this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.currentThisScope().inClassFieldInit && name === "arguments") + { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } + if (this.inClassStaticBlock && (name === "arguments" || name === "await")) + { this.raise(start, ("Cannot use " + name + " in class static initialization block")); } if (this.keywords.test(name)) { this.raise(start, ("Unexpected keyword '" + name + "'")); } if (this.options.ecmaVersion < 6 && @@ -2948,9 +3372,9 @@ // when parsing properties), it will also convert keywords into // identifiers. - pp$3.parseIdent = function(liberal, isBinding) { + pp$5.parseIdent = function(liberal) { var node = this.startNode(); - if (this.type === types.name) { + if (this.type === types$1.name) { node.name = this.value; } else if (this.type.keyword) { node.name = this.type.keyword; @@ -2976,29 +3400,49 @@ return node }; + pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + + // For validating existence + if (this.privateNameStack.length === 0) { + this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class")); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + + return node + }; + // Parses yield expression inside generator. - pp$3.parseYield = function(noIn) { + pp$5.parseYield = function(forInit) { if (!this.yieldPos) { this.yieldPos = this.start; } var node = this.startNode(); this.next(); - if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { node.delegate = false; node.argument = null; } else { - node.delegate = this.eat(types.star); - node.argument = this.parseMaybeAssign(noIn); + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); } return this.finishNode(node, "YieldExpression") }; - pp$3.parseAwait = function() { + pp$5.parseAwait = function(forInit) { if (!this.awaitPos) { this.awaitPos = this.start; } var node = this.startNode(); this.next(); - node.argument = this.parseMaybeUnary(null, true); + node.argument = this.parseMaybeUnary(null, true, false, forInit); return this.finishNode(node, "AwaitExpression") }; @@ -3026,7 +3470,7 @@ } }; - var pp$5 = Parser.prototype; + var pp$3 = Parser.prototype; var Scope = function Scope(flags) { this.flags = flags; @@ -3036,26 +3480,28 @@ this.lexical = []; // A list of lexically-declared FunctionDeclaration names in the current lexical scope this.functions = []; + // A switch to disallow the identifier reference 'arguments' + this.inClassFieldInit = false; }; // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. - pp$5.enterScope = function(flags) { + pp$3.enterScope = function(flags) { this.scopeStack.push(new Scope(flags)); }; - pp$5.exitScope = function() { + pp$3.exitScope = function() { this.scopeStack.pop(); }; // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. - pp$5.treatFunctionsAsVarInScope = function(scope) { + pp$3.treatFunctionsAsVarInScope = function(scope) { return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; - pp$5.declareName = function(name, bindingType, pos) { + pp$3.declareName = function(name, bindingType, pos) { var redeclared = false; if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); @@ -3090,7 +3536,7 @@ if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; - pp$5.checkLocalExport = function(id) { + pp$3.checkLocalExport = function(id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { @@ -3098,11 +3544,11 @@ } }; - pp$5.currentScope = function() { + pp$3.currentScope = function() { return this.scopeStack[this.scopeStack.length - 1] }; - pp$5.currentVarScope = function() { + pp$3.currentVarScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR) { return scope } @@ -3110,7 +3556,7 @@ }; // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. - pp$5.currentThisScope = function() { + pp$3.currentThisScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } @@ -3131,13 +3577,13 @@ // Start an AST node, attaching a start offset. - var pp$6 = Parser.prototype; + var pp$2 = Parser.prototype; - pp$6.startNode = function() { + pp$2.startNode = function() { return new Node(this, this.start, this.startLoc) }; - pp$6.startNodeAt = function(pos, loc) { + pp$2.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) }; @@ -3153,167 +3599,24 @@ return node } - pp$6.finishNode = function(node, type) { + pp$2.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) }; // Finish node at given position - pp$6.finishNodeAt = function(node, type, pos, loc) { + pp$2.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) }; - pp$6.copyNode = function(node) { + pp$2.copyNode = function(node) { var newNode = new Node(this, node.start, this.startLoc); for (var prop in node) { newNode[prop] = node[prop]; } return newNode }; - // The algorithm used to determine whether a regexp can appear at a - - var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; - }; - - var types$1 = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", false), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), - f_stat: new TokContext("function", false), - f_expr: new TokContext("function", true), - f_expr_gen: new TokContext("function", true, false, null, true), - f_gen: new TokContext("function", false, false, null, true) - }; - - var pp$7 = Parser.prototype; - - pp$7.initialContext = function() { - return [types$1.b_stat] - }; - - pp$7.braceIsBlock = function(prevType) { - var parent = this.curContext(); - if (parent === types$1.f_expr || parent === types$1.f_stat) - { return true } - if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) - { return !parent.isExpr } - - // The check for `tt.name && exprAllowed` detects whether we are - // after a `yield` or `of` construct. See the `updateContext` for - // `tt.name`. - if (prevType === types._return || prevType === types.name && this.exprAllowed) - { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) - { return true } - if (prevType === types.braceL) - { return parent === types$1.b_stat } - if (prevType === types._var || prevType === types._const || prevType === types.name) - { return false } - return !this.exprAllowed - }; - - pp$7.inGeneratorContext = function() { - for (var i = this.context.length - 1; i >= 1; i--) { - var context = this.context[i]; - if (context.token === "function") - { return context.generator } - } - return false - }; - - pp$7.updateContext = function(prevType) { - var update, type = this.type; - if (type.keyword && prevType === types.dot) - { this.exprAllowed = false; } - else if (update = type.updateContext) - { update.call(this, prevType); } - else - { this.exprAllowed = type.beforeExpr; } - }; - - // Token-specific context update code - - types.parenR.updateContext = types.braceR.updateContext = function() { - if (this.context.length === 1) { - this.exprAllowed = true; - return - } - var out = this.context.pop(); - if (out === types$1.b_stat && this.curContext().token === "function") { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; - }; - - types.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); - this.exprAllowed = true; - }; - - types.dollarBraceL.updateContext = function() { - this.context.push(types$1.b_tmpl); - this.exprAllowed = true; - }; - - types.parenL.updateContext = function(prevType) { - var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); - this.exprAllowed = true; - }; - - types.incDec.updateContext = function() { - // tokExprAllowed stays unchanged - }; - - types._function.updateContext = types._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types._else && - !(prevType === types.semi && this.curContext() !== types$1.p_stat) && - !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) - { this.context.push(types$1.f_expr); } - else - { this.context.push(types$1.f_stat); } - this.exprAllowed = false; - }; - - types.backQuote.updateContext = function() { - if (this.curContext() === types$1.q_tmpl) - { this.context.pop(); } - else - { this.context.push(types$1.q_tmpl); } - this.exprAllowed = false; - }; - - types.star.updateContext = function(prevType) { - if (prevType === types._function) { - var index = this.context.length - 1; - if (this.context[index] === types$1.f_expr) - { this.context[index] = types$1.f_expr_gen; } - else - { this.context[index] = types$1.f_gen; } - } - this.exprAllowed = true; - }; - - types.name.updateContext = function(prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { - if (this.value === "of" && !this.exprAllowed || - this.value === "yield" && this.inGeneratorContext()) - { allowed = true; } - } - this.exprAllowed = allowed; - }; - - // This file contains Unicode properties extracted from the ECMAScript - // specification. The lists are extracted like so: + // This file contains Unicode properties extracted from the ECMAScript specification. + // The lists are extracted like so: // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) // #table-binary-unicode-properties @@ -3321,26 +3624,36 @@ var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties = ecma12BinaryProperties; + var ecma14BinaryProperties = ecma13BinaryProperties; + var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties }; // #table-unicode-general-category-values var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values - var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"; + var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, - 12: ecma12ScriptValues + 12: ecma12ScriptValues, + 13: ecma13ScriptValues, + 14: ecma14ScriptValues }; var data = {}; @@ -3358,17 +3671,19 @@ d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } - buildUnicodeData(9); - buildUnicodeData(10); - buildUnicodeData(11); - buildUnicodeData(12); - var pp$8 = Parser.prototype; + for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { + var ecmaVersion = list[i]; + + buildUnicodeData(ecmaVersion); + } + + var pp$1 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; - this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion]; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -3459,19 +3774,13 @@ return false }; - function codePointToString(ch) { - if (ch <= 0xFFFF) { return String.fromCharCode(ch) } - ch -= 0x10000; - return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) - } - /** * Validate the flags part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ - pp$8.validateRegExpFlags = function(state) { + pp$1.validateRegExpFlags = function(state) { var validFlags = state.validFlags; var flags = state.flags; @@ -3492,7 +3801,7 @@ * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ - pp$8.validateRegExpPattern = function(state) { + pp$1.validateRegExpPattern = function(state) { this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of @@ -3507,7 +3816,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern - pp$8.regexp_pattern = function(state) { + pp$1.regexp_pattern = function(state) { state.pos = 0; state.lastIntValue = 0; state.lastStringValue = ""; @@ -3541,7 +3850,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction - pp$8.regexp_disjunction = function(state) { + pp$1.regexp_disjunction = function(state) { this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { this.regexp_alternative(state); @@ -3557,13 +3866,13 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative - pp$8.regexp_alternative = function(state) { + pp$1.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term - pp$8.regexp_eatTerm = function(state) { + pp$1.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion @@ -3586,7 +3895,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion - pp$8.regexp_eatAssertion = function(state) { + pp$1.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; @@ -3624,7 +3933,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier - pp$8.regexp_eatQuantifier = function(state, noError) { + pp$1.regexp_eatQuantifier = function(state, noError) { if ( noError === void 0 ) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { @@ -3635,7 +3944,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix - pp$8.regexp_eatQuantifierPrefix = function(state, noError) { + pp$1.regexp_eatQuantifierPrefix = function(state, noError) { return ( state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || @@ -3643,7 +3952,7 @@ this.regexp_eatBracedQuantifier(state, noError) ) }; - pp$8.regexp_eatBracedQuantifier = function(state, noError) { + pp$1.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(0x7B /* { */)) { var min = 0, max = -1; @@ -3669,7 +3978,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom - pp$8.regexp_eatAtom = function(state) { + pp$1.regexp_eatAtom = function(state) { return ( this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || @@ -3679,7 +3988,7 @@ this.regexp_eatCapturingGroup(state) ) }; - pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { + pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { @@ -3689,7 +3998,7 @@ } return false }; - pp$8.regexp_eatUncapturingGroup = function(state) { + pp$1.regexp_eatUncapturingGroup = function(state) { var start = state.pos; if (state.eat(0x28 /* ( */)) { if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { @@ -3703,7 +4012,7 @@ } return false }; - pp$8.regexp_eatCapturingGroup = function(state) { + pp$1.regexp_eatCapturingGroup = function(state) { if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); @@ -3721,7 +4030,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom - pp$8.regexp_eatExtendedAtom = function(state) { + pp$1.regexp_eatExtendedAtom = function(state) { return ( state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || @@ -3734,7 +4043,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier - pp$8.regexp_eatInvalidBracedQuantifier = function(state) { + pp$1.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } @@ -3742,7 +4051,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter - pp$8.regexp_eatSyntaxCharacter = function(state) { + pp$1.regexp_eatSyntaxCharacter = function(state) { var ch = state.current(); if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; @@ -3764,7 +4073,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. - pp$8.regexp_eatPatternCharacters = function(state) { + pp$1.regexp_eatPatternCharacters = function(state) { var start = state.pos; var ch = 0; while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { @@ -3774,7 +4083,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter - pp$8.regexp_eatExtendedPatternCharacter = function(state) { + pp$1.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if ( ch !== -1 && @@ -3795,7 +4104,7 @@ // GroupSpecifier :: // [empty] // `?` GroupName - pp$8.regexp_groupSpecifier = function(state) { + pp$1.regexp_groupSpecifier = function(state) { if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { @@ -3811,7 +4120,7 @@ // GroupName :: // `<` RegExpIdentifierName `>` // Note: this updates `state.lastStringValue` property with the eaten name. - pp$8.regexp_eatGroupName = function(state) { + pp$1.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(0x3C /* < */)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { @@ -3826,7 +4135,7 @@ // RegExpIdentifierStart // RegExpIdentifierName RegExpIdentifierPart // Note: this updates `state.lastStringValue` property with the eaten name. - pp$8.regexp_eatRegExpIdentifierName = function(state) { + pp$1.regexp_eatRegExpIdentifierName = function(state) { state.lastStringValue = ""; if (this.regexp_eatRegExpIdentifierStart(state)) { state.lastStringValue += codePointToString(state.lastIntValue); @@ -3843,7 +4152,7 @@ // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] - pp$8.regexp_eatRegExpIdentifierStart = function(state) { + pp$1.regexp_eatRegExpIdentifierStart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -3871,7 +4180,7 @@ // `\` RegExpUnicodeEscapeSequence[+U] // // - pp$8.regexp_eatRegExpIdentifierPart = function(state) { + pp$1.regexp_eatRegExpIdentifierPart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -3893,7 +4202,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape - pp$8.regexp_eatAtomEscape = function(state) { + pp$1.regexp_eatAtomEscape = function(state) { if ( this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || @@ -3911,7 +4220,7 @@ } return false }; - pp$8.regexp_eatBackReference = function(state) { + pp$1.regexp_eatBackReference = function(state) { var start = state.pos; if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; @@ -3929,7 +4238,7 @@ } return false }; - pp$8.regexp_eatKGroupName = function(state) { + pp$1.regexp_eatKGroupName = function(state) { if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); @@ -3941,7 +4250,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape - pp$8.regexp_eatCharacterEscape = function(state) { + pp$1.regexp_eatCharacterEscape = function(state) { return ( this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || @@ -3952,7 +4261,7 @@ this.regexp_eatIdentityEscape(state) ) }; - pp$8.regexp_eatCControlLetter = function(state) { + pp$1.regexp_eatCControlLetter = function(state) { var start = state.pos; if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { @@ -3962,7 +4271,7 @@ } return false }; - pp$8.regexp_eatZero = function(state) { + pp$1.regexp_eatZero = function(state) { if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); @@ -3972,7 +4281,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape - pp$8.regexp_eatControlEscape = function(state) { + pp$1.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 0x74 /* t */) { state.lastIntValue = 0x09; /* \t */ @@ -4003,7 +4312,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter - pp$8.regexp_eatControlLetter = function(state) { + pp$1.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; @@ -4020,7 +4329,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence - pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { if ( forceU === void 0 ) forceU = false; var start = state.pos; @@ -4065,7 +4374,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape - pp$8.regexp_eatIdentityEscape = function(state) { + pp$1.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true @@ -4088,7 +4397,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape - pp$8.regexp_eatDecimalEscape = function(state) { + pp$1.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { @@ -4102,7 +4411,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape - pp$8.regexp_eatCharacterClassEscape = function(state) { + pp$1.regexp_eatCharacterClassEscape = function(state) { var ch = state.current(); if (isCharacterClassEscape(ch)) { @@ -4144,7 +4453,7 @@ // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue - pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue @@ -4166,20 +4475,20 @@ } return false }; - pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!has(state.unicodeProperties.nonBinary, name)) + pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; - pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } }; // UnicodePropertyName :: // UnicodePropertyNameCharacters - pp$8.regexp_eatUnicodePropertyName = function(state) { + pp$1.regexp_eatUnicodePropertyName = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyNameCharacter(ch = state.current())) { @@ -4194,7 +4503,7 @@ // UnicodePropertyValue :: // UnicodePropertyValueCharacters - pp$8.regexp_eatUnicodePropertyValue = function(state) { + pp$1.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { @@ -4209,12 +4518,12 @@ // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters - pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass - pp$8.regexp_eatCharacterClass = function(state) { + pp$1.regexp_eatCharacterClass = function(state) { if (state.eat(0x5B /* [ */)) { state.eat(0x5E /* ^ */); this.regexp_classRanges(state); @@ -4230,7 +4539,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash - pp$8.regexp_classRanges = function(state) { + pp$1.regexp_classRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { @@ -4247,7 +4556,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash - pp$8.regexp_eatClassAtom = function(state) { + pp$1.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { @@ -4276,7 +4585,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape - pp$8.regexp_eatClassEscape = function(state) { + pp$1.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(0x62 /* b */)) { @@ -4303,7 +4612,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter - pp$8.regexp_eatClassControlLetter = function(state) { + pp$1.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; @@ -4314,7 +4623,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$8.regexp_eatHexEscapeSequence = function(state) { + pp$1.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { @@ -4329,7 +4638,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits - pp$8.regexp_eatDecimalDigits = function(state) { + pp$1.regexp_eatDecimalDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -4344,7 +4653,7 @@ } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits - pp$8.regexp_eatHexDigits = function(state) { + pp$1.regexp_eatHexDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -4373,7 +4682,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). - pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { + pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; if (this.regexp_eatOctalDigit(state)) { @@ -4392,7 +4701,7 @@ }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit - pp$8.regexp_eatOctalDigit = function(state) { + pp$1.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 0x30; /* 0 */ @@ -4409,7 +4718,7 @@ // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$8.regexp_eatFixedHexDigits = function(state, length) { + pp$1.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i = 0; i < length; ++i) { @@ -4441,11 +4750,11 @@ // ## Tokenizer - var pp$9 = Parser.prototype; + var pp = Parser.prototype; // Move to the next token - pp$9.next = function(ignoreEscapeSequenceInKeyword) { + pp.next = function(ignoreEscapeSequenceInKeyword) { if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } if (this.options.onToken) @@ -4458,21 +4767,21 @@ this.nextToken(); }; - pp$9.getToken = function() { + pp.getToken = function() { this.next(); return new Token(this) }; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") - { pp$9[Symbol.iterator] = function() { - var this$1 = this; + { pp[Symbol.iterator] = function() { + var this$1$1 = this; return { next: function () { - var token = this$1.getToken(); + var token = this$1$1.getToken(); return { - done: token.type === types.eof, + done: token.type === types$1.eof, value: token } } @@ -4482,26 +4791,22 @@ // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). - pp$9.curContext = function() { - return this.context[this.context.length - 1] - }; - // Read a single token, updating the parser object's token-related // properties. - pp$9.nextToken = function() { + pp.nextToken = function() { var curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } this.start = this.pos; if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } if (curContext.override) { return curContext.override(this) } else { this.readToken(this.fullCharCodeAtPos()); } }; - pp$9.readToken = function(code) { + pp.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) @@ -4510,24 +4815,22 @@ return this.getTokenFromCode(code) }; - pp$9.fullCharCodeAtPos = function() { + pp.fullCharCodeAtPos = function() { var code = this.input.charCodeAt(this.pos); - if (code <= 0xd7ff || code >= 0xe000) { return code } + if (code <= 0xd7ff || code >= 0xdc00) { return code } var next = this.input.charCodeAt(this.pos + 1); - return (code << 10) + next - 0x35fdc00 + return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 }; - pp$9.skipBlockComment = function() { + pp.skipBlockComment = function() { var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } this.pos = end + 2; if (this.options.locations) { - lineBreakG.lastIndex = start; - var match; - while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { ++this.curLine; - this.lineStart = match.index + match[0].length; + pos = this.lineStart = nextBreak; } } if (this.options.onComment) @@ -4535,7 +4838,7 @@ startLoc, this.curPosition()); } }; - pp$9.skipLineComment = function(startSkip) { + pp.skipLineComment = function(startSkip) { var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); @@ -4550,7 +4853,7 @@ // Called at the start of the parse and after every token. Skips // whitespace and comments, and. - pp$9.skipSpace = function() { + pp.skipSpace = function() { loop: while (this.pos < this.input.length) { var ch = this.input.charCodeAt(this.pos); switch (ch) { @@ -4595,7 +4898,7 @@ // the token, so that the next one's `start` will point at the // right position. - pp$9.finishToken = function(type, val) { + pp.finishToken = function(type, val) { this.end = this.pos; if (this.options.locations) { this.endLoc = this.curPosition(); } var prevType = this.type; @@ -4614,62 +4917,62 @@ // // All in the name of speed. // - pp$9.readToken_dot = function() { + pp.readToken_dot = function() { var next = this.input.charCodeAt(this.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true) } var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; - return this.finishToken(types.ellipsis) + return this.finishToken(types$1.ellipsis) } else { ++this.pos; - return this.finishToken(types.dot) + return this.finishToken(types$1.dot) } }; - pp$9.readToken_slash = function() { // '/' + pp.readToken_slash = function() { // '/' var next = this.input.charCodeAt(this.pos + 1); if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.slash, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.slash, 1) }; - pp$9.readToken_mult_modulo_exp = function(code) { // '%*' + pp.readToken_mult_modulo_exp = function(code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; - var tokentype = code === 42 ? types.star : types.modulo; + var tokentype = code === 42 ? types$1.star : types$1.modulo; // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; - tokentype = types.starstar; + tokentype = types$1.starstar; next = this.input.charCodeAt(this.pos + 2); } - if (next === 61) { return this.finishOp(types.assign, size + 1) } + if (next === 61) { return this.finishOp(types$1.assign, size + 1) } return this.finishOp(tokentype, size) }; - pp$9.readToken_pipe_amp = function(code) { // '|&' + pp.readToken_pipe_amp = function(code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (this.options.ecmaVersion >= 12) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types.assign, 3) } + if (next2 === 61) { return this.finishOp(types$1.assign, 3) } } - return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) }; - pp$9.readToken_caret = function() { // '^' + pp.readToken_caret = function() { // '^' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.bitwiseXOR, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.bitwiseXOR, 1) }; - pp$9.readToken_plus_min = function(code) { // '+-' + pp.readToken_plus_min = function(code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && @@ -4679,19 +4982,19 @@ this.skipSpace(); return this.nextToken() } - return this.finishOp(types.incDec, 2) + return this.finishOp(types$1.incDec, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) }; - pp$9.readToken_lt_gt = function(code) { // '<>' + pp.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { @@ -4701,39 +5004,53 @@ return this.nextToken() } if (next === 61) { size = 2; } - return this.finishOp(types.relational, size) + return this.finishOp(types$1.relational, size) }; - pp$9.readToken_eq_excl = function(code) { // '=!' + pp.readToken_eq_excl = function(code) { // '=!' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } + if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' this.pos += 2; - return this.finishToken(types.arrow) + return this.finishToken(types$1.arrow) } - return this.finishOp(code === 61 ? types.eq : types.prefix, 1) + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1) }; - pp$9.readToken_question = function() { // '?' + pp.readToken_question = function() { // '?' var ecmaVersion = this.options.ecmaVersion; if (ecmaVersion >= 11) { var next = this.input.charCodeAt(this.pos + 1); if (next === 46) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) } + if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) } } if (next === 63) { if (ecmaVersion >= 12) { var next2$1 = this.input.charCodeAt(this.pos + 2); - if (next2$1 === 61) { return this.finishOp(types.assign, 3) } + if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) } } - return this.finishOp(types.coalesce, 2) + return this.finishOp(types$1.coalesce, 2) + } + } + return this.finishOp(types$1.question, 1) + }; + + pp.readToken_numberSign = function() { // '#' + var ecmaVersion = this.options.ecmaVersion; + var code = 35; // '#' + if (ecmaVersion >= 13) { + ++this.pos; + code = this.fullCharCodeAtPos(); + if (isIdentifierStart(code, true) || code === 92 /* '\' */) { + return this.finishToken(types$1.privateId, this.readWord1()) } } - return this.finishOp(types.question, 1) + + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; - pp$9.getTokenFromCode = function(code) { + pp.getTokenFromCode = function(code) { switch (code) { // The interpretation of a dot depends on whether it is followed // by a digit or another two dots. @@ -4741,20 +5058,20 @@ return this.readToken_dot() // Punctuation tokens. - case 40: ++this.pos; return this.finishToken(types.parenL) - case 41: ++this.pos; return this.finishToken(types.parenR) - case 59: ++this.pos; return this.finishToken(types.semi) - case 44: ++this.pos; return this.finishToken(types.comma) - case 91: ++this.pos; return this.finishToken(types.bracketL) - case 93: ++this.pos; return this.finishToken(types.bracketR) - case 123: ++this.pos; return this.finishToken(types.braceL) - case 125: ++this.pos; return this.finishToken(types.braceR) - case 58: ++this.pos; return this.finishToken(types.colon) + case 40: ++this.pos; return this.finishToken(types$1.parenL) + case 41: ++this.pos; return this.finishToken(types$1.parenR) + case 59: ++this.pos; return this.finishToken(types$1.semi) + case 44: ++this.pos; return this.finishToken(types$1.comma) + case 91: ++this.pos; return this.finishToken(types$1.bracketL) + case 93: ++this.pos; return this.finishToken(types$1.bracketR) + case 123: ++this.pos; return this.finishToken(types$1.braceL) + case 125: ++this.pos; return this.finishToken(types$1.braceR) + case 58: ++this.pos; return this.finishToken(types$1.colon) case 96: // '`' if (this.options.ecmaVersion < 6) { break } ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) case 48: // '0' var next = this.input.charCodeAt(this.pos + 1); @@ -4777,7 +5094,6 @@ // often referred to. `finishOp` simply skips the amount of // characters it is given as second argument, and returns a token // of the type given by its first argument. - case 47: // '/' return this.readToken_slash() @@ -4803,19 +5119,22 @@ return this.readToken_question() case 126: // '~' - return this.finishOp(types.prefix, 1) + return this.finishOp(types$1.prefix, 1) + + case 35: // '#' + return this.readToken_numberSign() } - this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; - pp$9.finishOp = function(type, size) { + pp.finishOp = function(type, size) { var str = this.input.slice(this.pos, this.pos + size); this.pos += size; return this.finishToken(type, str) }; - pp$9.readRegexp = function() { + pp.readRegexp = function() { var escaped, inClass, start = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); } @@ -4850,14 +5169,14 @@ // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral } - return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value}) + return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value}) }; // Read an integer in the given radix. Return null if zero digits // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. - pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { // `len` is used for character escape sequences. In that case, disallow separators. var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined; @@ -4911,7 +5230,7 @@ return BigInt(str.replace(/_/g, "")) } - pp$9.readRadixNumber = function(radix) { + pp.readRadixNumber = function(radix) { var start = this.pos; this.pos += 2; // 0x var val = this.readInt(radix); @@ -4920,12 +5239,12 @@ val = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read an integer, octal integer, or floating-point number. - pp$9.readNumber = function(startsWithDot) { + pp.readNumber = function(startsWithDot) { var start = this.pos; if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); } var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; @@ -4935,7 +5254,7 @@ var val$1 = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val$1) + return this.finishToken(types$1.num, val$1) } if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } if (next === 46 && !octal) { // '.' @@ -4951,12 +5270,12 @@ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } var val = stringToNumber(this.input.slice(start, this.pos), octal); - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read a string value, interpreting backslash-escapes. - pp$9.readCodePoint = function() { + pp.readCodePoint = function() { var ch = this.input.charCodeAt(this.pos), code; if (ch === 123) { // '{' @@ -4971,14 +5290,7 @@ return code }; - function codePointToString$1(code) { - // UTF-16 Decoding - if (code <= 0xFFFF) { return String.fromCharCode(code) } - code -= 0x10000; - return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) - } - - pp$9.readString = function(quote) { + pp.readString = function(quote) { var out = "", chunkStart = ++this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); } @@ -4988,20 +5300,27 @@ out += this.input.slice(chunkStart, this.pos); out += this.readEscapedChar(false); chunkStart = this.pos; + } else if (ch === 0x2028 || ch === 0x2029) { + if (this.options.ecmaVersion < 10) { this.raise(this.start, "Unterminated string constant"); } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } } else { - if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); } + if (isNewLine(ch)) { this.raise(this.start, "Unterminated string constant"); } ++this.pos; } } out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types.string, out) + return this.finishToken(types$1.string, out) }; // Reads template string tokens. var INVALID_TEMPLATE_ESCAPE_ERROR = {}; - pp$9.tryReadTemplateToken = function() { + pp.tryReadTemplateToken = function() { this.inTemplateElement = true; try { this.readTmplToken(); @@ -5016,7 +5335,7 @@ this.inTemplateElement = false; }; - pp$9.invalidStringToken = function(position, message) { + pp.invalidStringToken = function(position, message) { if (this.inTemplateElement && this.options.ecmaVersion >= 9) { throw INVALID_TEMPLATE_ESCAPE_ERROR } else { @@ -5024,23 +5343,23 @@ } }; - pp$9.readTmplToken = function() { + pp.readTmplToken = function() { var out = "", chunkStart = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); } var ch = this.input.charCodeAt(this.pos); if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${' - if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { if (ch === 36) { this.pos += 2; - return this.finishToken(types.dollarBraceL) + return this.finishToken(types$1.dollarBraceL) } else { ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) } } out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types.template, out) + return this.finishToken(types$1.template, out) } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.pos); @@ -5071,7 +5390,7 @@ }; // Reads a template token to search for the end, without validating any escape sequences - pp$9.readInvalidTemplateToken = function() { + pp.readInvalidTemplateToken = function() { for (; this.pos < this.input.length; this.pos++) { switch (this.input[this.pos]) { case "\\": @@ -5082,10 +5401,10 @@ if (this.input[this.pos + 1] !== "{") { break } - // falls through + // falls through case "`": - return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos)) + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)) // no default } @@ -5095,14 +5414,14 @@ // Used to read escaped characters - pp$9.readEscapedChar = function(inTemplate) { + pp.readEscapedChar = function(inTemplate) { var ch = this.input.charCodeAt(++this.pos); ++this.pos; switch (ch) { case 110: return "\n" // 'n' -> '\n' case 114: return "\r" // 'r' -> '\r' case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' - case 117: return codePointToString$1(this.readCodePoint()) // 'u' + case 117: return codePointToString(this.readCodePoint()) // 'u' case 116: return "\t" // 't' -> '\t' case 98: return "\b" // 'b' -> '\b' case 118: return "\u000b" // 'v' -> '\u000b' @@ -5126,8 +5445,6 @@ codePos, "Invalid escape sequence in template string" ); - - return null } default: if (ch >= 48 && ch <= 55) { @@ -5160,7 +5477,7 @@ // Used to read character escape sequences ('\x', '\u', '\U'). - pp$9.readHexChar = function(len) { + pp.readHexChar = function(len) { var codePos = this.pos; var n = this.readInt(16, len); if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); } @@ -5173,7 +5490,7 @@ // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. - pp$9.readWord1 = function() { + pp.readWord1 = function() { this.containsEsc = false; var word = "", first = true, chunkStart = this.pos; var astral = this.options.ecmaVersion >= 6; @@ -5191,7 +5508,7 @@ var esc = this.readCodePoint(); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { this.invalidStringToken(escStart, "Invalid Unicode escape"); } - word += codePointToString$1(esc); + word += codePointToString(esc); chunkStart = this.pos; } else { break @@ -5204,18 +5521,18 @@ // Read an identifier or keyword token. Will check for reserved // words when necessary. - pp$9.readWord = function() { + pp.readWord = function() { var word = this.readWord1(); - var type = types.name; + var type = types$1.name; if (this.keywords.test(word)) { - type = keywords$1[word]; + type = keywords[word]; } return this.finishToken(type, word) }; // Acorn is a tiny, fast JavaScript parser written in JavaScript. - var version = "8.1.0"; + var version = "8.8.2"; Parser.acorn = { Parser: Parser, @@ -5226,10 +5543,10 @@ getLineInfo: getLineInfo, Node: Node, TokenType: TokenType, - tokTypes: types, - keywordTypes: keywords$1, + tokTypes: types$1, + keywordTypes: keywords, TokContext: TokContext, - tokContexts: types$1, + tokContexts: types, isIdentifierChar: isIdentifierChar, isIdentifierStart: isIdentifierStart, Token: Token, @@ -5277,18 +5594,15 @@ exports.isIdentifierChar = isIdentifierChar; exports.isIdentifierStart = isIdentifierStart; exports.isNewLine = isNewLine; - exports.keywordTypes = keywords$1; + exports.keywordTypes = keywords; exports.lineBreak = lineBreak; exports.lineBreakG = lineBreakG; exports.nonASCIIwhitespace = nonASCIIwhitespace; exports.parse = parse; exports.parseExpressionAt = parseExpressionAt; - exports.tokContexts = types$1; - exports.tokTypes = types; + exports.tokContexts = types; + exports.tokTypes = types$1; exports.tokenizer = tokenizer; exports.version = version; - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=acorn.js.map +})); diff --git a/node_modules/acorn/dist/acorn.js.map b/node_modules/acorn/dist/acorn.js.map deleted file mode 100644 index 626f5d68c..000000000 --- a/node_modules/acorn/dist/acorn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"acorn.js","sources":["../src/identifier.js","../src/tokentype.js","../src/whitespace.js","../src/util.js","../src/locutil.js","../src/options.js","../src/scopeflags.js","../src/state.js","../src/parseutil.js","../src/statement.js","../src/lval.js","../src/expression.js","../src/location.js","../src/scope.js","../src/node.js","../src/tokencontext.js","../src/unicode-property-data.js","../src/regexp.js","../src/tokenize.js","../src/index.js"],"sourcesContent":["// Reserved word lists for various dialects of the language\n\nexport const reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n}\n\n// And the keywords\n\nconst ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\"\n\nexport const keywords = {\n 5: ecma5AndLessKeywords,\n \"5module\": ecma5AndLessKeywords + \" export import\",\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n}\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\n// Generated by `bin/generate-identifier-regex.js`.\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\"\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\"\n\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\")\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\")\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null\n\n// These are a run-length and offset encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by bin/generate-identifier-regex.js\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n let pos = 0x10000\n for (let i = 0; i < set.length; i += 2) {\n pos += set[i]\n if (pos > code) return false\n pos += set[i + 1]\n if (pos >= code) return true\n }\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code, astral) {\n if (code < 65) return code === 36\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n","// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nexport class TokenType {\n constructor(label, conf = {}) {\n this.label = label\n this.keyword = conf.keyword\n this.beforeExpr = !!conf.beforeExpr\n this.startsExpr = !!conf.startsExpr\n this.isLoop = !!conf.isLoop\n this.isAssign = !!conf.isAssign\n this.prefix = !!conf.prefix\n this.postfix = !!conf.postfix\n this.binop = conf.binop || null\n this.updateContext = null\n }\n}\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nconst beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}\n\n// Map keyword names to token types.\n\nexport const keywords = {}\n\n// Succinct definitions of keyword token types\nfunction kw(name, options = {}) {\n options.keyword = name\n return keywords[name] = new TokenType(name, options)\n}\n\nexport const types = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"/<=/>=\", 7),\n bitShift: binop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n coalesce: binop(\"??\", 1),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\", startsExpr),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n}\n","// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nexport const lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\")\n\nexport function isNewLine(code, ecma2019String) {\n return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))\n}\n\nexport const nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g\n","const {hasOwnProperty, toString} = Object.prototype\n\n// Checks if an object has a property.\n\nexport function has(obj, propName) {\n return hasOwnProperty.call(obj, propName)\n}\n\nexport const isArray = Array.isArray || ((obj) => (\n toString.call(obj) === \"[object Array]\"\n))\n\nexport function wordsRegexp(words) {\n return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n}\n","import {lineBreakG} from \"./whitespace.js\"\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n constructor(line, col) {\n this.line = line\n this.column = col\n }\n\n offset(n) {\n return new Position(this.line, this.column + n)\n }\n}\n\nexport class SourceLocation {\n constructor(p, start, end) {\n this.start = start\n this.end = end\n if (p.sourceFile !== null) this.source = p.sourceFile\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input, offset) {\n for (let line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n let match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}\n","import {has, isArray} from \"./util.js\"\nimport {SourceLocation} from \"./locutil.js\"\n\n// A second argument must be given to configure the parser process.\n// These options are recognized (only `ecmaVersion` is required):\n\nexport const defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n // (2019), 11 (2020), 12 (2021), or `\"latest\"` (the latest version\n // the library supports). This influences support for strict mode,\n // the set of reserved words, and support for new syntax features.\n ecmaVersion: null,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"` or `\"module\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called\n // when a semicolon is automatically inserted. It will be passed\n // the position of the comma as an offset, and if `locations` is\n // enabled, it is given the location as a `{line, column}` object\n // as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program, and an import.meta expression\n // in a script isn't considered an error.\n allowImportExportEverywhere: false,\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: false,\n // When enabled, hashbang directive in the beginning of file\n // is allowed and treated as a line comment.\n allowHashBang: false,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n}\n\n// Interpret and default an options object\n\nlet warnedAboutEcmaVersion = false\n\nexport function getOptions(opts) {\n let options = {}\n\n for (let opt in defaultOptions)\n options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]\n\n if (options.ecmaVersion === \"latest\") {\n options.ecmaVersion = 1e8\n } else if (options.ecmaVersion == null) {\n if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n warnedAboutEcmaVersion = true\n console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\")\n }\n options.ecmaVersion = 11\n } else if (options.ecmaVersion >= 2015) {\n options.ecmaVersion -= 2009\n }\n\n if (options.allowReserved == null)\n options.allowReserved = options.ecmaVersion < 5\n\n if (isArray(options.onToken)) {\n let tokens = options.onToken\n options.onToken = (token) => tokens.push(token)\n }\n if (isArray(options.onComment))\n options.onComment = pushComment(options, options.onComment)\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n let comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n }\n if (options.locations)\n comment.loc = new SourceLocation(this, startLoc, endLoc)\n if (options.ranges)\n comment.range = [start, end]\n array.push(comment)\n }\n}\n","// Each scope gets a bitset that may contain these flags\nexport const\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128\n\nexport function functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal* and declareName to determine the type of a binding\nexport const\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5 // Special case for function names as bound inside the function\n","import {reservedWords, keywords} from \"./identifier.js\"\nimport {types as tt} from \"./tokentype.js\"\nimport {lineBreak} from \"./whitespace.js\"\nimport {getOptions} from \"./options.js\"\nimport {wordsRegexp} from \"./util.js\"\nimport {SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_SUPER, SCOPE_DIRECT_SUPER} from \"./scopeflags.js\"\n\nexport class Parser {\n constructor(options, input, startPos) {\n this.options = options = getOptions(options)\n this.sourceFile = options.sourceFile\n this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5])\n let reserved = \"\"\n if (options.allowReserved !== true) {\n reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]\n if (options.sourceType === \"module\") reserved += \" await\"\n }\n this.reservedWords = wordsRegexp(reserved)\n let reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict\n this.reservedWordsStrict = wordsRegexp(reservedStrict)\n this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind)\n this.input = String(input)\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length\n } else {\n this.pos = this.lineStart = 0\n this.curLine = 1\n }\n\n // Properties of the current token:\n // Its type\n this.type = tt.eof\n // For tokens that include more information than their type, the value\n this.value = null\n // Its start and end offset\n this.start = this.end = this.pos\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition()\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null\n this.lastTokStart = this.lastTokEnd = this.pos\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext()\n this.exprAllowed = true\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\"\n this.strict = this.inModule || this.strictDirective(this.pos)\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = this.awaitIdentPos = 0\n // Labels in scope.\n this.labels = []\n // Thus-far undefined exports.\n this.undefinedExports = Object.create(null)\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n this.skipLineComment(2)\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = []\n this.enterScope(SCOPE_TOP)\n\n // For RegExp validation\n this.regexpState = null\n }\n\n parse() {\n let node = this.options.program || this.startNode()\n this.nextToken()\n return this.parseTopLevel(node)\n }\n\n get inFunction() { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }\n get inGenerator() { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }\n get inAsync() { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }\n get allowSuper() { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }\n get allowDirectSuper() { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }\n get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()) }\n get inNonArrowFunction() { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }\n\n static extend(...plugins) {\n let cls = this\n for (let i = 0; i < plugins.length; i++) cls = plugins[i](cls)\n return cls\n }\n\n static parse(input, options) {\n return new this(options, input).parse()\n }\n\n static parseExpressionAt(input, pos, options) {\n let parser = new this(options, input, pos)\n parser.nextToken()\n return parser.parseExpression()\n }\n\n static tokenizer(input, options) {\n return new this(options, input)\n }\n}\n","import {types as tt} from \"./tokentype.js\"\nimport {Parser} from \"./state.js\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace.js\"\n\nconst pp = Parser.prototype\n\n// ## Parser utilities\n\nconst literal = /^(?:'((?:\\\\.|[^'\\\\])*?)'|\"((?:\\\\.|[^\"\\\\])*?)\")/\npp.strictDirective = function(start) {\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n let match = literal.exec(this.input.slice(start))\n if (!match) return false\n if ((match[1] || match[2]) === \"use strict\") {\n skipWhiteSpace.lastIndex = start + match[0].length\n let spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length\n let next = this.input.charAt(end)\n return next === \";\" || next === \"}\" ||\n (lineBreak.test(spaceAfter[0]) &&\n !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n }\n start += match[0].length\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n if (this.input[start] === \";\")\n start++\n }\n}\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp.eat = function(type) {\n if (this.type === type) {\n this.next()\n return true\n } else {\n return false\n }\n}\n\n// Tests whether parsed token is a contextual keyword.\n\npp.isContextual = function(name) {\n return this.type === tt.name && this.value === name && !this.containsEsc\n}\n\n// Consumes contextual keyword if possible.\n\npp.eatContextual = function(name) {\n if (!this.isContextual(name)) return false\n this.next()\n return true\n}\n\n// Asserts that following token is given contextual keyword.\n\npp.expectContextual = function(name) {\n if (!this.eatContextual(name)) this.unexpected()\n}\n\n// Test whether a semicolon can be inserted at the current position.\n\npp.canInsertSemicolon = function() {\n return this.type === tt.eof ||\n this.type === tt.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\npp.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc)\n return true\n }\n}\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp.semicolon = function() {\n if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected()\n}\n\npp.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc)\n if (!notNext)\n this.next()\n return true\n }\n}\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp.expect = function(type) {\n this.eat(type) || this.unexpected()\n}\n\n// Raise an unexpected token error.\n\npp.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\")\n}\n\nexport function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1\n}\n\npp.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) return\n if (refDestructuringErrors.trailingComma > -1)\n this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\")\n let parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind\n if (parens > -1) this.raiseRecoverable(parens, \"Parenthesized pattern\")\n}\n\npp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) return false\n let {shorthandAssign, doubleProto} = refDestructuringErrors\n if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0\n if (shorthandAssign >= 0)\n this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\")\n if (doubleProto >= 0)\n this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\")\n}\n\npp.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n this.raise(this.yieldPos, \"Yield expression cannot be a default value\")\n if (this.awaitPos)\n this.raise(this.awaitPos, \"Await expression cannot be a default value\")\n}\n\npp.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n return this.isSimpleAssignTarget(expr.expression)\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n}\n","import {types as tt} from \"./tokentype.js\"\nimport {Parser} from \"./state.js\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace.js\"\nimport {isIdentifierStart, isIdentifierChar, keywordRelationalOperator} from \"./identifier.js\"\nimport {has} from \"./util.js\"\nimport {DestructuringErrors} from \"./parseutil.js\"\nimport {functionFlags, SCOPE_SIMPLE_CATCH, BIND_SIMPLE_CATCH, BIND_LEXICAL, BIND_VAR, BIND_FUNCTION} from \"./scopeflags.js\"\n\nconst pp = Parser.prototype\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp.parseTopLevel = function(node) {\n let exports = Object.create(null)\n if (!node.body) node.body = []\n while (this.type !== tt.eof) {\n let stmt = this.parseStatement(null, true, exports)\n node.body.push(stmt)\n }\n if (this.inModule)\n for (let name of Object.keys(this.undefinedExports))\n this.raiseRecoverable(this.undefinedExports[name].start, `Export '${name}' is not defined`)\n this.adaptDirectivePrologue(node.body)\n this.next()\n node.sourceType = this.options.sourceType\n return this.finishNode(node, \"Program\")\n}\n\nconst loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"}\n\npp.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) return false\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next)\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91) return true // '['\n if (context) return false\n\n if (nextCh === 123) return true // '{'\n if (isIdentifierStart(nextCh, true)) {\n let pos = next + 1\n while (isIdentifierChar(this.input.charCodeAt(pos), true)) ++pos\n let ident = this.input.slice(next, pos)\n if (!keywordRelationalOperator.test(ident)) return true\n }\n return false\n}\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n return false\n\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))\n}\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp.parseStatement = function(context, topLevel, exports) {\n let starttype = this.type, node = this.startNode(), kind\n\n if (this.isLet(context)) {\n starttype = tt._var\n kind = \"let\"\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case tt._debugger: return this.parseDebuggerStatement(node)\n case tt._do: return this.parseDoStatement(node)\n case tt._for: return this.parseForStatement(node)\n case tt._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) this.unexpected()\n return this.parseFunctionStatement(node, false, !context)\n case tt._class:\n if (context) this.unexpected()\n return this.parseClass(node, true)\n case tt._if: return this.parseIfStatement(node)\n case tt._return: return this.parseReturnStatement(node)\n case tt._switch: return this.parseSwitchStatement(node)\n case tt._throw: return this.parseThrowStatement(node)\n case tt._try: return this.parseTryStatement(node)\n case tt._const: case tt._var:\n kind = kind || this.value\n if (context && kind !== \"var\") this.unexpected()\n return this.parseVarStatement(node, kind)\n case tt._while: return this.parseWhileStatement(node)\n case tt._with: return this.parseWithStatement(node)\n case tt.braceL: return this.parseBlock(true, node)\n case tt.semi: return this.parseEmptyStatement(node)\n case tt._export:\n case tt._import:\n if (this.options.ecmaVersion > 10 && starttype === tt._import) {\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next)\n if (nextCh === 40 || nextCh === 46) // '(' or '.'\n return this.parseExpressionStatement(node, this.parseExpression())\n }\n\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n this.raise(this.start, \"'import' and 'export' may only appear at the top level\")\n if (!this.inModule)\n this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\")\n }\n return starttype === tt._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) this.unexpected()\n this.next()\n return this.parseFunctionStatement(node, true, !context)\n }\n\n let maybeName = this.value, expr = this.parseExpression()\n if (starttype === tt.name && expr.type === \"Identifier\" && this.eat(tt.colon))\n return this.parseLabeledStatement(node, maybeName, expr, context)\n else return this.parseExpressionStatement(node, expr)\n }\n}\n\npp.parseBreakContinueStatement = function(node, keyword) {\n let isBreak = keyword === \"break\"\n this.next()\n if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null\n else if (this.type !== tt.name) this.unexpected()\n else {\n node.label = this.parseIdent()\n this.semicolon()\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n let i = 0\n for (; i < this.labels.length; ++i) {\n let lab = this.labels[i]\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break\n if (node.label && isBreak) break\n }\n }\n if (i === this.labels.length) this.raise(node.start, \"Unsyntactic \" + keyword)\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n}\n\npp.parseDebuggerStatement = function(node) {\n this.next()\n this.semicolon()\n return this.finishNode(node, \"DebuggerStatement\")\n}\n\npp.parseDoStatement = function(node) {\n this.next()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"do\")\n this.labels.pop()\n this.expect(tt._while)\n node.test = this.parseParenExpression()\n if (this.options.ecmaVersion >= 6)\n this.eat(tt.semi)\n else\n this.semicolon()\n return this.finishNode(node, \"DoWhileStatement\")\n}\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp.parseForStatement = function(node) {\n this.next()\n let awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual(\"await\")) ? this.lastTokStart : -1\n this.labels.push(loopLabel)\n this.enterScope(0)\n this.expect(tt.parenL)\n if (this.type === tt.semi) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, null)\n }\n let isLet = this.isLet()\n if (this.type === tt._var || this.type === tt._const || isLet) {\n let init = this.startNode(), kind = isLet ? \"let\" : this.value\n this.next()\n this.parseVar(init, true, kind)\n this.finishNode(init, \"VariableDeclaration\")\n if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init.declarations.length === 1) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n return this.parseForIn(node, init)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n }\n let refDestructuringErrors = new DestructuringErrors\n let init = this.parseExpression(true, refDestructuringErrors)\n if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n this.toAssignable(init, false, refDestructuringErrors)\n this.checkLValPattern(init)\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n}\n\npp.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next()\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n}\n\npp.parseIfStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\")\n node.alternate = this.eat(tt._else) ? this.parseStatement(\"if\") : null\n return this.finishNode(node, \"IfStatement\")\n}\n\npp.parseReturnStatement = function(node) {\n if (!this.inFunction && !this.options.allowReturnOutsideFunction)\n this.raise(this.start, \"'return' outside of function\")\n this.next()\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null\n else { node.argument = this.parseExpression(); this.semicolon() }\n return this.finishNode(node, \"ReturnStatement\")\n}\n\npp.parseSwitchStatement = function(node) {\n this.next()\n node.discriminant = this.parseParenExpression()\n node.cases = []\n this.expect(tt.braceL)\n this.labels.push(switchLabel)\n this.enterScope(0)\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n let cur\n for (let sawDefault = false; this.type !== tt.braceR;) {\n if (this.type === tt._case || this.type === tt._default) {\n let isCase = this.type === tt._case\n if (cur) this.finishNode(cur, \"SwitchCase\")\n node.cases.push(cur = this.startNode())\n cur.consequent = []\n this.next()\n if (isCase) {\n cur.test = this.parseExpression()\n } else {\n if (sawDefault) this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\")\n sawDefault = true\n cur.test = null\n }\n this.expect(tt.colon)\n } else {\n if (!cur) this.unexpected()\n cur.consequent.push(this.parseStatement(null))\n }\n }\n this.exitScope()\n if (cur) this.finishNode(cur, \"SwitchCase\")\n this.next() // Closing brace\n this.labels.pop()\n return this.finishNode(node, \"SwitchStatement\")\n}\n\npp.parseThrowStatement = function(node) {\n this.next()\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n this.raise(this.lastTokEnd, \"Illegal newline after throw\")\n node.argument = this.parseExpression()\n this.semicolon()\n return this.finishNode(node, \"ThrowStatement\")\n}\n\n// Reused empty array added for node fields that are always empty.\n\nconst empty = []\n\npp.parseTryStatement = function(node) {\n this.next()\n node.block = this.parseBlock()\n node.handler = null\n if (this.type === tt._catch) {\n let clause = this.startNode()\n this.next()\n if (this.eat(tt.parenL)) {\n clause.param = this.parseBindingAtom()\n let simple = clause.param.type === \"Identifier\"\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0)\n this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL)\n this.expect(tt.parenR)\n } else {\n if (this.options.ecmaVersion < 10) this.unexpected()\n clause.param = null\n this.enterScope(0)\n }\n clause.body = this.parseBlock(false)\n this.exitScope()\n node.handler = this.finishNode(clause, \"CatchClause\")\n }\n node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null\n if (!node.handler && !node.finalizer)\n this.raise(node.start, \"Missing catch or finally clause\")\n return this.finishNode(node, \"TryStatement\")\n}\n\npp.parseVarStatement = function(node, kind) {\n this.next()\n this.parseVar(node, false, kind)\n this.semicolon()\n return this.finishNode(node, \"VariableDeclaration\")\n}\n\npp.parseWhileStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"while\")\n this.labels.pop()\n return this.finishNode(node, \"WhileStatement\")\n}\n\npp.parseWithStatement = function(node) {\n if (this.strict) this.raise(this.start, \"'with' in strict mode\")\n this.next()\n node.object = this.parseParenExpression()\n node.body = this.parseStatement(\"with\")\n return this.finishNode(node, \"WithStatement\")\n}\n\npp.parseEmptyStatement = function(node) {\n this.next()\n return this.finishNode(node, \"EmptyStatement\")\n}\n\npp.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (let label of this.labels)\n if (label.name === maybeName)\n this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\")\n let kind = this.type.isLoop ? \"loop\" : this.type === tt._switch ? \"switch\" : null\n for (let i = this.labels.length - 1; i >= 0; i--) {\n let label = this.labels[i]\n if (label.statementStart === node.start) {\n // Update information about previous labels on this node\n label.statementStart = this.start\n label.kind = kind\n } else break\n }\n this.labels.push({name: maybeName, kind, statementStart: this.start})\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\")\n this.labels.pop()\n node.label = expr\n return this.finishNode(node, \"LabeledStatement\")\n}\n\npp.parseExpressionStatement = function(node, expr) {\n node.expression = expr\n this.semicolon()\n return this.finishNode(node, \"ExpressionStatement\")\n}\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp.parseBlock = function(createNewLexicalScope = true, node = this.startNode(), exitStrict) {\n node.body = []\n this.expect(tt.braceL)\n if (createNewLexicalScope) this.enterScope(0)\n while (this.type !== tt.braceR) {\n let stmt = this.parseStatement(null)\n node.body.push(stmt)\n }\n if (exitStrict) this.strict = false\n this.next()\n if (createNewLexicalScope) this.exitScope()\n return this.finishNode(node, \"BlockStatement\")\n}\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp.parseFor = function(node, init) {\n node.init = init\n this.expect(tt.semi)\n node.test = this.type === tt.semi ? null : this.parseExpression()\n this.expect(tt.semi)\n node.update = this.type === tt.parenR ? null : this.parseExpression()\n this.expect(tt.parenR)\n node.body = this.parseStatement(\"for\")\n this.exitScope()\n this.labels.pop()\n return this.finishNode(node, \"ForStatement\")\n}\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp.parseForIn = function(node, init) {\n const isForIn = this.type === tt._in\n this.next()\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (\n !isForIn ||\n this.options.ecmaVersion < 8 ||\n this.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\"\n )\n ) {\n this.raise(\n init.start,\n `${\n isForIn ? \"for-in\" : \"for-of\"\n } loop variable declaration may not have an initializer`\n )\n }\n node.left = init\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign()\n this.expect(tt.parenR)\n node.body = this.parseStatement(\"for\")\n this.exitScope()\n this.labels.pop()\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n}\n\n// Parse a list of variable declarations.\n\npp.parseVar = function(node, isFor, kind) {\n node.declarations = []\n node.kind = kind\n for (;;) {\n let decl = this.startNode()\n this.parseVarId(decl, kind)\n if (this.eat(tt.eq)) {\n decl.init = this.parseMaybeAssign(isFor)\n } else if (kind === \"const\" && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected()\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === tt._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\")\n } else {\n decl.init = null\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"))\n if (!this.eat(tt.comma)) break\n }\n return node\n}\n\npp.parseVarId = function(decl, kind) {\n decl.id = this.parseBindingAtom()\n this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false)\n}\n\nconst FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4\n\n// Parse a function declaration or literal (depending on the\n// `statement & FUNC_STATEMENT`).\n\n// Remove `allowExpressionBody` for 7.0.0, as it is only called with false\npp.parseFunction = function(node, statement, allowExpressionBody, isAsync) {\n this.initFunction(node)\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === tt.star && (statement & FUNC_HANGING_STATEMENT))\n this.unexpected()\n node.generator = this.eat(tt.star)\n }\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== tt.name ? null : this.parseIdent()\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION)\n }\n\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n this.enterScope(functionFlags(node.async, node.generator))\n\n if (!(statement & FUNC_STATEMENT))\n node.id = this.type === tt.name ? this.parseIdent() : null\n\n this.parseFunctionParams(node)\n this.parseFunctionBody(node, allowExpressionBody, false)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n}\n\npp.parseFunctionParams = function(node) {\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n}\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp.parseClass = function(node, isStatement) {\n this.next()\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n const oldStrict = this.strict\n this.strict = true\n\n this.parseClassId(node, isStatement)\n this.parseClassSuper(node)\n let classBody = this.startNode()\n let hadConstructor = false\n classBody.body = []\n this.expect(tt.braceL)\n while (this.type !== tt.braceR) {\n const element = this.parseClassElement(node.superClass !== null)\n if (element) {\n classBody.body.push(element)\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) this.raise(element.start, \"Duplicate constructor in the same class\")\n hadConstructor = true\n }\n }\n }\n this.strict = oldStrict\n this.next()\n node.body = this.finishNode(classBody, \"ClassBody\")\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n}\n\npp.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(tt.semi)) return null\n\n let method = this.startNode()\n const tryContextual = (k, noLineBreak = false) => {\n const start = this.start, startLoc = this.startLoc\n if (!this.eatContextual(k)) return false\n if (this.type !== tt.parenL && (!noLineBreak || !this.canInsertSemicolon())) return true\n if (method.key) this.unexpected()\n method.computed = false\n method.key = this.startNodeAt(start, startLoc)\n method.key.name = k\n this.finishNode(method.key, \"Identifier\")\n return false\n }\n\n method.kind = \"method\"\n method.static = tryContextual(\"static\")\n let isGenerator = this.eat(tt.star)\n let isAsync = false\n if (!isGenerator) {\n if (this.options.ecmaVersion >= 8 && tryContextual(\"async\", true)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n } else if (tryContextual(\"get\")) {\n method.kind = \"get\"\n } else if (tryContextual(\"set\")) {\n method.kind = \"set\"\n }\n }\n if (!method.key) this.parsePropertyName(method)\n let {key} = method\n let allowsDirectSuper = false\n if (!method.computed && !method.static && (key.type === \"Identifier\" && key.name === \"constructor\" ||\n key.type === \"Literal\" && key.value === \"constructor\")) {\n if (method.kind !== \"method\") this.raise(key.start, \"Constructor can't have get/set modifier\")\n if (isGenerator) this.raise(key.start, \"Constructor can't be a generator\")\n if (isAsync) this.raise(key.start, \"Constructor can't be an async method\")\n method.kind = \"constructor\"\n allowsDirectSuper = constructorAllowsSuper\n } else if (method.static && key.type === \"Identifier\" && key.name === \"prototype\") {\n this.raise(key.start, \"Classes may not have a static property named prototype\")\n }\n this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper)\n if (method.kind === \"get\" && method.value.params.length !== 0)\n this.raiseRecoverable(method.value.start, \"getter should have no params\")\n if (method.kind === \"set\" && method.value.params.length !== 1)\n this.raiseRecoverable(method.value.start, \"setter should have exactly one param\")\n if (method.kind === \"set\" && method.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(method.value.params[0].start, \"Setter cannot use rest params\")\n return method\n}\n\npp.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper)\n return this.finishNode(method, \"MethodDefinition\")\n}\n\npp.parseClassId = function(node, isStatement) {\n if (this.type === tt.name) {\n node.id = this.parseIdent()\n if (isStatement)\n this.checkLValSimple(node.id, BIND_LEXICAL, false)\n } else {\n if (isStatement === true)\n this.unexpected()\n node.id = null\n }\n}\n\npp.parseClassSuper = function(node) {\n node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null\n}\n\n// Parses module export declaration.\n\npp.parseExport = function(node, exports) {\n this.next()\n // export * from '...'\n if (this.eat(tt.star)) {\n if (this.options.ecmaVersion >= 11) {\n if (this.eatContextual(\"as\")) {\n node.exported = this.parseIdent(true)\n this.checkExport(exports, node.exported.name, this.lastTokStart)\n } else {\n node.exported = null\n }\n }\n this.expectContextual(\"from\")\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n this.semicolon()\n return this.finishNode(node, \"ExportAllDeclaration\")\n }\n if (this.eat(tt._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart)\n let isAsync\n if (this.type === tt._function || (isAsync = this.isAsyncFunction())) {\n let fNode = this.startNode()\n this.next()\n if (isAsync) this.next()\n node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)\n } else if (this.type === tt._class) {\n let cNode = this.startNode()\n node.declaration = this.parseClass(cNode, \"nullableID\")\n } else {\n node.declaration = this.parseMaybeAssign()\n this.semicolon()\n }\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseStatement(null)\n if (node.declaration.type === \"VariableDeclaration\")\n this.checkVariableExport(exports, node.declaration.declarations)\n else\n this.checkExport(exports, node.declaration.id.name, node.declaration.id.start)\n node.specifiers = []\n node.source = null\n } else { // export { x, y as z } [from '...']\n node.declaration = null\n node.specifiers = this.parseExportSpecifiers(exports)\n if (this.eatContextual(\"from\")) {\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n } else {\n for (let spec of node.specifiers) {\n // check for keywords used as local names\n this.checkUnreserved(spec.local)\n // check if export is defined\n this.checkLocalExport(spec.local)\n }\n\n node.source = null\n }\n this.semicolon()\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n}\n\npp.checkExport = function(exports, name, pos) {\n if (!exports) return\n if (has(exports, name))\n this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\")\n exports[name] = true\n}\n\npp.checkPatternExport = function(exports, pat) {\n let type = pat.type\n if (type === \"Identifier\")\n this.checkExport(exports, pat.name, pat.start)\n else if (type === \"ObjectPattern\")\n for (let prop of pat.properties)\n this.checkPatternExport(exports, prop)\n else if (type === \"ArrayPattern\")\n for (let elt of pat.elements) {\n if (elt) this.checkPatternExport(exports, elt)\n }\n else if (type === \"Property\")\n this.checkPatternExport(exports, pat.value)\n else if (type === \"AssignmentPattern\")\n this.checkPatternExport(exports, pat.left)\n else if (type === \"RestElement\")\n this.checkPatternExport(exports, pat.argument)\n else if (type === \"ParenthesizedExpression\")\n this.checkPatternExport(exports, pat.expression)\n}\n\npp.checkVariableExport = function(exports, decls) {\n if (!exports) return\n for (let decl of decls)\n this.checkPatternExport(exports, decl.id)\n}\n\npp.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n}\n\n// Parses a comma-separated list of module exports.\n\npp.parseExportSpecifiers = function(exports) {\n let nodes = [], first = true\n // export { x, y as z } [from '...']\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.local = this.parseIdent(true)\n node.exported = this.eatContextual(\"as\") ? this.parseIdent(true) : node.local\n this.checkExport(exports, node.exported.name, node.exported.start)\n nodes.push(this.finishNode(node, \"ExportSpecifier\"))\n }\n return nodes\n}\n\n// Parses import declaration.\n\npp.parseImport = function(node) {\n this.next()\n // import '...'\n if (this.type === tt.string) {\n node.specifiers = empty\n node.source = this.parseExprAtom()\n } else {\n node.specifiers = this.parseImportSpecifiers()\n this.expectContextual(\"from\")\n node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()\n }\n this.semicolon()\n return this.finishNode(node, \"ImportDeclaration\")\n}\n\n// Parses a comma-separated list of module imports.\n\npp.parseImportSpecifiers = function() {\n let nodes = [], first = true\n if (this.type === tt.name) {\n // import defaultObj, { x, y as z } from '...'\n let node = this.startNode()\n node.local = this.parseIdent()\n this.checkLValSimple(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"))\n if (!this.eat(tt.comma)) return nodes\n }\n if (this.type === tt.star) {\n let node = this.startNode()\n this.next()\n this.expectContextual(\"as\")\n node.local = this.parseIdent()\n this.checkLValSimple(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportNamespaceSpecifier\"))\n return nodes\n }\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.imported = this.parseIdent(true)\n if (this.eatContextual(\"as\")) {\n node.local = this.parseIdent()\n } else {\n this.checkUnreserved(node.imported)\n node.local = node.imported\n }\n this.checkLValSimple(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportSpecifier\"))\n }\n return nodes\n}\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp.adaptDirectivePrologue = function(statements) {\n for (let i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1)\n }\n}\npp.isDirectiveCandidate = function(statement) {\n return (\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n}\n","import {types as tt} from \"./tokentype.js\"\nimport {Parser} from \"./state.js\"\nimport {has} from \"./util.js\"\nimport {BIND_NONE, BIND_OUTSIDE, BIND_LEXICAL} from \"./scopeflags.js\"\n\nconst pp = Parser.prototype\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\")\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n for (let prop of node.properties) {\n this.toAssignable(prop, isBinding)\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\")\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") this.raise(node.key.start, \"Object pattern can't contain getter or setter\")\n this.toAssignable(node.value, isBinding)\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n this.toAssignableList(node.elements, isBinding)\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\"\n this.toAssignable(node.argument, isBinding)\n if (node.argument.type === \"AssignmentPattern\")\n this.raise(node.argument.start, \"Rest elements cannot have a default value\")\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\")\n node.type = \"AssignmentPattern\"\n delete node.operator\n this.toAssignable(node.left, isBinding)\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors)\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\")\n break\n\n case \"MemberExpression\":\n if (!isBinding) break\n\n default:\n this.raise(node.start, \"Assigning to rvalue\")\n }\n } else if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n return node\n}\n\n// Convert list of expression atoms to binding list.\n\npp.toAssignableList = function(exprList, isBinding) {\n let end = exprList.length\n for (let i = 0; i < end; i++) {\n let elt = exprList[i]\n if (elt) this.toAssignable(elt, isBinding)\n }\n if (end) {\n let last = exprList[end - 1]\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n this.unexpected(last.argument.start)\n }\n return exprList\n}\n\n// Parses spread element.\n\npp.parseSpread = function(refDestructuringErrors) {\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n return this.finishNode(node, \"SpreadElement\")\n}\n\npp.parseRestBinding = function() {\n let node = this.startNode()\n this.next()\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== tt.name)\n this.unexpected()\n\n node.argument = this.parseBindingAtom()\n\n return this.finishNode(node, \"RestElement\")\n}\n\n// Parses lvalue (assignable) atom.\n\npp.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case tt.bracketL:\n let node = this.startNode()\n this.next()\n node.elements = this.parseBindingList(tt.bracketR, true, true)\n return this.finishNode(node, \"ArrayPattern\")\n\n case tt.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n}\n\npp.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (first) first = false\n else this.expect(tt.comma)\n if (allowEmpty && this.type === tt.comma) {\n elts.push(null)\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === tt.ellipsis) {\n let rest = this.parseRestBinding()\n this.parseBindingListItem(rest)\n elts.push(rest)\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n this.expect(close)\n break\n } else {\n let elem = this.parseMaybeDefault(this.start, this.startLoc)\n this.parseBindingListItem(elem)\n elts.push(elem)\n }\n }\n return elts\n}\n\npp.parseBindingListItem = function(param) {\n return param\n}\n\n// Parses assignment pattern around given atom if possible.\n\npp.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom()\n if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.right = this.parseMaybeAssign()\n return this.finishNode(node, \"AssignmentPattern\")\n}\n\n// The following three functions all verify that a node is an lvalue —\n// something that can be bound, or assigned to. In order to do so, they perform\n// a variety of checks:\n//\n// - Check that none of the bound/assigned-to identifiers are reserved words.\n// - Record name declarations for bindings in the appropriate scope.\n// - Check duplicate argument names, if checkClashes is set.\n//\n// If a complex binding pattern is encountered (e.g., object and array\n// destructuring), the entire pattern is recursively checked.\n//\n// There are three versions of checkLVal*() appropriate for different\n// circumstances:\n//\n// - checkLValSimple() shall be used if the syntactic construct supports\n// nothing other than identifiers and member expressions. Parenthesized\n// expressions are also correctly handled. This is generally appropriate for\n// constructs for which the spec says\n//\n// > It is a Syntax Error if AssignmentTargetType of [the production] is not\n// > simple.\n//\n// It is also appropriate for checking if an identifier is valid and not\n// defined elsewhere, like import declarations or function/class identifiers.\n//\n// Examples where this is used include:\n// a += …;\n// import a from '…';\n// where a is the node to be checked.\n//\n// - checkLValPattern() shall be used if the syntactic construct supports\n// anything checkLValSimple() supports, as well as object and array\n// destructuring patterns. This is generally appropriate for constructs for\n// which the spec says\n//\n// > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n// > an ArrayLiteral and AssignmentTargetType of [the production] is not\n// > simple.\n//\n// Examples where this is used include:\n// (a = …);\n// const a = …;\n// try { … } catch (a) { … }\n// where a is the node to be checked.\n//\n// - checkLValInnerPattern() shall be used if the syntactic construct supports\n// anything checkLValPattern() supports, as well as default assignment\n// patterns, rest elements, and other constructs that may appear within an\n// object or array destructuring pattern.\n//\n// As a special case, function parameters also use checkLValInnerPattern(),\n// as they also support defaults and rest constructs.\n//\n// These functions deliberately support both assignment and binding constructs,\n// as the logic for both is exceedingly similar. If the node is the target of\n// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n// should be set to the appropriate BIND_* constant, like BIND_VAR or\n// BIND_LEXICAL.\n//\n// If the function is called with a non-BIND_NONE bindingType, then\n// additionally a checkClashes object may be specified to allow checking for\n// duplicate argument names. checkClashes is ignored if the provided construct\n// is an assignment (i.e., bindingType is BIND_NONE).\n\npp.checkLValSimple = function(expr, bindingType = BIND_NONE, checkClashes) {\n const isBind = bindingType !== BIND_NONE\n\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\")\n if (isBind) {\n if (bindingType === BIND_LEXICAL && expr.name === \"let\")\n this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\")\n if (checkClashes) {\n if (has(checkClashes, expr.name))\n this.raiseRecoverable(expr.start, \"Argument name clash\")\n checkClashes[expr.name] = true\n }\n if (bindingType !== BIND_OUTSIDE) this.declareName(expr.name, bindingType, expr.start)\n }\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\")\n break\n\n case \"MemberExpression\":\n if (isBind) this.raiseRecoverable(expr.start, \"Binding member expression\")\n break\n\n case \"ParenthesizedExpression\":\n if (isBind) this.raiseRecoverable(expr.start, \"Binding parenthesized expression\")\n return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n\n default:\n this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\")\n }\n}\n\npp.checkLValPattern = function(expr, bindingType = BIND_NONE, checkClashes) {\n switch (expr.type) {\n case \"ObjectPattern\":\n for (let prop of expr.properties) {\n this.checkLValInnerPattern(prop, bindingType, checkClashes)\n }\n break\n\n case \"ArrayPattern\":\n for (let elem of expr.elements) {\n if (elem) this.checkLValInnerPattern(elem, bindingType, checkClashes)\n }\n break\n\n default:\n this.checkLValSimple(expr, bindingType, checkClashes)\n }\n}\n\npp.checkLValInnerPattern = function(expr, bindingType = BIND_NONE, checkClashes) {\n switch (expr.type) {\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLValInnerPattern(expr.value, bindingType, checkClashes)\n break\n\n case \"AssignmentPattern\":\n this.checkLValPattern(expr.left, bindingType, checkClashes)\n break\n\n case \"RestElement\":\n this.checkLValPattern(expr.argument, bindingType, checkClashes)\n break\n\n default:\n this.checkLValPattern(expr, bindingType, checkClashes)\n }\n}\n","// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\nimport {types as tt} from \"./tokentype.js\"\nimport {Parser} from \"./state.js\"\nimport {DestructuringErrors} from \"./parseutil.js\"\nimport {lineBreak} from \"./whitespace.js\"\nimport {functionFlags, SCOPE_ARROW, SCOPE_SUPER, SCOPE_DIRECT_SUPER, BIND_OUTSIDE, BIND_VAR} from \"./scopeflags.js\"\n\nconst pp = Parser.prototype\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n return\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n return\n let {key} = prop, name\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n let {kind} = prop\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors) {\n if (refDestructuringErrors.doubleProto < 0)\n refDestructuringErrors.doubleProto = key.start\n // Backwards-compat kludge. Can be removed in version 6.0\n } else this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\")\n }\n propHash.proto = true\n }\n return\n }\n name = \"$\" + name\n let other = propHash[name]\n if (other) {\n let redefinition\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set\n } else {\n redefinition = other.init || other[kind]\n }\n if (redefinition)\n this.raiseRecoverable(key.start, \"Redefinition of property\")\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n }\n }\n other[kind] = true\n}\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp.parseExpression = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeAssign(noIn, refDestructuringErrors)\n if (this.type === tt.comma) {\n let node = this.startNodeAt(startPos, startLoc)\n node.expressions = [expr]\n while (this.eat(tt.comma)) node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors))\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n}\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) return this.parseYield(noIn)\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else this.exprAllowed = false\n }\n\n let ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign\n oldTrailingComma = refDestructuringErrors.trailingComma\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1\n } else {\n refDestructuringErrors = new DestructuringErrors\n ownDestructuringErrors = true\n }\n\n let startPos = this.start, startLoc = this.startLoc\n if (this.type === tt.parenL || this.type === tt.name)\n this.potentialArrowAt = this.start\n let left = this.parseMaybeConditional(noIn, refDestructuringErrors)\n if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc)\n if (this.type.isAssign) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n if (this.type === tt.eq)\n left = this.toAssignable(left, false, refDestructuringErrors)\n if (!ownDestructuringErrors) {\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1\n }\n if (refDestructuringErrors.shorthandAssign >= left.start)\n refDestructuringErrors.shorthandAssign = -1 // reset because shorthand default was used correctly\n if (this.type === tt.eq)\n this.checkLValPattern(left)\n else\n this.checkLValSimple(left)\n node.left = left\n this.next()\n node.right = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (oldParenAssign > -1) refDestructuringErrors.parenthesizedAssign = oldParenAssign\n if (oldTrailingComma > -1) refDestructuringErrors.trailingComma = oldTrailingComma\n return left\n}\n\n// Parse a ternary conditional (`?:`) operator.\n\npp.parseMaybeConditional = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprOps(noIn, refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n if (this.eat(tt.question)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.test = expr\n node.consequent = this.parseMaybeAssign()\n this.expect(tt.colon)\n node.alternate = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n}\n\n// Start the precedence parser.\n\npp.parseExprOps = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeUnary(refDestructuringErrors, false)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)\n}\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {\n let prec = this.type.binop\n if (prec != null && (!noIn || this.type !== tt._in)) {\n if (prec > minPrec) {\n let logical = this.type === tt.logicalOR || this.type === tt.logicalAND\n let coalesce = this.type === tt.coalesce\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = tt.logicalAND.binop\n }\n let op = this.value\n this.next()\n let startPos = this.start, startLoc = this.startLoc\n let right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn)\n let node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce)\n if ((logical && this.type === tt.coalesce) || (coalesce && (this.type === tt.logicalOR || this.type === tt.logicalAND))) {\n this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\")\n }\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)\n }\n }\n return left\n}\n\npp.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.operator = op\n node.right = right\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n}\n\n// Parse unary operators, both prefix and postfix.\n\npp.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {\n let startPos = this.start, startLoc = this.startLoc, expr\n if (this.isContextual(\"await\") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {\n expr = this.parseAwait()\n sawUnary = true\n } else if (this.type.prefix) {\n let node = this.startNode(), update = this.type === tt.incDec\n node.operator = this.value\n node.prefix = true\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n this.checkExpressionErrors(refDestructuringErrors, true)\n if (update) this.checkLValSimple(node.argument)\n else if (this.strict && node.operator === \"delete\" &&\n node.argument.type === \"Identifier\")\n this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\")\n else sawUnary = true\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\")\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n while (this.type.postfix && !this.canInsertSemicolon()) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.prefix = false\n node.argument = expr\n this.checkLValSimple(expr)\n this.next()\n expr = this.finishNode(node, \"UpdateExpression\")\n }\n }\n\n if (!sawUnary && this.eat(tt.starstar))\n return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), \"**\", false)\n else\n return expr\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp.parseExprSubscripts = function(refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprAtom(refDestructuringErrors)\n if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\")\n return expr\n let result = this.parseSubscripts(expr, startPos, startLoc)\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) refDestructuringErrors.parenthesizedAssign = -1\n if (refDestructuringErrors.parenthesizedBind >= result.start) refDestructuringErrors.parenthesizedBind = -1\n if (refDestructuringErrors.trailingComma >= result.start) refDestructuringErrors.trailingComma = -1\n }\n return result\n}\n\npp.parseSubscripts = function(base, startPos, startLoc, noCalls) {\n let maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n this.potentialArrowAt === base.start\n let optionalChained = false\n\n while (true) {\n let element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained)\n\n if (element.optional) optionalChained = true\n if (element === base || element.type === \"ArrowFunctionExpression\") {\n if (optionalChained) {\n const chainNode = this.startNodeAt(startPos, startLoc)\n chainNode.expression = element\n element = this.finishNode(chainNode, \"ChainExpression\")\n }\n return element\n }\n\n base = element\n }\n}\n\npp.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {\n let optionalSupported = this.options.ecmaVersion >= 11\n let optional = optionalSupported && this.eat(tt.questionDot)\n if (noCalls && optional) this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\")\n\n let computed = this.eat(tt.bracketL)\n if (computed || (optional && this.type !== tt.parenL && this.type !== tt.backQuote) || this.eat(tt.dot)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.object = base\n node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== \"never\")\n node.computed = !!computed\n if (computed) this.expect(tt.bracketR)\n if (optionalSupported) {\n node.optional = optional\n }\n base = this.finishNode(node, \"MemberExpression\")\n } else if (!noCalls && this.eat(tt.parenL)) {\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n let exprList = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors)\n if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n if (this.awaitIdentPos > 0)\n this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\")\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)\n }\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos\n let node = this.startNodeAt(startPos, startLoc)\n node.callee = base\n node.arguments = exprList\n if (optionalSupported) {\n node.optional = optional\n }\n base = this.finishNode(node, \"CallExpression\")\n } else if (this.type === tt.backQuote) {\n if (optional || optionalChained) {\n this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\")\n }\n let node = this.startNodeAt(startPos, startLoc)\n node.tag = base\n node.quasi = this.parseTemplate({isTagged: true})\n base = this.finishNode(node, \"TaggedTemplateExpression\")\n }\n return base\n}\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp.parseExprAtom = function(refDestructuringErrors) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === tt.slash) this.readRegexp()\n\n let node, canBeArrow = this.potentialArrowAt === this.start\n switch (this.type) {\n case tt._super:\n if (!this.allowSuper)\n this.raise(this.start, \"'super' keyword outside a method\")\n node = this.startNode()\n this.next()\n if (this.type === tt.parenL && !this.allowDirectSuper)\n this.raise(node.start, \"super() call outside constructor of a subclass\")\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super ( Arguments )\n if (this.type !== tt.dot && this.type !== tt.bracketL && this.type !== tt.parenL)\n this.unexpected()\n return this.finishNode(node, \"Super\")\n\n case tt._this:\n node = this.startNode()\n this.next()\n return this.finishNode(node, \"ThisExpression\")\n\n case tt.name:\n let startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc\n let id = this.parseIdent(false)\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(tt._function))\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true)\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(tt.arrow))\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false)\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === tt.name && !containsEsc) {\n id = this.parseIdent(false)\n if (this.canInsertSemicolon() || !this.eat(tt.arrow))\n this.unexpected()\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)\n }\n }\n return id\n\n case tt.regexp:\n let value = this.value\n node = this.parseLiteral(value.value)\n node.regex = {pattern: value.pattern, flags: value.flags}\n return node\n\n case tt.num: case tt.string:\n return this.parseLiteral(this.value)\n\n case tt._null: case tt._true: case tt._false:\n node = this.startNode()\n node.value = this.type === tt._null ? null : this.type === tt._true\n node.raw = this.type.keyword\n this.next()\n return this.finishNode(node, \"Literal\")\n\n case tt.parenL:\n let start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow)\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n refDestructuringErrors.parenthesizedAssign = start\n if (refDestructuringErrors.parenthesizedBind < 0)\n refDestructuringErrors.parenthesizedBind = start\n }\n return expr\n\n case tt.bracketL:\n node = this.startNode()\n this.next()\n node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors)\n return this.finishNode(node, \"ArrayExpression\")\n\n case tt.braceL:\n return this.parseObj(false, refDestructuringErrors)\n\n case tt._function:\n node = this.startNode()\n this.next()\n return this.parseFunction(node, 0)\n\n case tt._class:\n return this.parseClass(this.startNode(), false)\n\n case tt._new:\n return this.parseNew()\n\n case tt.backQuote:\n return this.parseTemplate()\n\n case tt._import:\n if (this.options.ecmaVersion >= 11) {\n return this.parseExprImport()\n } else {\n return this.unexpected()\n }\n\n default:\n this.unexpected()\n }\n}\n\npp.parseExprImport = function() {\n const node = this.startNode()\n\n // Consume `import` as an identifier for `import.meta`.\n // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n if (this.containsEsc) this.raiseRecoverable(this.start, \"Escape sequence in keyword import\")\n const meta = this.parseIdent(true)\n\n switch (this.type) {\n case tt.parenL:\n return this.parseDynamicImport(node)\n case tt.dot:\n node.meta = meta\n return this.parseImportMeta(node)\n default:\n this.unexpected()\n }\n}\n\npp.parseDynamicImport = function(node) {\n this.next() // skip `(`\n\n // Parse node.source.\n node.source = this.parseMaybeAssign()\n\n // Verify ending.\n if (!this.eat(tt.parenR)) {\n const errorPos = this.start\n if (this.eat(tt.comma) && this.eat(tt.parenR)) {\n this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\")\n } else {\n this.unexpected(errorPos)\n }\n }\n\n return this.finishNode(node, \"ImportExpression\")\n}\n\npp.parseImportMeta = function(node) {\n this.next() // skip `.`\n\n const containsEsc = this.containsEsc\n node.property = this.parseIdent(true)\n\n if (node.property.name !== \"meta\")\n this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\")\n if (containsEsc)\n this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\")\n if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere)\n this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\")\n\n return this.finishNode(node, \"MetaProperty\")\n}\n\npp.parseLiteral = function(value) {\n let node = this.startNode()\n node.value = value\n node.raw = this.input.slice(this.start, this.end)\n if (node.raw.charCodeAt(node.raw.length - 1) === 110) node.bigint = node.raw.slice(0, -1).replace(/_/g, \"\")\n this.next()\n return this.finishNode(node, \"Literal\")\n}\n\npp.parseParenExpression = function() {\n this.expect(tt.parenL)\n let val = this.parseExpression()\n this.expect(tt.parenR)\n return val\n}\n\npp.parseParenAndDistinguishExpression = function(canBeArrow) {\n let startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8\n if (this.options.ecmaVersion >= 6) {\n this.next()\n\n let innerStartPos = this.start, innerStartLoc = this.startLoc\n let exprList = [], first = true, lastIsComma = false\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart\n this.yieldPos = 0\n this.awaitPos = 0\n // Do not save awaitIdentPos to allow checking awaits nested in parameters\n while (this.type !== tt.parenR) {\n first ? first = false : this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(tt.parenR, true)) {\n lastIsComma = true\n break\n } else if (this.type === tt.ellipsis) {\n spreadStart = this.start\n exprList.push(this.parseParenItem(this.parseRestBinding()))\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem))\n }\n }\n let innerEndPos = this.start, innerEndLoc = this.startLoc\n this.expect(tt.parenR)\n\n if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.parseParenArrowList(startPos, startLoc, exprList)\n }\n\n if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart)\n if (spreadStart) this.unexpected(spreadStart)\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc)\n val.expressions = exprList\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc)\n } else {\n val = exprList[0]\n }\n } else {\n val = this.parseParenExpression()\n }\n\n if (this.options.preserveParens) {\n let par = this.startNodeAt(startPos, startLoc)\n par.expression = val\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n}\n\npp.parseParenItem = function(item) {\n return item\n}\n\npp.parseParenArrowList = function(startPos, startLoc, exprList) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)\n}\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nconst empty = []\n\npp.parseNew = function() {\n if (this.containsEsc) this.raiseRecoverable(this.start, \"Escape sequence in keyword new\")\n let node = this.startNode()\n let meta = this.parseIdent(true)\n if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) {\n node.meta = meta\n let containsEsc = this.containsEsc\n node.property = this.parseIdent(true)\n if (node.property.name !== \"target\")\n this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\")\n if (containsEsc)\n this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\")\n if (!this.inNonArrowFunction)\n this.raiseRecoverable(node.start, \"'new.target' can only be used in functions\")\n return this.finishNode(node, \"MetaProperty\")\n }\n let startPos = this.start, startLoc = this.startLoc, isImport = this.type === tt._import\n node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true)\n if (isImport && node.callee.type === \"ImportExpression\") {\n this.raise(startPos, \"Cannot use new with import()\")\n }\n if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false)\n else node.arguments = empty\n return this.finishNode(node, \"NewExpression\")\n}\n\n// Parse template expression.\n\npp.parseTemplateElement = function({isTagged}) {\n let elem = this.startNode()\n if (this.type === tt.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\")\n }\n elem.value = {\n raw: this.value,\n cooked: null\n }\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n }\n }\n this.next()\n elem.tail = this.type === tt.backQuote\n return this.finishNode(elem, \"TemplateElement\")\n}\n\npp.parseTemplate = function({isTagged = false} = {}) {\n let node = this.startNode()\n this.next()\n node.expressions = []\n let curElt = this.parseTemplateElement({isTagged})\n node.quasis = [curElt]\n while (!curElt.tail) {\n if (this.type === tt.eof) this.raise(this.pos, \"Unterminated template literal\")\n this.expect(tt.dollarBraceL)\n node.expressions.push(this.parseExpression())\n this.expect(tt.braceR)\n node.quasis.push(curElt = this.parseTemplateElement({isTagged}))\n }\n this.next()\n return this.finishNode(node, \"TemplateLiteral\")\n}\n\npp.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === tt.name || this.type === tt.num || this.type === tt.string || this.type === tt.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === tt.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\n// Parse an object literal or binding pattern.\n\npp.parseObj = function(isPattern, refDestructuringErrors) {\n let node = this.startNode(), first = true, propHash = {}\n node.properties = []\n this.next()\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n const prop = this.parseProperty(isPattern, refDestructuringErrors)\n if (!isPattern) this.checkPropClash(prop, propHash, refDestructuringErrors)\n node.properties.push(prop)\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n}\n\npp.parseProperty = function(isPattern, refDestructuringErrors) {\n let prop = this.startNode(), isGenerator, isAsync, startPos, startLoc\n if (this.options.ecmaVersion >= 9 && this.eat(tt.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false)\n if (this.type === tt.comma) {\n this.raise(this.start, \"Comma is not permitted after the rest element\")\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // To disallow parenthesized identifier via `this.toAssignable()`.\n if (this.type === tt.parenL && refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0) {\n refDestructuringErrors.parenthesizedAssign = this.start\n }\n if (refDestructuringErrors.parenthesizedBind < 0) {\n refDestructuringErrors.parenthesizedBind = this.start\n }\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === tt.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false\n prop.shorthand = false\n if (isPattern || refDestructuringErrors) {\n startPos = this.start\n startLoc = this.startLoc\n }\n if (!isPattern)\n isGenerator = this.eat(tt.star)\n }\n let containsEsc = this.containsEsc\n this.parsePropertyName(prop)\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n this.parsePropertyName(prop, refDestructuringErrors)\n } else {\n isAsync = false\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc)\n return this.finishNode(prop, \"Property\")\n}\n\npp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === tt.colon)\n this.unexpected()\n\n if (this.eat(tt.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors)\n prop.kind = \"init\"\n } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) {\n if (isPattern) this.unexpected()\n prop.kind = \"init\"\n prop.method = true\n prop.value = this.parseMethod(isGenerator, isAsync)\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== tt.comma && this.type !== tt.braceR && this.type !== tt.eq)) {\n if (isGenerator || isAsync) this.unexpected()\n prop.kind = prop.key.name\n this.parsePropertyName(prop)\n prop.value = this.parseMethod(false)\n let paramCount = prop.kind === \"get\" ? 0 : 1\n if (prop.value.params.length !== paramCount) {\n let start = prop.value.start\n if (prop.kind === \"get\")\n this.raiseRecoverable(start, \"getter should have no params\")\n else\n this.raiseRecoverable(start, \"setter should have exactly one param\")\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\")\n }\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n if (isGenerator || isAsync) this.unexpected()\n this.checkUnreserved(prop.key)\n if (prop.key.name === \"await\" && !this.awaitIdentPos)\n this.awaitIdentPos = startPos\n prop.kind = \"init\"\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key))\n } else if (this.type === tt.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n refDestructuringErrors.shorthandAssign = this.start\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key))\n } else {\n prop.value = this.copyNode(prop.key)\n }\n prop.shorthand = true\n } else this.unexpected()\n}\n\npp.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(tt.bracketL)) {\n prop.computed = true\n prop.key = this.parseMaybeAssign()\n this.expect(tt.bracketR)\n return prop.key\n } else {\n prop.computed = false\n }\n }\n return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n}\n\n// Initialize empty function node.\n\npp.initFunction = function(node) {\n node.id = null\n if (this.options.ecmaVersion >= 6) node.generator = node.expression = false\n if (this.options.ecmaVersion >= 8) node.async = false\n}\n\n// Parse object or class method.\n\npp.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n let node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n\n this.initFunction(node)\n if (this.options.ecmaVersion >= 6)\n node.generator = isGenerator\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0))\n\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n this.parseFunctionBody(node, false, true)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.finishNode(node, \"FunctionExpression\")\n}\n\n// Parse arrow function expression with given parameters.\n\npp.parseArrowExpression = function(node, params, isAsync) {\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW)\n this.initFunction(node)\n if (this.options.ecmaVersion >= 8) node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n\n node.params = this.toAssignableList(params, true)\n this.parseFunctionBody(node, true, false)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.finishNode(node, \"ArrowFunctionExpression\")\n}\n\n// Parse function body and check parameters.\n\npp.parseFunctionBody = function(node, isArrowFunction, isMethod) {\n let isExpression = isArrowFunction && this.type !== tt.braceL\n let oldStrict = this.strict, useStrict = false\n\n if (isExpression) {\n node.body = this.parseMaybeAssign()\n node.expression = true\n this.checkParams(node, false)\n } else {\n let nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params)\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end)\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\")\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n let oldLabels = this.labels\n this.labels = []\n if (useStrict) this.strict = true\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params))\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) this.checkLValSimple(node.id, BIND_OUTSIDE)\n node.body = this.parseBlock(false, undefined, useStrict && !oldStrict)\n node.expression = false\n this.adaptDirectivePrologue(node.body.body)\n this.labels = oldLabels\n }\n this.exitScope()\n}\n\npp.isSimpleParamList = function(params) {\n for (let param of params)\n if (param.type !== \"Identifier\") return false\n return true\n}\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp.checkParams = function(node, allowDuplicates) {\n let nameHash = Object.create(null)\n for (let param of node.params)\n this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash)\n}\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (!first) {\n this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(close)) break\n } else first = false\n\n let elt\n if (allowEmpty && this.type === tt.comma)\n elt = null\n else if (this.type === tt.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors)\n if (refDestructuringErrors && this.type === tt.comma && refDestructuringErrors.trailingComma < 0)\n refDestructuringErrors.trailingComma = this.start\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors)\n }\n elts.push(elt)\n }\n return elts\n}\n\npp.checkUnreserved = function({start, end, name}) {\n if (this.inGenerator && name === \"yield\")\n this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\")\n if (this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\")\n if (this.keywords.test(name))\n this.raise(start, `Unexpected keyword '${name}'`)\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) return\n const re = this.strict ? this.reservedWordsStrict : this.reservedWords\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\")\n this.raiseRecoverable(start, `The keyword '${name}' is reserved`)\n }\n}\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp.parseIdent = function(liberal, isBinding) {\n let node = this.startNode()\n if (this.type === tt.name) {\n node.name = this.value\n } else if (this.type.keyword) {\n node.name = this.type.keyword\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop()\n }\n } else {\n this.unexpected()\n }\n this.next(!!liberal)\n this.finishNode(node, \"Identifier\")\n if (!liberal) {\n this.checkUnreserved(node)\n if (node.name === \"await\" && !this.awaitIdentPos)\n this.awaitIdentPos = node.start\n }\n return node\n}\n\n// Parses yield expression inside generator.\n\npp.parseYield = function(noIn) {\n if (!this.yieldPos) this.yieldPos = this.start\n\n let node = this.startNode()\n this.next()\n if (this.type === tt.semi || this.canInsertSemicolon() || (this.type !== tt.star && !this.type.startsExpr)) {\n node.delegate = false\n node.argument = null\n } else {\n node.delegate = this.eat(tt.star)\n node.argument = this.parseMaybeAssign(noIn)\n }\n return this.finishNode(node, \"YieldExpression\")\n}\n\npp.parseAwait = function() {\n if (!this.awaitPos) this.awaitPos = this.start\n\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n return this.finishNode(node, \"AwaitExpression\")\n}\n","import {Parser} from \"./state.js\"\nimport {Position, getLineInfo} from \"./locutil.js\"\n\nconst pp = Parser.prototype\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp.raise = function(pos, message) {\n let loc = getLineInfo(this.input, pos)\n message += \" (\" + loc.line + \":\" + loc.column + \")\"\n let err = new SyntaxError(message)\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos\n throw err\n}\n\npp.raiseRecoverable = pp.raise\n\npp.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n}\n","import {Parser} from \"./state.js\"\nimport {SCOPE_VAR, SCOPE_FUNCTION, SCOPE_TOP, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, BIND_LEXICAL, BIND_SIMPLE_CATCH, BIND_FUNCTION} from \"./scopeflags.js\"\n\nconst pp = Parser.prototype\n\nclass Scope {\n constructor(flags) {\n this.flags = flags\n // A list of var-declared names in the current lexical scope\n this.var = []\n // A list of lexically-declared names in the current lexical scope\n this.lexical = []\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = []\n }\n}\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags))\n}\n\npp.exitScope = function() {\n this.scopeStack.pop()\n}\n\n// The spec says:\n// > At the top level of a function, or script, function declarations are\n// > treated like var declarations rather than like lexical declarations.\npp.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n}\n\npp.declareName = function(name, bindingType, pos) {\n let redeclared = false\n if (bindingType === BIND_LEXICAL) {\n const scope = this.currentScope()\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.lexical.push(name)\n if (this.inModule && (scope.flags & SCOPE_TOP))\n delete this.undefinedExports[name]\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n const scope = this.currentScope()\n scope.lexical.push(name)\n } else if (bindingType === BIND_FUNCTION) {\n const scope = this.currentScope()\n if (this.treatFunctionsAsVar)\n redeclared = scope.lexical.indexOf(name) > -1\n else\n redeclared = scope.lexical.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.functions.push(name)\n } else {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n const scope = this.scopeStack[i]\n if (scope.lexical.indexOf(name) > -1 && !((scope.flags & SCOPE_SIMPLE_CATCH) && scope.lexical[0] === name) ||\n !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1) {\n redeclared = true\n break\n }\n scope.var.push(name)\n if (this.inModule && (scope.flags & SCOPE_TOP))\n delete this.undefinedExports[name]\n if (scope.flags & SCOPE_VAR) break\n }\n }\n if (redeclared) this.raiseRecoverable(pos, `Identifier '${name}' has already been declared`)\n}\n\npp.checkLocalExport = function(id) {\n // scope.functions must be empty as Module code is always strict.\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1) {\n this.undefinedExports[id.name] = id\n }\n}\n\npp.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n}\n\npp.currentVarScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR) return scope\n }\n}\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp.currentThisScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) return scope\n }\n}\n","import {Parser} from \"./state.js\"\nimport {SourceLocation} from \"./locutil.js\"\n\nexport class Node {\n constructor(parser, pos, loc) {\n this.type = \"\"\n this.start = pos\n this.end = 0\n if (parser.options.locations)\n this.loc = new SourceLocation(parser, loc)\n if (parser.options.directSourceFile)\n this.sourceFile = parser.options.directSourceFile\n if (parser.options.ranges)\n this.range = [pos, 0]\n }\n}\n\n// Start an AST node, attaching a start offset.\n\nconst pp = Parser.prototype\n\npp.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n}\n\npp.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n}\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type\n node.end = pos\n if (this.options.locations)\n node.loc.end = loc\n if (this.options.ranges)\n node.range[1] = pos\n return node\n}\n\npp.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n}\n\n// Finish node at given position\n\npp.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n}\n\npp.copyNode = function(node) {\n let newNode = new Node(this, node.start, this.startLoc)\n for (let prop in node) newNode[prop] = node[prop]\n return newNode\n}\n","// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport {Parser} from \"./state.js\"\nimport {types as tt} from \"./tokentype.js\"\nimport {lineBreak} from \"./whitespace.js\"\n\nexport class TokContext {\n constructor(token, isExpr, preserveSpace, override, generator) {\n this.token = token\n this.isExpr = !!isExpr\n this.preserveSpace = !!preserveSpace\n this.override = override\n this.generator = !!generator\n }\n}\n\nexport const types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, p => p.tryReadTemplateToken()),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n}\n\nconst pp = Parser.prototype\n\npp.initialContext = function() {\n return [types.b_stat]\n}\n\npp.braceIsBlock = function(prevType) {\n let parent = this.curContext()\n if (parent === types.f_expr || parent === types.f_stat)\n return true\n if (prevType === tt.colon && (parent === types.b_stat || parent === types.b_expr))\n return !parent.isExpr\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === tt._return || prevType === tt.name && this.exprAllowed)\n return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR || prevType === tt.arrow)\n return true\n if (prevType === tt.braceL)\n return parent === types.b_stat\n if (prevType === tt._var || prevType === tt._const || prevType === tt.name)\n return false\n return !this.exprAllowed\n}\n\npp.inGeneratorContext = function() {\n for (let i = this.context.length - 1; i >= 1; i--) {\n let context = this.context[i]\n if (context.token === \"function\")\n return context.generator\n }\n return false\n}\n\npp.updateContext = function(prevType) {\n let update, type = this.type\n if (type.keyword && prevType === tt.dot)\n this.exprAllowed = false\n else if (update = type.updateContext)\n update.call(this, prevType)\n else\n this.exprAllowed = type.beforeExpr\n}\n\n// Token-specific context update code\n\ntt.parenR.updateContext = tt.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true\n return\n }\n let out = this.context.pop()\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop()\n }\n this.exprAllowed = !out.isExpr\n}\n\ntt.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr)\n this.exprAllowed = true\n}\n\ntt.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl)\n this.exprAllowed = true\n}\n\ntt.parenL.updateContext = function(prevType) {\n let statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while\n this.context.push(statementParens ? types.p_stat : types.p_expr)\n this.exprAllowed = true\n}\n\ntt.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n}\n\ntt._function.updateContext = tt._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== tt._else &&\n !(prevType === tt.semi && this.curContext() !== types.p_stat) &&\n !(prevType === tt._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat))\n this.context.push(types.f_expr)\n else\n this.context.push(types.f_stat)\n this.exprAllowed = false\n}\n\ntt.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n this.context.pop()\n else\n this.context.push(types.q_tmpl)\n this.exprAllowed = false\n}\n\ntt.star.updateContext = function(prevType) {\n if (prevType === tt._function) {\n let index = this.context.length - 1\n if (this.context[index] === types.f_expr)\n this.context[index] = types.f_expr_gen\n else\n this.context[index] = types.f_gen\n }\n this.exprAllowed = true\n}\n\ntt.name.updateContext = function(prevType) {\n let allowed = false\n if (this.options.ecmaVersion >= 6 && prevType !== tt.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n allowed = true\n }\n this.exprAllowed = allowed\n}\n","import {wordsRegexp} from \"./util.js\"\n\n// This file contains Unicode properties extracted from the ECMAScript\n// specification. The lists are extracted like so:\n// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n\n// #table-binary-unicode-properties\nconst ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\"\nconst ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\"\nconst ecma11BinaryProperties = ecma10BinaryProperties\nconst ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\"\nconst unicodeBinaryProperties = {\n 9: ecma9BinaryProperties,\n 10: ecma10BinaryProperties,\n 11: ecma11BinaryProperties,\n 12: ecma12BinaryProperties\n}\n\n// #table-unicode-general-category-values\nconst unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\"\n\n// #table-unicode-script-values\nconst ecma9ScriptValues = \"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\"\nconst ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\"\nconst ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\"\nconst ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\"\nconst unicodeScriptValues = {\n 9: ecma9ScriptValues,\n 10: ecma10ScriptValues,\n 11: ecma11ScriptValues,\n 12: ecma12ScriptValues\n}\n\nconst data = {}\nfunction buildUnicodeData(ecmaVersion) {\n let d = data[ecmaVersion] = {\n binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n nonBinary: {\n General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n }\n }\n d.nonBinary.Script_Extensions = d.nonBinary.Script\n\n d.nonBinary.gc = d.nonBinary.General_Category\n d.nonBinary.sc = d.nonBinary.Script\n d.nonBinary.scx = d.nonBinary.Script_Extensions\n}\nbuildUnicodeData(9)\nbuildUnicodeData(10)\nbuildUnicodeData(11)\nbuildUnicodeData(12)\n\nexport default data\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier.js\"\nimport {Parser} from \"./state.js\"\nimport UNICODE_PROPERTY_VALUES from \"./unicode-property-data.js\"\nimport {has} from \"./util.js\"\n\nconst pp = Parser.prototype\n\nexport class RegExpValidationState {\n constructor(parser) {\n this.parser = parser\n this.validFlags = `gim${parser.options.ecmaVersion >= 6 ? \"uy\" : \"\"}${parser.options.ecmaVersion >= 9 ? \"s\" : \"\"}`\n this.unicodeProperties = UNICODE_PROPERTY_VALUES[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion]\n this.source = \"\"\n this.flags = \"\"\n this.start = 0\n this.switchU = false\n this.switchN = false\n this.pos = 0\n this.lastIntValue = 0\n this.lastStringValue = \"\"\n this.lastAssertionIsQuantifiable = false\n this.numCapturingParens = 0\n this.maxBackReference = 0\n this.groupNames = []\n this.backReferenceNames = []\n }\n\n reset(start, pattern, flags) {\n const unicode = flags.indexOf(\"u\") !== -1\n this.start = start | 0\n this.source = pattern + \"\"\n this.flags = flags\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9\n }\n\n raise(message) {\n this.parser.raiseRecoverable(this.start, `Invalid regular expression: /${this.source}/: ${message}`)\n }\n\n // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n at(i, forceU = false) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return -1\n }\n const c = s.charCodeAt(i)\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n const next = s.charCodeAt(i + 1)\n return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n }\n\n nextIndex(i, forceU = false) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return l\n }\n let c = s.charCodeAt(i), next\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n return i + 1\n }\n return i + 2\n }\n\n current(forceU = false) {\n return this.at(this.pos, forceU)\n }\n\n lookahead(forceU = false) {\n return this.at(this.nextIndex(this.pos, forceU), forceU)\n }\n\n advance(forceU = false) {\n this.pos = this.nextIndex(this.pos, forceU)\n }\n\n eat(ch, forceU = false) {\n if (this.current(forceU) === ch) {\n this.advance(forceU)\n return true\n }\n return false\n }\n}\n\nfunction codePointToString(ch) {\n if (ch <= 0xFFFF) return String.fromCharCode(ch)\n ch -= 0x10000\n return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)\n}\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpFlags = function(state) {\n const validFlags = state.validFlags\n const flags = state.flags\n\n for (let i = 0; i < flags.length; i++) {\n const flag = flags.charAt(i)\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\")\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\")\n }\n }\n}\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpPattern = function(state) {\n this.regexp_pattern(state)\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n state.switchN = true\n this.regexp_pattern(state)\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp.regexp_pattern = function(state) {\n state.pos = 0\n state.lastIntValue = 0\n state.lastStringValue = \"\"\n state.lastAssertionIsQuantifiable = false\n state.numCapturingParens = 0\n state.maxBackReference = 0\n state.groupNames.length = 0\n state.backReferenceNames.length = 0\n\n this.regexp_disjunction(state)\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\")\n }\n if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\")\n }\n for (const name of state.backReferenceNames) {\n if (state.groupNames.indexOf(name) === -1) {\n state.raise(\"Invalid named capture referenced\")\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp.regexp_disjunction = function(state) {\n this.regexp_alternative(state)\n while (state.eat(0x7C /* | */)) {\n this.regexp_alternative(state)\n }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state))\n ;\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\")\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state)\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp.regexp_eatAssertion = function(state) {\n const start = state.pos\n state.lastAssertionIsQuantifiable = false\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n let lookbehind = false\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */)\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state)\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\")\n }\n state.lastAssertionIsQuantifiable = !lookbehind\n return true\n }\n }\n\n state.pos = start\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp.regexp_eatQuantifier = function(state, noError = false) {\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n}\npp.regexp_eatBracedQuantifier = function(state, noError) {\n const start = state.pos\n if (state.eat(0x7B /* { */)) {\n let min = 0, max = -1\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\")\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n}\npp.regexp_eatReverseSolidusAtomEscape = function(state) {\n const start = state.pos\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatUncapturingGroup = function(state) {\n const start = state.pos\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\")\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state)\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\")\n }\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1\n return true\n }\n state.raise(\"Unterminated group\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp.regexp_eatSyntaxCharacter = function(state) {\n const ch = state.current()\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n return false\n}\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp.regexp_eatPatternCharacters = function(state) {\n const start = state.pos\n let ch = 0\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance()\n }\n return state.pos !== start\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp.regexp_eatExtendedPatternCharacter = function(state) {\n const ch = state.current()\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance()\n return true\n }\n return false\n}\n\n// GroupSpecifier ::\n// [empty]\n// `?` GroupName\npp.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (this.regexp_eatGroupName(state)) {\n if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n state.raise(\"Duplicate capture group name\")\n }\n state.groupNames.push(state.lastStringValue)\n return\n }\n state.raise(\"Invalid group\")\n }\n}\n\n// GroupName ::\n// `<` RegExpIdentifierName `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\"\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\")\n }\n return false\n}\n\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierPart\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\"\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n }\n return true\n }\n return false\n}\n\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\npp.regexp_eatRegExpIdentifierStart = function(state) {\n const start = state.pos\n const forceU = this.options.ecmaVersion >= 11\n let ch = state.current(forceU)\n state.advance(forceU)\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\n// \n// \npp.regexp_eatRegExpIdentifierPart = function(state) {\n const start = state.pos\n const forceU = this.options.ecmaVersion >= 11\n let ch = state.current(forceU)\n state.advance(forceU)\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\")\n }\n state.raise(\"Invalid escape\")\n }\n return false\n}\npp.regexp_eatBackReference = function(state) {\n const start = state.pos\n if (this.regexp_eatDecimalEscape(state)) {\n const n = state.lastIntValue\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue)\n return true\n }\n state.raise(\"Invalid named reference\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n}\npp.regexp_eatCControlLetter = function(state) {\n const start = state.pos\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp.regexp_eatControlEscape = function(state) {\n const ch = state.current()\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09 /* \\t */\n state.advance()\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A /* \\n */\n state.advance()\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B /* \\v */\n state.advance()\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C /* \\f */\n state.advance()\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D /* \\r */\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp.regexp_eatControlLetter = function(state) {\n const ch = state.current()\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU = false) {\n const start = state.pos\n const switchU = forceU || state.switchU\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n const lead = state.lastIntValue\n if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n const leadSurrogateEnd = state.pos\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n const trail = state.lastIntValue\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000\n return true\n }\n }\n state.pos = leadSurrogateEnd\n state.lastIntValue = lead\n }\n return true\n }\n if (\n switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (switchU) {\n state.raise(\"Invalid unicode escape\")\n }\n state.pos = start\n }\n\n return false\n}\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F /* / */\n return true\n }\n return false\n }\n\n const ch = state.current()\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0\n let ch = state.current()\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp.regexp_eatCharacterClassEscape = function(state) {\n const ch = state.current()\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1\n state.advance()\n return true\n }\n\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n (ch === 0x50 /* P */ || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1\n state.advance()\n if (\n state.eat(0x7B /* { */) &&\n this.regexp_eatUnicodePropertyValueExpression(state) &&\n state.eat(0x7D /* } */)\n ) {\n return true\n }\n state.raise(\"Invalid property name\")\n }\n\n return false\n}\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp.regexp_eatUnicodePropertyValueExpression = function(state) {\n const start = state.pos\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n const name = state.lastStringValue\n if (this.regexp_eatUnicodePropertyValue(state)) {\n const value = state.lastStringValue\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value)\n return true\n }\n }\n state.pos = start\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n const nameOrValue = state.lastStringValue\n this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)\n return true\n }\n return false\n}\npp.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!has(state.unicodeProperties.nonBinary, name))\n state.raise(\"Invalid property name\")\n if (!state.unicodeProperties.nonBinary[name].test(value))\n state.raise(\"Invalid property value\")\n}\npp.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (!state.unicodeProperties.binary.test(nameOrValue))\n state.raise(\"Invalid property name\")\n}\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp.regexp_eatUnicodePropertyName = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatUnicodePropertyValue = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n state.eat(0x5E /* ^ */)\n this.regexp_classRanges(state)\n if (state.eat(0x5D /* ] */)) {\n return true\n }\n // Unreachable since it threw \"unterminated regular expression\" error before.\n state.raise(\"Unterminated character class\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp.regexp_classRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n const left = state.lastIntValue\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n const right = state.lastIntValue\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\")\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\")\n }\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp.regexp_eatClassAtom = function(state) {\n const start = state.pos\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n const ch = state.current()\n if (ch === 0x63 /* c */ || isOctalDigit(ch)) {\n state.raise(\"Invalid class escape\")\n }\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n\n const ch = state.current()\n if (ch !== 0x5D /* ] */) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp.regexp_eatClassEscape = function(state) {\n const start = state.pos\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08 /* */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp.regexp_eatClassControlLetter = function(state) {\n const ch = state.current()\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatHexEscapeSequence = function(state) {\n const start = state.pos\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp.regexp_eatDecimalDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp.regexp_eatHexDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n const n1 = state.lastIntValue\n if (this.regexp_eatOctalDigit(state)) {\n const n2 = state.lastIntValue\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue\n } else {\n state.lastIntValue = n1 * 8 + n2\n }\n } else {\n state.lastIntValue = n1\n }\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp.regexp_eatOctalDigit = function(state) {\n const ch = state.current()\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30 /* 0 */\n state.advance()\n return true\n }\n state.lastIntValue = 0\n return false\n}\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatFixedHexDigits = function(state, length) {\n const start = state.pos\n state.lastIntValue = 0\n for (let i = 0; i < length; ++i) {\n const ch = state.current()\n if (!isHexDigit(ch)) {\n state.pos = start\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return true\n}\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier.js\"\nimport {types as tt, keywords as keywordTypes} from \"./tokentype.js\"\nimport {Parser} from \"./state.js\"\nimport {SourceLocation} from \"./locutil.js\"\nimport {RegExpValidationState} from \"./regexp.js\"\nimport {lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace} from \"./whitespace.js\"\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(p) {\n this.type = p.type\n this.value = p.value\n this.start = p.start\n this.end = p.end\n if (p.options.locations)\n this.loc = new SourceLocation(p, p.startLoc, p.endLoc)\n if (p.options.ranges)\n this.range = [p.start, p.end]\n }\n}\n\n// ## Tokenizer\n\nconst pp = Parser.prototype\n\n// Move to the next token\n\npp.next = function(ignoreEscapeSequenceInKeyword) {\n if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)\n this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword)\n if (this.options.onToken)\n this.options.onToken(new Token(this))\n\n this.lastTokEnd = this.end\n this.lastTokStart = this.start\n this.lastTokEndLoc = this.endLoc\n this.lastTokStartLoc = this.startLoc\n this.nextToken()\n}\n\npp.getToken = function() {\n this.next()\n return new Token(this)\n}\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n pp[Symbol.iterator] = function() {\n return {\n next: () => {\n let token = this.getToken()\n return {\n done: token.type === tt.eof,\n value: token\n }\n }\n }\n }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\npp.curContext = function() {\n return this.context[this.context.length - 1]\n}\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n let curContext = this.curContext()\n if (!curContext || !curContext.preserveSpace) this.skipSpace()\n\n this.start = this.pos\n if (this.options.locations) this.startLoc = this.curPosition()\n if (this.pos >= this.input.length) return this.finishToken(tt.eof)\n\n if (curContext.override) return curContext.override(this)\n else this.readToken(this.fullCharCodeAtPos())\n}\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n return this.readWord()\n\n return this.getTokenFromCode(code)\n}\n\npp.fullCharCodeAtPos = function() {\n let code = this.input.charCodeAt(this.pos)\n if (code <= 0xd7ff || code >= 0xe000) return code\n let next = this.input.charCodeAt(this.pos + 1)\n return (code << 10) + next - 0x35fdc00\n}\n\npp.skipBlockComment = function() {\n let startLoc = this.options.onComment && this.curPosition()\n let start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2)\n if (end === -1) this.raise(this.pos - 2, \"Unterminated comment\")\n this.pos = end + 2\n if (this.options.locations) {\n lineBreakG.lastIndex = start\n let match\n while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {\n ++this.curLine\n this.lineStart = match.index + match[0].length\n }\n }\n if (this.options.onComment)\n this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition())\n}\n\npp.skipLineComment = function(startSkip) {\n let start = this.pos\n let startLoc = this.options.onComment && this.curPosition()\n let ch = this.input.charCodeAt(this.pos += startSkip)\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos)\n }\n if (this.options.onComment)\n this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition())\n}\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n let ch = this.input.charCodeAt(this.pos)\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos\n }\n case 10: case 8232: case 8233:\n ++this.pos\n if (this.options.locations) {\n ++this.curLine\n this.lineStart = this.pos\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment()\n break\n case 47:\n this.skipLineComment(2)\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos\n } else {\n break loop\n }\n }\n }\n}\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos\n if (this.options.locations) this.endLoc = this.curPosition()\n let prevType = this.type\n this.type = type\n this.value = val\n\n this.updateContext(prevType)\n}\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n let next = this.input.charCodeAt(this.pos + 1)\n if (next >= 48 && next <= 57) return this.readNumber(true)\n let next2 = this.input.charCodeAt(this.pos + 2)\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3\n return this.finishToken(tt.ellipsis)\n } else {\n ++this.pos\n return this.finishToken(tt.dot)\n }\n}\n\npp.readToken_slash = function() { // '/'\n let next = this.input.charCodeAt(this.pos + 1)\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.slash, 1)\n}\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n let tokentype = code === 42 ? tt.star : tt.modulo\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size\n tokentype = tt.starstar\n next = this.input.charCodeAt(this.pos + 2)\n }\n\n if (next === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tokentype, size)\n}\n\npp.readToken_pipe_amp = function(code) { // '|&'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) {\n if (this.options.ecmaVersion >= 12) {\n let next2 = this.input.charCodeAt(this.pos + 2)\n if (next2 === 61) return this.finishOp(tt.assign, 3)\n }\n return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1)\n}\n\npp.readToken_caret = function() { // '^'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.bitwiseXOR, 1)\n}\n\npp.readToken_plus_min = function(code) { // '+-'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` - -```js -const { Prompt } = require('enquirer'); - -class HaiKarate extends Prompt { - constructor(options = {}) { - super(options); - this.value = options.initial || 0; - this.cursorHide(); - } - up() { - this.value++; - this.render(); - } - down() { - this.value--; - this.render(); - } - render() { - this.clear(); // clear previously rendered prompt from the terminal - this.write(`${this.state.message}: ${this.value}`); - } -} - -// Use the prompt by creating an instance of your custom prompt class. -const prompt = new HaiKarate({ - message: 'How many sprays do you want?', - initial: 10 -}); - -prompt.run() - .then(answer => console.log('Sprays:', answer)) - .catch(console.error); -``` - -If you want to be able to specify your prompt by `type` so that it may be used alongside other prompts, you will need to first create an instance of `Enquirer`. - -```js -const Enquirer = require('enquirer'); -const enquirer = new Enquirer(); -``` - -Then use the `.register()` method to add your custom prompt. - -```js -enquirer.register('haikarate', HaiKarate); -``` - -Now you can do the following when defining "questions". - -```js -let spritzer = require('cologne-drone'); -let answers = await enquirer.prompt([ - { - type: 'haikarate', - name: 'cologne', - message: 'How many sprays do you need?', - initial: 10, - async onSubmit(name, value) { - await spritzer.activate(value); //<= activate drone - return value; - } - } -]); -``` - -
- -## ❯ Key Bindings - -### All prompts - -These key combinations may be used with all prompts. - -| **command** | **description** | -| -------------------------------- | -------------------------------------- | -| ctrl + c | Cancel the prompt. | -| ctrl + g | Reset the prompt to its initial state. | - -
- -### Move cursor - -These combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). - -| **command** | **description** | -| ------------------------------ | ---------------------------------------- | -| left | Move the cursor back one character. | -| right | Move the cursor forward one character. | -| ctrl + a | Move cursor to the start of the line | -| ctrl + e | Move cursor to the end of the line | -| ctrl + b | Move cursor back one character | -| ctrl + f | Move cursor forward one character | -| ctrl + x | Toggle between first and cursor position | - -
- -### Edit Input - -These key combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). - -| **command** | **description** | -| ------------------------------ | ---------------------------------------- | -| ctrl + a | Move cursor to the start of the line | -| ctrl + e | Move cursor to the end of the line | -| ctrl + b | Move cursor back one character | -| ctrl + f | Move cursor forward one character | -| ctrl + x | Toggle between first and cursor position | - -
- -| **command (Mac)** | **command (Windows)** | **description** | -| ----------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| delete | backspace | Delete one character to the left. | -| fn + delete | delete | Delete one character to the right. | -| option + up | alt + up | Scroll to the previous item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | -| option + down | alt + down | Scroll to the next item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | - -### Select choices - -These key combinations may be used on prompts that support _multiple_ choices, such as the [multiselect prompt](#multiselect-prompt), or the [select prompt](#select-prompt) when the `multiple` options is true. - -| **command** | **description** | -| ----------------- | -------------------------------------------------------------------------------------------------------------------- | -| space | Toggle the currently selected choice when `options.multiple` is true. | -| number | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | -| a | Toggle all choices to be enabled or disabled. | -| i | Invert the current selection of choices. | -| g | Toggle the current choice group. | - -
- -### Hide/show choices - -| **command** | **description** | -| ------------------------------- | ---------------------------------------------- | -| fn + up | Decrease the number of visible choices by one. | -| fn + down | Increase the number of visible choices by one. | - -
- -### Move/lock Pointer - -| **command** | **description** | -| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| number | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | -| up | Move the pointer up. | -| down | Move the pointer down. | -| ctrl + a | Move the pointer to the first _visible_ choice. | -| ctrl + e | Move the pointer to the last _visible_ choice. | -| shift + up | Scroll up one choice without changing pointer position (locks the pointer while scrolling). | -| shift + down | Scroll down one choice without changing pointer position (locks the pointer while scrolling). | - -
- -| **command (Mac)** | **command (Windows)** | **description** | -| -------------------------------- | --------------------- | ---------------------------------------------------------- | -| fn + left | home | Move the pointer to the first choice in the choices array. | -| fn + right | end | Move the pointer to the last choice in the choices array. | - -
- -## ❯ Release History - -Please see [CHANGELOG.md](CHANGELOG.md). - -## ❯ Performance - -### System specs - -MacBook Pro, Intel Core i7, 2.5 GHz, 16 GB. - -### Load time - -Time it takes for the module to load the first time (average of 3 runs): - -``` -enquirer: 4.013ms -inquirer: 286.717ms -``` - -
- -## ❯ About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Todo - -We're currently working on documentation for the following items. Please star and watch the repository for updates! - -* [ ] Customizing symbols -* [ ] Customizing styles (palette) -* [ ] Customizing rendered input -* [ ] Customizing returned values -* [ ] Customizing key bindings -* [ ] Question validation -* [ ] Choice validation -* [ ] Skipping questions -* [ ] Async choices -* [ ] Async timers: loaders, spinners and other animations -* [ ] Links to examples -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` -```sh -$ yarn && yarn test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -#### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 283 | [jonschlinkert](https://github.com/jonschlinkert) | -| 82 | [doowb](https://github.com/doowb) | -| 32 | [rajat-sr](https://github.com/rajat-sr) | -| 20 | [318097](https://github.com/318097) | -| 15 | [g-plane](https://github.com/g-plane) | -| 12 | [pixelass](https://github.com/pixelass) | -| 5 | [adityavyas611](https://github.com/adityavyas611) | -| 5 | [satotake](https://github.com/satotake) | -| 3 | [tunnckoCore](https://github.com/tunnckoCore) | -| 3 | [Ovyerus](https://github.com/Ovyerus) | -| 3 | [sw-yx](https://github.com/sw-yx) | -| 2 | [DanielRuf](https://github.com/DanielRuf) | -| 2 | [GabeL7r](https://github.com/GabeL7r) | -| 1 | [AlCalzone](https://github.com/AlCalzone) | -| 1 | [hipstersmoothie](https://github.com/hipstersmoothie) | -| 1 | [danieldelcore](https://github.com/danieldelcore) | -| 1 | [ImgBotApp](https://github.com/ImgBotApp) | -| 1 | [jsonkao](https://github.com/jsonkao) | -| 1 | [knpwrs](https://github.com/knpwrs) | -| 1 | [yeskunall](https://github.com/yeskunall) | -| 1 | [mischah](https://github.com/mischah) | -| 1 | [renarsvilnis](https://github.com/renarsvilnis) | -| 1 | [sbugert](https://github.com/sbugert) | -| 1 | [stephencweiss](https://github.com/stephencweiss) | -| 1 | [skellock](https://github.com/skellock) | -| 1 | [whxaxes](https://github.com/whxaxes) | - -#### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -#### Credit - -Thanks to [derhuerst](https://github.com/derhuerst), creator of prompt libraries such as [prompt-skeleton](https://github.com/derhuerst/prompt-skeleton), which influenced some of the concepts we used in our prompts. - -#### License - -Copyright © 2018-present, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). \ No newline at end of file diff --git a/node_modules/enquirer/index.d.ts b/node_modules/enquirer/index.d.ts deleted file mode 100644 index bcc7752a4..000000000 --- a/node_modules/enquirer/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { EventEmitter } from "events"; - -interface BasePromptOptions { - name: string | (() => string) - type: string | (() => string) - message: string | (() => string) | (() => Promise) - initial?: any - required?: boolean - format?(value: string): string | Promise - result?(value: string): string | Promise - skip?: ((state: object) => boolean | Promise) | boolean - validate?(value: string): boolean | Promise | string | Promise - onSubmit?(name: string, value: any, prompt: Enquirer.Prompt): boolean | Promise - onCancel?(name: string, value: any, prompt: Enquirer.Prompt): boolean | Promise - stdin?: NodeJS.ReadStream - stdout?: NodeJS.WriteStream -} - -interface Choice { - name: string - message?: string - value?: string - hint?: string - disabled?: boolean | string -} - -interface ArrayPromptOptions extends BasePromptOptions { - type: - | 'autocomplete' - | 'editable' - | 'form' - | 'multiselect' - | 'select' - | 'survey' - | 'list' - | 'scale' - choices: string[] | Choice[] - maxChoices?: number - muliple?: boolean - initial?: number - delay?: number - separator?: boolean - sort?: boolean - linebreak?: boolean - edgeLength?: number - align?: 'left' | 'right' - scroll?: boolean -} - -interface BooleanPromptOptions extends BasePromptOptions { - type: 'confirm' - initial?: boolean -} - -interface StringPromptOptions extends BasePromptOptions { - type: 'input' | 'invisible' | 'list' | 'password' | 'text' - initial?: string - multiline?: boolean -} - -interface NumberPromptOptions extends BasePromptOptions { - type: 'numeral' - min?: number - max?: number - delay?: number - float?: boolean - round?: boolean - major?: number - minor?: number - initial?: number -} - -interface SnippetPromptOptions extends BasePromptOptions { - type: 'snippet' - newline?: string - template?: string -} - -interface SortPromptOptions extends BasePromptOptions { - type: 'sort' - hint?: string - drag?: boolean - numbered?: boolean -} - -type PromptOptions = - | BasePromptOptions - | ArrayPromptOptions - | BooleanPromptOptions - | StringPromptOptions - | NumberPromptOptions - | SnippetPromptOptions - | SortPromptOptions - -declare class BasePrompt extends EventEmitter { - constructor(options?: PromptOptions); - - render(): void; - - run(): Promise; - } - -declare class Enquirer extends EventEmitter { - constructor(options?: object, answers?: T); - - /** - * Register a custom prompt type. - * - * @param type - * @param fn `Prompt` class, or a function that returns a `Prompt` class. - */ - register(type: string, fn: typeof BasePrompt | (() => typeof BasePrompt)): this; - - /** - * Register a custom prompt type. - */ - register(type: { [key: string]: typeof BasePrompt | (() => typeof BasePrompt) }): this; - - /** - * Prompt function that takes a "question" object or array of question objects, - * and returns an object with responses from the user. - * - * @param questions Options objects for one or more prompts to run. - */ - prompt( - questions: - | PromptOptions - | ((this: Enquirer) => PromptOptions) - | (PromptOptions | ((this: Enquirer) => PromptOptions))[] - ): Promise; - - /** - * Use an enquirer plugin. - * - * @param plugin Plugin function that takes an instance of Enquirer. - */ - use(plugin: (this: this, enquirer: this) => void): this; -} - -declare namespace Enquirer { - function prompt( - questions: - | PromptOptions - | ((this: Enquirer) => PromptOptions) - | (PromptOptions | ((this: Enquirer) => PromptOptions))[] - ): Promise; - - class Prompt extends BasePrompt {} -} - -export = Enquirer; diff --git a/node_modules/enquirer/index.js b/node_modules/enquirer/index.js deleted file mode 100644 index d0ef3f69b..000000000 --- a/node_modules/enquirer/index.js +++ /dev/null @@ -1,250 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const Events = require('events'); -const utils = require('./lib/utils'); - -/** - * Create an instance of `Enquirer`. - * - * ```js - * const Enquirer = require('enquirer'); - * const enquirer = new Enquirer(); - * ``` - * @name Enquirer - * @param {Object} `options` (optional) Options to use with all prompts. - * @param {Object} `answers` (optional) Answers object to initialize with. - * @api public - */ - -class Enquirer extends Events { - constructor(options, answers) { - super(); - this.options = utils.merge({}, options); - this.answers = { ...answers }; - } - - /** - * Register a custom prompt type. - * - * ```js - * const Enquirer = require('enquirer'); - * const enquirer = new Enquirer(); - * enquirer.register('customType', require('./custom-prompt')); - * ``` - * @name register() - * @param {String} `type` - * @param {Function|Prompt} `fn` `Prompt` class, or a function that returns a `Prompt` class. - * @return {Object} Returns the Enquirer instance - * @api public - */ - - register(type, fn) { - if (utils.isObject(type)) { - for (let key of Object.keys(type)) this.register(key, type[key]); - return this; - } - assert.equal(typeof fn, 'function', 'expected a function'); - let name = type.toLowerCase(); - if (fn.prototype instanceof this.Prompt) { - this.prompts[name] = fn; - } else { - this.prompts[name] = fn(this.Prompt, this); - } - return this; - } - - /** - * Prompt function that takes a "question" object or array of question objects, - * and returns an object with responses from the user. - * - * ```js - * const Enquirer = require('enquirer'); - * const enquirer = new Enquirer(); - * - * const response = await enquirer.prompt({ - * type: 'input', - * name: 'username', - * message: 'What is your username?' - * }); - * console.log(response); - * ``` - * @name prompt() - * @param {Array|Object} `questions` Options objects for one or more prompts to run. - * @return {Promise} Promise that returns an "answers" object with the user's responses. - * @api public - */ - - async prompt(questions = []) { - for (let question of [].concat(questions)) { - try { - if (typeof question === 'function') question = await question.call(this); - await this.ask(utils.merge({}, this.options, question)); - } catch (err) { - return Promise.reject(err); - } - } - return this.answers; - } - - async ask(question) { - if (typeof question === 'function') { - question = await question.call(this); - } - - let opts = utils.merge({}, this.options, question); - let { type, name } = question; - let { set, get } = utils; - - if (typeof type === 'function') { - type = await type.call(this, question, this.answers); - } - - if (!type) return this.answers[name]; - - assert(this.prompts[type], `Prompt "${type}" is not registered`); - - let prompt = new this.prompts[type](opts); - let value = get(this.answers, name); - - prompt.state.answers = this.answers; - prompt.enquirer = this; - - if (name) { - prompt.on('submit', value => { - this.emit('answer', name, value, prompt); - set(this.answers, name, value); - }); - } - - // bubble events - let emit = prompt.emit.bind(prompt); - prompt.emit = (...args) => { - this.emit.call(this, ...args); - return emit(...args); - }; - - this.emit('prompt', prompt, this); - - if (opts.autofill && value != null) { - prompt.value = prompt.input = value; - - // if "autofill=show" render the prompt, otherwise stay "silent" - if (opts.autofill === 'show') { - await prompt.submit(); - } - } else { - value = prompt.value = await prompt.run(); - } - - return value; - } - - /** - * Use an enquirer plugin. - * - * ```js - * const Enquirer = require('enquirer'); - * const enquirer = new Enquirer(); - * const plugin = enquirer => { - * // do stuff to enquire instance - * }; - * enquirer.use(plugin); - * ``` - * @name use() - * @param {Function} `plugin` Plugin function that takes an instance of Enquirer. - * @return {Object} Returns the Enquirer instance. - * @api public - */ - - use(plugin) { - plugin.call(this, this); - return this; - } - - set Prompt(value) { - this._Prompt = value; - } - get Prompt() { - return this._Prompt || this.constructor.Prompt; - } - - get prompts() { - return this.constructor.prompts; - } - - static set Prompt(value) { - this._Prompt = value; - } - static get Prompt() { - return this._Prompt || require('./lib/prompt'); - } - - static get prompts() { - return require('./lib/prompts'); - } - - static get types() { - return require('./lib/types'); - } - - /** - * Prompt function that takes a "question" object or array of question objects, - * and returns an object with responses from the user. - * - * ```js - * const { prompt } = require('enquirer'); - * const response = await prompt({ - * type: 'input', - * name: 'username', - * message: 'What is your username?' - * }); - * console.log(response); - * ``` - * @name Enquirer#prompt - * @param {Array|Object} `questions` Options objects for one or more prompts to run. - * @return {Promise} Promise that returns an "answers" object with the user's responses. - * @api public - */ - - static get prompt() { - const fn = (questions, ...rest) => { - let enquirer = new this(...rest); - let emit = enquirer.emit.bind(enquirer); - enquirer.emit = (...args) => { - fn.emit(...args); - return emit(...args); - }; - return enquirer.prompt(questions); - }; - utils.mixinEmitter(fn, new Events()); - return fn; - } -} - -utils.mixinEmitter(Enquirer, new Events()); -const prompts = Enquirer.prompts; - -for (let name of Object.keys(prompts)) { - let key = name.toLowerCase(); - - let run = options => new prompts[name](options).run(); - Enquirer.prompt[key] = run; - Enquirer[key] = run; - - if (!Enquirer[name]) { - Reflect.defineProperty(Enquirer, name, { get: () => prompts[name] }); - } -} - -const exp = name => { - utils.defineExport(Enquirer, name, () => Enquirer.types[name]); -}; - -exp('ArrayPrompt'); -exp('AuthPrompt'); -exp('BooleanPrompt'); -exp('NumberPrompt'); -exp('StringPrompt'); - -module.exports = Enquirer; diff --git a/node_modules/enquirer/lib/ansi.js b/node_modules/enquirer/lib/ansi.js deleted file mode 100644 index 1ba19813d..000000000 --- a/node_modules/enquirer/lib/ansi.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const isTerm = process.env.TERM_PROGRAM === 'Apple_Terminal'; -const colors = require('ansi-colors'); -const utils = require('./utils'); -const ansi = module.exports = exports; -const ESC = '\u001b['; -const BEL = '\u0007'; -let hidden = false; - -const code = ansi.code = { - bell: BEL, - beep: BEL, - beginning: `${ESC}G`, - down: `${ESC}J`, - esc: ESC, - getPosition: `${ESC}6n`, - hide: `${ESC}?25l`, - line: `${ESC}2K`, - lineEnd: `${ESC}K`, - lineStart: `${ESC}1K`, - restorePosition: ESC + (isTerm ? '8' : 'u'), - savePosition: ESC + (isTerm ? '7' : 's'), - screen: `${ESC}2J`, - show: `${ESC}?25h`, - up: `${ESC}1J` -}; - -const cursor = ansi.cursor = { - get hidden() { - return hidden; - }, - - hide() { - hidden = true; - return code.hide; - }, - show() { - hidden = false; - return code.show; - }, - - forward: (count = 1) => `${ESC}${count}C`, - backward: (count = 1) => `${ESC}${count}D`, - nextLine: (count = 1) => `${ESC}E`.repeat(count), - prevLine: (count = 1) => `${ESC}F`.repeat(count), - - up: (count = 1) => count ? `${ESC}${count}A` : '', - down: (count = 1) => count ? `${ESC}${count}B` : '', - right: (count = 1) => count ? `${ESC}${count}C` : '', - left: (count = 1) => count ? `${ESC}${count}D` : '', - - to(x, y) { - return y ? `${ESC}${y + 1};${x + 1}H` : `${ESC}${x + 1}G`; - }, - - move(x = 0, y = 0) { - let res = ''; - res += (x < 0) ? cursor.left(-x) : (x > 0) ? cursor.right(x) : ''; - res += (y < 0) ? cursor.up(-y) : (y > 0) ? cursor.down(y) : ''; - return res; - }, - - restore(state = {}) { - let { after, cursor, initial, input, prompt, size, value } = state; - initial = utils.isPrimitive(initial) ? String(initial) : ''; - input = utils.isPrimitive(input) ? String(input) : ''; - value = utils.isPrimitive(value) ? String(value) : ''; - - if (size) { - let codes = ansi.cursor.up(size) + ansi.cursor.to(prompt.length); - let diff = input.length - cursor; - if (diff > 0) { - codes += ansi.cursor.left(diff); - } - return codes; - } - - if (value || after) { - let pos = (!input && !!initial) ? -initial.length : -input.length + cursor; - if (after) pos -= after.length; - if (input === '' && initial && !prompt.includes(initial)) { - pos += initial.length; - } - return ansi.cursor.move(pos); - } - } -}; - -const erase = ansi.erase = { - screen: code.screen, - up: code.up, - down: code.down, - line: code.line, - lineEnd: code.lineEnd, - lineStart: code.lineStart, - lines(n) { - let str = ''; - for (let i = 0; i < n; i++) { - str += ansi.erase.line + (i < n - 1 ? ansi.cursor.up(1) : ''); - } - if (n) str += ansi.code.beginning; - return str; - } -}; - -ansi.clear = (input = '', columns = process.stdout.columns) => { - if (!columns) return erase.line + cursor.to(0); - let width = str => [...colors.unstyle(str)].length; - let lines = input.split(/\r?\n/); - let rows = 0; - for (let line of lines) { - rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / columns); - } - return (erase.line + cursor.prevLine()).repeat(rows - 1) + erase.line + cursor.to(0); -}; diff --git a/node_modules/enquirer/lib/combos.js b/node_modules/enquirer/lib/combos.js deleted file mode 100644 index 5b9d86c55..000000000 --- a/node_modules/enquirer/lib/combos.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -/** - * Actions are mappings from keypress event names to method names - * in the prompts. - */ - -exports.ctrl = { - a: 'first', - b: 'backward', - c: 'cancel', - d: 'deleteForward', - e: 'last', - f: 'forward', - g: 'reset', - i: 'tab', - k: 'cutForward', - l: 'reset', - n: 'newItem', - m: 'cancel', - j: 'submit', - p: 'search', - r: 'remove', - s: 'save', - u: 'undo', - w: 'cutLeft', - x: 'toggleCursor', - v: 'paste' -}; - -exports.shift = { - up: 'shiftUp', - down: 'shiftDown', - left: 'shiftLeft', - right: 'shiftRight', - tab: 'prev' -}; - -exports.fn = { - up: 'pageUp', - down: 'pageDown', - left: 'pageLeft', - right: 'pageRight', - delete: 'deleteForward' -}; - -// on Windows -exports.option = { - b: 'backward', - f: 'forward', - d: 'cutRight', - left: 'cutLeft', - up: 'altUp', - down: 'altDown' -}; - -exports.keys = { - pageup: 'pageUp', // + (mac), (windows) - pagedown: 'pageDown', // + (mac), (windows) - home: 'home', // + (mac), (windows) - end: 'end', // + (mac), (windows) - cancel: 'cancel', - delete: 'deleteForward', - backspace: 'delete', - down: 'down', - enter: 'submit', - escape: 'cancel', - left: 'left', - space: 'space', - number: 'number', - return: 'submit', - right: 'right', - tab: 'next', - up: 'up' -}; diff --git a/node_modules/enquirer/lib/completer.js b/node_modules/enquirer/lib/completer.js deleted file mode 100644 index 4a50af0a1..000000000 --- a/node_modules/enquirer/lib/completer.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const unique = arr => arr.filter((v, i) => arr.lastIndexOf(v) === i); -const compact = arr => unique(arr).filter(Boolean); - -module.exports = (action, data = {}, value = '') => { - let { past = [], present = '' } = data; - let rest, prev; - - switch (action) { - case 'prev': - case 'undo': - rest = past.slice(0, past.length - 1); - prev = past[past.length - 1] || ''; - return { - past: compact([value, ...rest]), - present: prev - }; - - case 'next': - case 'redo': - rest = past.slice(1); - prev = past[0] || ''; - return { - past: compact([...rest, value]), - present: prev - }; - - case 'save': - return { - past: compact([...past, value]), - present: '' - }; - - case 'remove': - prev = compact(past.filter(v => v !== value)); - present = ''; - - if (prev.length) { - present = prev.pop(); - } - - return { - past: prev, - present - }; - - default: { - throw new Error(`Invalid action: "${action}"`); - } - } -}; diff --git a/node_modules/enquirer/lib/interpolate.js b/node_modules/enquirer/lib/interpolate.js deleted file mode 100644 index c3d9b3f3f..000000000 --- a/node_modules/enquirer/lib/interpolate.js +++ /dev/null @@ -1,266 +0,0 @@ -'use strict'; - -const colors = require('ansi-colors'); -const clean = (str = '') => { - return typeof str === 'string' ? str.replace(/^['"]|['"]$/g, '') : ''; -}; - -/** - * This file contains the interpolation and rendering logic for - * the Snippet prompt. - */ - -class Item { - constructor(token) { - this.name = token.key; - this.field = token.field || {}; - this.value = clean(token.initial || this.field.initial || ''); - this.message = token.message || this.name; - this.cursor = 0; - this.input = ''; - this.lines = []; - } -} - -const tokenize = async(options = {}, defaults = {}, fn = token => token) => { - let unique = new Set(); - let fields = options.fields || []; - let input = options.template; - let tabstops = []; - let items = []; - let keys = []; - let line = 1; - - if (typeof input === 'function') { - input = await input(); - } - - let i = -1; - let next = () => input[++i]; - let peek = () => input[i + 1]; - let push = token => { - token.line = line; - tabstops.push(token); - }; - - push({ type: 'bos', value: '' }); - - while (i < input.length - 1) { - let value = next(); - - if (/^[^\S\n ]$/.test(value)) { - push({ type: 'text', value }); - continue; - } - - if (value === '\n') { - push({ type: 'newline', value }); - line++; - continue; - } - - if (value === '\\') { - value += next(); - push({ type: 'text', value }); - continue; - } - - if ((value === '$' || value === '#' || value === '{') && peek() === '{') { - let n = next(); - value += n; - - let token = { type: 'template', open: value, inner: '', close: '', value }; - let ch; - - while ((ch = next())) { - if (ch === '}') { - if (peek() === '}') ch += next(); - token.value += ch; - token.close = ch; - break; - } - - if (ch === ':') { - token.initial = ''; - token.key = token.inner; - } else if (token.initial !== void 0) { - token.initial += ch; - } - - token.value += ch; - token.inner += ch; - } - - token.template = token.open + (token.initial || token.inner) + token.close; - token.key = token.key || token.inner; - - if (defaults.hasOwnProperty(token.key)) { - token.initial = defaults[token.key]; - } - - token = fn(token); - push(token); - - keys.push(token.key); - unique.add(token.key); - - let item = items.find(item => item.name === token.key); - token.field = fields.find(ch => ch.name === token.key); - - if (!item) { - item = new Item(token); - items.push(item); - } - - item.lines.push(token.line - 1); - continue; - } - - let last = tabstops[tabstops.length - 1]; - if (last.type === 'text' && last.line === line) { - last.value += value; - } else { - push({ type: 'text', value }); - } - } - - push({ type: 'eos', value: '' }); - return { input, tabstops, unique, keys, items }; -}; - -module.exports = async prompt => { - let options = prompt.options; - let required = new Set(options.required === true ? [] : (options.required || [])); - let defaults = { ...options.values, ...options.initial }; - let { tabstops, items, keys } = await tokenize(options, defaults); - - let result = createFn('result', prompt, options); - let format = createFn('format', prompt, options); - let isValid = createFn('validate', prompt, options, true); - let isVal = prompt.isValue.bind(prompt); - - return async(state = {}, submitted = false) => { - let index = 0; - - state.required = required; - state.items = items; - state.keys = keys; - state.output = ''; - - let validate = async(value, state, item, index) => { - let error = await isValid(value, state, item, index); - if (error === false) { - return 'Invalid field ' + item.name; - } - return error; - }; - - for (let token of tabstops) { - let value = token.value; - let key = token.key; - - if (token.type !== 'template') { - if (value) state.output += value; - continue; - } - - if (token.type === 'template') { - let item = items.find(ch => ch.name === key); - - if (options.required === true) { - state.required.add(item.name); - } - - let val = [item.input, state.values[item.value], item.value, value].find(isVal); - let field = item.field || {}; - let message = field.message || token.inner; - - if (submitted) { - let error = await validate(state.values[key], state, item, index); - if ((error && typeof error === 'string') || error === false) { - state.invalid.set(key, error); - continue; - } - - state.invalid.delete(key); - let res = await result(state.values[key], state, item, index); - state.output += colors.unstyle(res); - continue; - } - - item.placeholder = false; - - let before = value; - value = await format(value, state, item, index); - - if (val !== value) { - state.values[key] = val; - value = prompt.styles.typing(val); - state.missing.delete(message); - - } else { - state.values[key] = void 0; - val = `<${message}>`; - value = prompt.styles.primary(val); - item.placeholder = true; - - if (state.required.has(key)) { - state.missing.add(message); - } - } - - if (state.missing.has(message) && state.validating) { - value = prompt.styles.warning(val); - } - - if (state.invalid.has(key) && state.validating) { - value = prompt.styles.danger(val); - } - - if (index === state.index) { - if (before !== value) { - value = prompt.styles.underline(value); - } else { - value = prompt.styles.heading(colors.unstyle(value)); - } - } - - index++; - } - - if (value) { - state.output += value; - } - } - - let lines = state.output.split('\n').map(l => ' ' + l); - let len = items.length; - let done = 0; - - for (let item of items) { - if (state.invalid.has(item.name)) { - item.lines.forEach(i => { - if (lines[i][0] !== ' ') return; - lines[i] = state.styles.danger(state.symbols.bullet) + lines[i].slice(1); - }); - } - - if (prompt.isValue(state.values[item.name])) { - done++; - } - } - - state.completed = ((done / len) * 100).toFixed(0); - state.output = lines.join('\n'); - return state.output; - }; -}; - -function createFn(prop, prompt, options, fallback) { - return (value, state, item, index) => { - if (typeof item.field[prop] === 'function') { - return item.field[prop].call(prompt, value, state, item, index); - } - return [fallback, value].find(v => prompt.isValue(v)); - }; -} diff --git a/node_modules/enquirer/lib/keypress.js b/node_modules/enquirer/lib/keypress.js deleted file mode 100644 index 15d731497..000000000 --- a/node_modules/enquirer/lib/keypress.js +++ /dev/null @@ -1,243 +0,0 @@ -'use strict'; - -const readline = require('readline'); -const combos = require('./combos'); - -/* eslint-disable no-control-regex */ -const metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/; -const fnKeyRe = /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/; -const keyName = { - /* xterm/gnome ESC O letter */ - 'OP': 'f1', - 'OQ': 'f2', - 'OR': 'f3', - 'OS': 'f4', - /* xterm/rxvt ESC [ number ~ */ - '[11~': 'f1', - '[12~': 'f2', - '[13~': 'f3', - '[14~': 'f4', - /* from Cygwin and used in libuv */ - '[[A': 'f1', - '[[B': 'f2', - '[[C': 'f3', - '[[D': 'f4', - '[[E': 'f5', - /* common */ - '[15~': 'f5', - '[17~': 'f6', - '[18~': 'f7', - '[19~': 'f8', - '[20~': 'f9', - '[21~': 'f10', - '[23~': 'f11', - '[24~': 'f12', - /* xterm ESC [ letter */ - '[A': 'up', - '[B': 'down', - '[C': 'right', - '[D': 'left', - '[E': 'clear', - '[F': 'end', - '[H': 'home', - /* xterm/gnome ESC O letter */ - 'OA': 'up', - 'OB': 'down', - 'OC': 'right', - 'OD': 'left', - 'OE': 'clear', - 'OF': 'end', - 'OH': 'home', - /* xterm/rxvt ESC [ number ~ */ - '[1~': 'home', - '[2~': 'insert', - '[3~': 'delete', - '[4~': 'end', - '[5~': 'pageup', - '[6~': 'pagedown', - /* putty */ - '[[5~': 'pageup', - '[[6~': 'pagedown', - /* rxvt */ - '[7~': 'home', - '[8~': 'end', - /* rxvt keys with modifiers */ - '[a': 'up', - '[b': 'down', - '[c': 'right', - '[d': 'left', - '[e': 'clear', - - '[2$': 'insert', - '[3$': 'delete', - '[5$': 'pageup', - '[6$': 'pagedown', - '[7$': 'home', - '[8$': 'end', - - 'Oa': 'up', - 'Ob': 'down', - 'Oc': 'right', - 'Od': 'left', - 'Oe': 'clear', - - '[2^': 'insert', - '[3^': 'delete', - '[5^': 'pageup', - '[6^': 'pagedown', - '[7^': 'home', - '[8^': 'end', - /* misc. */ - '[Z': 'tab', -} - -function isShiftKey(code) { - return ['[a', '[b', '[c', '[d', '[e', '[2$', '[3$', '[5$', '[6$', '[7$', '[8$', '[Z'].includes(code) -} - -function isCtrlKey(code) { - return [ 'Oa', 'Ob', 'Oc', 'Od', 'Oe', '[2^', '[3^', '[5^', '[6^', '[7^', '[8^'].includes(code) -} - -const keypress = (s = '', event = {}) => { - let parts; - let key = { - name: event.name, - ctrl: false, - meta: false, - shift: false, - option: false, - sequence: s, - raw: s, - ...event - }; - - if (Buffer.isBuffer(s)) { - if (s[0] > 127 && s[1] === void 0) { - s[0] -= 128; - s = '\x1b' + String(s); - } else { - s = String(s); - } - } else if (s !== void 0 && typeof s !== 'string') { - s = String(s); - } else if (!s) { - s = key.sequence || ''; - } - - key.sequence = key.sequence || s || key.name; - - if (s === '\r') { - // carriage return - key.raw = void 0; - key.name = 'return'; - } else if (s === '\n') { - // enter, should have been called linefeed - key.name = 'enter'; - } else if (s === '\t') { - // tab - key.name = 'tab'; - } else if (s === '\b' || s === '\x7f' || s === '\x1b\x7f' || s === '\x1b\b') { - // backspace or ctrl+h - key.name = 'backspace'; - key.meta = s.charAt(0) === '\x1b'; - } else if (s === '\x1b' || s === '\x1b\x1b') { - // escape key - key.name = 'escape'; - key.meta = s.length === 2; - } else if (s === ' ' || s === '\x1b ') { - key.name = 'space'; - key.meta = s.length === 2; - } else if (s <= '\x1a') { - // ctrl+letter - key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1); - key.ctrl = true; - } else if (s.length === 1 && s >= '0' && s <= '9') { - // number - key.name = 'number'; - } else if (s.length === 1 && s >= 'a' && s <= 'z') { - // lowercase letter - key.name = s; - } else if (s.length === 1 && s >= 'A' && s <= 'Z') { - // shift+letter - key.name = s.toLowerCase(); - key.shift = true; - } else if ((parts = metaKeyCodeRe.exec(s))) { - // meta+character key - key.meta = true; - key.shift = /^[A-Z]$/.test(parts[1]); - } else if ((parts = fnKeyRe.exec(s))) { - let segs = [...s]; - - if (segs[0] === '\u001b' && segs[1] === '\u001b') { - key.option = true; - } - - // ansi escape sequence - // reassemble the key code leaving out leading \x1b's, - // the modifier key bitflag and any meaningless "1;" sequence - let code = [parts[1], parts[2], parts[4], parts[6]].filter(Boolean).join(''); - let modifier = (parts[3] || parts[5] || 1) - 1; - - // Parse the key modifier - key.ctrl = !!(modifier & 4); - key.meta = !!(modifier & 10); - key.shift = !!(modifier & 1); - key.code = code; - - key.name = keyName[code]; - key.shift = isShiftKey(code) || key.shift; - key.ctrl = isCtrlKey(code) || key.ctrl; - } - return key; -}; - -keypress.listen = (options = {}, onKeypress) => { - let { stdin } = options; - - if (!stdin || (stdin !== process.stdin && !stdin.isTTY)) { - throw new Error('Invalid stream passed'); - } - - let rl = readline.createInterface({ terminal: true, input: stdin }); - readline.emitKeypressEvents(stdin, rl); - - let on = (buf, key) => onKeypress(buf, keypress(buf, key), rl); - let isRaw = stdin.isRaw; - - if (stdin.isTTY) stdin.setRawMode(true); - stdin.on('keypress', on); - rl.resume(); - - let off = () => { - if (stdin.isTTY) stdin.setRawMode(isRaw); - stdin.removeListener('keypress', on); - rl.pause(); - rl.close(); - }; - - return off; -}; - -keypress.action = (buf, key, customActions) => { - let obj = { ...combos, ...customActions }; - if (key.ctrl) { - key.action = obj.ctrl[key.name]; - return key; - } - - if (key.option && obj.option) { - key.action = obj.option[key.name]; - return key; - } - - if (key.shift) { - key.action = obj.shift[key.name]; - return key; - } - - key.action = obj.keys[key.name]; - return key; -}; - -module.exports = keypress; diff --git a/node_modules/enquirer/lib/placeholder.js b/node_modules/enquirer/lib/placeholder.js deleted file mode 100644 index ae2af1cff..000000000 --- a/node_modules/enquirer/lib/placeholder.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const utils = require('./utils'); - -/** - * Render a placeholder value with cursor and styling based on the - * position of the cursor. - * - * @param {Object} `prompt` Prompt instance. - * @param {String} `input` Input string. - * @param {String} `initial` The initial user-provided value. - * @param {Number} `pos` Current cursor position. - * @param {Boolean} `showCursor` Render a simulated cursor using the inverse primary style. - * @return {String} Returns the styled placeholder string. - * @api public - */ - -module.exports = (prompt, options = {}) => { - prompt.cursorHide(); - - let { input = '', initial = '', pos, showCursor = true, color } = options; - let style = color || prompt.styles.placeholder; - let inverse = utils.inverse(prompt.styles.primary); - let blinker = str => inverse(prompt.styles.black(str)); - let output = input; - let char = ' '; - let reverse = blinker(char); - - if (prompt.blink && prompt.blink.off === true) { - blinker = str => str; - reverse = ''; - } - - if (showCursor && pos === 0 && initial === '' && input === '') { - return blinker(char); - } - - if (showCursor && pos === 0 && (input === initial || input === '')) { - return blinker(initial[0]) + style(initial.slice(1)); - } - - initial = utils.isPrimitive(initial) ? `${initial}` : ''; - input = utils.isPrimitive(input) ? `${input}` : ''; - - let placeholder = initial && initial.startsWith(input) && initial !== input; - let cursor = placeholder ? blinker(initial[input.length]) : reverse; - - if (pos !== input.length && showCursor === true) { - output = input.slice(0, pos) + blinker(input[pos]) + input.slice(pos + 1); - cursor = ''; - } - - if (showCursor === false) { - cursor = ''; - } - - if (placeholder) { - let raw = prompt.styles.unstyle(output + cursor); - return output + cursor + style(initial.slice(raw.length)); - } - - return output + cursor; -}; diff --git a/node_modules/enquirer/lib/prompt.js b/node_modules/enquirer/lib/prompt.js deleted file mode 100644 index 65f7bdd1e..000000000 --- a/node_modules/enquirer/lib/prompt.js +++ /dev/null @@ -1,485 +0,0 @@ -'use strict'; - -const Events = require('events'); -const colors = require('ansi-colors'); -const keypress = require('./keypress'); -const timer = require('./timer'); -const State = require('./state'); -const theme = require('./theme'); -const utils = require('./utils'); -const ansi = require('./ansi'); - -/** - * Base class for creating a new Prompt. - * @param {Object} `options` Question object. - */ - -class Prompt extends Events { - constructor(options = {}) { - super(); - this.name = options.name; - this.type = options.type; - this.options = options; - theme(this); - timer(this); - this.state = new State(this); - this.initial = [options.initial, options.default].find(v => v != null); - this.stdout = options.stdout || process.stdout; - this.stdin = options.stdin || process.stdin; - this.scale = options.scale || 1; - this.term = this.options.term || process.env.TERM_PROGRAM; - this.margin = margin(this.options.margin); - this.setMaxListeners(0); - setOptions(this); - } - - async keypress(input, event = {}) { - this.keypressed = true; - let key = keypress.action(input, keypress(input, event), this.options.actions); - this.state.keypress = key; - this.emit('keypress', input, key); - this.emit('state', this.state.clone()); - let fn = this.options[key.action] || this[key.action] || this.dispatch; - if (typeof fn === 'function') { - return await fn.call(this, input, key); - } - this.alert(); - } - - alert() { - delete this.state.alert; - if (this.options.show === false) { - this.emit('alert'); - } else { - this.stdout.write(ansi.code.beep); - } - } - - cursorHide() { - this.stdout.write(ansi.cursor.hide()); - utils.onExit(() => this.cursorShow()); - } - - cursorShow() { - this.stdout.write(ansi.cursor.show()); - } - - write(str) { - if (!str) return; - if (this.stdout && this.state.show !== false) { - this.stdout.write(str); - } - this.state.buffer += str; - } - - clear(lines = 0) { - let buffer = this.state.buffer; - this.state.buffer = ''; - if ((!buffer && !lines) || this.options.show === false) return; - this.stdout.write(ansi.cursor.down(lines) + ansi.clear(buffer, this.width)); - } - - restore() { - if (this.state.closed || this.options.show === false) return; - - let { prompt, after, rest } = this.sections(); - let { cursor, initial = '', input = '', value = '' } = this; - - let size = this.state.size = rest.length; - let state = { after, cursor, initial, input, prompt, size, value }; - let codes = ansi.cursor.restore(state); - if (codes) { - this.stdout.write(codes); - } - } - - sections() { - let { buffer, input, prompt } = this.state; - prompt = colors.unstyle(prompt); - let buf = colors.unstyle(buffer); - let idx = buf.indexOf(prompt); - let header = buf.slice(0, idx); - let rest = buf.slice(idx); - let lines = rest.split('\n'); - let first = lines[0]; - let last = lines[lines.length - 1]; - let promptLine = prompt + (input ? ' ' + input : ''); - let len = promptLine.length; - let after = len < first.length ? first.slice(len + 1) : ''; - return { header, prompt: first, after, rest: lines.slice(1), last }; - } - - async submit() { - this.state.submitted = true; - this.state.validating = true; - - // this will only be called when the prompt is directly submitted - // without initializing, i.e. when the prompt is skipped, etc. Otherwize, - // "options.onSubmit" is will be handled by the "initialize()" method. - if (this.options.onSubmit) { - await this.options.onSubmit.call(this, this.name, this.value, this); - } - - let result = this.state.error || await this.validate(this.value, this.state); - if (result !== true) { - let error = '\n' + this.symbols.pointer + ' '; - - if (typeof result === 'string') { - error += result.trim(); - } else { - error += 'Invalid input'; - } - - this.state.error = '\n' + this.styles.danger(error); - this.state.submitted = false; - await this.render(); - await this.alert(); - this.state.validating = false; - this.state.error = void 0; - return; - } - - this.state.validating = false; - await this.render(); - await this.close(); - - this.value = await this.result(this.value); - this.emit('submit', this.value); - } - - async cancel(err) { - this.state.cancelled = this.state.submitted = true; - - await this.render(); - await this.close(); - - if (typeof this.options.onCancel === 'function') { - await this.options.onCancel.call(this, this.name, this.value, this); - } - - this.emit('cancel', await this.error(err)); - } - - async close() { - this.state.closed = true; - - try { - let sections = this.sections(); - let lines = Math.ceil(sections.prompt.length / this.width); - if (sections.rest) { - this.write(ansi.cursor.down(sections.rest.length)); - } - this.write('\n'.repeat(lines)); - } catch (err) { /* do nothing */ } - - this.emit('close'); - } - - start() { - if (!this.stop && this.options.show !== false) { - this.stop = keypress.listen(this, this.keypress.bind(this)); - this.once('close', this.stop); - } - } - - async skip() { - this.skipped = this.options.skip === true; - if (typeof this.options.skip === 'function') { - this.skipped = await this.options.skip.call(this, this.name, this.value); - } - return this.skipped; - } - - async initialize() { - let { format, options, result } = this; - - this.format = () => format.call(this, this.value); - this.result = () => result.call(this, this.value); - - if (typeof options.initial === 'function') { - this.initial = await options.initial.call(this, this); - } - - if (typeof options.onRun === 'function') { - await options.onRun.call(this, this); - } - - // if "options.onSubmit" is defined, we wrap the "submit" method to guarantee - // that "onSubmit" will always called first thing inside the submit - // method, regardless of how it's handled in inheriting prompts. - if (typeof options.onSubmit === 'function') { - let onSubmit = options.onSubmit.bind(this); - let submit = this.submit.bind(this); - delete this.options.onSubmit; - this.submit = async() => { - await onSubmit(this.name, this.value, this); - return submit(); - }; - } - - await this.start(); - await this.render(); - } - - render() { - throw new Error('expected prompt to have a custom render method'); - } - - run() { - return new Promise(async(resolve, reject) => { - this.once('submit', resolve); - this.once('cancel', reject); - if (await this.skip()) { - this.render = () => {}; - return this.submit(); - } - await this.initialize(); - this.emit('run'); - }); - } - - async element(name, choice, i) { - let { options, state, symbols, timers } = this; - let timer = timers && timers[name]; - state.timer = timer; - let value = options[name] || state[name] || symbols[name]; - let val = choice && choice[name] != null ? choice[name] : await value; - if (val === '') return val; - - let res = await this.resolve(val, state, choice, i); - if (!res && choice && choice[name]) { - return this.resolve(value, state, choice, i); - } - return res; - } - - async prefix() { - let element = await this.element('prefix') || this.symbols; - let timer = this.timers && this.timers.prefix; - let state = this.state; - state.timer = timer; - if (utils.isObject(element)) element = element[state.status] || element.pending; - if (!utils.hasColor(element)) { - let style = this.styles[state.status] || this.styles.pending; - return style(element); - } - return element; - } - - async message() { - let message = await this.element('message'); - if (!utils.hasColor(message)) { - return this.styles.strong(message); - } - return message; - } - - async separator() { - let element = await this.element('separator') || this.symbols; - let timer = this.timers && this.timers.separator; - let state = this.state; - state.timer = timer; - let value = element[state.status] || element.pending || state.separator; - let ele = await this.resolve(value, state); - if (utils.isObject(ele)) ele = ele[state.status] || ele.pending; - if (!utils.hasColor(ele)) { - return this.styles.muted(ele); - } - return ele; - } - - async pointer(choice, i) { - let val = await this.element('pointer', choice, i); - - if (typeof val === 'string' && utils.hasColor(val)) { - return val; - } - - if (val) { - let styles = this.styles; - let focused = this.index === i; - let style = focused ? styles.primary : val => val; - let ele = await this.resolve(val[focused ? 'on' : 'off'] || val, this.state); - let styled = !utils.hasColor(ele) ? style(ele) : ele; - return focused ? styled : ' '.repeat(ele.length); - } - } - - async indicator(choice, i) { - let val = await this.element('indicator', choice, i); - if (typeof val === 'string' && utils.hasColor(val)) { - return val; - } - if (val) { - let styles = this.styles; - let enabled = choice.enabled === true; - let style = enabled ? styles.success : styles.dark; - let ele = val[enabled ? 'on' : 'off'] || val; - return !utils.hasColor(ele) ? style(ele) : ele; - } - return ''; - } - - body() { - return null; - } - - footer() { - if (this.state.status === 'pending') { - return this.element('footer'); - } - } - - header() { - if (this.state.status === 'pending') { - return this.element('header'); - } - } - - async hint() { - if (this.state.status === 'pending' && !this.isValue(this.state.input)) { - let hint = await this.element('hint'); - if (!utils.hasColor(hint)) { - return this.styles.muted(hint); - } - return hint; - } - } - - error(err) { - return !this.state.submitted ? (err || this.state.error) : ''; - } - - format(value) { - return value; - } - - result(value) { - return value; - } - - validate(value) { - if (this.options.required === true) { - return this.isValue(value); - } - return true; - } - - isValue(value) { - return value != null && value !== ''; - } - - resolve(value, ...args) { - return utils.resolve(this, value, ...args); - } - - get base() { - return Prompt.prototype; - } - - get style() { - return this.styles[this.state.status]; - } - - get height() { - return this.options.rows || utils.height(this.stdout, 25); - } - get width() { - return this.options.columns || utils.width(this.stdout, 80); - } - get size() { - return { width: this.width, height: this.height }; - } - - set cursor(value) { - this.state.cursor = value; - } - get cursor() { - return this.state.cursor; - } - - set input(value) { - this.state.input = value; - } - get input() { - return this.state.input; - } - - set value(value) { - this.state.value = value; - } - get value() { - let { input, value } = this.state; - let result = [value, input].find(this.isValue.bind(this)); - return this.isValue(result) ? result : this.initial; - } - - static get prompt() { - return options => new this(options).run(); - } -} - -function setOptions(prompt) { - let isValidKey = key => { - return prompt[key] === void 0 || typeof prompt[key] === 'function'; - }; - - let ignore = [ - 'actions', - 'choices', - 'initial', - 'margin', - 'roles', - 'styles', - 'symbols', - 'theme', - 'timers', - 'value' - ]; - - let ignoreFn = [ - 'body', - 'footer', - 'error', - 'header', - 'hint', - 'indicator', - 'message', - 'prefix', - 'separator', - 'skip' - ]; - - for (let key of Object.keys(prompt.options)) { - if (ignore.includes(key)) continue; - if (/^on[A-Z]/.test(key)) continue; - let option = prompt.options[key]; - if (typeof option === 'function' && isValidKey(key)) { - if (!ignoreFn.includes(key)) { - prompt[key] = option.bind(prompt); - } - } else if (typeof prompt[key] !== 'function') { - prompt[key] = option; - } - } -} - -function margin(value) { - if (typeof value === 'number') { - value = [value, value, value, value]; - } - let arr = [].concat(value || []); - let pad = i => i % 2 === 0 ? '\n' : ' '; - let res = []; - for (let i = 0; i < 4; i++) { - let char = pad(i); - if (arr[i]) { - res.push(char.repeat(arr[i])); - } else { - res.push(''); - } - } - return res; -} - -module.exports = Prompt; diff --git a/node_modules/enquirer/lib/prompts/autocomplete.js b/node_modules/enquirer/lib/prompts/autocomplete.js deleted file mode 100644 index daa4a16af..000000000 --- a/node_modules/enquirer/lib/prompts/autocomplete.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const Select = require('./select'); - -const highlight = (input, color) => { - let val = input.toLowerCase(); - return str => { - let s = str.toLowerCase(); - let i = s.indexOf(val); - let colored = color(str.slice(i, i + val.length)); - return i >= 0 ? str.slice(0, i) + colored + str.slice(i + val.length) : str; - }; -}; - -class AutoComplete extends Select { - constructor(options) { - super(options); - this.cursorShow(); - } - - moveCursor(n) { - this.state.cursor += n; - } - - dispatch(ch) { - return this.append(ch); - } - - space(ch) { - return this.options.multiple ? super.space(ch) : this.append(ch); - } - - append(ch) { - let { cursor, input } = this.state; - this.input = input.slice(0, cursor) + ch + input.slice(cursor); - this.moveCursor(1); - return this.complete(); - } - - delete() { - let { cursor, input } = this.state; - if (!input) return this.alert(); - this.input = input.slice(0, cursor - 1) + input.slice(cursor); - this.moveCursor(-1); - return this.complete(); - } - - deleteForward() { - let { cursor, input } = this.state; - if (input[cursor] === void 0) return this.alert(); - this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1); - return this.complete(); - } - - number(ch) { - return this.append(ch); - } - - async complete() { - this.completing = true; - this.choices = await this.suggest(this.input, this.state._choices); - this.state.limit = void 0; // allow getter/setter to reset limit - this.index = Math.min(Math.max(this.visible.length - 1, 0), this.index); - await this.render(); - this.completing = false; - } - - suggest(input = this.input, choices = this.state._choices) { - if (typeof this.options.suggest === 'function') { - return this.options.suggest.call(this, input, choices); - } - let str = input.toLowerCase(); - return choices.filter(ch => ch.message.toLowerCase().includes(str)); - } - - pointer() { - return ''; - } - - format() { - if (!this.focused) return this.input; - if (this.options.multiple && this.state.submitted) { - return this.selected.map(ch => this.styles.primary(ch.message)).join(', '); - } - if (this.state.submitted) { - let value = this.value = this.input = this.focused.value; - return this.styles.primary(value); - } - return this.input; - } - - async render() { - if (this.state.status !== 'pending') return super.render(); - let style = this.options.highlight - ? this.options.highlight.bind(this) - : this.styles.placeholder; - - let color = highlight(this.input, style); - let choices = this.choices; - this.choices = choices.map(ch => ({ ...ch, message: color(ch.message) })); - await super.render(); - this.choices = choices; - } - - submit() { - if (this.options.multiple) { - this.value = this.selected.map(ch => ch.name); - } - return super.submit(); - } -} - -module.exports = AutoComplete; diff --git a/node_modules/enquirer/lib/prompts/basicauth.js b/node_modules/enquirer/lib/prompts/basicauth.js deleted file mode 100644 index 54c5ea77b..000000000 --- a/node_modules/enquirer/lib/prompts/basicauth.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const AuthPrompt = require('../types/auth'); - -function defaultAuthenticate(value, state) { - if (value.username === this.options.username && value.password === this.options.password) { - return true; - } - return false; -} - -const factory = (authenticate = defaultAuthenticate) => { - const choices = [ - { name: 'username', message: 'username' }, - { - name: 'password', - message: 'password', - format(input) { - if (this.options.showPassword) { - return input; - } - let color = this.state.submitted ? this.styles.primary : this.styles.muted; - return color(this.symbols.asterisk.repeat(input.length)); - } - } - ]; - - class BasicAuthPrompt extends AuthPrompt.create(authenticate) { - constructor(options) { - super({ ...options, choices }); - } - - static create(authenticate) { - return factory(authenticate); - } - } - - return BasicAuthPrompt; -}; - -module.exports = factory(); diff --git a/node_modules/enquirer/lib/prompts/confirm.js b/node_modules/enquirer/lib/prompts/confirm.js deleted file mode 100644 index 61eae7ad9..000000000 --- a/node_modules/enquirer/lib/prompts/confirm.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const BooleanPrompt = require('../types/boolean'); - -class ConfirmPrompt extends BooleanPrompt { - constructor(options) { - super(options); - this.default = this.options.default || (this.initial ? '(Y/n)' : '(y/N)'); - } -} - -module.exports = ConfirmPrompt; - diff --git a/node_modules/enquirer/lib/prompts/editable.js b/node_modules/enquirer/lib/prompts/editable.js deleted file mode 100644 index 042e4c9d0..000000000 --- a/node_modules/enquirer/lib/prompts/editable.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict'; - -const Select = require('./select'); -const Form = require('./form'); -const form = Form.prototype; - -class Editable extends Select { - constructor(options) { - super({ ...options, multiple: true }); - this.align = [this.options.align, 'left'].find(v => v != null); - this.emptyError = ''; - this.values = {}; - } - - dispatch(char, key) { - let choice = this.focused; - let parent = choice.parent || {}; - if (!choice.editable && !parent.editable) { - if (char === 'a' || char === 'i') return super[char](); - } - return form.dispatch.call(this, char, key); - } - - append(char, key) { - return form.append.call(this, char, key); - } - - delete(char, key) { - return form.delete.call(this, char, key); - } - - space(char) { - return this.focused.editable ? this.append(char) : super.space(); - } - - number(char) { - return this.focused.editable ? this.append(char) : super.number(char); - } - - next() { - return this.focused.editable ? form.next.call(this) : super.next(); - } - - prev() { - return this.focused.editable ? form.prev.call(this) : super.prev(); - } - - async indicator(choice, i) { - let symbol = choice.indicator || ''; - let value = choice.editable ? symbol : super.indicator(choice, i); - return await this.resolve(value, this.state, choice, i) || ''; - } - - indent(choice) { - return choice.role === 'heading' ? '' : (choice.editable ? ' ' : ' '); - } - - async renderChoice(choice, i) { - choice.indent = ''; - if (choice.editable) return form.renderChoice.call(this, choice, i); - return super.renderChoice(choice, i); - } - - error() { - return ''; - } - - footer() { - return this.state.error; - } - - async validate() { - let result = true; - - for (let choice of this.choices) { - if (typeof choice.validate !== 'function') { - continue; - } - - if (choice.role === 'heading') { - continue; - } - - let val = choice.parent ? this.value[choice.parent.name] : this.value; - - if (choice.editable) { - val = choice.value === choice.name ? choice.initial || '' : choice.value; - } else if (!this.isDisabled(choice)) { - val = choice.enabled === true; - } - - result = await choice.validate(val, this.state); - - if (result !== true) { - break; - } - } - - if (result !== true) { - this.state.error = typeof result === 'string' ? result : 'Invalid Input'; - } - - return result; - } - - submit() { - if (this.focused.newChoice === true) return super.submit(); - if (this.choices.some(ch => ch.newChoice)) { - return this.alert(); - } - - this.value = {}; - - for (let choice of this.choices) { - let val = choice.parent ? this.value[choice.parent.name] : this.value; - - if (choice.role === 'heading') { - this.value[choice.name] = {}; - continue; - } - - if (choice.editable) { - val[choice.name] = choice.value === choice.name - ? (choice.initial || '') - : choice.value; - - } else if (!this.isDisabled(choice)) { - val[choice.name] = choice.enabled === true; - } - } - - return this.base.submit.call(this); - } -} - -module.exports = Editable; diff --git a/node_modules/enquirer/lib/prompts/form.js b/node_modules/enquirer/lib/prompts/form.js deleted file mode 100644 index aad4c6c6f..000000000 --- a/node_modules/enquirer/lib/prompts/form.js +++ /dev/null @@ -1,196 +0,0 @@ -'use strict'; - -const colors = require('ansi-colors'); -const SelectPrompt = require('./select'); -const placeholder = require('../placeholder'); - -class FormPrompt extends SelectPrompt { - constructor(options) { - super({ ...options, multiple: true }); - this.type = 'form'; - this.initial = this.options.initial; - this.align = [this.options.align, 'right'].find(v => v != null); - this.emptyError = ''; - this.values = {}; - } - - async reset(first) { - await super.reset(); - if (first === true) this._index = this.index; - this.index = this._index; - this.values = {}; - this.choices.forEach(choice => choice.reset && choice.reset()); - return this.render(); - } - - dispatch(char) { - return !!char && this.append(char); - } - - append(char) { - let choice = this.focused; - if (!choice) return this.alert(); - let { cursor, input } = choice; - choice.value = choice.input = input.slice(0, cursor) + char + input.slice(cursor); - choice.cursor++; - return this.render(); - } - - delete() { - let choice = this.focused; - if (!choice || choice.cursor <= 0) return this.alert(); - let { cursor, input } = choice; - choice.value = choice.input = input.slice(0, cursor - 1) + input.slice(cursor); - choice.cursor--; - return this.render(); - } - - deleteForward() { - let choice = this.focused; - if (!choice) return this.alert(); - let { cursor, input } = choice; - if (input[cursor] === void 0) return this.alert(); - let str = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1); - choice.value = choice.input = str; - return this.render(); - } - - right() { - let choice = this.focused; - if (!choice) return this.alert(); - if (choice.cursor >= choice.input.length) return this.alert(); - choice.cursor++; - return this.render(); - } - - left() { - let choice = this.focused; - if (!choice) return this.alert(); - if (choice.cursor <= 0) return this.alert(); - choice.cursor--; - return this.render(); - } - - space(ch, key) { - return this.dispatch(ch, key); - } - - number(ch, key) { - return this.dispatch(ch, key); - } - - next() { - let ch = this.focused; - if (!ch) return this.alert(); - let { initial, input } = ch; - if (initial && initial.startsWith(input) && input !== initial) { - ch.value = ch.input = initial; - ch.cursor = ch.value.length; - return this.render(); - } - return super.next(); - } - - prev() { - let ch = this.focused; - if (!ch) return this.alert(); - if (ch.cursor === 0) return super.prev(); - ch.value = ch.input = ''; - ch.cursor = 0; - return this.render(); - } - - separator() { - return ''; - } - - format(value) { - return !this.state.submitted ? super.format(value) : ''; - } - - pointer() { - return ''; - } - - indicator(choice) { - return choice.input ? '⦿' : '⊙'; - } - - async choiceSeparator(choice, i) { - let sep = await this.resolve(choice.separator, this.state, choice, i) || ':'; - return sep ? ' ' + this.styles.disabled(sep) : ''; - } - - async renderChoice(choice, i) { - await this.onChoice(choice, i); - - let { state, styles } = this; - let { cursor, initial = '', name, hint, input = '' } = choice; - let { muted, submitted, primary, danger } = styles; - - let help = hint; - let focused = this.index === i; - let validate = choice.validate || (() => true); - let sep = await this.choiceSeparator(choice, i); - let msg = choice.message; - - if (this.align === 'right') msg = msg.padStart(this.longest + 1, ' '); - if (this.align === 'left') msg = msg.padEnd(this.longest + 1, ' '); - - // re-populate the form values (answers) object - let value = this.values[name] = (input || initial); - let color = input ? 'success' : 'dark'; - - if ((await validate.call(choice, value, this.state)) !== true) { - color = 'danger'; - } - - let style = styles[color]; - let indicator = style(await this.indicator(choice, i)) + (choice.pad || ''); - - let indent = this.indent(choice); - let line = () => [indent, indicator, msg + sep, input, help].filter(Boolean).join(' '); - - if (state.submitted) { - msg = colors.unstyle(msg); - input = submitted(input); - help = ''; - return line(); - } - - if (choice.format) { - input = await choice.format.call(this, input, choice, i); - } else { - let color = this.styles.muted; - let options = { input, initial, pos: cursor, showCursor: focused, color }; - input = placeholder(this, options); - } - - if (!this.isValue(input)) { - input = this.styles.muted(this.symbols.ellipsis); - } - - if (choice.result) { - this.values[name] = await choice.result.call(this, value, choice, i); - } - - if (focused) { - msg = primary(msg); - } - - if (choice.error) { - input += (input ? ' ' : '') + danger(choice.error.trim()); - } else if (choice.hint) { - input += (input ? ' ' : '') + muted(choice.hint.trim()); - } - - return line(); - } - - async submit() { - this.value = this.values; - return super.base.submit.call(this); - } -} - -module.exports = FormPrompt; diff --git a/node_modules/enquirer/lib/prompts/index.js b/node_modules/enquirer/lib/prompts/index.js deleted file mode 100644 index a82fbfb4a..000000000 --- a/node_modules/enquirer/lib/prompts/index.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const utils = require('../utils'); - -const define = (key, fn) => { - utils.defineExport(exports, key, fn); - utils.defineExport(exports, key.toLowerCase(), fn); -}; - -define('AutoComplete', () => require('./autocomplete')); -define('BasicAuth', () => require('./basicauth')); -define('Confirm', () => require('./confirm')); -define('Editable', () => require('./editable')); -define('Form', () => require('./form')); -define('Input', () => require('./input')); -define('Invisible', () => require('./invisible')); -define('List', () => require('./list')); -define('MultiSelect', () => require('./multiselect')); -define('Numeral', () => require('./numeral')); -define('Password', () => require('./password')); -define('Scale', () => require('./scale')); -define('Select', () => require('./select')); -define('Snippet', () => require('./snippet')); -define('Sort', () => require('./sort')); -define('Survey', () => require('./survey')); -define('Text', () => require('./text')); -define('Toggle', () => require('./toggle')); -define('Quiz', () => require('./quiz')); diff --git a/node_modules/enquirer/lib/prompts/input.js b/node_modules/enquirer/lib/prompts/input.js deleted file mode 100644 index 80ba193b4..000000000 --- a/node_modules/enquirer/lib/prompts/input.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const Prompt = require('../types/string'); -const completer = require('../completer'); - -class Input extends Prompt { - constructor(options) { - super(options); - let history = this.options.history; - if (history && history.store) { - let initial = history.values || this.initial; - this.autosave = !!history.autosave; - this.store = history.store; - this.data = this.store.get('values') || { past: [], present: initial }; - this.initial = this.data.present || this.data.past[this.data.past.length - 1]; - } - } - - completion(action) { - if (!this.store) return this.alert(); - this.data = completer(action, this.data, this.input); - if (!this.data.present) return this.alert(); - this.input = this.data.present; - this.cursor = this.input.length; - return this.render(); - } - - altUp() { - return this.completion('prev'); - } - - altDown() { - return this.completion('next'); - } - - prev() { - this.save(); - return super.prev(); - } - - save() { - if (!this.store) return; - this.data = completer('save', this.data, this.input); - this.store.set('values', this.data); - } - - submit() { - if (this.store && this.autosave === true) { - this.save(); - } - return super.submit(); - } -} - -module.exports = Input; diff --git a/node_modules/enquirer/lib/prompts/invisible.js b/node_modules/enquirer/lib/prompts/invisible.js deleted file mode 100644 index 548106243..000000000 --- a/node_modules/enquirer/lib/prompts/invisible.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const StringPrompt = require('../types/string'); - -class InvisiblePrompt extends StringPrompt { - format() { - return ''; - } -} - -module.exports = InvisiblePrompt; diff --git a/node_modules/enquirer/lib/prompts/list.js b/node_modules/enquirer/lib/prompts/list.js deleted file mode 100644 index 7657c7fff..000000000 --- a/node_modules/enquirer/lib/prompts/list.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const StringPrompt = require('../types/string'); - -class ListPrompt extends StringPrompt { - constructor(options = {}) { - super(options); - this.sep = this.options.separator || /, */; - this.initial = options.initial || ''; - } - - split(input = this.value) { - return input ? String(input).split(this.sep) : []; - } - - format() { - let style = this.state.submitted ? this.styles.primary : val => val; - return this.list.map(style).join(', '); - } - - async submit(value) { - let result = this.state.error || await this.validate(this.list, this.state); - if (result !== true) { - this.state.error = result; - return super.submit(); - } - this.value = this.list; - return super.submit(); - } - - get list() { - return this.split(); - } -} - -module.exports = ListPrompt; diff --git a/node_modules/enquirer/lib/prompts/multiselect.js b/node_modules/enquirer/lib/prompts/multiselect.js deleted file mode 100644 index f64fcd582..000000000 --- a/node_modules/enquirer/lib/prompts/multiselect.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const Select = require('./select'); - -class MultiSelect extends Select { - constructor(options) { - super({ ...options, multiple: true }); - } -} - -module.exports = MultiSelect; diff --git a/node_modules/enquirer/lib/prompts/numeral.js b/node_modules/enquirer/lib/prompts/numeral.js deleted file mode 100644 index 2a81fdd26..000000000 --- a/node_modules/enquirer/lib/prompts/numeral.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../types/number'); diff --git a/node_modules/enquirer/lib/prompts/password.js b/node_modules/enquirer/lib/prompts/password.js deleted file mode 100644 index 46df22d28..000000000 --- a/node_modules/enquirer/lib/prompts/password.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -const StringPrompt = require('../types/string'); - -class PasswordPrompt extends StringPrompt { - constructor(options) { - super(options); - this.cursorShow(); - } - - format(input = this.input) { - if (!this.keypressed) return ''; - let color = this.state.submitted ? this.styles.primary : this.styles.muted; - return color(this.symbols.asterisk.repeat(input.length)); - } -} - -module.exports = PasswordPrompt; diff --git a/node_modules/enquirer/lib/prompts/quiz.js b/node_modules/enquirer/lib/prompts/quiz.js deleted file mode 100644 index 2be455184..000000000 --- a/node_modules/enquirer/lib/prompts/quiz.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -const SelectPrompt = require('./select'); - -class Quiz extends SelectPrompt { - constructor(options) { - super(options); - if (typeof this.options.correctChoice !== 'number' || this.options.correctChoice < 0) { - throw new Error('Please specify the index of the correct answer from the list of choices'); - } - } - - async toChoices(value, parent) { - let choices = await super.toChoices(value, parent); - if (choices.length < 2) { - throw new Error('Please give at least two choices to the user'); - } - if (this.options.correctChoice > choices.length) { - throw new Error('Please specify the index of the correct answer from the list of choices'); - } - return choices; - } - - check(state) { - return state.index === this.options.correctChoice; - } - - async result(selected) { - return { - selectedAnswer: selected, - correctAnswer: this.options.choices[this.options.correctChoice].value, - correct: await this.check(this.state) - }; - } -} - -module.exports = Quiz; diff --git a/node_modules/enquirer/lib/prompts/scale.js b/node_modules/enquirer/lib/prompts/scale.js deleted file mode 100644 index 29d682964..000000000 --- a/node_modules/enquirer/lib/prompts/scale.js +++ /dev/null @@ -1,237 +0,0 @@ -'use strict'; - -const colors = require('ansi-colors'); -const ArrayPrompt = require('../types/array'); -const utils = require('../utils'); - -class LikertScale extends ArrayPrompt { - constructor(options = {}) { - super(options); - this.widths = [].concat(options.messageWidth || 50); - this.align = [].concat(options.align || 'left'); - this.linebreak = options.linebreak || false; - this.edgeLength = options.edgeLength || 3; - this.newline = options.newline || '\n '; - let start = options.startNumber || 1; - if (typeof this.scale === 'number') { - this.scaleKey = false; - this.scale = Array(this.scale).fill(0).map((v, i) => ({ name: i + start })); - } - } - - async reset() { - this.tableized = false; - await super.reset(); - return this.render(); - } - - tableize() { - if (this.tableized === true) return; - this.tableized = true; - let longest = 0; - - for (let ch of this.choices) { - longest = Math.max(longest, ch.message.length); - ch.scaleIndex = ch.initial || 2; - ch.scale = []; - - for (let i = 0; i < this.scale.length; i++) { - ch.scale.push({ index: i }); - } - } - this.widths[0] = Math.min(this.widths[0], longest + 3); - } - - async dispatch(s, key) { - if (this.multiple) { - return this[key.name] ? await this[key.name](s, key) : await super.dispatch(s, key); - } - this.alert(); - } - - heading(msg, item, i) { - return this.styles.strong(msg); - } - - separator() { - return this.styles.muted(this.symbols.ellipsis); - } - - right() { - let choice = this.focused; - if (choice.scaleIndex >= this.scale.length - 1) return this.alert(); - choice.scaleIndex++; - return this.render(); - } - - left() { - let choice = this.focused; - if (choice.scaleIndex <= 0) return this.alert(); - choice.scaleIndex--; - return this.render(); - } - - indent() { - return ''; - } - - format() { - if (this.state.submitted) { - let values = this.choices.map(ch => this.styles.info(ch.index)); - return values.join(', '); - } - return ''; - } - - pointer() { - return ''; - } - - /** - * Render the scale "Key". Something like: - * @return {String} - */ - - renderScaleKey() { - if (this.scaleKey === false) return ''; - if (this.state.submitted) return ''; - let scale = this.scale.map(item => ` ${item.name} - ${item.message}`); - let key = ['', ...scale].map(item => this.styles.muted(item)); - return key.join('\n'); - } - - /** - * Render the heading row for the scale. - * @return {String} - */ - - renderScaleHeading(max) { - let keys = this.scale.map(ele => ele.name); - if (typeof this.options.renderScaleHeading === 'function') { - keys = this.options.renderScaleHeading.call(this, max); - } - let diff = this.scaleLength - keys.join('').length; - let spacing = Math.round(diff / (keys.length - 1)); - let names = keys.map(key => this.styles.strong(key)); - let headings = names.join(' '.repeat(spacing)); - let padding = ' '.repeat(this.widths[0]); - return this.margin[3] + padding + this.margin[1] + headings; - } - - /** - * Render a scale indicator => ◯ or ◉ by default - */ - - scaleIndicator(choice, item, i) { - if (typeof this.options.scaleIndicator === 'function') { - return this.options.scaleIndicator.call(this, choice, item, i); - } - let enabled = choice.scaleIndex === item.index; - if (item.disabled) return this.styles.hint(this.symbols.radio.disabled); - if (enabled) return this.styles.success(this.symbols.radio.on); - return this.symbols.radio.off; - } - - /** - * Render the actual scale => ◯────◯────◉────◯────◯ - */ - - renderScale(choice, i) { - let scale = choice.scale.map(item => this.scaleIndicator(choice, item, i)); - let padding = this.term === 'Hyper' ? '' : ' '; - return scale.join(padding + this.symbols.line.repeat(this.edgeLength)); - } - - /** - * Render a choice, including scale => - * "The website is easy to navigate. ◯───◯───◉───◯───◯" - */ - - async renderChoice(choice, i) { - await this.onChoice(choice, i); - - let focused = this.index === i; - let pointer = await this.pointer(choice, i); - let hint = await choice.hint; - - if (hint && !utils.hasColor(hint)) { - hint = this.styles.muted(hint); - } - - let pad = str => this.margin[3] + str.replace(/\s+$/, '').padEnd(this.widths[0], ' '); - let newline = this.newline; - let ind = this.indent(choice); - let message = await this.resolve(choice.message, this.state, choice, i); - let scale = await this.renderScale(choice, i); - let margin = this.margin[1] + this.margin[3]; - this.scaleLength = colors.unstyle(scale).length; - this.widths[0] = Math.min(this.widths[0], this.width - this.scaleLength - margin.length); - let msg = utils.wordWrap(message, { width: this.widths[0], newline }); - let lines = msg.split('\n').map(line => pad(line) + this.margin[1]); - - if (focused) { - scale = this.styles.info(scale); - lines = lines.map(line => this.styles.info(line)); - } - - lines[0] += scale; - - if (this.linebreak) lines.push(''); - return [ind + pointer, lines.join('\n')].filter(Boolean); - } - - async renderChoices() { - if (this.state.submitted) return ''; - this.tableize(); - let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); - let visible = await Promise.all(choices); - let heading = await this.renderScaleHeading(); - return this.margin[0] + [heading, ...visible.map(v => v.join(' '))].join('\n'); - } - - async render() { - let { submitted, size } = this.state; - - let prefix = await this.prefix(); - let separator = await this.separator(); - let message = await this.message(); - - let prompt = ''; - if (this.options.promptLine !== false) { - prompt = [prefix, message, separator, ''].join(' '); - this.state.prompt = prompt; - } - - let header = await this.header(); - let output = await this.format(); - let key = await this.renderScaleKey(); - let help = await this.error() || await this.hint(); - let body = await this.renderChoices(); - let footer = await this.footer(); - let err = this.emptyError; - - if (output) prompt += output; - if (help && !prompt.includes(help)) prompt += ' ' + help; - - if (submitted && !output && !body.trim() && this.multiple && err != null) { - prompt += this.styles.danger(err); - } - - this.clear(size); - this.write([header, prompt, key, body, footer].filter(Boolean).join('\n')); - if (!this.state.submitted) { - this.write(this.margin[2]); - } - this.restore(); - } - - submit() { - this.value = {}; - for (let choice of this.choices) { - this.value[choice.name] = choice.scaleIndex; - } - return this.base.submit.call(this); - } -} - -module.exports = LikertScale; diff --git a/node_modules/enquirer/lib/prompts/select.js b/node_modules/enquirer/lib/prompts/select.js deleted file mode 100644 index 5d3ad3703..000000000 --- a/node_modules/enquirer/lib/prompts/select.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -const ArrayPrompt = require('../types/array'); -const utils = require('../utils'); - -class SelectPrompt extends ArrayPrompt { - constructor(options) { - super(options); - this.emptyError = this.options.emptyError || 'No items were selected'; - } - - async dispatch(s, key) { - if (this.multiple) { - return this[key.name] ? await this[key.name](s, key) : await super.dispatch(s, key); - } - this.alert(); - } - - separator() { - if (this.options.separator) return super.separator(); - let sep = this.styles.muted(this.symbols.ellipsis); - return this.state.submitted ? super.separator() : sep; - } - - pointer(choice, i) { - return (!this.multiple || this.options.pointer) ? super.pointer(choice, i) : ''; - } - - indicator(choice, i) { - return this.multiple ? super.indicator(choice, i) : ''; - } - - choiceMessage(choice, i) { - let message = this.resolve(choice.message, this.state, choice, i); - if (choice.role === 'heading' && !utils.hasColor(message)) { - message = this.styles.strong(message); - } - return this.resolve(message, this.state, choice, i); - } - - choiceSeparator() { - return ':'; - } - - async renderChoice(choice, i) { - await this.onChoice(choice, i); - - let focused = this.index === i; - let pointer = await this.pointer(choice, i); - let check = await this.indicator(choice, i) + (choice.pad || ''); - let hint = await this.resolve(choice.hint, this.state, choice, i); - - if (hint && !utils.hasColor(hint)) { - hint = this.styles.muted(hint); - } - - let ind = this.indent(choice); - let msg = await this.choiceMessage(choice, i); - let line = () => [this.margin[3], ind + pointer + check, msg, this.margin[1], hint].filter(Boolean).join(' '); - - if (choice.role === 'heading') { - return line(); - } - - if (choice.disabled) { - if (!utils.hasColor(msg)) { - msg = this.styles.disabled(msg); - } - return line(); - } - - if (focused) { - msg = this.styles.em(msg); - } - - return line(); - } - - async renderChoices() { - if (this.state.loading === 'choices') { - return this.styles.warning('Loading choices'); - } - - if (this.state.submitted) return ''; - let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); - let visible = await Promise.all(choices); - if (!visible.length) visible.push(this.styles.danger('No matching choices')); - let result = this.margin[0] + visible.join('\n'); - let header; - - if (this.options.choicesHeader) { - header = await this.resolve(this.options.choicesHeader, this.state); - } - - return [header, result].filter(Boolean).join('\n'); - } - - format() { - if (!this.state.submitted || this.state.cancelled) return ''; - if (Array.isArray(this.selected)) { - return this.selected.map(choice => this.styles.primary(choice.name)).join(', '); - } - return this.styles.primary(this.selected.name); - } - - async render() { - let { submitted, size } = this.state; - - let prompt = ''; - let header = await this.header(); - let prefix = await this.prefix(); - let separator = await this.separator(); - let message = await this.message(); - - if (this.options.promptLine !== false) { - prompt = [prefix, message, separator, ''].join(' '); - this.state.prompt = prompt; - } - - let output = await this.format(); - let help = (await this.error()) || (await this.hint()); - let body = await this.renderChoices(); - let footer = await this.footer(); - - if (output) prompt += output; - if (help && !prompt.includes(help)) prompt += ' ' + help; - - if (submitted && !output && !body.trim() && this.multiple && this.emptyError != null) { - prompt += this.styles.danger(this.emptyError); - } - - this.clear(size); - this.write([header, prompt, body, footer].filter(Boolean).join('\n')); - this.write(this.margin[2]); - this.restore(); - } -} - -module.exports = SelectPrompt; diff --git a/node_modules/enquirer/lib/prompts/snippet.js b/node_modules/enquirer/lib/prompts/snippet.js deleted file mode 100644 index eec6cc3ab..000000000 --- a/node_modules/enquirer/lib/prompts/snippet.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -const colors = require('ansi-colors'); -const interpolate = require('../interpolate'); -const Prompt = require('../prompt'); - -class SnippetPrompt extends Prompt { - constructor(options) { - super(options); - this.cursorHide(); - this.reset(true); - } - - async initialize() { - this.interpolate = await interpolate(this); - await super.initialize(); - } - - async reset(first) { - this.state.keys = []; - this.state.invalid = new Map(); - this.state.missing = new Set(); - this.state.completed = 0; - this.state.values = {}; - - if (first !== true) { - await this.initialize(); - await this.render(); - } - } - - moveCursor(n) { - let item = this.getItem(); - this.cursor += n; - item.cursor += n; - } - - dispatch(ch, key) { - if (!key.code && !key.ctrl && ch != null && this.getItem()) { - this.append(ch, key); - return; - } - this.alert(); - } - - append(ch, key) { - let item = this.getItem(); - let prefix = item.input.slice(0, this.cursor); - let suffix = item.input.slice(this.cursor); - this.input = item.input = `${prefix}${ch}${suffix}`; - this.moveCursor(1); - this.render(); - } - - delete() { - let item = this.getItem(); - if (this.cursor <= 0 || !item.input) return this.alert(); - let suffix = item.input.slice(this.cursor); - let prefix = item.input.slice(0, this.cursor - 1); - this.input = item.input = `${prefix}${suffix}`; - this.moveCursor(-1); - this.render(); - } - - increment(i) { - return i >= this.state.keys.length - 1 ? 0 : i + 1; - } - - decrement(i) { - return i <= 0 ? this.state.keys.length - 1 : i - 1; - } - - first() { - this.state.index = 0; - this.render(); - } - - last() { - this.state.index = this.state.keys.length - 1; - this.render(); - } - - right() { - if (this.cursor >= this.input.length) return this.alert(); - this.moveCursor(1); - this.render(); - } - - left() { - if (this.cursor <= 0) return this.alert(); - this.moveCursor(-1); - this.render(); - } - - prev() { - this.state.index = this.decrement(this.state.index); - this.getItem(); - this.render(); - } - - next() { - this.state.index = this.increment(this.state.index); - this.getItem(); - this.render(); - } - - up() { - this.prev(); - } - - down() { - this.next(); - } - - format(value) { - let color = this.state.completed < 100 ? this.styles.warning : this.styles.success; - if (this.state.submitted === true && this.state.completed !== 100) { - color = this.styles.danger; - } - return color(`${this.state.completed}% completed`); - } - - async render() { - let { index, keys = [], submitted, size } = this.state; - - let newline = [this.options.newline, '\n'].find(v => v != null); - let prefix = await this.prefix(); - let separator = await this.separator(); - let message = await this.message(); - - let prompt = [prefix, message, separator].filter(Boolean).join(' '); - this.state.prompt = prompt; - - let header = await this.header(); - let error = (await this.error()) || ''; - let hint = (await this.hint()) || ''; - let body = submitted ? '' : await this.interpolate(this.state); - - let key = this.state.key = keys[index] || ''; - let input = await this.format(key); - let footer = await this.footer(); - if (input) prompt += ' ' + input; - if (hint && !input && this.state.completed === 0) prompt += ' ' + hint; - - this.clear(size); - let lines = [header, prompt, body, footer, error.trim()]; - this.write(lines.filter(Boolean).join(newline)); - this.restore(); - } - - getItem(name) { - let { items, keys, index } = this.state; - let item = items.find(ch => ch.name === keys[index]); - if (item && item.input != null) { - this.input = item.input; - this.cursor = item.cursor; - } - return item; - } - - async submit() { - if (typeof this.interpolate !== 'function') await this.initialize(); - await this.interpolate(this.state, true); - - let { invalid, missing, output, values } = this.state; - if (invalid.size) { - let err = ''; - for (let [key, value] of invalid) err += `Invalid ${key}: ${value}\n`; - this.state.error = err; - return super.submit(); - } - - if (missing.size) { - this.state.error = 'Required: ' + [...missing.keys()].join(', '); - return super.submit(); - } - - let lines = colors.unstyle(output).split('\n'); - let result = lines.map(v => v.slice(1)).join('\n'); - this.value = { values, result }; - return super.submit(); - } -} - -module.exports = SnippetPrompt; diff --git a/node_modules/enquirer/lib/prompts/sort.js b/node_modules/enquirer/lib/prompts/sort.js deleted file mode 100644 index b779b9b24..000000000 --- a/node_modules/enquirer/lib/prompts/sort.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -const hint = '(Use + to sort)'; -const Prompt = require('./select'); - -class Sort extends Prompt { - constructor(options) { - super({ ...options, reorder: false, sort: true, multiple: true }); - this.state.hint = [this.options.hint, hint].find(this.isValue.bind(this)); - } - - indicator() { - return ''; - } - - async renderChoice(choice, i) { - let str = await super.renderChoice(choice, i); - let sym = this.symbols.identicalTo + ' '; - let pre = (this.index === i && this.sorting) ? this.styles.muted(sym) : ' '; - if (this.options.drag === false) pre = ''; - if (this.options.numbered === true) { - return pre + `${i + 1} - ` + str; - } - return pre + str; - } - - get selected() { - return this.choices; - } - - submit() { - this.value = this.choices.map(choice => choice.value); - return super.submit(); - } -} - -module.exports = Sort; diff --git a/node_modules/enquirer/lib/prompts/survey.js b/node_modules/enquirer/lib/prompts/survey.js deleted file mode 100644 index 5d39f6bd2..000000000 --- a/node_modules/enquirer/lib/prompts/survey.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const ArrayPrompt = require('../types/array'); - -class Survey extends ArrayPrompt { - constructor(options = {}) { - super(options); - this.emptyError = options.emptyError || 'No items were selected'; - this.term = process.env.TERM_PROGRAM; - - if (!this.options.header) { - let header = ['', '4 - Strongly Agree', '3 - Agree', '2 - Neutral', '1 - Disagree', '0 - Strongly Disagree', '']; - header = header.map(ele => this.styles.muted(ele)); - this.state.header = header.join('\n '); - } - } - - async toChoices(...args) { - if (this.createdScales) return false; - this.createdScales = true; - let choices = await super.toChoices(...args); - for (let choice of choices) { - choice.scale = createScale(5, this.options); - choice.scaleIdx = 2; - } - return choices; - } - - dispatch() { - this.alert(); - } - - space() { - let choice = this.focused; - let ele = choice.scale[choice.scaleIdx]; - let selected = ele.selected; - choice.scale.forEach(e => (e.selected = false)); - ele.selected = !selected; - return this.render(); - } - - indicator() { - return ''; - } - - pointer() { - return ''; - } - - separator() { - return this.styles.muted(this.symbols.ellipsis); - } - - right() { - let choice = this.focused; - if (choice.scaleIdx >= choice.scale.length - 1) return this.alert(); - choice.scaleIdx++; - return this.render(); - } - - left() { - let choice = this.focused; - if (choice.scaleIdx <= 0) return this.alert(); - choice.scaleIdx--; - return this.render(); - } - - indent() { - return ' '; - } - - async renderChoice(item, i) { - await this.onChoice(item, i); - let focused = this.index === i; - let isHyper = this.term === 'Hyper'; - let n = !isHyper ? 8 : 9; - let s = !isHyper ? ' ' : ''; - let ln = this.symbols.line.repeat(n); - let sp = ' '.repeat(n + (isHyper ? 0 : 1)); - let dot = enabled => (enabled ? this.styles.success('◉') : '◯') + s; - - let num = i + 1 + '.'; - let color = focused ? this.styles.heading : this.styles.noop; - let msg = await this.resolve(item.message, this.state, item, i); - let indent = this.indent(item); - let scale = indent + item.scale.map((e, i) => dot(i === item.scaleIdx)).join(ln); - let val = i => i === item.scaleIdx ? color(i) : i; - let next = indent + item.scale.map((e, i) => val(i)).join(sp); - - let line = () => [num, msg].filter(Boolean).join(' '); - let lines = () => [line(), scale, next, ' '].filter(Boolean).join('\n'); - - if (focused) { - scale = this.styles.cyan(scale); - next = this.styles.cyan(next); - } - - return lines(); - } - - async renderChoices() { - if (this.state.submitted) return ''; - let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); - let visible = await Promise.all(choices); - if (!visible.length) visible.push(this.styles.danger('No matching choices')); - return visible.join('\n'); - } - - format() { - if (this.state.submitted) { - let values = this.choices.map(ch => this.styles.info(ch.scaleIdx)); - return values.join(', '); - } - return ''; - } - - async render() { - let { submitted, size } = this.state; - - let prefix = await this.prefix(); - let separator = await this.separator(); - let message = await this.message(); - - let prompt = [prefix, message, separator].filter(Boolean).join(' '); - this.state.prompt = prompt; - - let header = await this.header(); - let output = await this.format(); - let help = await this.error() || await this.hint(); - let body = await this.renderChoices(); - let footer = await this.footer(); - - if (output || !help) prompt += ' ' + output; - if (help && !prompt.includes(help)) prompt += ' ' + help; - - if (submitted && !output && !body && this.multiple && this.type !== 'form') { - prompt += this.styles.danger(this.emptyError); - } - - this.clear(size); - this.write([prompt, header, body, footer].filter(Boolean).join('\n')); - this.restore(); - } - - submit() { - this.value = {}; - for (let choice of this.choices) { - this.value[choice.name] = choice.scaleIdx; - } - return this.base.submit.call(this); - } -} - -function createScale(n, options = {}) { - if (Array.isArray(options.scale)) { - return options.scale.map(ele => ({ ...ele })); - } - let scale = []; - for (let i = 1; i < n + 1; i++) scale.push({ i, selected: false }); - return scale; -} - -module.exports = Survey; diff --git a/node_modules/enquirer/lib/prompts/text.js b/node_modules/enquirer/lib/prompts/text.js deleted file mode 100644 index 556e1db44..000000000 --- a/node_modules/enquirer/lib/prompts/text.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./input'); diff --git a/node_modules/enquirer/lib/prompts/toggle.js b/node_modules/enquirer/lib/prompts/toggle.js deleted file mode 100644 index 26d33945e..000000000 --- a/node_modules/enquirer/lib/prompts/toggle.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -const BooleanPrompt = require('../types/boolean'); - -class TogglePrompt extends BooleanPrompt { - async initialize() { - await super.initialize(); - this.value = this.initial = !!this.options.initial; - this.disabled = this.options.disabled || 'no'; - this.enabled = this.options.enabled || 'yes'; - await this.render(); - } - - reset() { - this.value = this.initial; - this.render(); - } - - delete() { - this.alert(); - } - - toggle() { - this.value = !this.value; - this.render(); - } - - enable() { - if (this.value === true) return this.alert(); - this.value = true; - this.render(); - } - disable() { - if (this.value === false) return this.alert(); - this.value = false; - this.render(); - } - - up() { - this.toggle(); - } - down() { - this.toggle(); - } - right() { - this.toggle(); - } - left() { - this.toggle(); - } - next() { - this.toggle(); - } - prev() { - this.toggle(); - } - - dispatch(ch = '', key) { - switch (ch.toLowerCase()) { - case ' ': - return this.toggle(); - case '1': - case 'y': - case 't': - return this.enable(); - case '0': - case 'n': - case 'f': - return this.disable(); - default: { - return this.alert(); - } - } - } - - format() { - let active = str => this.styles.primary.underline(str); - let value = [ - this.value ? this.disabled : active(this.disabled), - this.value ? active(this.enabled) : this.enabled - ]; - return value.join(this.styles.muted(' / ')); - } - - async render() { - let { size } = this.state; - - let header = await this.header(); - let prefix = await this.prefix(); - let separator = await this.separator(); - let message = await this.message(); - - let output = await this.format(); - let help = (await this.error()) || (await this.hint()); - let footer = await this.footer(); - - let prompt = [prefix, message, separator, output].join(' '); - this.state.prompt = prompt; - - if (help && !prompt.includes(help)) prompt += ' ' + help; - - this.clear(size); - this.write([header, prompt, footer].filter(Boolean).join('\n')); - this.write(this.margin[2]); - this.restore(); - } -} - -module.exports = TogglePrompt; diff --git a/node_modules/enquirer/lib/render.js b/node_modules/enquirer/lib/render.js deleted file mode 100644 index 6a6df4a24..000000000 --- a/node_modules/enquirer/lib/render.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -module.exports = async(value, prompt, context = {}) => { - let { choices, multiple } = prompt.options; - let { size, submitted } = prompt.state; - - let prefix = context.prefix || await prompt.prefix(); - let separator = context.separator || await prompt.separator(); - let message = context.message || await prompt.message(); - - // ? Select your favorite colors > - // ^ ^ ^ - // prefix message separator - let promptLine = [prefix, message, separator].filter(Boolean).join(' '); - prompt.state.prompt = promptLine; - - let header = context.header || await prompt.header(); - let output = context.format || await prompt.format(value); - let help = context.help || await prompt.error() || await prompt.hint(); - let body = context.body || await prompt.body(); - let footer = context.footer || await prompt.footer(); - - if (output || !help) promptLine += ' ' + output; - if (help && !promptLine.includes(help)) promptLine += ' ' + help; - - if (submitted && choices && multiple && !output && !body) { - promptLine += prompt.styles.danger('No items were selected'); - } - - prompt.clear(size); - prompt.write([header, promptLine, body, footer].filter(Boolean).join('\n')); - prompt.restore(); -}; diff --git a/node_modules/enquirer/lib/roles.js b/node_modules/enquirer/lib/roles.js deleted file mode 100644 index 1d663d22d..000000000 --- a/node_modules/enquirer/lib/roles.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -const utils = require('./utils'); -const roles = { - default(prompt, choice) { - return choice; - }, - checkbox(prompt, choice) { - throw new Error('checkbox role is not implemented yet'); - }, - editable(prompt, choice) { - throw new Error('editable role is not implemented yet'); - }, - expandable(prompt, choice) { - throw new Error('expandable role is not implemented yet'); - }, - heading(prompt, choice) { - choice.disabled = ''; - choice.indicator = [choice.indicator, ' '].find(v => v != null); - choice.message = choice.message || ''; - return choice; - }, - input(prompt, choice) { - throw new Error('input role is not implemented yet'); - }, - option(prompt, choice) { - return roles.default(prompt, choice); - }, - radio(prompt, choice) { - throw new Error('radio role is not implemented yet'); - }, - separator(prompt, choice) { - choice.disabled = ''; - choice.indicator = [choice.indicator, ' '].find(v => v != null); - choice.message = choice.message || prompt.symbols.line.repeat(5); - return choice; - }, - spacer(prompt, choice) { - return choice; - } -}; - -module.exports = (name, options = {}) => { - let role = utils.merge({}, roles, options.roles); - return role[name] || role.default; -}; diff --git a/node_modules/enquirer/lib/state.js b/node_modules/enquirer/lib/state.js deleted file mode 100644 index 501890b8e..000000000 --- a/node_modules/enquirer/lib/state.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -const { define, width } = require('./utils'); - -class State { - constructor(prompt) { - let options = prompt.options; - define(this, '_prompt', prompt); - this.type = prompt.type; - this.name = prompt.name; - this.message = ''; - this.header = ''; - this.footer = ''; - this.error = ''; - this.hint = ''; - this.input = ''; - this.cursor = 0; - this.index = 0; - this.lines = 0; - this.tick = 0; - this.prompt = ''; - this.buffer = ''; - this.width = width(options.stdout || process.stdout); - Object.assign(this, options); - this.name = this.name || this.message; - this.message = this.message || this.name; - this.symbols = prompt.symbols; - this.styles = prompt.styles; - this.required = new Set(); - this.cancelled = false; - this.submitted = false; - } - - clone() { - let state = { ...this }; - state.status = this.status; - state.buffer = Buffer.from(state.buffer); - delete state.clone; - return state; - } - - set color(val) { - this._color = val; - } - get color() { - let styles = this.prompt.styles; - if (this.cancelled) return styles.cancelled; - if (this.submitted) return styles.submitted; - let color = this._color || styles[this.status]; - return typeof color === 'function' ? color : styles.pending; - } - - set loading(value) { - this._loading = value; - } - get loading() { - if (typeof this._loading === 'boolean') return this._loading; - if (this.loadingChoices) return 'choices'; - return false; - } - - get status() { - if (this.cancelled) return 'cancelled'; - if (this.submitted) return 'submitted'; - return 'pending'; - } -} - -module.exports = State; diff --git a/node_modules/enquirer/lib/styles.js b/node_modules/enquirer/lib/styles.js deleted file mode 100644 index 0a177f429..000000000 --- a/node_modules/enquirer/lib/styles.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; - -const utils = require('./utils'); -const colors = require('ansi-colors'); - -const styles = { - default: colors.noop, - noop: colors.noop, - - /** - * Modifiers - */ - - set inverse(custom) { - this._inverse = custom; - }, - get inverse() { - return this._inverse || utils.inverse(this.primary); - }, - - set complement(custom) { - this._complement = custom; - }, - get complement() { - return this._complement || utils.complement(this.primary); - }, - - /** - * Main color - */ - - primary: colors.cyan, - - /** - * Main palette - */ - - success: colors.green, - danger: colors.magenta, - strong: colors.bold, - warning: colors.yellow, - muted: colors.dim, - disabled: colors.gray, - dark: colors.dim.gray, - underline: colors.underline, - - set info(custom) { - this._info = custom; - }, - get info() { - return this._info || this.primary; - }, - - set em(custom) { - this._em = custom; - }, - get em() { - return this._em || this.primary.underline; - }, - - set heading(custom) { - this._heading = custom; - }, - get heading() { - return this._heading || this.muted.underline; - }, - - /** - * Statuses - */ - - set pending(custom) { - this._pending = custom; - }, - get pending() { - return this._pending || this.primary; - }, - - set submitted(custom) { - this._submitted = custom; - }, - get submitted() { - return this._submitted || this.success; - }, - - set cancelled(custom) { - this._cancelled = custom; - }, - get cancelled() { - return this._cancelled || this.danger; - }, - - /** - * Special styling - */ - - set typing(custom) { - this._typing = custom; - }, - get typing() { - return this._typing || this.dim; - }, - - set placeholder(custom) { - this._placeholder = custom; - }, - get placeholder() { - return this._placeholder || this.primary.dim; - }, - - set highlight(custom) { - this._highlight = custom; - }, - get highlight() { - return this._highlight || this.inverse; - } -}; - -styles.merge = (options = {}) => { - if (options.styles && typeof options.styles.enabled === 'boolean') { - colors.enabled = options.styles.enabled; - } - if (options.styles && typeof options.styles.visible === 'boolean') { - colors.visible = options.styles.visible; - } - - let result = utils.merge({}, styles, options.styles); - delete result.merge; - - for (let key of Object.keys(colors)) { - if (!result.hasOwnProperty(key)) { - Reflect.defineProperty(result, key, { get: () => colors[key] }); - } - } - - for (let key of Object.keys(colors.styles)) { - if (!result.hasOwnProperty(key)) { - Reflect.defineProperty(result, key, { get: () => colors[key] }); - } - } - return result; -}; - -module.exports = styles; diff --git a/node_modules/enquirer/lib/symbols.js b/node_modules/enquirer/lib/symbols.js deleted file mode 100644 index 16adb8690..000000000 --- a/node_modules/enquirer/lib/symbols.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -const isWindows = process.platform === 'win32'; -const colors = require('ansi-colors'); -const utils = require('./utils'); - -const symbols = { - ...colors.symbols, - upDownDoubleArrow: '⇕', - upDownDoubleArrow2: '⬍', - upDownArrow: '↕', - asterisk: '*', - asterism: '⁂', - bulletWhite: '◦', - electricArrow: '⌁', - ellipsisLarge: '⋯', - ellipsisSmall: '…', - fullBlock: '█', - identicalTo: '≡', - indicator: colors.symbols.check, - leftAngle: '‹', - mark: '※', - minus: '−', - multiplication: '×', - obelus: '÷', - percent: '%', - pilcrow: '¶', - pilcrow2: '❡', - pencilUpRight: '✐', - pencilDownRight: '✎', - pencilRight: '✏', - plus: '+', - plusMinus: '±', - pointRight: '☞', - rightAngle: '›', - section: '§', - hexagon: { off: '⬡', on: '⬢', disabled: '⬢' }, - ballot: { on: '☑', off: '☐', disabled: '☒' }, - stars: { on: '★', off: '☆', disabled: '☆' }, - folder: { on: '▼', off: '▶', disabled: '▶' }, - prefix: { - pending: colors.symbols.question, - submitted: colors.symbols.check, - cancelled: colors.symbols.cross - }, - separator: { - pending: colors.symbols.pointerSmall, - submitted: colors.symbols.middot, - cancelled: colors.symbols.middot - }, - radio: { - off: isWindows ? '( )' : '◯', - on: isWindows ? '(*)' : '◉', - disabled: isWindows ? '(|)' : 'Ⓘ' - }, - numbers: ['⓪', '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳', '㉑', '㉒', '㉓', '㉔', '㉕', '㉖', '㉗', '㉘', '㉙', '㉚', '㉛', '㉜', '㉝', '㉞', '㉟', '㊱', '㊲', '㊳', '㊴', '㊵', '㊶', '㊷', '㊸', '㊹', '㊺', '㊻', '㊼', '㊽', '㊾', '㊿'] -}; - -symbols.merge = options => { - let result = utils.merge({}, colors.symbols, symbols, options.symbols); - delete result.merge; - return result; -}; - -module.exports = symbols; - diff --git a/node_modules/enquirer/lib/theme.js b/node_modules/enquirer/lib/theme.js deleted file mode 100644 index f9c642ac5..000000000 --- a/node_modules/enquirer/lib/theme.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const styles = require('./styles'); -const symbols = require('./symbols'); -const utils = require('./utils'); - -module.exports = prompt => { - prompt.options = utils.merge({}, prompt.options.theme, prompt.options); - prompt.symbols = symbols.merge(prompt.options); - prompt.styles = styles.merge(prompt.options); -}; diff --git a/node_modules/enquirer/lib/timer.js b/node_modules/enquirer/lib/timer.js deleted file mode 100644 index 564998b3a..000000000 --- a/node_modules/enquirer/lib/timer.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -module.exports = prompt => { - prompt.timers = prompt.timers || {}; - - let timers = prompt.options.timers; - if (!timers) return; - - for (let key of Object.keys(timers)) { - let opts = timers[key]; - if (typeof opts === 'number') { - opts = { interval: opts }; - } - create(prompt, key, opts); - } -}; - -function create(prompt, name, options = {}) { - let timer = prompt.timers[name] = { name, start: Date.now(), ms: 0, tick: 0 }; - let ms = options.interval || 120; - timer.frames = options.frames || []; - timer.loading = true; - - let interval = setInterval(() => { - timer.ms = Date.now() - timer.start; - timer.tick++; - prompt.render(); - }, ms); - - timer.stop = () => { - timer.loading = false; - clearInterval(interval); - }; - - Reflect.defineProperty(timer, 'interval', { value: interval }); - prompt.once('close', () => timer.stop()); - return timer.stop; -} diff --git a/node_modules/enquirer/lib/types/array.js b/node_modules/enquirer/lib/types/array.js deleted file mode 100644 index 0a522cb20..000000000 --- a/node_modules/enquirer/lib/types/array.js +++ /dev/null @@ -1,658 +0,0 @@ -'use strict'; - -const colors = require('ansi-colors'); -const Prompt = require('../prompt'); -const roles = require('../roles'); -const utils = require('../utils'); -const { reorder, scrollUp, scrollDown, isObject, swap } = utils; - -class ArrayPrompt extends Prompt { - constructor(options) { - super(options); - this.cursorHide(); - this.maxSelected = options.maxSelected || Infinity; - this.multiple = options.multiple || false; - this.initial = options.initial || 0; - this.delay = options.delay || 0; - this.longest = 0; - this.num = ''; - } - - async initialize() { - if (typeof this.options.initial === 'function') { - this.initial = await this.options.initial.call(this); - } - await this.reset(true); - await super.initialize(); - } - - async reset() { - let { choices, initial, autofocus, suggest } = this.options; - this.state._choices = []; - this.state.choices = []; - - this.choices = await Promise.all(await this.toChoices(choices)); - this.choices.forEach(ch => (ch.enabled = false)); - - if (typeof suggest !== 'function' && this.selectable.length === 0) { - throw new Error('At least one choice must be selectable'); - } - - if (isObject(initial)) initial = Object.keys(initial); - if (Array.isArray(initial)) { - if (autofocus != null) this.index = this.findIndex(autofocus); - initial.forEach(v => this.enable(this.find(v))); - await this.render(); - } else { - if (autofocus != null) initial = autofocus; - if (typeof initial === 'string') initial = this.findIndex(initial); - if (typeof initial === 'number' && initial > -1) { - this.index = Math.max(0, Math.min(initial, this.choices.length)); - this.enable(this.find(this.index)); - } - } - - if (this.isDisabled(this.focused)) { - await this.down(); - } - } - - async toChoices(value, parent) { - this.state.loadingChoices = true; - let choices = []; - let index = 0; - - let toChoices = async(items, parent) => { - if (typeof items === 'function') items = await items.call(this); - if (items instanceof Promise) items = await items; - - for (let i = 0; i < items.length; i++) { - let choice = items[i] = await this.toChoice(items[i], index++, parent); - choices.push(choice); - - if (choice.choices) { - await toChoices(choice.choices, choice); - } - } - return choices; - }; - - return toChoices(value, parent) - .then(choices => { - this.state.loadingChoices = false; - return choices; - }); - } - - async toChoice(ele, i, parent) { - if (typeof ele === 'function') ele = await ele.call(this, this); - if (ele instanceof Promise) ele = await ele; - if (typeof ele === 'string') ele = { name: ele }; - - if (ele.normalized) return ele; - ele.normalized = true; - - let origVal = ele.value; - let role = roles(ele.role, this.options); - ele = role(this, ele); - - if (typeof ele.disabled === 'string' && !ele.hint) { - ele.hint = ele.disabled; - ele.disabled = true; - } - - if (ele.disabled === true && ele.hint == null) { - ele.hint = '(disabled)'; - } - - // if the choice was already normalized, return it - if (ele.index != null) return ele; - ele.name = ele.name || ele.key || ele.title || ele.value || ele.message; - ele.message = ele.message || ele.name || ''; - ele.value = [ele.value, ele.name].find(this.isValue.bind(this)); - - ele.input = ''; - ele.index = i; - ele.cursor = 0; - - utils.define(ele, 'parent', parent); - ele.level = parent ? parent.level + 1 : 1; - if (ele.indent == null) { - ele.indent = parent ? parent.indent + ' ' : (ele.indent || ''); - } - - ele.path = parent ? parent.path + '.' + ele.name : ele.name; - ele.enabled = !!(this.multiple && !this.isDisabled(ele) && (ele.enabled || this.isSelected(ele))); - - if (!this.isDisabled(ele)) { - this.longest = Math.max(this.longest, colors.unstyle(ele.message).length); - } - - // shallow clone the choice first - let choice = { ...ele }; - - // then allow the choice to be reset using the "original" values - ele.reset = (input = choice.input, value = choice.value) => { - for (let key of Object.keys(choice)) ele[key] = choice[key]; - ele.input = input; - ele.value = value; - }; - - if (origVal == null && typeof ele.initial === 'function') { - ele.input = await ele.initial.call(this, this.state, ele, i); - } - - return ele; - } - - async onChoice(choice, i) { - this.emit('choice', choice, i, this); - - if (typeof choice.onChoice === 'function') { - await choice.onChoice.call(this, this.state, choice, i); - } - } - - async addChoice(ele, i, parent) { - let choice = await this.toChoice(ele, i, parent); - this.choices.push(choice); - this.index = this.choices.length - 1; - this.limit = this.choices.length; - return choice; - } - - async newItem(item, i, parent) { - let ele = { name: 'New choice name?', editable: true, newChoice: true, ...item }; - let choice = await this.addChoice(ele, i, parent); - - choice.updateChoice = () => { - delete choice.newChoice; - choice.name = choice.message = choice.input; - choice.input = ''; - choice.cursor = 0; - }; - - return this.render(); - } - - indent(choice) { - if (choice.indent == null) { - return choice.level > 1 ? ' '.repeat(choice.level - 1) : ''; - } - return choice.indent; - } - - dispatch(s, key) { - if (this.multiple && this[key.name]) return this[key.name](); - this.alert(); - } - - focus(choice, enabled) { - if (typeof enabled !== 'boolean') enabled = choice.enabled; - if (enabled && !choice.enabled && this.selected.length >= this.maxSelected) { - return this.alert(); - } - this.index = choice.index; - choice.enabled = enabled && !this.isDisabled(choice); - return choice; - } - - space() { - if (!this.multiple) return this.alert(); - this.toggle(this.focused); - return this.render(); - } - - a() { - if (this.maxSelected < this.choices.length) return this.alert(); - let enabled = this.selectable.every(ch => ch.enabled); - this.choices.forEach(ch => (ch.enabled = !enabled)); - return this.render(); - } - - i() { - // don't allow choices to be inverted if it will result in - // more than the maximum number of allowed selected items. - if (this.choices.length - this.selected.length > this.maxSelected) { - return this.alert(); - } - this.choices.forEach(ch => (ch.enabled = !ch.enabled)); - return this.render(); - } - - g(choice = this.focused) { - if (!this.choices.some(ch => !!ch.parent)) return this.a(); - this.toggle((choice.parent && !choice.choices) ? choice.parent : choice); - return this.render(); - } - - toggle(choice, enabled) { - if (!choice.enabled && this.selected.length >= this.maxSelected) { - return this.alert(); - } - - if (typeof enabled !== 'boolean') enabled = !choice.enabled; - choice.enabled = enabled; - - if (choice.choices) { - choice.choices.forEach(ch => this.toggle(ch, enabled)); - } - - let parent = choice.parent; - while (parent) { - let choices = parent.choices.filter(ch => this.isDisabled(ch)); - parent.enabled = choices.every(ch => ch.enabled === true); - parent = parent.parent; - } - - reset(this, this.choices); - this.emit('toggle', choice, this); - return choice; - } - - enable(choice) { - if (this.selected.length >= this.maxSelected) return this.alert(); - choice.enabled = !this.isDisabled(choice); - choice.choices && choice.choices.forEach(this.enable.bind(this)); - return choice; - } - - disable(choice) { - choice.enabled = false; - choice.choices && choice.choices.forEach(this.disable.bind(this)); - return choice; - } - - number(n) { - this.num += n; - - let number = num => { - let i = Number(num); - if (i > this.choices.length - 1) return this.alert(); - - let focused = this.focused; - let choice = this.choices.find(ch => i === ch.index); - - if (!choice.enabled && this.selected.length >= this.maxSelected) { - return this.alert(); - } - - if (this.visible.indexOf(choice) === -1) { - let choices = reorder(this.choices); - let actualIdx = choices.indexOf(choice); - - if (focused.index > actualIdx) { - let start = choices.slice(actualIdx, actualIdx + this.limit); - let end = choices.filter(ch => !start.includes(ch)); - this.choices = start.concat(end); - } else { - let pos = actualIdx - this.limit + 1; - this.choices = choices.slice(pos).concat(choices.slice(0, pos)); - } - } - - this.index = this.choices.indexOf(choice); - this.toggle(this.focused); - return this.render(); - }; - - clearTimeout(this.numberTimeout); - - return new Promise(resolve => { - let len = this.choices.length; - let num = this.num; - - let handle = (val = false, res) => { - clearTimeout(this.numberTimeout); - if (val) res = number(num); - this.num = ''; - resolve(res); - }; - - if (num === '0' || (num.length === 1 && Number(num + '0') > len)) { - return handle(true); - } - - if (Number(num) > len) { - return handle(false, this.alert()); - } - - this.numberTimeout = setTimeout(() => handle(true), this.delay); - }); - } - - home() { - this.choices = reorder(this.choices); - this.index = 0; - return this.render(); - } - - end() { - let pos = this.choices.length - this.limit; - let choices = reorder(this.choices); - this.choices = choices.slice(pos).concat(choices.slice(0, pos)); - this.index = this.limit - 1; - return this.render(); - } - - first() { - this.index = 0; - return this.render(); - } - - last() { - this.index = this.visible.length - 1; - return this.render(); - } - - prev() { - if (this.visible.length <= 1) return this.alert(); - return this.up(); - } - - next() { - if (this.visible.length <= 1) return this.alert(); - return this.down(); - } - - right() { - if (this.cursor >= this.input.length) return this.alert(); - this.cursor++; - return this.render(); - } - - left() { - if (this.cursor <= 0) return this.alert(); - this.cursor--; - return this.render(); - } - - up() { - let len = this.choices.length; - let vis = this.visible.length; - let idx = this.index; - if (this.options.scroll === false && idx === 0) { - return this.alert(); - } - if (len > vis && idx === 0) { - return this.scrollUp(); - } - this.index = ((idx - 1 % len) + len) % len; - if (this.isDisabled()) { - return this.up(); - } - return this.render(); - } - - down() { - let len = this.choices.length; - let vis = this.visible.length; - let idx = this.index; - if (this.options.scroll === false && idx === vis - 1) { - return this.alert(); - } - if (len > vis && idx === vis - 1) { - return this.scrollDown(); - } - this.index = (idx + 1) % len; - if (this.isDisabled()) { - return this.down(); - } - return this.render(); - } - - scrollUp(i = 0) { - this.choices = scrollUp(this.choices); - this.index = i; - if (this.isDisabled()) { - return this.up(); - } - return this.render(); - } - - scrollDown(i = this.visible.length - 1) { - this.choices = scrollDown(this.choices); - this.index = i; - if (this.isDisabled()) { - return this.down(); - } - return this.render(); - } - - async shiftUp() { - if (this.options.sort === true) { - this.sorting = true; - this.swap(this.index - 1); - await this.up(); - this.sorting = false; - return; - } - return this.scrollUp(this.index); - } - - async shiftDown() { - if (this.options.sort === true) { - this.sorting = true; - this.swap(this.index + 1); - await this.down(); - this.sorting = false; - return; - } - return this.scrollDown(this.index); - } - - pageUp() { - if (this.visible.length <= 1) return this.alert(); - this.limit = Math.max(this.limit - 1, 0); - this.index = Math.min(this.limit - 1, this.index); - this._limit = this.limit; - if (this.isDisabled()) { - return this.up(); - } - return this.render(); - } - - pageDown() { - if (this.visible.length >= this.choices.length) return this.alert(); - this.index = Math.max(0, this.index); - this.limit = Math.min(this.limit + 1, this.choices.length); - this._limit = this.limit; - if (this.isDisabled()) { - return this.down(); - } - return this.render(); - } - - swap(pos) { - swap(this.choices, this.index, pos); - } - - isDisabled(choice = this.focused) { - let keys = ['disabled', 'collapsed', 'hidden', 'completing', 'readonly']; - if (choice && keys.some(key => choice[key] === true)) { - return true; - } - return choice && choice.role === 'heading'; - } - - isEnabled(choice = this.focused) { - if (Array.isArray(choice)) return choice.every(ch => this.isEnabled(ch)); - if (choice.choices) { - let choices = choice.choices.filter(ch => !this.isDisabled(ch)); - return choice.enabled && choices.every(ch => this.isEnabled(ch)); - } - return choice.enabled && !this.isDisabled(choice); - } - - isChoice(choice, value) { - return choice.name === value || choice.index === Number(value); - } - - isSelected(choice) { - if (Array.isArray(this.initial)) { - return this.initial.some(value => this.isChoice(choice, value)); - } - return this.isChoice(choice, this.initial); - } - - map(names = [], prop = 'value') { - return [].concat(names || []).reduce((acc, name) => { - acc[name] = this.find(name, prop); - return acc; - }, {}); - } - - filter(value, prop) { - let isChoice = (ele, i) => [ele.name, i].includes(value); - let fn = typeof value === 'function' ? value : isChoice; - let choices = this.options.multiple ? this.state._choices : this.choices; - let result = choices.filter(fn); - if (prop) { - return result.map(ch => ch[prop]); - } - return result; - } - - find(value, prop) { - if (isObject(value)) return prop ? value[prop] : value; - let isChoice = (ele, i) => [ele.name, i].includes(value); - let fn = typeof value === 'function' ? value : isChoice; - let choice = this.choices.find(fn); - if (choice) { - return prop ? choice[prop] : choice; - } - } - - findIndex(value) { - return this.choices.indexOf(this.find(value)); - } - - async submit() { - let choice = this.focused; - if (!choice) return this.alert(); - - if (choice.newChoice) { - if (!choice.input) return this.alert(); - choice.updateChoice(); - return this.render(); - } - - if (this.choices.some(ch => ch.newChoice)) { - return this.alert(); - } - - let { reorder, sort } = this.options; - let multi = this.multiple === true; - let value = this.selected; - if (value === void 0) { - return this.alert(); - } - - // re-sort choices to original order - if (Array.isArray(value) && reorder !== false && sort !== true) { - value = utils.reorder(value); - } - - this.value = multi ? value.map(ch => ch.name) : value.name; - return super.submit(); - } - - set choices(choices = []) { - this.state._choices = this.state._choices || []; - this.state.choices = choices; - - for (let choice of choices) { - if (!this.state._choices.some(ch => ch.name === choice.name)) { - this.state._choices.push(choice); - } - } - - if (!this._initial && this.options.initial) { - this._initial = true; - let init = this.initial; - if (typeof init === 'string' || typeof init === 'number') { - let choice = this.find(init); - if (choice) { - this.initial = choice.index; - this.focus(choice, true); - } - } - } - } - get choices() { - return reset(this, this.state.choices || []); - } - - set visible(visible) { - this.state.visible = visible; - } - get visible() { - return (this.state.visible || this.choices).slice(0, this.limit); - } - - set limit(num) { - this.state.limit = num; - } - get limit() { - let { state, options, choices } = this; - let limit = state.limit || this._limit || options.limit || choices.length; - return Math.min(limit, this.height); - } - - set value(value) { - super.value = value; - } - get value() { - if (typeof super.value !== 'string' && super.value === this.initial) { - return this.input; - } - return super.value; - } - - set index(i) { - this.state.index = i; - } - get index() { - return Math.max(0, this.state ? this.state.index : 0); - } - - get enabled() { - return this.filter(this.isEnabled.bind(this)); - } - - get focused() { - let choice = this.choices[this.index]; - if (choice && this.state.submitted && this.multiple !== true) { - choice.enabled = true; - } - return choice; - } - - get selectable() { - return this.choices.filter(choice => !this.isDisabled(choice)); - } - - get selected() { - return this.multiple ? this.enabled : this.focused; - } -} - -function reset(prompt, choices) { - if (choices instanceof Promise) return choices; - if (typeof choices === 'function') { - if (utils.isAsyncFn(choices)) return choices; - choices = choices.call(prompt, prompt); - } - for (let choice of choices) { - if (Array.isArray(choice.choices)) { - let items = choice.choices.filter(ch => !prompt.isDisabled(ch)); - choice.enabled = items.every(ch => ch.enabled === true); - } - if (prompt.isDisabled(choice) === true) { - delete choice.enabled; - } - } - return choices; -} - -module.exports = ArrayPrompt; diff --git a/node_modules/enquirer/lib/types/auth.js b/node_modules/enquirer/lib/types/auth.js deleted file mode 100644 index c2c66fae9..000000000 --- a/node_modules/enquirer/lib/types/auth.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const FormPrompt = require('../prompts/form'); - -const defaultAuthenticate = () => { - throw new Error('expected prompt to have a custom authenticate method'); -}; - -const factory = (authenticate = defaultAuthenticate) => { - - class AuthPrompt extends FormPrompt { - constructor(options) { - super(options); - } - - async submit() { - this.value = await authenticate.call(this, this.values, this.state); - super.base.submit.call(this); - } - - static create(authenticate) { - return factory(authenticate); - } - } - - return AuthPrompt; -}; - -module.exports = factory(); diff --git a/node_modules/enquirer/lib/types/boolean.js b/node_modules/enquirer/lib/types/boolean.js deleted file mode 100644 index d3e7f3408..000000000 --- a/node_modules/enquirer/lib/types/boolean.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -const Prompt = require('../prompt'); -const { isPrimitive, hasColor } = require('../utils'); - -class BooleanPrompt extends Prompt { - constructor(options) { - super(options); - this.cursorHide(); - } - - async initialize() { - let initial = await this.resolve(this.initial, this.state); - this.input = await this.cast(initial); - await super.initialize(); - } - - dispatch(ch) { - if (!this.isValue(ch)) return this.alert(); - this.input = ch; - return this.submit(); - } - - format(value) { - let { styles, state } = this; - return !state.submitted ? styles.primary(value) : styles.success(value); - } - - cast(input) { - return this.isTrue(input); - } - - isTrue(input) { - return /^[ty1]/i.test(input); - } - - isFalse(input) { - return /^[fn0]/i.test(input); - } - - isValue(value) { - return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value)); - } - - async hint() { - if (this.state.status === 'pending') { - let hint = await this.element('hint'); - if (!hasColor(hint)) { - return this.styles.muted(hint); - } - return hint; - } - } - - async render() { - let { input, size } = this.state; - - let prefix = await this.prefix(); - let sep = await this.separator(); - let msg = await this.message(); - let hint = this.styles.muted(this.default); - - let promptLine = [prefix, msg, hint, sep].filter(Boolean).join(' '); - this.state.prompt = promptLine; - - let header = await this.header(); - let value = this.value = this.cast(input); - let output = await this.format(value); - let help = (await this.error()) || (await this.hint()); - let footer = await this.footer(); - - if (help && !promptLine.includes(help)) output += ' ' + help; - promptLine += ' ' + output; - - this.clear(size); - this.write([header, promptLine, footer].filter(Boolean).join('\n')); - this.restore(); - } - - set value(value) { - super.value = value; - } - get value() { - return this.cast(super.value); - } -} - -module.exports = BooleanPrompt; diff --git a/node_modules/enquirer/lib/types/index.js b/node_modules/enquirer/lib/types/index.js deleted file mode 100644 index b3a2300d8..000000000 --- a/node_modules/enquirer/lib/types/index.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - ArrayPrompt: require('./array'), - AuthPrompt: require('./auth'), - BooleanPrompt: require('./boolean'), - NumberPrompt: require('./number'), - StringPrompt: require('./string') -}; diff --git a/node_modules/enquirer/lib/types/number.js b/node_modules/enquirer/lib/types/number.js deleted file mode 100644 index 199a7c99a..000000000 --- a/node_modules/enquirer/lib/types/number.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -const StringPrompt = require('./string'); - -class NumberPrompt extends StringPrompt { - constructor(options = {}) { - super({ style: 'number', ...options }); - this.min = this.isValue(options.min) ? this.toNumber(options.min) : -Infinity; - this.max = this.isValue(options.max) ? this.toNumber(options.max) : Infinity; - this.delay = options.delay != null ? options.delay : 1000; - this.float = options.float !== false; - this.round = options.round === true || options.float === false; - this.major = options.major || 10; - this.minor = options.minor || 1; - this.initial = options.initial != null ? options.initial : ''; - this.input = String(this.initial); - this.cursor = this.input.length; - this.cursorShow(); - } - - append(ch) { - if (!/[-+.]/.test(ch) || (ch === '.' && this.input.includes('.'))) { - return this.alert('invalid number'); - } - return super.append(ch); - } - - number(ch) { - return super.append(ch); - } - - next() { - if (this.input && this.input !== this.initial) return this.alert(); - if (!this.isValue(this.initial)) return this.alert(); - this.input = this.initial; - this.cursor = String(this.initial).length; - return this.render(); - } - - up(number) { - let step = number || this.minor; - let num = this.toNumber(this.input); - if (num > this.max + step) return this.alert(); - this.input = `${num + step}`; - return this.render(); - } - - down(number) { - let step = number || this.minor; - let num = this.toNumber(this.input); - if (num < this.min - step) return this.alert(); - this.input = `${num - step}`; - return this.render(); - } - - shiftDown() { - return this.down(this.major); - } - - shiftUp() { - return this.up(this.major); - } - - format(input = this.input) { - if (typeof this.options.format === 'function') { - return this.options.format.call(this, input); - } - return this.styles.info(input); - } - - toNumber(value = '') { - return this.float ? +value : Math.round(+value); - } - - isValue(value) { - return /^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(value); - } - - submit() { - let value = [this.input, this.initial].find(v => this.isValue(v)); - this.value = this.toNumber(value || 0); - return super.submit(); - } -} - -module.exports = NumberPrompt; diff --git a/node_modules/enquirer/lib/types/string.js b/node_modules/enquirer/lib/types/string.js deleted file mode 100644 index d4e0ce9ad..000000000 --- a/node_modules/enquirer/lib/types/string.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -const Prompt = require('../prompt'); -const placeholder = require('../placeholder'); -const { isPrimitive } = require('../utils'); - -class StringPrompt extends Prompt { - constructor(options) { - super(options); - this.initial = isPrimitive(this.initial) ? String(this.initial) : ''; - if (this.initial) this.cursorHide(); - this.state.prevCursor = 0; - this.state.clipboard = []; - } - - async keypress(input, key = {}) { - let prev = this.state.prevKeypress; - this.state.prevKeypress = key; - if (this.options.multiline === true && key.name === 'return') { - if (!prev || prev.name !== 'return') { - return this.append('\n', key); - } - } - return super.keypress(input, key); - } - - moveCursor(n) { - this.cursor += n; - } - - reset() { - this.input = this.value = ''; - this.cursor = 0; - return this.render(); - } - - dispatch(ch, key) { - if (!ch || key.ctrl || key.code) return this.alert(); - this.append(ch); - } - - append(ch) { - let { cursor, input } = this.state; - this.input = `${input}`.slice(0, cursor) + ch + `${input}`.slice(cursor); - this.moveCursor(String(ch).length); - this.render(); - } - - insert(str) { - this.append(str); - } - - delete() { - let { cursor, input } = this.state; - if (cursor <= 0) return this.alert(); - this.input = `${input}`.slice(0, cursor - 1) + `${input}`.slice(cursor); - this.moveCursor(-1); - this.render(); - } - - deleteForward() { - let { cursor, input } = this.state; - if (input[cursor] === void 0) return this.alert(); - this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1); - this.render(); - } - - cutForward() { - let pos = this.cursor; - if (this.input.length <= pos) return this.alert(); - this.state.clipboard.push(this.input.slice(pos)); - this.input = this.input.slice(0, pos); - this.render(); - } - - cutLeft() { - let pos = this.cursor; - if (pos === 0) return this.alert(); - let before = this.input.slice(0, pos); - let after = this.input.slice(pos); - let words = before.split(' '); - this.state.clipboard.push(words.pop()); - this.input = words.join(' '); - this.cursor = this.input.length; - this.input += after; - this.render(); - } - - paste() { - if (!this.state.clipboard.length) return this.alert(); - this.insert(this.state.clipboard.pop()); - this.render(); - } - - toggleCursor() { - if (this.state.prevCursor) { - this.cursor = this.state.prevCursor; - this.state.prevCursor = 0; - } else { - this.state.prevCursor = this.cursor; - this.cursor = 0; - } - this.render(); - } - - first() { - this.cursor = 0; - this.render(); - } - - last() { - this.cursor = this.input.length - 1; - this.render(); - } - - next() { - let init = this.initial != null ? String(this.initial) : ''; - if (!init || !init.startsWith(this.input)) return this.alert(); - this.input = this.initial; - this.cursor = this.initial.length; - this.render(); - } - - prev() { - if (!this.input) return this.alert(); - this.reset(); - } - - backward() { - return this.left(); - } - - forward() { - return this.right(); - } - - right() { - if (this.cursor >= this.input.length) return this.alert(); - this.moveCursor(1); - return this.render(); - } - - left() { - if (this.cursor <= 0) return this.alert(); - this.moveCursor(-1); - return this.render(); - } - - isValue(value) { - return !!value; - } - - async format(input = this.value) { - let initial = await this.resolve(this.initial, this.state); - if (!this.state.submitted) { - return placeholder(this, { input, initial, pos: this.cursor }); - } - return this.styles.submitted(input || initial); - } - - async render() { - let size = this.state.size; - - let prefix = await this.prefix(); - let separator = await this.separator(); - let message = await this.message(); - - let prompt = [prefix, message, separator].filter(Boolean).join(' '); - this.state.prompt = prompt; - - let header = await this.header(); - let output = await this.format(); - let help = (await this.error()) || (await this.hint()); - let footer = await this.footer(); - - if (help && !output.includes(help)) output += ' ' + help; - prompt += ' ' + output; - - this.clear(size); - this.write([header, prompt, footer].filter(Boolean).join('\n')); - this.restore(); - } -} - -module.exports = StringPrompt; diff --git a/node_modules/enquirer/lib/utils.js b/node_modules/enquirer/lib/utils.js deleted file mode 100644 index 7493c0d53..000000000 --- a/node_modules/enquirer/lib/utils.js +++ /dev/null @@ -1,268 +0,0 @@ -'use strict'; - -const toString = Object.prototype.toString; -const colors = require('ansi-colors'); -let called = false; -let fns = []; - -const complements = { - 'yellow': 'blue', - 'cyan': 'red', - 'green': 'magenta', - 'black': 'white', - 'blue': 'yellow', - 'red': 'cyan', - 'magenta': 'green', - 'white': 'black' -}; - -exports.longest = (arr, prop) => { - return arr.reduce((a, v) => Math.max(a, prop ? v[prop].length : v.length), 0); -}; - -exports.hasColor = str => !!str && colors.hasColor(str); - -const isObject = exports.isObject = val => { - return val !== null && typeof val === 'object' && !Array.isArray(val); -}; - -exports.nativeType = val => { - return toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -exports.isAsyncFn = val => { - return exports.nativeType(val) === 'asyncfunction'; -}; - -exports.isPrimitive = val => { - return val != null && typeof val !== 'object' && typeof val !== 'function'; -}; - -exports.resolve = (context, value, ...rest) => { - if (typeof value === 'function') { - return value.call(context, ...rest); - } - return value; -}; - -exports.scrollDown = (choices = []) => [...choices.slice(1), choices[0]]; -exports.scrollUp = (choices = []) => [choices.pop(), ...choices]; - -exports.reorder = (arr = []) => { - let res = arr.slice(); - res.sort((a, b) => { - if (a.index > b.index) return 1; - if (a.index < b.index) return -1; - return 0; - }); - return res; -}; - -exports.swap = (arr, index, pos) => { - let len = arr.length; - let idx = pos === len ? 0 : pos < 0 ? len - 1 : pos; - let choice = arr[index]; - arr[index] = arr[idx]; - arr[idx] = choice; -}; - -exports.width = (stream, fallback = 80) => { - let columns = (stream && stream.columns) ? stream.columns : fallback; - if (stream && typeof stream.getWindowSize === 'function') { - columns = stream.getWindowSize()[0]; - } - if (process.platform === 'win32') { - return columns - 1; - } - return columns; -}; - -exports.height = (stream, fallback = 20) => { - let rows = (stream && stream.rows) ? stream.rows : fallback; - if (stream && typeof stream.getWindowSize === 'function') { - rows = stream.getWindowSize()[1]; - } - return rows; -}; - -exports.wordWrap = (str, options = {}) => { - if (!str) return str; - - if (typeof options === 'number') { - options = { width: options }; - } - - let { indent = '', newline = ('\n' + indent), width = 80 } = options; - let spaces = (newline + indent).match(/[^\S\n]/g) || []; - width -= spaces.length; - let source = `.{1,${width}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`; - let output = str.trim(); - let regex = new RegExp(source, 'g'); - let lines = output.match(regex) || []; - lines = lines.map(line => line.replace(/\n$/, '')); - if (options.padEnd) lines = lines.map(line => line.padEnd(width, ' ')); - if (options.padStart) lines = lines.map(line => line.padStart(width, ' ')); - return indent + lines.join(newline); -}; - -exports.unmute = color => { - let name = color.stack.find(n => colors.keys.color.includes(n)); - if (name) { - return colors[name]; - } - let bg = color.stack.find(n => n.slice(2) === 'bg'); - if (bg) { - return colors[name.slice(2)]; - } - return str => str; -}; - -exports.pascal = str => str ? str[0].toUpperCase() + str.slice(1) : ''; - -exports.inverse = color => { - if (!color || !color.stack) return color; - let name = color.stack.find(n => colors.keys.color.includes(n)); - if (name) { - let col = colors['bg' + exports.pascal(name)]; - return col ? col.black : color; - } - let bg = color.stack.find(n => n.slice(0, 2) === 'bg'); - if (bg) { - return colors[bg.slice(2).toLowerCase()] || color; - } - return colors.none; -}; - -exports.complement = color => { - if (!color || !color.stack) return color; - let name = color.stack.find(n => colors.keys.color.includes(n)); - let bg = color.stack.find(n => n.slice(0, 2) === 'bg'); - if (name && !bg) { - return colors[complements[name] || name]; - } - if (bg) { - let lower = bg.slice(2).toLowerCase(); - let comp = complements[lower]; - if (!comp) return color; - return colors['bg' + exports.pascal(comp)] || color; - } - return colors.none; -}; - -exports.meridiem = date => { - let hours = date.getHours(); - let minutes = date.getMinutes(); - let ampm = hours >= 12 ? 'pm' : 'am'; - hours = hours % 12; - let hrs = hours === 0 ? 12 : hours; - let min = minutes < 10 ? '0' + minutes : minutes; - return hrs + ':' + min + ' ' + ampm; -}; - -/** - * Set a value on the given object. - * @param {Object} obj - * @param {String} prop - * @param {any} value - */ - -exports.set = (obj = {}, prop = '', val) => { - return prop.split('.').reduce((acc, k, i, arr) => { - let value = arr.length - 1 > i ? (acc[k] || {}) : val; - if (!exports.isObject(value) && i < arr.length - 1) value = {}; - return (acc[k] = value); - }, obj); -}; - -/** - * Get a value from the given object. - * @param {Object} obj - * @param {String} prop - */ - -exports.get = (obj = {}, prop = '', fallback) => { - let value = obj[prop] == null - ? prop.split('.').reduce((acc, k) => acc && acc[k], obj) - : obj[prop]; - return value == null ? fallback : value; -}; - -exports.mixin = (target, b) => { - if (!isObject(target)) return b; - if (!isObject(b)) return target; - for (let key of Object.keys(b)) { - let desc = Object.getOwnPropertyDescriptor(b, key); - if (desc.hasOwnProperty('value')) { - if (target.hasOwnProperty(key) && isObject(desc.value)) { - let existing = Object.getOwnPropertyDescriptor(target, key); - if (isObject(existing.value)) { - target[key] = exports.merge({}, target[key], b[key]); - } else { - Reflect.defineProperty(target, key, desc); - } - } else { - Reflect.defineProperty(target, key, desc); - } - } else { - Reflect.defineProperty(target, key, desc); - } - } - return target; -}; - -exports.merge = (...args) => { - let target = {}; - for (let ele of args) exports.mixin(target, ele); - return target; -}; - -exports.mixinEmitter = (obj, emitter) => { - let proto = emitter.constructor.prototype; - for (let key of Object.keys(proto)) { - let val = proto[key]; - if (typeof val === 'function') { - exports.define(obj, key, val.bind(emitter)); - } else { - exports.define(obj, key, val); - } - } -}; - -exports.onExit = callback => { - const onExit = (quit, code) => { - if (called) return; - - called = true; - fns.forEach(fn => fn()); - - if (quit === true) { - process.exit(128 + code); - } - }; - - if (fns.length === 0) { - process.once('SIGTERM', onExit.bind(null, true, 15)); - process.once('SIGINT', onExit.bind(null, true, 2)); - process.once('exit', onExit); - } - - fns.push(callback); -}; - -exports.define = (obj, key, value) => { - Reflect.defineProperty(obj, key, { value }); -}; - -exports.defineExport = (obj, key, fn) => { - let custom; - Reflect.defineProperty(obj, key, { - enumerable: true, - configurable: true, - set(val) { - custom = val; - }, - get() { - return custom ? custom() : fn(); - } - }); -}; diff --git a/node_modules/enquirer/package.json b/node_modules/enquirer/package.json deleted file mode 100644 index b34d0ee07..000000000 --- a/node_modules/enquirer/package.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "_from": "enquirer@^2.3.5", - "_id": "enquirer@2.3.6", - "_inBundle": false, - "_integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "_location": "/enquirer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "enquirer@^2.3.5", - "name": "enquirer", - "escapedName": "enquirer", - "rawSpec": "^2.3.5", - "saveSpec": null, - "fetchSpec": "^2.3.5" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "_shasum": "2a7fe5dd634a1e4125a975ec994ff5456dc3734d", - "_spec": "enquirer@^2.3.5", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/enquirer/enquirer/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "deprecated": false, - "description": "Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.", - "devDependencies": { - "@types/node": "^8", - "gulp-format-md": "^2.0.0", - "inquirer": "^6.2.0", - "mocha": "^5.2.0", - "nyc": "^13.1.0", - "prompts": "^1.2.1", - "time-require": "github:jonschlinkert/time-require", - "typescript": "^3.1.6" - }, - "engines": { - "node": ">=8.6" - }, - "files": [ - "index.js", - "index.d.ts", - "lib" - ], - "homepage": "https://github.com/enquirer/enquirer", - "keywords": [ - "answer", - "answers", - "ask", - "base", - "cli", - "command", - "command-line", - "confirm", - "enquirer", - "generator", - "generate", - "hyper", - "input", - "inquire", - "inquirer", - "interface", - "iterm", - "javascript", - "node", - "nodejs", - "prompt", - "prompts", - "promptly", - "question", - "readline", - "scaffold", - "scaffolding", - "scaffolder", - "stdin", - "stdout", - "terminal", - "tty", - "ui", - "yeoman", - "yo", - "zsh" - ], - "license": "MIT", - "lintDeps": { - "devDependencies": { - "files": { - "patterns": [ - "examples/**/*.js", - "perf/*.js", - "recipes/*.js" - ] - } - } - }, - "main": "index.js", - "name": "enquirer", - "repository": { - "type": "git", - "url": "git+https://github.com/enquirer/enquirer.git" - }, - "scripts": { - "cover": "nyc --reporter=text --reporter=html mocha", - "test": "mocha && tsc -p ./test/types" - }, - "verb": { - "toc": false, - "layout": false, - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "helpers": [ - "./docs/helpers.js" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "inquirer", - "prompt-skeleton" - ] - }, - "version": "2.3.6" -} diff --git a/node_modules/eslint-scope/CHANGELOG.md b/node_modules/eslint-scope/CHANGELOG.md deleted file mode 100644 index cc07de01c..000000000 --- a/node_modules/eslint-scope/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -v5.1.1 - September 12, 2020 - -* [`9b528d7`](https://github.com/eslint/eslint-scope/commit/9b528d778c381718c12dabfb7f1c0e0dc6b36e49) Upgrade: esrecurse version to ^4.3.0 (#64) (Timofey Kachalov) -* [`f758bbc`](https://github.com/eslint/eslint-scope/commit/f758bbc3d49b9b9ea2289a5d6a6bba8dcf2c4903) Chore: fix definiton -> definition typo in comments (#63) (Kevin Kirsche) -* [`7513734`](https://github.com/eslint/eslint-scope/commit/751373473375b3f2edc4eaf1c8d2763d8435bb72) Chore: move to GitHub Actions (#62) (Kai Cataldo) - -v5.1.0 - June 4, 2020 - -* [`d4a3764`](https://github.com/eslint/eslint-scope/commit/d4a376434b16289c1a428d7e304576e997520873) Update: support new export syntax (#56) (Toru Nagashima) - -v5.0.0 - July 20, 2019 - -* [`e9fa22e`](https://github.com/eslint/eslint-scope/commit/e9fa22ea412c26cf2761fa98af7e715644bdb464) Upgrade: update dependencies after dropping support for Node <8 (#53) (Kai Cataldo) -* [`ee9f7c1`](https://github.com/eslint/eslint-scope/commit/ee9f7c12721aa195ba7e0e69551f49bfdb479951) Breaking: drop support for Node v6 (#54) (Kai Cataldo) - -v4.0.3 - March 15, 2019 - -* [`299df64`](https://github.com/eslint/eslint-scope/commit/299df64bdafb30b4d9372e4b7af0cf51a3818c4a) Fix: arrow function scope strictness (take 2) (#52) (futpib) - -v4.0.2 - March 1, 2019 - -* [`c925600`](https://github.com/eslint/eslint-scope/commit/c925600a684ae0f71b96f85339437a43b4d50d99) Revert "Fix: Arrow function scope strictness (fixes #49) (#50)" (#51) (Teddy Katz) - -v4.0.1 - March 1, 2019 - -* [`2533966`](https://github.com/eslint/eslint-scope/commit/2533966faf317df5a3847fab937ba462c16808b8) Fix: Arrow function scope strictness (fixes #49) (#50) (futpib) -* [`0cbeea5`](https://github.com/eslint/eslint-scope/commit/0cbeea51dfb66ab88ea34b0e3b4ad5e6cc210f2f) Chore: add supported Node.js versions to CI (#47) (Kai Cataldo) -* [`b423057`](https://github.com/eslint/eslint-scope/commit/b42305760638b8edf4667acf1445e450869bd983) Upgrade: eslint-release@1.0.0 (#46) (Teddy Katz) - -v4.0.0 - June 21, 2018 - - - -v4.0.0-rc.0 - June 9, 2018 - -* 3b919b8 Build: Adding rc release script to package.json (#38) (Kevin Partington) -* 137732a Chore: avoid creating package-lock.json files (#37) (Teddy Katz) - -v4.0.0-alpha.0 - April 27, 2018 - -* 7cc3769 Upgrade: eslint-release ^0.11.1 (#36) (Teddy Katz) -* c9f6967 Breaking: remove TDZScope (refs eslint/eslint#10245) (#35) (Toru Nagashima) -* 982a71f Fix: wrong resolution about default parameters (#33) (Toru Nagashima) -* 57889f1 Docs: Remove extra header line from LICENSE (#32) (Gyandeep Singh) - -v3.7.1 - April 12, 2017 - -* ced6262 Fix: restore previous Scope API exports from escope (#31) (Vitor Balocco) -* 5c3d966 Fix: Remove and Modify tests that contain invalid ES6 syntax (#29) (Reyad Attiyat) - -v3.7.0 - March 17, 2017 - -* 9e27835 Chore: Add files section to package.json (#24) (Ilya Volodin) -* 3e4d123 Upgrade: eslint-config-eslint to 4.0.0 (#21) (Teddy Katz) -* 38c50fb Chore: Rename src to lib and test to tests (#20) (Corbin Uselton) -* f4cd920 Chore: Remove esprima (#19) (Corbin Uselton) -* f81fad5 Revert "Chore: Remove esprima" (#18) (James Henry) -* 31b0085 Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (#13) (Corbin Uselton) -* 12a1ca1 Add Makefile.js and eslint (#15) (Reyad Attiyat) -* 7d23f8e Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (Corbin Uselton) -* 019441e Chore: Convert to ES6 that is supported on Node 4, commonjs modules and remove Babel (#14) (Corbin Uselton) -* c647f65 Update: Add check for node.body in referencer (#2) (Corbin Uselton) -* eb5c9db Remove browserify and jsdoc (#12) (Corbin Uselton) -* cf38df0 Chore: Update README.md (#3) (James Henry) -* 8a142ca Chore: Add eslint-release scripts (#6) (James Henry) -* e60d8cb Chore: Remove unused bower.json (#5) (James Henry) -* 049c545 Chore: Fix tests for eslint-scope (#4) (James Henry) -* f026aab Chore: Update package.json for eslint fork (#1) (James Henry) -* a94d281 Chore: Update license with JSF copyright (Nicholas C. Zakas) - diff --git a/node_modules/eslint-scope/README.md b/node_modules/eslint-scope/README.md index 7e7ce0d34..4ad41d5c1 100644 --- a/node_modules/eslint-scope/README.md +++ b/node_modules/eslint-scope/README.md @@ -2,35 +2,47 @@ ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). -## Usage - -Install: +## Install ``` npm i eslint-scope --save ``` +## 📖 Usage + +To use in an ESM file: + +```js +import * as eslintScope from 'eslint-scope'; +``` + +To use in a CommonJS file: + +```js +const eslintScope = require('eslint-scope'); +``` + Example: ```js -var eslintScope = require('eslint-scope'); -var espree = require('espree'); -var estraverse = require('estraverse'); +import * as eslintScope from 'eslint-scope'; +import * as espree from 'espree'; +import estraverse from 'estraverse'; -var ast = espree.parse(code); -var scopeManager = eslintScope.analyze(ast); +const ast = espree.parse(code, { range: true }); +const scopeManager = eslintScope.analyze(ast); -var currentScope = scopeManager.acquire(ast); // global scope +const currentScope = scopeManager.acquire(ast); // global scope estraverse.traverse(ast, { - enter: function(node, parent) { + enter (node, parent) { // do stuff if (/Function/.test(node.type)) { currentScope = scopeManager.acquire(node); // get current function scope } }, - leave: function(node, parent) { + leave(node, parent) { if (/Function/.test(node.type)) { currentScope = currentScope.upper; // set to parent scope } diff --git a/node_modules/eslint-scope/dist/eslint-scope.cjs b/node_modules/eslint-scope/dist/eslint-scope.cjs new file mode 100644 index 000000000..9e3cadfc4 --- /dev/null +++ b/node_modules/eslint-scope/dist/eslint-scope.cjs @@ -0,0 +1,2240 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var assert = require('assert'); +var estraverse = require('estraverse'); +var esrecurse = require('esrecurse'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); +var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse); +var esrecurse__default = /*#__PURE__*/_interopDefaultLegacy(esrecurse); + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @constructor Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @function Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @function Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @function Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @function Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @function Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @function Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @constructor Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {string} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @constructor Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {string?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @constructor ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const { Syntax: Syntax$2 } = estraverse__default["default"]; + +/** + * Test if scope is struct + * @param {Scope} scope scope + * @param {Block} block block + * @param {boolean} isMethodDefinition is method definition + * @param {boolean} useDirective use directive + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition, useDirective) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax$2.ArrowFunctionExpression && block.body.type !== Syntax$2.BlockStatement) { + return false; + } + + if (block.type === Syntax$2.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search 'use strict' directive. + if (useDirective) { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax$2.DirectiveStatement) { + break; + } + if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { + return true; + } + } + } else { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax$2.ExpressionStatement) { + break; + } + const expr = stmt.expression; + + if (expr.type !== Syntax$2.Literal || typeof expr.value !== "string") { + break; + } + if (expr.raw !== null && expr.raw !== undefined) { + if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { + return true; + } + } else { + if (expr.value === "use strict") { + return true; + } + } + } + } + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager scope manager + * @param {Scope} scope scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @constructor Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for", + * "class", "class-field-initializer", "class-static-block". + * @member {string} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + this.type === "global" || + this.type === "module" || + this.type === "function" || + this.type === "class-field-initializer" || + this.type === "class-static-block" + ? this + : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = scopeManager.isStrictModeSupported() + ? isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()) + : false; + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === undefined) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === undefined) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (variables.indexOf(variable) === -1) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax$2.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def + ); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax$2.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @function Scope#resolve + * @param {Espree.Identifier} ident identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert__default["default"](this.__isClosed(), "Scope should be closed."); + assert__default["default"](ident.type === Syntax$2.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @function Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @function Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + /** + * returns this scope has materialized `this` reference + * @function Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax$2.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def + ); + } + } +} + +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax$2.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax$2.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert__default["default"](variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null + ); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +class ClassFieldInitializerScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-field-initializer", upperScope, block, true); + } +} + +class ClassStaticBlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-static-block", upperScope, block, true); + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @constructor ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __useDirective() { + return this.__options.directive; + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + __isNodejsScope() { + return this.__options.nodejsScope || this.__options.sourceType === "commonjs"; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * @param {Espree.Node} node a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @function ScopeManager#acquire + * @param {Espree.Node} node node for the acquired scope. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @function ScopeManager#acquireAll + * @param {Espree.Node} node node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @function ScopeManager#release + * @param {Espree.Node} node releasing node. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this + + detach() { } // eslint-disable-line class-methods-use-this + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert__default["default"](this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestClassFieldInitializerScope(node) { + return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node)); + } + + __nestClassStaticBlockScope(node) { + return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const { Syntax: Syntax$1 } = estraverse__default["default"]; + +/** + * Get last array element + * @param {Array} xs array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs[xs.length - 1] || null; +} + +class PatternVisitor extends esrecurse__default["default"].Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax$1.Identifier || + nodeType === Syntax$1.ObjectPattern || + nodeType === Syntax$1.ArrayPattern || + nodeType === Syntax$1.SpreadElement || + nodeType === Syntax$1.RestElement || + nodeType === Syntax$1.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +const { Syntax } = estraverse__default["default"]; + +/** + * Traverse identifier in pattern + * @param {Object} options options + * @param {pattern} rootPattern root pattern + * @param {Refencer} referencer referencer + * @param {callback} callback callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== undefined) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +class Importer extends esrecurse__default["default"].Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +// Referencing variables and creating bindings. +class Referencer extends esrecurse__default["default"].Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init + ); + }); + } + + visitPattern(node, options, callback) { + let visitPatternOptions = options; + let visitPatternCallback = callback; + + if (typeof options === "function") { + visitPatternCallback = options; + visitPatternOptions = { processRightHandNodes: false }; + } + + traverseIdentifierInPattern( + this.options, + node, + visitPatternOptions.processRightHandNodes ? this : null, + visitPatternCallback + ); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern pattern + * @param {Object} info info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.visit(node.superClass); + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + node.param, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.__isNodejsScope()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + // eslint-disable-next-line class-methods-use-this + PrivateIdentifier() { + + // Do nothing. + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + PropertyDefinition(node) { + const { computed, key, value } = node; + + if (computed) { + this.visit(key); + } + if (value) { + this.scopeManager.__nestClassFieldInitializerScope(value); + this.visit(value); + this.close(value); + } + } + + StaticBlock(node) { + this.scopeManager.__nestClassStaticBlockScope(node); + + this.visitChildren(node); + + this.close(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this + + ContinueStatement() {} // eslint-disable-line class-methods-use-this + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert__default["default"](this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + // TODO: ExportDeclaration doesn't exist. for bc? + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportAllDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportDefaultDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + + // TODO: `node.id` doesn't exist. for bc? + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this + + // do nothing. + } +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +const version = "7.1.1"; + +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + directive: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module', 'commonjs'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target Options + * @param {Object} override Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (Object.prototype.hasOwnProperty.call(override, key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree Abstract Syntax Tree + * @param {Object} providedOptions Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] the optimistic flag + * @param {boolean} [providedOptions.directive=false] the directive flag + * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false] whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs' + * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert__default["default"](scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +/* vim: set sw=4 ts=4 et tw=80 : */ + +exports.Definition = Definition; +exports.PatternVisitor = PatternVisitor; +exports.Reference = Reference; +exports.Referencer = Referencer; +exports.Scope = Scope; +exports.ScopeManager = ScopeManager; +exports.Variable = Variable; +exports.analyze = analyze; +exports.version = version; +//# sourceMappingURL=eslint-scope.cjs.map diff --git a/node_modules/eslint-scope/lib/definition.js b/node_modules/eslint-scope/lib/definition.js index 172bfe23b..9744ef48b 100644 --- a/node_modules/eslint-scope/lib/definition.js +++ b/node_modules/eslint-scope/lib/definition.js @@ -21,18 +21,17 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; -const Variable = require("./variable"); +import Variable from "./variable.js"; /** - * @class Definition + * @constructor Definition */ class Definition { constructor(type, name, node, parent, index, kind) { /** - * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). */ this.type = type; @@ -52,19 +51,19 @@ class Definition { this.parent = parent; /** - * @member {Number?} Definition#index - the index in the declaration statement. + * @member {number?} Definition#index - the index in the declaration statement. */ this.index = index; /** - * @member {String?} Definition#kind - the kind of the declaration statement. + * @member {string?} Definition#kind - the kind of the declaration statement. */ this.kind = kind; } } /** - * @class ParameterDefinition + * @constructor ParameterDefinition */ class ParameterDefinition extends Definition { constructor(name, node, index, rest) { @@ -78,7 +77,7 @@ class ParameterDefinition extends Definition { } } -module.exports = { +export { ParameterDefinition, Definition }; diff --git a/node_modules/eslint-scope/lib/index.js b/node_modules/eslint-scope/lib/index.js index 0f16fa40f..cd0678d2e 100644 --- a/node_modules/eslint-scope/lib/index.js +++ b/node_modules/eslint-scope/lib/index.js @@ -45,18 +45,16 @@ * The main interface is the {@link analyze} function. * @module escope */ -"use strict"; - /* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ -const assert = require("assert"); +import assert from "assert"; + +import ScopeManager from "./scope-manager.js"; +import Referencer from "./referencer.js"; +import Reference from "./reference.js"; +import Variable from "./variable.js"; -const ScopeManager = require("./scope-manager"); -const Referencer = require("./referencer"); -const Reference = require("./reference"); -const Variable = require("./variable"); -const Scope = require("./scope").Scope; -const version = require("../package.json").version; +import eslintScopeVersion from "./version.js"; /** * Set the default options @@ -68,7 +66,7 @@ function defaultOptions() { directive: false, nodejsScope: false, impliedStrict: false, - sourceType: "script", // one of ['script', 'module'] + sourceType: "script", // one of ['script', 'module', 'commonjs'] ecmaVersion: 5, childVisitorKeys: null, fallback: "iteration" @@ -77,15 +75,15 @@ function defaultOptions() { /** * Preform deep update on option object - * @param {Object} target - Options - * @param {Object} override - Updates + * @param {Object} target Options + * @param {Object} override Updates * @returns {Object} Updated options */ function updateDeeply(target, override) { /** * Is hash object - * @param {Object} value - Test value + * @param {Object} value Test value * @returns {boolean} Result */ function isHashObject(value) { @@ -114,20 +112,20 @@ function updateDeeply(target, override) { * Main interface function. Takes an Espree syntax tree and returns the * analyzed scopes. * @function analyze - * @param {espree.Tree} tree - Abstract Syntax Tree - * @param {Object} providedOptions - Options that tailor the scope analysis - * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag - * @param {boolean} [providedOptions.directive=false]- the directive flag - * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls - * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole + * @param {espree.Tree} tree Abstract Syntax Tree + * @param {Object} providedOptions Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] the optimistic flag + * @param {boolean} [providedOptions.directive=false] the directive flag + * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false] whether the whole * script is executed under node.js environment. When enabled, escope adds * a function scope immediately following the global scope. - * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode + * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode * (if ecmaVersion >= 5). - * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' - * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered - * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. - * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs' + * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. * @returns {ScopeManager} ScopeManager */ function analyze(tree, providedOptions) { @@ -142,10 +140,10 @@ function analyze(tree, providedOptions) { return scopeManager; } -module.exports = { +export { /** @name module:escope.version */ - version, + eslintScopeVersion as version, /** @name module:escope.Reference */ Reference, @@ -153,13 +151,22 @@ module.exports = { /** @name module:escope.Variable */ Variable, - /** @name module:escope.Scope */ - Scope, - /** @name module:escope.ScopeManager */ ScopeManager, + + /** @name module:escope.Referencer */ + Referencer, + analyze }; +/** @name module:escope.Definition */ +export { Definition } from "./definition.js"; + +/** @name module:escope.PatternVisitor */ +export { default as PatternVisitor } from "./pattern-visitor.js"; + +/** @name module:escope.Scope */ +export { Scope } from "./scope.js"; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/pattern-visitor.js b/node_modules/eslint-scope/lib/pattern-visitor.js index afa629173..a9ff48e50 100644 --- a/node_modules/eslint-scope/lib/pattern-visitor.js +++ b/node_modules/eslint-scope/lib/pattern-visitor.js @@ -21,16 +21,17 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; /* eslint-disable no-undefined */ -const Syntax = require("estraverse").Syntax; -const esrecurse = require("esrecurse"); +import estraverse from "estraverse"; +import esrecurse from "esrecurse"; + +const { Syntax } = estraverse; /** * Get last array element - * @param {array} xs - array + * @param {Array} xs array * @returns {any} Last elment */ function getLast(xs) { @@ -147,6 +148,6 @@ class PatternVisitor extends esrecurse.Visitor { } } -module.exports = PatternVisitor; +export default PatternVisitor; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/reference.js b/node_modules/eslint-scope/lib/reference.js index 9529827fe..e657d6286 100644 --- a/node_modules/eslint-scope/lib/reference.js +++ b/node_modules/eslint-scope/lib/reference.js @@ -21,7 +21,6 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; const READ = 0x1; const WRITE = 0x2; @@ -29,7 +28,7 @@ const RW = READ | WRITE; /** * A Reference represents a single occurrence of an identifier in code. - * @class Reference + * @constructor Reference */ class Reference { constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { @@ -91,7 +90,7 @@ class Reference { /** * Whether the reference is static. - * @method Reference#isStatic + * @function Reference#isStatic * @returns {boolean} static */ isStatic() { @@ -100,7 +99,7 @@ class Reference { /** * Whether the reference is writeable. - * @method Reference#isWrite + * @function Reference#isWrite * @returns {boolean} write */ isWrite() { @@ -109,7 +108,7 @@ class Reference { /** * Whether the reference is readable. - * @method Reference#isRead + * @function Reference#isRead * @returns {boolean} read */ isRead() { @@ -118,7 +117,7 @@ class Reference { /** * Whether the reference is read-only. - * @method Reference#isReadOnly + * @function Reference#isReadOnly * @returns {boolean} read only */ isReadOnly() { @@ -127,7 +126,7 @@ class Reference { /** * Whether the reference is write-only. - * @method Reference#isWriteOnly + * @function Reference#isWriteOnly * @returns {boolean} write only */ isWriteOnly() { @@ -136,7 +135,7 @@ class Reference { /** * Whether the reference is read-write. - * @method Reference#isReadWrite + * @function Reference#isReadWrite * @returns {boolean} read write */ isReadWrite() { @@ -162,6 +161,6 @@ Reference.WRITE = WRITE; */ Reference.RW = RW; -module.exports = Reference; +export default Reference; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/referencer.js b/node_modules/eslint-scope/lib/referencer.js index 63d1935b3..0147f686a 100644 --- a/node_modules/eslint-scope/lib/referencer.js +++ b/node_modules/eslint-scope/lib/referencer.js @@ -21,28 +21,26 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; /* eslint-disable no-underscore-dangle */ /* eslint-disable no-undefined */ -const Syntax = require("estraverse").Syntax; -const esrecurse = require("esrecurse"); -const Reference = require("./reference"); -const Variable = require("./variable"); -const PatternVisitor = require("./pattern-visitor"); -const definition = require("./definition"); -const assert = require("assert"); +import estraverse from "estraverse"; +import esrecurse from "esrecurse"; +import Reference from "./reference.js"; +import Variable from "./variable.js"; +import PatternVisitor from "./pattern-visitor.js"; +import { Definition, ParameterDefinition } from "./definition.js"; +import assert from "assert"; -const ParameterDefinition = definition.ParameterDefinition; -const Definition = definition.Definition; +const { Syntax } = estraverse; /** * Traverse identifier in pattern - * @param {Object} options - options - * @param {pattern} rootPattern - root pattern - * @param {Refencer} referencer - referencer - * @param {callback} callback - callback + * @param {Object} options options + * @param {pattern} rootPattern root pattern + * @param {Refencer} referencer referencer + * @param {callback} callback callback * @returns {void} */ function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { @@ -209,8 +207,8 @@ class Referencer extends esrecurse.Visitor { /** * Visit pattern callback - * @param {pattern} pattern - pattern - * @param {Object} info - info + * @param {pattern} pattern pattern + * @param {Object} info info * @returns {void} */ function visitPatternCallback(pattern, info) { @@ -434,6 +432,12 @@ class Referencer extends esrecurse.Visitor { this.currentScope().__referencing(node); } + // eslint-disable-next-line class-methods-use-this + PrivateIdentifier() { + + // Do nothing. + } + UpdateExpression(node) { if (PatternVisitor.isPattern(node.argument)) { this.currentScope().__referencing(node.argument, Reference.RW, null); @@ -453,6 +457,27 @@ class Referencer extends esrecurse.Visitor { this.visitProperty(node); } + PropertyDefinition(node) { + const { computed, key, value } = node; + + if (computed) { + this.visit(key); + } + if (value) { + this.scopeManager.__nestClassFieldInitializerScope(value); + this.visit(value); + this.close(value); + } + } + + StaticBlock(node) { + this.scopeManager.__nestClassStaticBlockScope(node); + + this.visitChildren(node); + + this.close(node); + } + MethodDefinition(node) { this.visitProperty(node); } @@ -624,6 +649,6 @@ class Referencer extends esrecurse.Visitor { } } -module.exports = Referencer; +export default Referencer; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope-manager.js b/node_modules/eslint-scope/lib/scope-manager.js index c1927994b..e41d47173 100644 --- a/node_modules/eslint-scope/lib/scope-manager.js +++ b/node_modules/eslint-scope/lib/scope-manager.js @@ -21,26 +21,27 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; /* eslint-disable no-underscore-dangle */ -const Scope = require("./scope"); -const assert = require("assert"); - -const GlobalScope = Scope.GlobalScope; -const CatchScope = Scope.CatchScope; -const WithScope = Scope.WithScope; -const ModuleScope = Scope.ModuleScope; -const ClassScope = Scope.ClassScope; -const SwitchScope = Scope.SwitchScope; -const FunctionScope = Scope.FunctionScope; -const ForScope = Scope.ForScope; -const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; -const BlockScope = Scope.BlockScope; +import { + BlockScope, + CatchScope, + ClassFieldInitializerScope, + ClassStaticBlockScope, + ClassScope, + ForScope, + FunctionExpressionNameScope, + FunctionScope, + GlobalScope, + ModuleScope, + SwitchScope, + WithScope +} from "./scope.js"; +import assert from "assert"; /** - * @class ScopeManager + * @constructor ScopeManager */ class ScopeManager { constructor(options) { @@ -65,7 +66,7 @@ class ScopeManager { } __isNodejsScope() { - return this.__options.nodejsScope; + return this.__options.nodejsScope || this.__options.sourceType === "commonjs"; } isModule() { @@ -91,8 +92,7 @@ class ScopeManager { * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. * If the node declares nothing, this method returns an empty array. * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. - * - * @param {Espree.Node} node - a node to get. + * @param {Espree.Node} node a node to get. * @returns {Variable[]} variables that declared by the node. */ getDeclaredVariables(node) { @@ -101,16 +101,16 @@ class ScopeManager { /** * acquire scope from node. - * @method ScopeManager#acquire - * @param {Espree.Node} node - node for the acquired scope. - * @param {boolean=} inner - look up the most inner scope, default value is false. + * @function ScopeManager#acquire + * @param {Espree.Node} node node for the acquired scope. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. * @returns {Scope?} Scope from node */ acquire(node, inner) { /** * predicate - * @param {Scope} testScope - scope to test + * @param {Scope} testScope scope to test * @returns {boolean} predicate */ function predicate(testScope) { @@ -155,8 +155,8 @@ class ScopeManager { /** * acquire all scopes from node. - * @method ScopeManager#acquireAll - * @param {Espree.Node} node - node for the acquired scope. + * @function ScopeManager#acquireAll + * @param {Espree.Node} node node for the acquired scope. * @returns {Scopes?} Scope array */ acquireAll(node) { @@ -165,9 +165,9 @@ class ScopeManager { /** * release the node. - * @method ScopeManager#release - * @param {Espree.Node} node - releasing node. - * @param {boolean=} inner - look up the most inner scope, default value is false. + * @function ScopeManager#release + * @param {Espree.Node} node releasing node. + * @param {?boolean} [inner=false] look up the most inner scope, default value is false. * @returns {Scope?} upper scope for the node. */ release(node, inner) { @@ -225,6 +225,14 @@ class ScopeManager { return this.__nestScope(new ClassScope(this, this.__currentScope, node)); } + __nestClassFieldInitializerScope(node) { + return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node)); + } + + __nestClassStaticBlockScope(node) { + return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node)); + } + __nestSwitchScope(node) { return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); } @@ -242,6 +250,6 @@ class ScopeManager { } } -module.exports = ScopeManager; +export default ScopeManager; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope.js b/node_modules/eslint-scope/lib/scope.js index bdb5f637f..0619b9068 100644 --- a/node_modules/eslint-scope/lib/scope.js +++ b/node_modules/eslint-scope/lib/scope.js @@ -21,24 +21,25 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; /* eslint-disable no-underscore-dangle */ /* eslint-disable no-undefined */ -const Syntax = require("estraverse").Syntax; +import estraverse from "estraverse"; -const Reference = require("./reference"); -const Variable = require("./variable"); -const Definition = require("./definition").Definition; -const assert = require("assert"); +import Reference from "./reference.js"; +import Variable from "./variable.js"; +import { Definition } from "./definition.js"; +import assert from "assert"; + +const { Syntax } = estraverse; /** * Test if scope is struct - * @param {Scope} scope - scope - * @param {Block} block - block - * @param {boolean} isMethodDefinition - is method definition - * @param {boolean} useDirective - use directive + * @param {Scope} scope scope + * @param {Block} block block + * @param {boolean} isMethodDefinition is method definition + * @param {boolean} useDirective use directive * @returns {boolean} is strict scope */ function isStrictScope(scope, block, isMethodDefinition, useDirective) { @@ -121,8 +122,8 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) { /** * Register scope - * @param {ScopeManager} scopeManager - scope manager - * @param {Scope} scope - scope + * @param {ScopeManager} scopeManager scope manager + * @param {Scope} scope scope * @returns {void} */ function registerScope(scopeManager, scope) { @@ -139,7 +140,7 @@ function registerScope(scopeManager, scope) { /** * Should be statically - * @param {Object} def - def + * @param {Object} def def * @returns {boolean} should be statically */ function shouldBeStatically(def) { @@ -150,14 +151,15 @@ function shouldBeStatically(def) { } /** - * @class Scope + * @constructor Scope */ class Scope { constructor(scopeManager, type, upperScope, block, isMethodDefinition) { /** - * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. - * @member {String} Scope#type + * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for", + * "class", "class-field-initializer", "class-static-block". + * @member {string} Scope#type */ this.type = type; @@ -224,7 +226,13 @@ class Scope { * @member {Scope} Scope#variableScope */ this.variableScope = - (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; + this.type === "global" || + this.type === "module" || + this.type === "function" || + this.type === "class-field-initializer" || + this.type === "class-static-block" + ? this + : upperScope.variableScope; /** * Whether this scope is created by a FunctionExpression. @@ -255,7 +263,9 @@ class Scope { * Whether 'use strict' is in effect in this scope. * @member {boolean} Scope#isStrict */ - this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); + this.isStrict = scopeManager.isStrictModeSupported() + ? isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()) + : false; /** * List of nested {@link Scope}s. @@ -461,8 +471,8 @@ class Scope { /** * returns resolved {Reference} - * @method Scope#resolve - * @param {Espree.Identifier} ident - identifier to be resolved. + * @function Scope#resolve + * @param {Espree.Identifier} ident identifier to be resolved. * @returns {Reference} reference */ resolve(ident) { @@ -481,7 +491,7 @@ class Scope { /** * returns this scope is static - * @method Scope#isStatic + * @function Scope#isStatic * @returns {boolean} static */ isStatic() { @@ -490,7 +500,7 @@ class Scope { /** * returns this scope has materialized arguments - * @method Scope#isArgumentsMaterialized + * @function Scope#isArgumentsMaterialized * @returns {boolean} arguemnts materialized */ isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this @@ -499,7 +509,7 @@ class Scope { /** * returns this scope has materialized `this` reference - * @method Scope#isThisMaterialized + * @function Scope#isThisMaterialized * @returns {boolean} this materialized */ isThisMaterialized() { // eslint-disable-line class-methods-use-this @@ -527,10 +537,10 @@ class GlobalScope extends Scope { variables: [], /** - * List of {@link Reference}s that are left to be resolved (i.e. which - * need to be linked to the variable they refer to). - * @member {Reference[]} Scope#implicit#left - */ + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ left: [] }; } @@ -731,7 +741,19 @@ class ClassScope extends Scope { } } -module.exports = { +class ClassFieldInitializerScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-field-initializer", upperScope, block, true); + } +} + +class ClassStaticBlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class-static-block", upperScope, block, true); + } +} + +export { Scope, GlobalScope, ModuleScope, @@ -742,7 +764,9 @@ module.exports = { SwitchScope, FunctionScope, ForScope, - ClassScope + ClassScope, + ClassFieldInitializerScope, + ClassStaticBlockScope }; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/variable.js b/node_modules/eslint-scope/lib/variable.js index 702c4780a..286202f72 100644 --- a/node_modules/eslint-scope/lib/variable.js +++ b/node_modules/eslint-scope/lib/variable.js @@ -21,19 +21,18 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -"use strict"; /** * A Variable represents a locally scoped identifier. These include arguments to * functions. - * @class Variable + * @constructor Variable */ class Variable { constructor(name, scope) { /** * The variable name, as given in the source code. - * @member {String} Variable#name + * @member {string} Variable#name */ this.name = name; @@ -83,6 +82,6 @@ Variable.Variable = "Variable"; Variable.ImportBinding = "ImportBinding"; Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; -module.exports = Variable; +export default Variable; /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/version.js b/node_modules/eslint-scope/lib/version.js new file mode 100644 index 000000000..35c77ddef --- /dev/null +++ b/node_modules/eslint-scope/lib/version.js @@ -0,0 +1,3 @@ +const version = "7.1.1"; + +export default version; diff --git a/node_modules/eslint-scope/node_modules/estraverse/.jshintrc b/node_modules/eslint-scope/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae76..000000000 --- a/node_modules/eslint-scope/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/node_modules/eslint-scope/node_modules/estraverse/LICENSE.BSD b/node_modules/eslint-scope/node_modules/estraverse/LICENSE.BSD deleted file mode 100644 index 3e580c355..000000000 --- a/node_modules/eslint-scope/node_modules/estraverse/LICENSE.BSD +++ /dev/null @@ -1,19 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint-scope/node_modules/estraverse/README.md b/node_modules/eslint-scope/node_modules/estraverse/README.md deleted file mode 100644 index ccd3377f3..000000000 --- a/node_modules/eslint-scope/node_modules/estraverse/README.md +++ /dev/null @@ -1,153 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -When `visitor.fallback` is a function, we can determine which keys to visit on each node. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Skip the `argument` property of each node - fallback: function(node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument'; - }); - } -}); -``` - -### License - -Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint-scope/node_modules/estraverse/estraverse.js b/node_modules/eslint-scope/node_modules/estraverse/estraverse.js deleted file mode 100644 index b106d386a..000000000 --- a/node_modules/eslint-scope/node_modules/estraverse/estraverse.js +++ /dev/null @@ -1,782 +0,0 @@ -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - Program: ['body'], - Property: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.version = require('./package.json').version; - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/node_modules/estraverse/gulpfile.js b/node_modules/eslint-scope/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbcca..000000000 --- a/node_modules/eslint-scope/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/node_modules/eslint-scope/node_modules/estraverse/package.json b/node_modules/eslint-scope/node_modules/estraverse/package.json deleted file mode 100644 index f019afefb..000000000 --- a/node_modules/eslint-scope/node_modules/estraverse/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "estraverse@^4.1.1", - "_id": "estraverse@4.3.0", - "_inBundle": false, - "_integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "_location": "/eslint-scope/estraverse", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "estraverse@^4.1.1", - "name": "estraverse", - "escapedName": "estraverse", - "rawSpec": "^4.1.1", - "saveSpec": null, - "fetchSpec": "^4.1.1" - }, - "_requiredBy": [ - "/eslint-scope" - ], - "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "_shasum": "398ad3f3c5a24948be7725e83d11a7de28cdbd1d", - "_spec": "estraverse@^4.1.1", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint-scope", - "bugs": { - "url": "https://github.com/estools/estraverse/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ECMAScript JS AST traversal functions", - "devDependencies": { - "babel-preset-env": "^1.6.1", - "babel-register": "^6.3.13", - "chai": "^2.1.1", - "espree": "^1.11.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.2.2", - "gulp-filter": "^2.0.0", - "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.3.0", - "jshint": "^2.5.6", - "mocha": "^2.1.0" - }, - "engines": { - "node": ">=4.0" - }, - "homepage": "https://github.com/estools/estraverse", - "license": "BSD-2-Clause", - "main": "estraverse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" - } - ], - "name": "estraverse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/estraverse.git" - }, - "scripts": { - "lint": "jshint estraverse.js", - "test": "npm run-script lint && npm run-script unit-test", - "unit-test": "mocha --compilers js:babel-register" - }, - "version": "4.3.0" -} diff --git a/node_modules/eslint-scope/package.json b/node_modules/eslint-scope/package.json index a00f3502e..737ba3874 100644 --- a/node_modules/eslint-scope/package.json +++ b/node_modules/eslint-scope/package.json @@ -1,76 +1,62 @@ { - "_from": "eslint-scope@^5.1.1", - "_id": "eslint-scope@5.1.1", - "_inBundle": false, - "_integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "_location": "/eslint-scope", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "eslint-scope@^5.1.1", - "name": "eslint-scope", - "escapedName": "eslint-scope", - "rawSpec": "^5.1.1", - "saveSpec": null, - "fetchSpec": "^5.1.1" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "_shasum": "e786e59a66cb92b3f6c1fb0d508aab174848f48c", - "_spec": "eslint-scope@^5.1.1", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "bugs": { - "url": "https://github.com/eslint/eslint-scope/issues" - }, - "bundleDependencies": false, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "deprecated": false, + "name": "eslint-scope", "description": "ECMAScript scope analyzer for ESLint", - "devDependencies": { - "@typescript-eslint/parser": "^1.11.0", - "chai": "^4.2.0", - "eslint": "^6.0.1", - "eslint-config-eslint": "^5.0.1", - "eslint-plugin-node": "^9.1.0", - "eslint-release": "^1.0.0", - "eslint-visitor-keys": "^1.2.0", - "espree": "^7.1.0", - "istanbul": "^0.4.5", - "mocha": "^6.1.4", - "npm-license": "^0.3.3", - "shelljs": "^0.8.3", - "typescript": "^3.5.2" + "homepage": "http://github.com/eslint/eslint-scope", + "main": "./dist/eslint-scope.cjs", + "type": "module", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./dist/eslint-scope.cjs" + }, + "./package.json": "./package.json" }, + "version": "7.1.1", "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "files": [ - "LICENSE", - "README.md", - "lib" - ], - "homepage": "http://github.com/eslint/eslint-scope", - "license": "BSD-2-Clause", - "main": "lib/index.js", - "name": "eslint-scope", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-scope.git" + "repository": "eslint/eslint-scope", + "bugs": { + "url": "https://github.com/eslint/eslint-scope/issues" }, + "license": "BSD-2-Clause", "scripts": { + "build": "rollup -c", + "lint": "npm run build && node Makefile.js lint", + "update-version": "node tools/update-version.js", + "test": "npm run build && node Makefile.js test", + "prepublishOnly": "npm run update-version && npm run build", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "node Makefile.js lint", - "publish-release": "eslint-publish-release", - "test": "node Makefile.js test" + "publish-release": "eslint-publish-release" + }, + "files": [ + "LICENSE", + "README.md", + "lib", + "dist/eslint-scope.cjs" + ], + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, - "version": "5.1.1" + "devDependencies": { + "@typescript-eslint/parser": "^4.28.1", + "c8": "^7.7.3", + "chai": "^4.3.4", + "eslint": "^7.29.0", + "eslint-config-eslint": "^7.0.0", + "eslint-plugin-jsdoc": "^35.4.1", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^3.2.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", + "mocha": "^9.0.1", + "npm-license": "^0.3.3", + "rollup": "^2.52.7", + "shelljs": "^0.8.4", + "typescript": "^4.3.5" + } } diff --git a/node_modules/eslint-utils/README.md b/node_modules/eslint-utils/README.md deleted file mode 100644 index 0b917591b..000000000 --- a/node_modules/eslint-utils/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# eslint-utils - -[![npm version](https://img.shields.io/npm/v/eslint-utils.svg)](https://www.npmjs.com/package/eslint-utils) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-utils.svg)](http://www.npmtrends.com/eslint-utils) -[![Build Status](https://github.com/mysticatea/eslint-utils/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-utils/actions) -[![Coverage Status](https://codecov.io/gh/mysticatea/eslint-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-utils) -[![Dependency Status](https://david-dm.org/mysticatea/eslint-utils.svg)](https://david-dm.org/mysticatea/eslint-utils) - -## 🏁 Goal - -This package provides utility functions and classes for make ESLint custom rules. - -For examples: - -- [getStaticValue](https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue) evaluates static value on AST. -- [ReferenceTracker](https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. - -## 📖 Usage - -See [documentation](https://eslint-utils.mysticatea.dev/). - -## 📰 Changelog - -See [releases](https://github.com/mysticatea/eslint-utils/releases). - -## ❤️ Contributing - -Welcome contributing! - -Please use GitHub's Issues/PRs. - -### Development Tools - -- `npm test` runs tests and measures coverage. -- `npm run clean` removes the coverage result of `npm test` command. -- `npm run coverage` shows the coverage result of the last `npm test` command. -- `npm run lint` runs ESLint. -- `npm run watch` runs tests on each file change. diff --git a/node_modules/eslint-utils/index.js.map b/node_modules/eslint-utils/index.js.map deleted file mode 100644 index 5fab2d406..000000000 --- a/node_modules/eslint-utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["src/get-innermost-scope.js","src/find-variable.js","src/token-predicate.js","src/get-function-head-location.js","src/get-static-value.js","src/get-string-if-constant.js","src/get-property-name.js","src/get-function-name-with-kind.js","src/has-side-effect.js","src/is-parenthesized.js","src/pattern-matcher.js","src/reference-tracker.js","src/index.js"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return token.value === \"=>\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return token.value === \",\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return token.value === \";\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return token.value === \":\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return token.value === \"(\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return token.value === \")\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return token.value === \"[\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return token.value === \"]\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return token.value === \"{\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return token.value === \"}\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return (\n token.type === \"Line\" ||\n token.type === \"Block\" ||\n token.type === \"Shebang\"\n )\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: Object.assign({}, start),\n end: Object.assign({}, end),\n }\n}\n","/* globals BigInt, globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ])\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map(k => Math[k])\n .filter(f => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter(f => typeof f === \"function\")\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: Math.pow(left.value, right.value) }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = calleeNode.computed\n ? getStaticValueR(calleeNode.property, initialScope)\n : { value: calleeNode.property.name }\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = node.computed\n ? getStaticValueR(node.property, initialScope)\n : { value: node.property.name }\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = propertyNode.computed\n ? getStaticValueR(propertyNode.key, initialScope)\n : { value: propertyNode.key.name }\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map(q => q.value.cooked)\n strings.raw = node.quasi.quasis.map(q => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @returns {string} The name and kind of the function node.\n */\nexport function getFunctionNameWithKind(node) {\n const parent = node.parent\n const tokens = []\n\n if (parent.type === \"MethodDefinition\" && parent.static) {\n tokens.push(\"static\")\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\", \"function\")\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else {\n tokens.push(\"function\")\n }\n\n if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else {\n const name = getPropertyName(parent)\n\n if (name) {\n tokens.push(`'${name}'`)\n }\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n }\n if (\n parent.type === \"AssignmentExpression\" &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n }\n }\n\n return tokens.join(\" \")\n}\n","import evk from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ])\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || evk.getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n })\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {}\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || evk.KEYS\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (node == null) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some(r => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {}\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? Object.assign(\n { default: nextTraceMap },\n nextTraceMap\n )\n : { default: nextTraceMap }\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind\"\nimport { getInnermostScope } from \"./get-innermost-scope\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStaticValue } from \"./get-static-value\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\nimport { hasSideEffect } from \"./has-side-effect\"\nimport { isParenthesized } from \"./is-parenthesized\"\nimport { PatternMatcher } from \"./pattern-matcher\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE;AACtD,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC;AAClC;AACA,IAAI,IAAI,KAAK,GAAG,aAAY;AAC5B,IAAI,IAAI,KAAK,GAAG,MAAK;AACrB,IAAI,GAAG;AACP,QAAQ,KAAK,GAAG,MAAK;AACrB,QAAQ,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,WAAW,EAAE;AACpD,YAAY,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,MAAK;AAChD;AACA,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE;AAC7D,gBAAgB,KAAK,GAAG,WAAU;AAClC,gBAAgB,KAAK,GAAG,KAAI;AAC5B,gBAAgB,KAAK;AACrB,aAAa;AACb,SAAS;AACT,KAAK,QAAQ,KAAK,CAAC;AACnB;AACA,IAAI,OAAO,KAAK;AAChB;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA,AAAO,SAAS,YAAY,CAAC,YAAY,EAAE,UAAU,EAAE;AACvD,IAAI,IAAI,IAAI,GAAG,GAAE;AACjB,IAAI,IAAI,KAAK,GAAG,aAAY;AAC5B;AACA,IAAI,IAAI,OAAO,UAA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vB,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/eslint-utils/index.mjs.map b/node_modules/eslint-utils/index.mjs.map deleted file mode 100644 index 0af151944..000000000 --- a/node_modules/eslint-utils/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["src/get-innermost-scope.js","src/find-variable.js","src/token-predicate.js","src/get-function-head-location.js","src/get-static-value.js","src/get-string-if-constant.js","src/get-property-name.js","src/get-function-name-with-kind.js","src/has-side-effect.js","src/is-parenthesized.js","src/pattern-matcher.js","src/reference-tracker.js","src/index.js"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return token.value === \"=>\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return token.value === \",\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return token.value === \";\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return token.value === \":\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return token.value === \"(\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return token.value === \")\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return token.value === \"[\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return token.value === \"]\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return token.value === \"{\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return token.value === \"}\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return (\n token.type === \"Line\" ||\n token.type === \"Block\" ||\n token.type === \"Shebang\"\n )\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: Object.assign({}, start),\n end: Object.assign({}, end),\n }\n}\n","/* globals BigInt, globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ])\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map(k => Math[k])\n .filter(f => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter(f => typeof f === \"function\")\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: Math.pow(left.value, right.value) }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = calleeNode.computed\n ? getStaticValueR(calleeNode.property, initialScope)\n : { value: calleeNode.property.name }\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = node.computed\n ? getStaticValueR(node.property, initialScope)\n : { value: node.property.name }\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = propertyNode.computed\n ? getStaticValueR(propertyNode.key, initialScope)\n : { value: propertyNode.key.name }\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map(q => q.value.cooked)\n strings.raw = node.quasi.quasis.map(q => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @returns {string} The name and kind of the function node.\n */\nexport function getFunctionNameWithKind(node) {\n const parent = node.parent\n const tokens = []\n\n if (parent.type === \"MethodDefinition\" && parent.static) {\n tokens.push(\"static\")\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\", \"function\")\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else {\n tokens.push(\"function\")\n }\n\n if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else {\n const name = getPropertyName(parent)\n\n if (name) {\n tokens.push(`'${name}'`)\n }\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n }\n if (\n parent.type === \"AssignmentExpression\" &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n }\n }\n\n return tokens.join(\" \")\n}\n","import evk from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ])\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || evk.getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n })\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {}\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || evk.KEYS\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (node == null) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some(r => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {}\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? Object.assign(\n { default: nextTraceMap },\n nextTraceMap\n )\n : { default: nextTraceMap }\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind\"\nimport { getInnermostScope } from \"./get-innermost-scope\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStaticValue } from \"./get-static-value\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\nimport { hasSideEffect } from \"./has-side-effect\"\nimport { isParenthesized } from \"./is-parenthesized\"\nimport { PatternMatcher } from \"./pattern-matcher\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE;AACtD,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC;AAClC;AACA,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I,gBAAgB;AACpB,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md deleted file mode 100644 index dc1d4b5ec..000000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md +++ /dev/null @@ -1,25 +0,0 @@ -v1.3.0 - June 19, 2020 - -* [`c92dd7f`](https://github.com/eslint/eslint-visitor-keys/commit/c92dd7ff96f0044dba12d681406a025b92b4c437) Update: add `ChainExpression` node (#12) (Toru Nagashima) - -v1.2.0 - June 4, 2020 - -* [`21f28bf`](https://github.com/eslint/eslint-visitor-keys/commit/21f28bf11be5329d740a8bf6bdbcd0ef13bbf1a2) Update: added exported in exportAllDeclaration key (#10) (Anix) - -v1.1.0 - August 13, 2019 - -* [`9331cc0`](https://github.com/eslint/eslint-visitor-keys/commit/9331cc09e756e65b9044c9186445a474b037fac6) Update: add ImportExpression (#8) (Toru Nagashima) -* [`5967f58`](https://github.com/eslint/eslint-visitor-keys/commit/5967f583b04f17fba9226aaa394e45d476d2b8af) Chore: add supported Node.js versions to CI (#7) (Kai Cataldo) -* [`6f7c60f`](https://github.com/eslint/eslint-visitor-keys/commit/6f7c60fef2ceec9f6323202df718321cec45cab0) Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz) - -v1.0.0 - December 18, 2017 - -* 1f6bd38 Breaking: update keys (#4) (Toru Nagashima) - -v0.1.0 - November 17, 2017 - -* 17b4a88 Chore: update `repository` field in package.json (#3) (Toru Nagashima) -* a5a026b New: eslint-visitor-keys (#1) (Toru Nagashima) -* a1a48b8 Update: Change license to Apache 2 (#2) (Ilya Volodin) -* 2204715 Initial commit (Toru Nagashima) - diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md deleted file mode 100644 index 250f5fa31..000000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# eslint-visitor-keys - -[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) -[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) -[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) -[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) - -Constants and utilities about visitor keys to traverse AST. - -## 💿 Installation - -Use [npm] to install. - -```bash -$ npm install eslint-visitor-keys -``` - -### Requirements - -- [Node.js] 4.0.0 or later. - -## 📖 Usage - -```js -const evk = require("eslint-visitor-keys") -``` - -### evk.KEYS - -> type: `{ [type: string]: string[] | undefined }` - -Visitor keys. This keys are frozen. - -This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. - -For example: - -``` -console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] -``` - -### evk.getKeys(node) - -> type: `(node: object) => string[]` - -Get the visitor keys of a given AST node. - -This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. - -This will be used to traverse unknown nodes. - -For example: - -``` -const node = { - type: "AssignmentExpression", - left: { type: "Identifier", name: "foo" }, - right: { type: "Literal", value: 0 } -} -console.log(evk.getKeys(node)) // → ["type", "left", "right"] -``` - -### evk.unionWith(additionalKeys) - -> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` - -Make the union set with `evk.KEYS` and the given keys. - -- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. -- It removes duplicated keys as keeping the first one. - -For example: - -``` -console.log(evk.unionWith({ - MethodDefinition: ["decorators"] -})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } -``` - -## 📰 Change log - -See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). - -## 🍻 Contributing - -Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). - -### Development commands - -- `npm test` runs tests and measures code coverage. -- `npm run lint` checks source codes with ESLint. -- `npm run coverage` opens the code coverage report of the previous test with your default browser. -- `npm run release` publishes this package to [npm] registory. - - -[npm]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/en/ -[ESTree]: https://github.com/estree/estree diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js deleted file mode 100644 index cd8a32608..000000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ -"use strict"; - -const KEYS = require("./visitor-keys.json"); - -// Types. -const NODE_TYPES = Object.freeze(Object.keys(KEYS)); - -// Freeze the keys. -for (const type of NODE_TYPES) { - Object.freeze(KEYS[type]); -} -Object.freeze(KEYS); - -// List to ignore keys. -const KEY_BLACKLIST = new Set([ - "parent", - "leadingComments", - "trailingComments" -]); - -/** - * Check whether a given key should be used or not. - * @param {string} key The key to check. - * @returns {boolean} `true` if the key should be used. - */ -function filterKey(key) { - return !KEY_BLACKLIST.has(key) && key[0] !== "_"; -} - -//------------------------------------------------------------------------------ -// Public interfaces -//------------------------------------------------------------------------------ - -module.exports = Object.freeze({ - - /** - * Visitor keys. - * @type {{ [type: string]: string[] | undefined }} - */ - KEYS, - - /** - * Get visitor keys of a given node. - * @param {Object} node The AST node to get keys. - * @returns {string[]} Visitor keys of the node. - */ - getKeys(node) { - return Object.keys(node).filter(filterKey); - }, - - // Disable valid-jsdoc rule because it reports syntax error on the type of @returns. - // eslint-disable-next-line valid-jsdoc - /** - * Make the union set with `KEYS` and given keys. - * @param {Object} additionalKeys The additional keys. - * @returns {{ [type: string]: string[] | undefined }} The union set. - */ - unionWith(additionalKeys) { - const retv = Object.assign({}, KEYS); - - for (const type of Object.keys(additionalKeys)) { - if (retv.hasOwnProperty(type)) { - const keys = new Set(additionalKeys[type]); - - for (const key of retv[type]) { - keys.add(key); - } - - retv[type] = Object.freeze(Array.from(keys)); - } else { - retv[type] = Object.freeze(Array.from(additionalKeys[type])); - } - } - - return Object.freeze(retv); - } -}); diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json deleted file mode 100644 index a33bbc660..000000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "AssignmentExpression": [ - "left", - "right" - ], - "AssignmentPattern": [ - "left", - "right" - ], - "ArrayExpression": [ - "elements" - ], - "ArrayPattern": [ - "elements" - ], - "ArrowFunctionExpression": [ - "params", - "body" - ], - "AwaitExpression": [ - "argument" - ], - "BlockStatement": [ - "body" - ], - "BinaryExpression": [ - "left", - "right" - ], - "BreakStatement": [ - "label" - ], - "CallExpression": [ - "callee", - "arguments" - ], - "CatchClause": [ - "param", - "body" - ], - "ChainExpression": [ - "expression" - ], - "ClassBody": [ - "body" - ], - "ClassDeclaration": [ - "id", - "superClass", - "body" - ], - "ClassExpression": [ - "id", - "superClass", - "body" - ], - "ConditionalExpression": [ - "test", - "consequent", - "alternate" - ], - "ContinueStatement": [ - "label" - ], - "DebuggerStatement": [], - "DoWhileStatement": [ - "body", - "test" - ], - "EmptyStatement": [], - "ExportAllDeclaration": [ - "exported", - "source" - ], - "ExportDefaultDeclaration": [ - "declaration" - ], - "ExportNamedDeclaration": [ - "declaration", - "specifiers", - "source" - ], - "ExportSpecifier": [ - "exported", - "local" - ], - "ExpressionStatement": [ - "expression" - ], - "ExperimentalRestProperty": [ - "argument" - ], - "ExperimentalSpreadProperty": [ - "argument" - ], - "ForStatement": [ - "init", - "test", - "update", - "body" - ], - "ForInStatement": [ - "left", - "right", - "body" - ], - "ForOfStatement": [ - "left", - "right", - "body" - ], - "FunctionDeclaration": [ - "id", - "params", - "body" - ], - "FunctionExpression": [ - "id", - "params", - "body" - ], - "Identifier": [], - "IfStatement": [ - "test", - "consequent", - "alternate" - ], - "ImportDeclaration": [ - "specifiers", - "source" - ], - "ImportDefaultSpecifier": [ - "local" - ], - "ImportExpression": [ - "source" - ], - "ImportNamespaceSpecifier": [ - "local" - ], - "ImportSpecifier": [ - "imported", - "local" - ], - "JSXAttribute": [ - "name", - "value" - ], - "JSXClosingElement": [ - "name" - ], - "JSXElement": [ - "openingElement", - "children", - "closingElement" - ], - "JSXEmptyExpression": [], - "JSXExpressionContainer": [ - "expression" - ], - "JSXIdentifier": [], - "JSXMemberExpression": [ - "object", - "property" - ], - "JSXNamespacedName": [ - "namespace", - "name" - ], - "JSXOpeningElement": [ - "name", - "attributes" - ], - "JSXSpreadAttribute": [ - "argument" - ], - "JSXText": [], - "JSXFragment": [ - "openingFragment", - "children", - "closingFragment" - ], - "Literal": [], - "LabeledStatement": [ - "label", - "body" - ], - "LogicalExpression": [ - "left", - "right" - ], - "MemberExpression": [ - "object", - "property" - ], - "MetaProperty": [ - "meta", - "property" - ], - "MethodDefinition": [ - "key", - "value" - ], - "NewExpression": [ - "callee", - "arguments" - ], - "ObjectExpression": [ - "properties" - ], - "ObjectPattern": [ - "properties" - ], - "Program": [ - "body" - ], - "Property": [ - "key", - "value" - ], - "RestElement": [ - "argument" - ], - "ReturnStatement": [ - "argument" - ], - "SequenceExpression": [ - "expressions" - ], - "SpreadElement": [ - "argument" - ], - "Super": [], - "SwitchStatement": [ - "discriminant", - "cases" - ], - "SwitchCase": [ - "test", - "consequent" - ], - "TaggedTemplateExpression": [ - "tag", - "quasi" - ], - "TemplateElement": [], - "TemplateLiteral": [ - "quasis", - "expressions" - ], - "ThisExpression": [], - "ThrowStatement": [ - "argument" - ], - "TryStatement": [ - "block", - "handler", - "finalizer" - ], - "UnaryExpression": [ - "argument" - ], - "UpdateExpression": [ - "argument" - ], - "VariableDeclaration": [ - "declarations" - ], - "VariableDeclarator": [ - "id", - "init" - ], - "WhileStatement": [ - "test", - "body" - ], - "WithStatement": [ - "object", - "body" - ], - "YieldExpression": [ - "argument" - ] -} diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json deleted file mode 100644 index 5238b115b..000000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "eslint-visitor-keys@^1.1.0", - "_id": "eslint-visitor-keys@1.3.0", - "_inBundle": false, - "_integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "_location": "/eslint-utils/eslint-visitor-keys", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "eslint-visitor-keys@^1.1.0", - "name": "eslint-visitor-keys", - "escapedName": "eslint-visitor-keys", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/eslint-utils" - ], - "_resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "_shasum": "30ebd1ef7c2fdff01c3a4f151044af25fab0523e", - "_spec": "eslint-visitor-keys@^1.1.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint-utils", - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Constants and utilities about visitor keys to traverse AST.", - "devDependencies": { - "eslint": "^4.7.2", - "eslint-config-eslint": "^4.0.0", - "eslint-release": "^1.0.0", - "mocha": "^3.5.3", - "nyc": "^11.2.1", - "opener": "^1.4.3" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", - "keywords": [], - "license": "Apache-2.0", - "main": "lib/index.js", - "name": "eslint-visitor-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-visitor-keys.git" - }, - "scripts": { - "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "publish-release": "eslint-publish-release", - "test": "nyc mocha tests/lib" - }, - "version": "1.3.0" -} diff --git a/node_modules/eslint-utils/package.json b/node_modules/eslint-utils/package.json deleted file mode 100644 index 754a86fdc..000000000 --- a/node_modules/eslint-utils/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_from": "eslint-utils@^2.1.0", - "_id": "eslint-utils@2.1.0", - "_inBundle": false, - "_integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "_location": "/eslint-utils", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "eslint-utils@^2.1.0", - "name": "eslint-utils", - "escapedName": "eslint-utils", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "_shasum": "d2de5e03424e707dc10c74068ddedae708741b27", - "_spec": "eslint-utils@^2.1.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Toru Nagashima" - }, - "bugs": { - "url": "https://github.com/mysticatea/eslint-utils/issues" - }, - "bundleDependencies": false, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "deprecated": false, - "description": "Utilities for ESLint plugins.", - "devDependencies": { - "@mysticatea/eslint-plugin": "^12.0.0", - "codecov": "^3.6.1", - "dot-prop": "^4.2.0", - "eslint": "^6.5.1", - "esm": "^3.2.25", - "espree": "^6.1.1", - "mocha": "^6.2.2", - "npm-run-all": "^4.1.5", - "nyc": "^14.1.1", - "opener": "^1.5.1", - "rimraf": "^3.0.0", - "rollup": "^1.25.0", - "rollup-plugin-sourcemaps": "^0.4.2", - "semver": "^7.3.2", - "vuepress": "^1.2.0", - "warun": "^1.0.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.*" - ], - "funding": "https://github.com/sponsors/mysticatea", - "homepage": "https://github.com/mysticatea/eslint-utils#readme", - "keywords": [ - "eslint" - ], - "license": "MIT", - "main": "index", - "module": "index.mjs", - "name": "eslint-utils", - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/eslint-utils.git" - }, - "scripts": { - "build": "rollup -c", - "clean": "rimraf .nyc_output coverage index.*", - "codecov": "nyc report -r lcovonly && codecov", - "coverage": "opener ./coverage/lcov-report/index.html", - "docs:build": "vuepress build docs", - "docs:watch": "vuepress dev docs", - "lint": "eslint src test", - "postversion": "git push && git push --tags", - "prebuild": "npm run -s clean", - "preversion": "npm test && npm run -s build", - "prewatch": "npm run -s clean", - "test": "run-s lint build test:mocha", - "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", - "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" - }, - "sideEffects": false, - "version": "2.1.0" -} diff --git a/node_modules/eslint-visitor-keys/CHANGELOG.md b/node_modules/eslint-visitor-keys/CHANGELOG.md deleted file mode 100644 index a980b62d2..000000000 --- a/node_modules/eslint-visitor-keys/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -v2.0.0 - August 14, 2020 - -* [`fb86ca3`](https://github.com/eslint/eslint-visitor-keys/commit/fb86ca315daafc84e23ed9005db40b0892b972a6) Breaking: drop support for Node <10 (#13) (Kai Cataldo) -* [`69383b3`](https://github.com/eslint/eslint-visitor-keys/commit/69383b372915e33ada094880ecc6b6e8f8c7ca4e) Chore: move to GitHub Actions (#14) (Kai Cataldo) - -v1.3.0 - June 19, 2020 - -* [`c92dd7f`](https://github.com/eslint/eslint-visitor-keys/commit/c92dd7ff96f0044dba12d681406a025b92b4c437) Update: add `ChainExpression` node (#12) (Toru Nagashima) - -v1.2.0 - June 4, 2020 - -* [`21f28bf`](https://github.com/eslint/eslint-visitor-keys/commit/21f28bf11be5329d740a8bf6bdbcd0ef13bbf1a2) Update: added exported in exportAllDeclaration key (#10) (Anix) - -v1.1.0 - August 13, 2019 - -* [`9331cc0`](https://github.com/eslint/eslint-visitor-keys/commit/9331cc09e756e65b9044c9186445a474b037fac6) Update: add ImportExpression (#8) (Toru Nagashima) -* [`5967f58`](https://github.com/eslint/eslint-visitor-keys/commit/5967f583b04f17fba9226aaa394e45d476d2b8af) Chore: add supported Node.js versions to CI (#7) (Kai Cataldo) -* [`6f7c60f`](https://github.com/eslint/eslint-visitor-keys/commit/6f7c60fef2ceec9f6323202df718321cec45cab0) Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz) - -v1.0.0 - December 18, 2017 - -* 1f6bd38 Breaking: update keys (#4) (Toru Nagashima) - -v0.1.0 - November 17, 2017 - -* 17b4a88 Chore: update `repository` field in package.json (#3) (Toru Nagashima) -* a5a026b New: eslint-visitor-keys (#1) (Toru Nagashima) -* a1a48b8 Update: Change license to Apache 2 (#2) (Ilya Volodin) -* 2204715 Initial commit (Toru Nagashima) - diff --git a/node_modules/eslint-visitor-keys/README.md b/node_modules/eslint-visitor-keys/README.md index 250f5fa31..8eda5c7cb 100644 --- a/node_modules/eslint-visitor-keys/README.md +++ b/node_modules/eslint-visitor-keys/README.md @@ -17,10 +17,19 @@ $ npm install eslint-visitor-keys ### Requirements -- [Node.js] 4.0.0 or later. +- [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0` + ## 📖 Usage +To use in an ESM file: + +```js +import * as evk from "eslint-visitor-keys" +``` + +To use in a CommonJS file: + ```js const evk = require("eslint-visitor-keys") ``` @@ -51,7 +60,7 @@ This will be used to traverse unknown nodes. For example: -``` +```js const node = { type: "AssignmentExpression", left: { type: "Identifier", name: "foo" }, @@ -71,7 +80,7 @@ Make the union set with `evk.KEYS` and the given keys. For example: -``` +```js console.log(evk.unionWith({ MethodDefinition: ["decorators"] })) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } @@ -94,5 +103,5 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer- [npm]: https://www.npmjs.com/ -[Node.js]: https://nodejs.org/en/ +[Node.js]: https://nodejs.org/ [ESTree]: https://github.com/estree/estree diff --git a/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs b/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs new file mode 100644 index 000000000..9d47fd751 --- /dev/null +++ b/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs @@ -0,0 +1,382 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/** + * @typedef {import('./index.js').VisitorKeys} VisitorKeys + */ + +/** + * @type {VisitorKeys} + */ +const KEYS = { + AssignmentExpression: [ + "left", + "right" + ], + AssignmentPattern: [ + "left", + "right" + ], + ArrayExpression: [ + "elements" + ], + ArrayPattern: [ + "elements" + ], + ArrowFunctionExpression: [ + "params", + "body" + ], + AwaitExpression: [ + "argument" + ], + BlockStatement: [ + "body" + ], + BinaryExpression: [ + "left", + "right" + ], + BreakStatement: [ + "label" + ], + CallExpression: [ + "callee", + "arguments" + ], + CatchClause: [ + "param", + "body" + ], + ChainExpression: [ + "expression" + ], + ClassBody: [ + "body" + ], + ClassDeclaration: [ + "id", + "superClass", + "body" + ], + ClassExpression: [ + "id", + "superClass", + "body" + ], + ConditionalExpression: [ + "test", + "consequent", + "alternate" + ], + ContinueStatement: [ + "label" + ], + DebuggerStatement: [], + DoWhileStatement: [ + "body", + "test" + ], + EmptyStatement: [], + ExportAllDeclaration: [ + "exported", + "source" + ], + ExportDefaultDeclaration: [ + "declaration" + ], + ExportNamedDeclaration: [ + "declaration", + "specifiers", + "source" + ], + ExportSpecifier: [ + "exported", + "local" + ], + ExpressionStatement: [ + "expression" + ], + ExperimentalRestProperty: [ + "argument" + ], + ExperimentalSpreadProperty: [ + "argument" + ], + ForStatement: [ + "init", + "test", + "update", + "body" + ], + ForInStatement: [ + "left", + "right", + "body" + ], + ForOfStatement: [ + "left", + "right", + "body" + ], + FunctionDeclaration: [ + "id", + "params", + "body" + ], + FunctionExpression: [ + "id", + "params", + "body" + ], + Identifier: [], + IfStatement: [ + "test", + "consequent", + "alternate" + ], + ImportDeclaration: [ + "specifiers", + "source" + ], + ImportDefaultSpecifier: [ + "local" + ], + ImportExpression: [ + "source" + ], + ImportNamespaceSpecifier: [ + "local" + ], + ImportSpecifier: [ + "imported", + "local" + ], + JSXAttribute: [ + "name", + "value" + ], + JSXClosingElement: [ + "name" + ], + JSXElement: [ + "openingElement", + "children", + "closingElement" + ], + JSXEmptyExpression: [], + JSXExpressionContainer: [ + "expression" + ], + JSXIdentifier: [], + JSXMemberExpression: [ + "object", + "property" + ], + JSXNamespacedName: [ + "namespace", + "name" + ], + JSXOpeningElement: [ + "name", + "attributes" + ], + JSXSpreadAttribute: [ + "argument" + ], + JSXText: [], + JSXFragment: [ + "openingFragment", + "children", + "closingFragment" + ], + JSXClosingFragment: [], + JSXOpeningFragment: [], + Literal: [], + LabeledStatement: [ + "label", + "body" + ], + LogicalExpression: [ + "left", + "right" + ], + MemberExpression: [ + "object", + "property" + ], + MetaProperty: [ + "meta", + "property" + ], + MethodDefinition: [ + "key", + "value" + ], + NewExpression: [ + "callee", + "arguments" + ], + ObjectExpression: [ + "properties" + ], + ObjectPattern: [ + "properties" + ], + PrivateIdentifier: [], + Program: [ + "body" + ], + Property: [ + "key", + "value" + ], + PropertyDefinition: [ + "key", + "value" + ], + RestElement: [ + "argument" + ], + ReturnStatement: [ + "argument" + ], + SequenceExpression: [ + "expressions" + ], + SpreadElement: [ + "argument" + ], + StaticBlock: [ + "body" + ], + Super: [], + SwitchStatement: [ + "discriminant", + "cases" + ], + SwitchCase: [ + "test", + "consequent" + ], + TaggedTemplateExpression: [ + "tag", + "quasi" + ], + TemplateElement: [], + TemplateLiteral: [ + "quasis", + "expressions" + ], + ThisExpression: [], + ThrowStatement: [ + "argument" + ], + TryStatement: [ + "block", + "handler", + "finalizer" + ], + UnaryExpression: [ + "argument" + ], + UpdateExpression: [ + "argument" + ], + VariableDeclaration: [ + "declarations" + ], + VariableDeclarator: [ + "id", + "init" + ], + WhileStatement: [ + "test", + "body" + ], + WithStatement: [ + "object", + "body" + ], + YieldExpression: [ + "argument" + ] +}; + +// Types. +const NODE_TYPES = Object.keys(KEYS); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + +/** + * Get visitor keys of a given node. + * @param {object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +function getKeys(node) { + return Object.keys(node).filter(filterKey); +} + +// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. +// eslint-disable-next-line valid-jsdoc +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +function unionWith(additionalKeys) { + const retv = /** @type {{ + [type: string]: ReadonlyArray + }} */ (Object.assign({}, KEYS)); + + for (const type of Object.keys(additionalKeys)) { + if (Object.prototype.hasOwnProperty.call(retv, type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); +} + +exports.KEYS = KEYS; +exports.getKeys = getKeys; +exports.unionWith = unionWith; +//# sourceMappingURL=eslint-visitor-keys.cjs.map diff --git a/node_modules/eslint-visitor-keys/dist/index.d.ts b/node_modules/eslint-visitor-keys/dist/index.d.ts new file mode 100644 index 000000000..d866198f9 --- /dev/null +++ b/node_modules/eslint-visitor-keys/dist/index.d.ts @@ -0,0 +1,18 @@ +/** + * Get visitor keys of a given node. + * @param {object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +export function getKeys(node: object): readonly string[]; +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +export function unionWith(additionalKeys: VisitorKeys): VisitorKeys; +export { KEYS }; +export type VisitorKeys = { + readonly [type: string]: readonly string[]; +}; +import KEYS from "./visitor-keys.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts b/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts new file mode 100644 index 000000000..19192383b --- /dev/null +++ b/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts @@ -0,0 +1,10 @@ +export default KEYS; +export type VisitorKeys = import('./index.js').VisitorKeys; +/** + * @typedef {import('./index.js').VisitorKeys} VisitorKeys + */ +/** + * @type {VisitorKeys} + */ +declare const KEYS: VisitorKeys; +//# sourceMappingURL=visitor-keys.d.ts.map \ No newline at end of file diff --git a/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/eslint-visitor-keys/lib/index.js index cd8a32608..83ebb1f80 100644 --- a/node_modules/eslint-visitor-keys/lib/index.js +++ b/node_modules/eslint-visitor-keys/lib/index.js @@ -2,18 +2,11 @@ * @author Toru Nagashima * See LICENSE file in root directory for full license. */ -"use strict"; +import KEYS from "./visitor-keys.js"; -const KEYS = require("./visitor-keys.json"); - -// Types. -const NODE_TYPES = Object.freeze(Object.keys(KEYS)); - -// Freeze the keys. -for (const type of NODE_TYPES) { - Object.freeze(KEYS[type]); -} -Object.freeze(KEYS); +/** + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + */ // List to ignore keys. const KEY_BLACKLIST = new Set([ @@ -31,51 +24,42 @@ function filterKey(key) { return !KEY_BLACKLIST.has(key) && key[0] !== "_"; } -//------------------------------------------------------------------------------ -// Public interfaces -//------------------------------------------------------------------------------ - -module.exports = Object.freeze({ - - /** - * Visitor keys. - * @type {{ [type: string]: string[] | undefined }} - */ - KEYS, - - /** - * Get visitor keys of a given node. - * @param {Object} node The AST node to get keys. - * @returns {string[]} Visitor keys of the node. - */ - getKeys(node) { - return Object.keys(node).filter(filterKey); - }, - - // Disable valid-jsdoc rule because it reports syntax error on the type of @returns. - // eslint-disable-next-line valid-jsdoc - /** - * Make the union set with `KEYS` and given keys. - * @param {Object} additionalKeys The additional keys. - * @returns {{ [type: string]: string[] | undefined }} The union set. - */ - unionWith(additionalKeys) { - const retv = Object.assign({}, KEYS); +/** + * Get visitor keys of a given node. + * @param {object} node The AST node to get keys. + * @returns {readonly string[]} Visitor keys of the node. + */ +export function getKeys(node) { + return Object.keys(node).filter(filterKey); +} - for (const type of Object.keys(additionalKeys)) { - if (retv.hasOwnProperty(type)) { - const keys = new Set(additionalKeys[type]); +// Disable valid-jsdoc rule because it reports syntax error on the type of @returns. +// eslint-disable-next-line valid-jsdoc +/** + * Make the union set with `KEYS` and given keys. + * @param {VisitorKeys} additionalKeys The additional keys. + * @returns {VisitorKeys} The union set. + */ +export function unionWith(additionalKeys) { + const retv = /** @type {{ + [type: string]: ReadonlyArray + }} */ (Object.assign({}, KEYS)); - for (const key of retv[type]) { - keys.add(key); - } + for (const type of Object.keys(additionalKeys)) { + if (Object.prototype.hasOwnProperty.call(retv, type)) { + const keys = new Set(additionalKeys[type]); - retv[type] = Object.freeze(Array.from(keys)); - } else { - retv[type] = Object.freeze(Array.from(additionalKeys[type])); + for (const key of retv[type]) { + keys.add(key); } - } - return Object.freeze(retv); + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } } -}); + + return Object.freeze(retv); +} + +export { KEYS }; diff --git a/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/eslint-visitor-keys/lib/visitor-keys.js similarity index 53% rename from node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json rename to node_modules/eslint-visitor-keys/lib/visitor-keys.js index a33bbc660..d456d648d 100644 --- a/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ b/node_modules/eslint-visitor-keys/lib/visitor-keys.js @@ -1,284 +1,312 @@ -{ - "AssignmentExpression": [ +/** + * @typedef {import('./index.js').VisitorKeys} VisitorKeys + */ + +/** + * @type {VisitorKeys} + */ +const KEYS = { + AssignmentExpression: [ "left", "right" ], - "AssignmentPattern": [ + AssignmentPattern: [ "left", "right" ], - "ArrayExpression": [ + ArrayExpression: [ "elements" ], - "ArrayPattern": [ + ArrayPattern: [ "elements" ], - "ArrowFunctionExpression": [ + ArrowFunctionExpression: [ "params", "body" ], - "AwaitExpression": [ + AwaitExpression: [ "argument" ], - "BlockStatement": [ + BlockStatement: [ "body" ], - "BinaryExpression": [ + BinaryExpression: [ "left", "right" ], - "BreakStatement": [ + BreakStatement: [ "label" ], - "CallExpression": [ + CallExpression: [ "callee", "arguments" ], - "CatchClause": [ + CatchClause: [ "param", "body" ], - "ChainExpression": [ + ChainExpression: [ "expression" ], - "ClassBody": [ + ClassBody: [ "body" ], - "ClassDeclaration": [ + ClassDeclaration: [ "id", "superClass", "body" ], - "ClassExpression": [ + ClassExpression: [ "id", "superClass", "body" ], - "ConditionalExpression": [ + ConditionalExpression: [ "test", "consequent", "alternate" ], - "ContinueStatement": [ + ContinueStatement: [ "label" ], - "DebuggerStatement": [], - "DoWhileStatement": [ + DebuggerStatement: [], + DoWhileStatement: [ "body", "test" ], - "EmptyStatement": [], - "ExportAllDeclaration": [ + EmptyStatement: [], + ExportAllDeclaration: [ "exported", "source" ], - "ExportDefaultDeclaration": [ + ExportDefaultDeclaration: [ "declaration" ], - "ExportNamedDeclaration": [ + ExportNamedDeclaration: [ "declaration", "specifiers", "source" ], - "ExportSpecifier": [ + ExportSpecifier: [ "exported", "local" ], - "ExpressionStatement": [ + ExpressionStatement: [ "expression" ], - "ExperimentalRestProperty": [ + ExperimentalRestProperty: [ "argument" ], - "ExperimentalSpreadProperty": [ + ExperimentalSpreadProperty: [ "argument" ], - "ForStatement": [ + ForStatement: [ "init", "test", "update", "body" ], - "ForInStatement": [ + ForInStatement: [ "left", "right", "body" ], - "ForOfStatement": [ + ForOfStatement: [ "left", "right", "body" ], - "FunctionDeclaration": [ + FunctionDeclaration: [ "id", "params", "body" ], - "FunctionExpression": [ + FunctionExpression: [ "id", "params", "body" ], - "Identifier": [], - "IfStatement": [ + Identifier: [], + IfStatement: [ "test", "consequent", "alternate" ], - "ImportDeclaration": [ + ImportDeclaration: [ "specifiers", "source" ], - "ImportDefaultSpecifier": [ + ImportDefaultSpecifier: [ "local" ], - "ImportExpression": [ + ImportExpression: [ "source" ], - "ImportNamespaceSpecifier": [ + ImportNamespaceSpecifier: [ "local" ], - "ImportSpecifier": [ + ImportSpecifier: [ "imported", "local" ], - "JSXAttribute": [ + JSXAttribute: [ "name", "value" ], - "JSXClosingElement": [ + JSXClosingElement: [ "name" ], - "JSXElement": [ + JSXElement: [ "openingElement", "children", "closingElement" ], - "JSXEmptyExpression": [], - "JSXExpressionContainer": [ + JSXEmptyExpression: [], + JSXExpressionContainer: [ "expression" ], - "JSXIdentifier": [], - "JSXMemberExpression": [ + JSXIdentifier: [], + JSXMemberExpression: [ "object", "property" ], - "JSXNamespacedName": [ + JSXNamespacedName: [ "namespace", "name" ], - "JSXOpeningElement": [ + JSXOpeningElement: [ "name", "attributes" ], - "JSXSpreadAttribute": [ + JSXSpreadAttribute: [ "argument" ], - "JSXText": [], - "JSXFragment": [ + JSXText: [], + JSXFragment: [ "openingFragment", "children", "closingFragment" ], - "Literal": [], - "LabeledStatement": [ + JSXClosingFragment: [], + JSXOpeningFragment: [], + Literal: [], + LabeledStatement: [ "label", "body" ], - "LogicalExpression": [ + LogicalExpression: [ "left", "right" ], - "MemberExpression": [ + MemberExpression: [ "object", "property" ], - "MetaProperty": [ + MetaProperty: [ "meta", "property" ], - "MethodDefinition": [ + MethodDefinition: [ "key", "value" ], - "NewExpression": [ + NewExpression: [ "callee", "arguments" ], - "ObjectExpression": [ + ObjectExpression: [ "properties" ], - "ObjectPattern": [ + ObjectPattern: [ "properties" ], - "Program": [ + PrivateIdentifier: [], + Program: [ "body" ], - "Property": [ + Property: [ "key", "value" ], - "RestElement": [ + PropertyDefinition: [ + "key", + "value" + ], + RestElement: [ "argument" ], - "ReturnStatement": [ + ReturnStatement: [ "argument" ], - "SequenceExpression": [ + SequenceExpression: [ "expressions" ], - "SpreadElement": [ + SpreadElement: [ "argument" ], - "Super": [], - "SwitchStatement": [ + StaticBlock: [ + "body" + ], + Super: [], + SwitchStatement: [ "discriminant", "cases" ], - "SwitchCase": [ + SwitchCase: [ "test", "consequent" ], - "TaggedTemplateExpression": [ + TaggedTemplateExpression: [ "tag", "quasi" ], - "TemplateElement": [], - "TemplateLiteral": [ + TemplateElement: [], + TemplateLiteral: [ "quasis", "expressions" ], - "ThisExpression": [], - "ThrowStatement": [ + ThisExpression: [], + ThrowStatement: [ "argument" ], - "TryStatement": [ + TryStatement: [ "block", "handler", "finalizer" ], - "UnaryExpression": [ + UnaryExpression: [ "argument" ], - "UpdateExpression": [ + UpdateExpression: [ "argument" ], - "VariableDeclaration": [ + VariableDeclaration: [ "declarations" ], - "VariableDeclarator": [ + VariableDeclarator: [ "id", "init" ], - "WhileStatement": [ + WhileStatement: [ "test", "body" ], - "WithStatement": [ + WithStatement: [ "object", "body" ], - "YieldExpression": [ + YieldExpression: [ "argument" ] +}; + +// Types. +const NODE_TYPES = Object.keys(KEYS); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); } +Object.freeze(KEYS); + +export default KEYS; diff --git a/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/eslint-visitor-keys/lib/visitor-keys.json deleted file mode 100644 index a33bbc660..000000000 --- a/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "AssignmentExpression": [ - "left", - "right" - ], - "AssignmentPattern": [ - "left", - "right" - ], - "ArrayExpression": [ - "elements" - ], - "ArrayPattern": [ - "elements" - ], - "ArrowFunctionExpression": [ - "params", - "body" - ], - "AwaitExpression": [ - "argument" - ], - "BlockStatement": [ - "body" - ], - "BinaryExpression": [ - "left", - "right" - ], - "BreakStatement": [ - "label" - ], - "CallExpression": [ - "callee", - "arguments" - ], - "CatchClause": [ - "param", - "body" - ], - "ChainExpression": [ - "expression" - ], - "ClassBody": [ - "body" - ], - "ClassDeclaration": [ - "id", - "superClass", - "body" - ], - "ClassExpression": [ - "id", - "superClass", - "body" - ], - "ConditionalExpression": [ - "test", - "consequent", - "alternate" - ], - "ContinueStatement": [ - "label" - ], - "DebuggerStatement": [], - "DoWhileStatement": [ - "body", - "test" - ], - "EmptyStatement": [], - "ExportAllDeclaration": [ - "exported", - "source" - ], - "ExportDefaultDeclaration": [ - "declaration" - ], - "ExportNamedDeclaration": [ - "declaration", - "specifiers", - "source" - ], - "ExportSpecifier": [ - "exported", - "local" - ], - "ExpressionStatement": [ - "expression" - ], - "ExperimentalRestProperty": [ - "argument" - ], - "ExperimentalSpreadProperty": [ - "argument" - ], - "ForStatement": [ - "init", - "test", - "update", - "body" - ], - "ForInStatement": [ - "left", - "right", - "body" - ], - "ForOfStatement": [ - "left", - "right", - "body" - ], - "FunctionDeclaration": [ - "id", - "params", - "body" - ], - "FunctionExpression": [ - "id", - "params", - "body" - ], - "Identifier": [], - "IfStatement": [ - "test", - "consequent", - "alternate" - ], - "ImportDeclaration": [ - "specifiers", - "source" - ], - "ImportDefaultSpecifier": [ - "local" - ], - "ImportExpression": [ - "source" - ], - "ImportNamespaceSpecifier": [ - "local" - ], - "ImportSpecifier": [ - "imported", - "local" - ], - "JSXAttribute": [ - "name", - "value" - ], - "JSXClosingElement": [ - "name" - ], - "JSXElement": [ - "openingElement", - "children", - "closingElement" - ], - "JSXEmptyExpression": [], - "JSXExpressionContainer": [ - "expression" - ], - "JSXIdentifier": [], - "JSXMemberExpression": [ - "object", - "property" - ], - "JSXNamespacedName": [ - "namespace", - "name" - ], - "JSXOpeningElement": [ - "name", - "attributes" - ], - "JSXSpreadAttribute": [ - "argument" - ], - "JSXText": [], - "JSXFragment": [ - "openingFragment", - "children", - "closingFragment" - ], - "Literal": [], - "LabeledStatement": [ - "label", - "body" - ], - "LogicalExpression": [ - "left", - "right" - ], - "MemberExpression": [ - "object", - "property" - ], - "MetaProperty": [ - "meta", - "property" - ], - "MethodDefinition": [ - "key", - "value" - ], - "NewExpression": [ - "callee", - "arguments" - ], - "ObjectExpression": [ - "properties" - ], - "ObjectPattern": [ - "properties" - ], - "Program": [ - "body" - ], - "Property": [ - "key", - "value" - ], - "RestElement": [ - "argument" - ], - "ReturnStatement": [ - "argument" - ], - "SequenceExpression": [ - "expressions" - ], - "SpreadElement": [ - "argument" - ], - "Super": [], - "SwitchStatement": [ - "discriminant", - "cases" - ], - "SwitchCase": [ - "test", - "consequent" - ], - "TaggedTemplateExpression": [ - "tag", - "quasi" - ], - "TemplateElement": [], - "TemplateLiteral": [ - "quasis", - "expressions" - ], - "ThisExpression": [], - "ThrowStatement": [ - "argument" - ], - "TryStatement": [ - "block", - "handler", - "finalizer" - ], - "UnaryExpression": [ - "argument" - ], - "UpdateExpression": [ - "argument" - ], - "VariableDeclaration": [ - "declarations" - ], - "VariableDeclarator": [ - "id", - "init" - ], - "WhileStatement": [ - "test", - "body" - ], - "WithStatement": [ - "object", - "body" - ], - "YieldExpression": [ - "argument" - ] -} diff --git a/node_modules/eslint-visitor-keys/package.json b/node_modules/eslint-visitor-keys/package.json index 50ee3557c..5368ad5a1 100644 --- a/node_modules/eslint-visitor-keys/package.json +++ b/node_modules/eslint-visitor-keys/package.json @@ -1,70 +1,62 @@ { - "_from": "eslint-visitor-keys@^2.0.0", - "_id": "eslint-visitor-keys@2.0.0", - "_inBundle": false, - "_integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "_location": "/eslint-visitor-keys", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "eslint-visitor-keys@^2.0.0", - "name": "eslint-visitor-keys", - "escapedName": "eslint-visitor-keys", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "_shasum": "21fdc8fbcd9c795cc0321f0563702095751511a8", - "_spec": "eslint-visitor-keys@^2.0.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "eslint-visitor-keys", + "version": "3.3.0", "description": "Constants and utilities about visitor keys to traverse AST.", - "devDependencies": { - "eslint": "^4.7.2", - "eslint-config-eslint": "^4.0.0", - "eslint-release": "^1.0.0", - "mocha": "^3.5.3", - "nyc": "^11.2.1", - "opener": "^1.4.3" - }, - "engines": { - "node": ">=10" + "type": "module", + "main": "dist/eslint-visitor-keys.cjs", + "types": "./dist/index.d.ts", + "exports": { + ".": [ + { + "import": "./lib/index.js", + "require": "./dist/eslint-visitor-keys.cjs" + }, + "./dist/eslint-visitor-keys.cjs" + ], + "./package.json": "./package.json" }, "files": [ + "dist/index.d.ts", + "dist/visitor-keys.d.ts", + "dist/eslint-visitor-keys.cjs", "lib" ], - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", - "keywords": [], - "license": "Apache-2.0", - "main": "lib/index.js", - "name": "eslint-visitor-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-visitor-keys.git" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "devDependencies": { + "c8": "^7.7.3", + "eslint": "^7.29.0", + "eslint-config-eslint": "^7.0.0", + "eslint-plugin-jsdoc": "^35.4.0", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^3.2.0", + "mocha": "^9.0.1", + "opener": "^1.5.2", + "rollup": "^2.52.1", + "tsd": "^0.19.1", + "typescript": "^4.5.5" }, "scripts": { - "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "prepare": "npm run build", + "build": "rollup -c && npm run tsc", + "lint": "eslint .", + "tsc": "tsc", + "tsd": "tsd", + "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run tsd", + "coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib tests/lib", - "publish-release": "eslint-publish-release", - "test": "nyc mocha tests/lib" + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" }, - "version": "2.0.0" + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" } diff --git a/node_modules/eslint/CHANGELOG.md b/node_modules/eslint/CHANGELOG.md deleted file mode 100644 index fecd09435..000000000 --- a/node_modules/eslint/CHANGELOG.md +++ /dev/null @@ -1,6410 +0,0 @@ -v7.22.0 - March 12, 2021 - -* [`3a432d8`](https://github.com/eslint/eslint/commit/3a432d82b3a5710aff7da20302fe0b94fedc46c2) Docs: Improve documentation for indent rule (#14168) (Serkan Özel) -* [`f62ec8d`](https://github.com/eslint/eslint/commit/f62ec8d30d925e70e4d0d40640857c587ac2e116) Update: throw error when fix range is invalid (#14142) (Jacob Bandes-Storch) -* [`0eecad2`](https://github.com/eslint/eslint/commit/0eecad271358f753730741fcfcb2f7cc915c1fa7) Upgrade: Update lodash in package.json to V 4.17.21 (#14159) (Basem Al-Nabulsi) -* [`5ad91aa`](https://github.com/eslint/eslint/commit/5ad91aa7df3d6bc185786e6eccd9e055fd951055) Update: report es2021 globals in no-extend-native (refs #13602) (#14177) (Milos Djermanovic) -* [`c295581`](https://github.com/eslint/eslint/commit/c295581aca4e08ec4ae8e5ee5726a6f454a3ee26) Chore: remove leftover JSDoc from lint-result-cache (#14176) (Milos Djermanovic) -* [`0d541f9`](https://github.com/eslint/eslint/commit/0d541f9d9d58966372e2055a8f69fb9483d56a4b) Chore: Reduce lodash usage (#14178) (Stephen Wade) -* [`27a67d7`](https://github.com/eslint/eslint/commit/27a67d71ffa9bbd7af02ae448844e127bcf956dc) Sponsors: Sync README with website (ESLint Jenkins) -* [`459d821`](https://github.com/eslint/eslint/commit/459d821f4a599501ceb002f9d7a5034fc45ffbb0) Chore: upgrade dependencies of browser test (#14127) (Pig Fang) -* [`ebfb63a`](https://github.com/eslint/eslint/commit/ebfb63a682004a008f2707dbad616e5ae1630b2c) Sponsors: Sync README with website (ESLint Jenkins) -* [`3ba029f`](https://github.com/eslint/eslint/commit/3ba029fbffd44068be93254890fc2aec3e92c212) Docs: Remove Extraneous Dash (#14164) (Danny Hurlburt) -* [`6f4540e`](https://github.com/eslint/eslint/commit/6f4540ea7ea39775906526506fd7abd7ea97610c) Sponsors: Sync README with website (ESLint Jenkins) -* [`ddf361c`](https://github.com/eslint/eslint/commit/ddf361ca2a2a01a9974f421e5f62270df282d0e8) Docs: Fix Formatting (#14154) (Danny Hurlburt) -* [`c0d2ac1`](https://github.com/eslint/eslint/commit/c0d2ac16f8f9c75c62c78e9fe6a24a25ba0d7828) Sponsors: Sync README with website (ESLint Jenkins) -* [`a8df03e`](https://github.com/eslint/eslint/commit/a8df03efe3bc47665d2112c2cdd5bead337d475d) Docs: Clarify triage process (#14117) (Nicholas C. Zakas) - -v7.21.0 - February 27, 2021 - -* [`3cd5440`](https://github.com/eslint/eslint/commit/3cd5440b94d5fa4f11a09f50b685f6150f0c2d41) Upgrade: @eslint/eslintrc to 0.4.0 (#14147) (Brandon Mills) -* [`c0b8c71`](https://github.com/eslint/eslint/commit/c0b8c71df4d0b3f54b20587432d9133741985d5c) Upgrade: Puppeteer to 7.1.0 (#14122) (Tim van der Lippe) -* [`08ae31e`](https://github.com/eslint/eslint/commit/08ae31e539e381cd0eabf6393fa5c20f1d59125f) New: Implement cacheStrategy (refs eslint/rfcs#63) (#14119) (Manu Chambon) -* [`5e51fd2`](https://github.com/eslint/eslint/commit/5e51fd28dc773c11c924450d24088f97f2824f00) Update: do not ignore symbolic links (fixes #13551, fixes #13615) (#14126) (Pig Fang) -* [`87c43a5`](https://github.com/eslint/eslint/commit/87c43a5d7ea2018cffd6d9b5c431ecb60caaf0d6) Chore: improve a few comments and fix typos (#14125) (Tobias Nießen) -* [`e19c51e`](https://github.com/eslint/eslint/commit/e19c51ea2ef2cf666d94218c66f6b223bb2e9dae) Sponsors: Sync README with website (ESLint Jenkins) -* [`b8aea99`](https://github.com/eslint/eslint/commit/b8aea9988b6451b6a05af4f3ede8d6ed5c1d9926) Fix: pluralize 'line' to 'lines' in max-lines-per-function description (#14115) (Trevin Hofmann) -* [`f5b53e2`](https://github.com/eslint/eslint/commit/f5b53e285ab5286ea382d73b379b820f649c20d0) Sponsors: Sync README with website (ESLint Jenkins) -* [`eee1213`](https://github.com/eslint/eslint/commit/eee12134ce0956e9f825c1630776b1731551a948) Sponsors: Sync README with website (ESLint Jenkins) -* [`5c4d7ea`](https://github.com/eslint/eslint/commit/5c4d7ea8d2e8d137c42b918dc99a84b4a5fed9b3) Sponsors: Sync README with website (ESLint Jenkins) - -v7.20.0 - February 12, 2021 - -* [`f4ac3b0`](https://github.com/eslint/eslint/commit/f4ac3b0e7072fbd3c14e9c64ff0c2c255a4eb730) Docs: fix sibling selector descriptions (#14099) (Milos Djermanovic) -* [`9d6063a`](https://github.com/eslint/eslint/commit/9d6063add931f0803cae1676d5df307baf114360) Fix: Crash with esquery when using JSX (fixes #13639) (#14072) (Yosuke Ota) -* [`a0871f1`](https://github.com/eslint/eslint/commit/a0871f1840060bd23cfe0952a096b107142db2f0) Docs: Triage process (#14014) (Nicholas C. Zakas) -* [`ad90761`](https://github.com/eslint/eslint/commit/ad9076183bc2c2029525edfc4596e403999348d1) Update: add enforceForJSX option to no-unused-expressions rule (#14012) (Duncan Beevers) -* [`d6c84af`](https://github.com/eslint/eslint/commit/d6c84af67318537177ffac0120a81af08e3e9df4) Fix: `--init` autoconfig shouldn't add deprecated rules (fixes #14017) (#14060) (Milos Djermanovic) -* [`9b277a1`](https://github.com/eslint/eslint/commit/9b277a16a7261e51b7ba36d6de7f996e9203a6a4) Fix: Support ENOTDIR error code in the folder existence checking utility (#13973) (Constantine Genchevsky) -* [`7aeb127`](https://github.com/eslint/eslint/commit/7aeb12798f2b9da706f3593f26a02e717929c9af) Upgrade: pin @babel/code-frame@7.12.11 (#14067) (Milos Djermanovic) -* [`b4e2af5`](https://github.com/eslint/eslint/commit/b4e2af5db1c29343ffec2cd104b04bf39b77ee56) Docs: Add more fields to bug report template (#14039) (Nicholas C. Zakas) -* [`96f1d49`](https://github.com/eslint/eslint/commit/96f1d49a4647e59f2fb918be096654e290513adc) Sponsors: Sync README with website (ESLint Jenkins) -* [`cb27b0a`](https://github.com/eslint/eslint/commit/cb27b0abeda6dfee55dd43b9cbe12afad321f55d) Build: package.json update for eslint-config-eslint release (ESLint Jenkins) -* [`4cab165`](https://github.com/eslint/eslint/commit/4cab165bf4e6e5e9f42a59a37a8ff2548c0af87d) Sponsors: Sync README with website (ESLint Jenkins) - -v7.19.0 - January 30, 2021 - -* [`ce7f061`](https://github.com/eslint/eslint/commit/ce7f06121d9eb9cc2b3da24b4456b4d382e1413b) Update: add shadowed variable loc to message in no-shadow (fixes #13646) (#13841) (t-mangoe) -* [`c60e23f`](https://github.com/eslint/eslint/commit/c60e23ff306a14ca6eabcadb275ed27995fcc6e4) Update: fix `let` logic in for-in and for-of loops in no-extra-parens (#14011) (Milos Djermanovic) -* [`d76e8f6`](https://github.com/eslint/eslint/commit/d76e8f69bd791357c67ada7b5c55608acf29b622) Fix: no-useless-rename invalid autofix with parenthesized identifiers (#14032) (Milos Djermanovic) -* [`5800d92`](https://github.com/eslint/eslint/commit/5800d921144ec330b6ee7cd03364434007331354) Docs: Clarify stylistic rule update policy (#14052) (Brandon Mills) -* [`0ccf6d2`](https://github.com/eslint/eslint/commit/0ccf6d200147437b338cadb34546451972befd75) Docs: remove configuring.md (#14036) (Milos Djermanovic) -* [`65bb0ab`](https://github.com/eslint/eslint/commit/65bb0abde56f72586036fff151aa2d13f1b7be6c) Chore: Clean up new issue workflow (#14040) (Nicholas C. Zakas) -* [`e1da90f`](https://github.com/eslint/eslint/commit/e1da90fc414a3c9c16f52db4a5bd81bd4f9532a4) Fix: nested indenting for offsetTernaryExpressions: true (fixes #13971) (#13972) (Chris Brody) -* [`1a078b9`](https://github.com/eslint/eslint/commit/1a078b9166f29cb3760435ddbc1a0da4a0974d4a) Update: check ternary `:` even if `?` was reported in space-infix-ops (#13963) (Milos Djermanovic) -* [`fb27422`](https://github.com/eslint/eslint/commit/fb274226242eaebc1480fc9c901202986afc3c8a) Fix: extend prefer-const fixer range to whole declaration (fixes #13899) (#14033) (Nitin Kumar) -* [`e0b05c7`](https://github.com/eslint/eslint/commit/e0b05c704f3ce6f549d14718236d22fe49fcb611) Docs: add a correct example to no-unsafe-optional-chaining (refs #14029) (#14050) (armin yahya) -* [`46e836d`](https://github.com/eslint/eslint/commit/46e836d46442d2ec756038a2e12ba19b74394dbd) Sponsors: Sync README with website (ESLint Jenkins) -* [`3fc4fa4`](https://github.com/eslint/eslint/commit/3fc4fa485ca9ccd5e16dbc7e53ba31452d22dc4a) Docs: update configuring links (#14038) (Milos Djermanovic) -* [`8561c21`](https://github.com/eslint/eslint/commit/8561c2116ef89e53ebffb750066f1b00a4acdb76) Docs: fix broken links in configuring/README.md (#14046) (Milos Djermanovic) -* [`1c309eb`](https://github.com/eslint/eslint/commit/1c309ebca4a81a0faf397103dbc621019dea8c9c) Update: fix no-invalid-regexp false negatives with no flags specified (#14018) (Milos Djermanovic) -* [`f6602d5`](https://github.com/eslint/eslint/commit/f6602d569427e9e2a4f3b5ca3fc3a8bffb28d15e) Docs: Reorganize Configuration Documentation (#13837) (klkhan) -* [`c753b44`](https://github.com/eslint/eslint/commit/c753b442ef67867a178ffc2ad29b4e0534f72469) Sponsors: Sync README with website (ESLint Jenkins) -* [`a4fdb70`](https://github.com/eslint/eslint/commit/a4fdb7001aa41b9ad8bb92cc8a47b9135c94afc7) Docs: Fixed Typo (#14007) (Yash Singh) -* [`f7ca481`](https://github.com/eslint/eslint/commit/f7ca48165d025e01c38698352cff24d1de87cc8b) Docs: Explain why we disable lock files (refs eslint/tsc-meetings#234) (#14006) (Brandon Mills) - -v7.18.0 - January 15, 2021 - -* [`e3264b2`](https://github.com/eslint/eslint/commit/e3264b26a625d926a1ea96df1c4b643af5c3797c) Upgrade: @eslint/eslintrc to improve error message for invalid extends (#14009) (Milos Djermanovic) -* [`f17c3c3`](https://github.com/eslint/eslint/commit/f17c3c371789ffa84f0cda57101e8193899adbe6) Update: check logical assignment operators in the complexity rule (#13979) (Milos Djermanovic) -* [`672deb0`](https://github.com/eslint/eslint/commit/672deb057a14a7acad8c669189870009f1edb8a6) Docs: fix no-invalid-regexp docs regarding ecmaVersion (#13991) (Milos Djermanovic) -* [`179a910`](https://github.com/eslint/eslint/commit/179a910b32e853bc12a9dd71f7c10e762cbeac44) Fix: --init crash on question to upgrade/downgrade ESLint (fixes #13978) (#13995) (Milos Djermanovic) -* [`292b1c0`](https://github.com/eslint/eslint/commit/292b1c0017bc442d399f67e01d699c59e6b71453) Fix: no-extra-parens false positive with `let` identifier in for-loop (#13981) (Milos Djermanovic) -* [`de61f94`](https://github.com/eslint/eslint/commit/de61f9444cf58a4d70e126ab3d10bf20851de7c9) Sponsors: Sync README with website (ESLint Jenkins) -* [`9250d16`](https://github.com/eslint/eslint/commit/9250d167ceb5684669eabe93dae326e33f0684f2) Upgrade: Bump lodash to fix security issue (#13993) (Frederik Prijck) -* [`75fea9b`](https://github.com/eslint/eslint/commit/75fea9bcdd3dde5a07e0089d9011a4df518cdbe3) Sponsors: Sync README with website (ESLint Jenkins) -* [`f2687e7`](https://github.com/eslint/eslint/commit/f2687e71f9e2a2773f821c4dc1a02abe95b97df4) Docs: update space-in-parens related rules (#13985) (Chris Brody) -* [`4a38bbe`](https://github.com/eslint/eslint/commit/4a38bbe81b4b29ca1a4e62d0a0cc8d525455b063) Docs: space-in-parens examples with no arguments etc. (#13987) (Chris Brody) -* [`3e49169`](https://github.com/eslint/eslint/commit/3e491698687aa08b3b798cee0931f0872ca1bc55) Sponsors: Sync README with website (ESLint Jenkins) -* [`c5bf1f2`](https://github.com/eslint/eslint/commit/c5bf1f2150a9fbbb9e74c04808dc3bfeda1ed321) Sponsors: Sync README with website (ESLint Jenkins) -* [`98a729c`](https://github.com/eslint/eslint/commit/98a729c9def54cee9e5478e75e8bd6f28167d5e8) Sponsors: Sync README with website (ESLint Jenkins) -* [`e83a696`](https://github.com/eslint/eslint/commit/e83a6962b51b05c2ddfe42b0748b405d515eeb9d) Sponsors: Sync README with website (ESLint Jenkins) -* [`78cb483`](https://github.com/eslint/eslint/commit/78cb48345c725e9f90fd0e631c476802244df4a4) Chore: test `foo( )` with space-in-parens option "always" (#13986) (Chris Brody) -* [`f6948f6`](https://github.com/eslint/eslint/commit/f6948f6bdc763dca0787bb2786bc9f6f9ed88f43) Docs: Update semantic versioning policy (#13970) (Nicholas C. Zakas) -* [`0688212`](https://github.com/eslint/eslint/commit/068821248e2d2eff11152f270102d537d8fa8126) Sponsors: Sync README with website (ESLint Jenkins) -* [`aeba5e5`](https://github.com/eslint/eslint/commit/aeba5e5e6062095a06d9b867d7e7ee75422f25b9) Chore: fix typo (#13975) (Nitin Kumar) -* [`4ee1134`](https://github.com/eslint/eslint/commit/4ee113414bdcbea240a5d9db27da6a10df472005) Sponsors: Sync README with website (ESLint Jenkins) - -v7.17.0 - January 1, 2021 - -* [`e128e77`](https://github.com/eslint/eslint/commit/e128e775e9fa116a0ad68a071f1f0997589f8cd4) Update: check logical assignment in no-constant-condition (#13946) (Milos Djermanovic) -* [`cc48713`](https://github.com/eslint/eslint/commit/cc4871369645c3409dc56ded7a555af8a9f63d51) Chore: refactor calculating range and loc in no-useless-escape (#13964) (Milos Djermanovic) -* [`535fe47`](https://github.com/eslint/eslint/commit/535fe47fee6544b4957378f9408117c8318d4762) Update: use regexpp's default ecmaVersion in no-control-regex (#13969) (Milos Djermanovic) -* [`83e98cd`](https://github.com/eslint/eslint/commit/83e98cd48ce3d1acf729f4fb9be40cff332abd6e) Fix: use regexpp's default ecmaVersion in no-invalid-regexp (#13968) (Milos Djermanovic) -* [`7297363`](https://github.com/eslint/eslint/commit/7297363ea355d0e3b2a74aaec586126deb91fd93) Docs: fix examples for no-multi-str (#13966) (Milos Djermanovic) -* [`0649871`](https://github.com/eslint/eslint/commit/06498716bfba65ed8c7217917a29a07ad267193a) Update: add autofix to rule multiline-ternary (#13958) (薛定谔的猫) -* [`f6e7e32`](https://github.com/eslint/eslint/commit/f6e7e3231bc43c989f8c953de8e0d328bac5eea0) Fix: no-useless-escape wrong loc and fix with CRLF in template elements (#13953) (Milos Djermanovic) -* [`19c69c0`](https://github.com/eslint/eslint/commit/19c69c0293a98634ff0d4884a0cdabc1213ebcb4) Fix: one-var shouldn't split declaration if it isn't in a statement list (#13959) (Milos Djermanovic) -* [`e451b96`](https://github.com/eslint/eslint/commit/e451b9664aface32ad9321eaf5619c875dc76553) Docs: update build tool for webpack (#13962) (Sam Chen) -* [`c3e9acc`](https://github.com/eslint/eslint/commit/c3e9accce2f61b04ab699fd37c90703305281aa3) Chore: fix typos (#13960) (YeonJuan) -* [`7289ecf`](https://github.com/eslint/eslint/commit/7289ecf58ed0d2e7f0ad7f1e5004c8927a7bf805) Sponsors: Sync README with website (ESLint Jenkins) - -v7.16.0 - December 18, 2020 - -* [`a62ad6f`](https://github.com/eslint/eslint/commit/a62ad6f03151358b93b5fede022a30d67310705c) Update: fix false negative of no-extra-parens with NewExpression (#13930) (Milos Djermanovic) -* [`f85b4c7`](https://github.com/eslint/eslint/commit/f85b4c72668c95c79fdb342b74dbd53d21baa93f) Fix: require-atomic-updates false positive across await (fixes #11954) (#13915) (buhi) -* [`301d0c0`](https://github.com/eslint/eslint/commit/301d0c05229dbd6cfb1045d716524e8ec46fa2c1) Fix: no-constant-condition false positives with unary expressions (#13927) (Milos Djermanovic) -* [`555c128`](https://github.com/eslint/eslint/commit/555c128b49ae6d9c100a9f8429416417edb40d13) Fix: false positive with await and ** in no-extra-parens (fixes #12739) (#13923) (Milos Djermanovic) -* [`d93c935`](https://github.com/eslint/eslint/commit/d93c9350361d2aa1a1976c553e47ab399e51e8c9) Docs: update JSON Schema links (#13936) (Milos Djermanovic) -* [`8d0c93a`](https://github.com/eslint/eslint/commit/8d0c93a7ef9449c7b7d082bbb4b7d8465b0d6bac) Upgrade: table@6.0.4 (#13920) (Rouven Weßling) -* [`9247683`](https://github.com/eslint/eslint/commit/924768377a4935a95a6ff3866f9545a5a6178b53) Docs: Remove for deleted npm run profile script (#13931) (Brandon Mills) -* [`ab240d4`](https://github.com/eslint/eslint/commit/ab240d49833b4e6e594667c1abe5b0caa8a9cf70) Fix: prefer-exponentiation-operator invalid autofix with await (#13924) (Milos Djermanovic) -* [`dc76911`](https://github.com/eslint/eslint/commit/dc7691103554a99bdb2142561cb507f50f547e3b) Chore: Add .pre-commit-hooks.yaml file (#13628) (Álvaro Mondéjar) -* [`2124e1b`](https://github.com/eslint/eslint/commit/2124e1b5dad30a905dc26bde9da472bf622d3f50) Docs: Fix wrong rule name (#13913) (noisyboy25) -* [`06b5809`](https://github.com/eslint/eslint/commit/06b58096975935ec016d96dd5f333f059c270f26) Sponsors: Sync README with website (ESLint Jenkins) -* [`26fc12f`](https://github.com/eslint/eslint/commit/26fc12f88109af9d4081bf0e16364c411bce3009) Docs: Update README team and sponsors (ESLint Jenkins) - -v7.15.0 - December 5, 2020 - -* [`5c11aab`](https://github.com/eslint/eslint/commit/5c11aabbe8249aeb8cad29bc6a33fc20c8c683ef) Upgrade: @eslint/esintrc and espree for bug fixes (refs #13878) (#13908) (Brandon Mills) -* [`0eb7957`](https://github.com/eslint/eslint/commit/0eb7957e27fd521317bd5c8479ce7abc1399169c) Upgrade: file-entry-cache@6.0.0 (#13877) (Rouven Weßling) -* [`683ad00`](https://github.com/eslint/eslint/commit/683ad00c41e1ae4d889deff82b2a94318e8c2129) New: no-unsafe-optional-chaining rule (fixes #13431) (#13859) (YeonJuan) -* [`cbc57fb`](https://github.com/eslint/eslint/commit/cbc57fb7d07c00663ed5781f5e6bc8f534cc2d76) Fix: one-var autofixing for export (fixes #13834) (#13891) (Anix) -* [`110cf96`](https://github.com/eslint/eslint/commit/110cf962d05625a8a1bf7b5f4ec2194db150eb32) Docs: Fix a broken link in working-with-rules.md (#13875) (Anton Niklasson) - -v7.14.0 - November 20, 2020 - -* [`5f09073`](https://github.com/eslint/eslint/commit/5f0907399a9666dec78c74384c8969c01483c30e) Update: fix 'skip' options in no-irregular-whitespace (fixes #13852) (#13853) (Milos Djermanovic) -* [`1861b40`](https://github.com/eslint/eslint/commit/1861b4086f1018f43ab19744d866d5da986c500d) Docs: correct the function-call-argument-newline 'default' descriptions (#13866) (Trevin Hofmann) -* [`98c00c4`](https://github.com/eslint/eslint/commit/98c00c41d2aecb3a990393d430694f4ce6b47de5) New: Add no-nonoctal-decimal-escape rule (fixes #13765) (#13845) (Milos Djermanovic) -* [`95d2fe6`](https://github.com/eslint/eslint/commit/95d2fe6057498fc1cc2193d28c8c2d1593224b33) Chore: remove eslint comment from no-octal-escape tests (#13846) (Milos Djermanovic) -* [`2004b7e`](https://github.com/eslint/eslint/commit/2004b7ecd3db0d4e7376cc3344246f7b9ada5801) Fix: enable debug logs for @eslint/eslintrc (fixes #13850) (#13861) (Milos Djermanovic) -* [`d2239a1`](https://github.com/eslint/eslint/commit/d2239a1fdec452e24ede04e990d16d42516fa538) Fix: no-useless-constructor crash on bodyless constructor (fixes #13830) (#13842) (Ari Perkkiö) -* [`eda0aa1`](https://github.com/eslint/eslint/commit/eda0aa18498dd85eb618873e8e0f4ac97032cfca) Docs: no-restricted-imports is only for static imports (#13863) (Robat Williams) -* [`042ae44`](https://github.com/eslint/eslint/commit/042ae44682a8a6c5037d920689124e2304056dd8) Docs: Fix JS syntax and doc URL in working-with-custom-formatters.md (#13828) (Raphael LANG) -* [`038dc73`](https://github.com/eslint/eslint/commit/038dc73c99ae68eae2035ef303f3a947053c8f05) Chore: Test on Node.js 15 (#13844) (Brandon Mills) -* [`37a06d6`](https://github.com/eslint/eslint/commit/37a06d633d3669f0f43236141dc43465b8bc7ec5) Sponsors: Sync README with website (ESLint Jenkins) - -v7.13.0 - November 6, 2020 - -* [`254e00f`](https://github.com/eslint/eslint/commit/254e00fea8745ff5a8bcc8cb874fcfd02996d81b) New: Configurable List Size For Per-Rule Performance Metrics (#13812) (Bryan Mishkin) -* [`6c3c710`](https://github.com/eslint/eslint/commit/6c3c710ade7cd8654990f1adb55b58f038eab92d) Docs: fix broken url in docs (#13815) (SaintMalik) -* [`4a09149`](https://github.com/eslint/eslint/commit/4a091495a236d231a5065ece972719a0c4dd1b77) Sponsors: Sync README with website (ESLint Jenkins) -* [`fb6fcbf`](https://github.com/eslint/eslint/commit/fb6fcbfe0a8c41b92f0a33ab90f159037bd195e2) Docs: Fix reference to Code of Conduct (#13797) (Tobias Nießen) -* [`1b89ebe`](https://github.com/eslint/eslint/commit/1b89ebe1bdbef7de6001100945b8f71429df302c) Sponsors: Sync README with website (ESLint Jenkins) - -v7.12.1 - October 26, 2020 - -* [`08f33e8`](https://github.com/eslint/eslint/commit/08f33e8b9a353c3183be6f937785db7a30fb90eb) Upgrade: @eslint/eslintrc to fix rule schema validation (fixes #13793) (#13794) (Brandon Mills) -* [`aeef485`](https://github.com/eslint/eslint/commit/aeef485dc790571b1a82ac09904329e0226b66a9) Fix: Pass internal config paths in FileEnumerator default (fixes #13789) (#13792) (Brandon Mills) -* [`631ae8b`](https://github.com/eslint/eslint/commit/631ae8b50e5f7975f10860e9e763b70b4f25182e) Sponsors: Sync README with website (ESLint Jenkins) - -v7.12.0 - October 23, 2020 - -* [`cbf3585`](https://github.com/eslint/eslint/commit/cbf3585f1d6c60414c07380367a8b4505ee3538d) Update: skip keyword check for fns in space-before-blocks (fixes #13553) (#13712) (Milos Djermanovic) -* [`256f656`](https://github.com/eslint/eslint/commit/256f656455b47bcf9ed3fc30fbf72532678f97da) Fix: autofix shouldn't produce template literals with `\8` or `\9` (#13737) (Milos Djermanovic) -* [`b165aa5`](https://github.com/eslint/eslint/commit/b165aa5f4d4d19328f13ab80e5f058cbce94c3a6) Fix: yoda rule autofix produces syntax errors with adjacent tokens (#13760) (Milos Djermanovic) -* [`3175316`](https://github.com/eslint/eslint/commit/3175316db26aebef4b19e269aca90c8ce3955363) Fix: prefer-destructuring invalid autofix with comma operator (#13761) (Milos Djermanovic) -* [`1a9f171`](https://github.com/eslint/eslint/commit/1a9f17151a4e93eb17c8a2bf4f0a5320cce616de) Chore: Remove more ESLintRC-related files (refs #13481) (#13762) (Nicholas C. Zakas) -* [`bfddced`](https://github.com/eslint/eslint/commit/bfddcedace5587d662c840c2edf33062b54a178e) Update: remove suggestion if it didn't provide a fix (fixes #13723) (#13772) (Milos Djermanovic) -* [`5183b14`](https://github.com/eslint/eslint/commit/5183b14a2420b42b4089fb134a61ae57142f31fd) Update: check template literal in no-script-url (#13775) (YeonJuan) -* [`bfe97d2`](https://github.com/eslint/eslint/commit/bfe97d2332e711ca76b1fd2e7f8548b0cc84cb1c) Sponsors: Sync README with website (ESLint Jenkins) -* [`6c51ade`](https://github.com/eslint/eslint/commit/6c51adeb86f1de292cd02d2ee19f7b56182e358b) Sponsors: Sync README with website (ESLint Jenkins) -* [`603de04`](https://github.com/eslint/eslint/commit/603de04cab5e700df12999af2918decd4da9d11b) Update: treat all literals like boolean literal in no-constant-condition (#13245) (Zen) -* [`289aa6f`](https://github.com/eslint/eslint/commit/289aa6fcef3874ba5f86455f9302dc4209ea83e5) Sponsors: Sync README with website (ESLint Jenkins) -* [`9a1f669`](https://github.com/eslint/eslint/commit/9a1f6694e59eb3e584d4c5a98b98675c895a9783) Sponsors: Sync README with website (ESLint Jenkins) -* [`637f818`](https://github.com/eslint/eslint/commit/637f8187404ded600fb3d4013b3cd495d5ae675b) Docs: add more examples for no-func-assign (fixes #13705) (#13777) (Nitin Kumar) -* [`17cc0dd`](https://github.com/eslint/eslint/commit/17cc0dd9b5d2d500359c36881cd3e5637443c133) Chore: add test case for no-func-assign (refs #13705) (#13783) (Nitin Kumar) -* [`dee0f77`](https://github.com/eslint/eslint/commit/dee0f7764a1d5a323c89b22c4db94acee2b3c718) Docs: add TOC to user-guide/configuring.md (#13727) (metasean) -* [`0510621`](https://github.com/eslint/eslint/commit/05106212985cb1ffa1e6fa996a57f6fd2fc3c970) Update: Fix && vs || short-circuiting false negatives (fixes #13634) (#13769) (Brandon Mills) -* [`8b6ed69`](https://github.com/eslint/eslint/commit/8b6ed691c48189b7d096339441a78cb5874d4137) Sponsors: Sync README with website (ESLint Jenkins) -* [`1457509`](https://github.com/eslint/eslint/commit/145750991b04fd4cfb3fff3c5d4211a4428e011c) Docs: fix broken links in Node.js API docs (#13771) (Laura Barluzzi) -* [`7c813d4`](https://github.com/eslint/eslint/commit/7c813d458f9aedf7a94351d137728a4647542879) Docs: Fix typo in v7 migration page (#13778) (Yusuke Sasaki) -* [`b025795`](https://github.com/eslint/eslint/commit/b0257953be704d0bb387fc15afd7859fd6f19ba5) Docs: Fix the format option name in the document (#13770) (Hideki Igarashi) -* [`84fd591`](https://github.com/eslint/eslint/commit/84fd591c234accc41bb5af555f178825012fd35d) Chore: Increase Mocha timeout for copying fixtures (#13768) (Brandon Mills) -* [`1faeb84`](https://github.com/eslint/eslint/commit/1faeb84e663d88c5d85a3cb3f15cd224cc552c2d) Docs: clarify that space-unary-ops doesn't apply when space is required (#13767) (Taylor Morgan) -* [`67c0605`](https://github.com/eslint/eslint/commit/67c06059dd1ddcee6f369c650ce71220da1510c3) Update: check computed keys in no-prototype-builtins (fixes #13088) (#13755) (Milos Djermanovic) -* [`b5e011c`](https://github.com/eslint/eslint/commit/b5e011c865e95d700d29cb9a4ba71c671d99e423) Sponsors: Sync README with website (ESLint Jenkins) - -v7.11.0 - October 9, 2020 - -* [`23e966f`](https://github.com/eslint/eslint/commit/23e966f6cf2a6c6b699dff5d6950ece3cc396498) Chore: Refactor CLIEngine tests (refs #13481) (#13709) (Nicholas C. Zakas) -* [`fa9429a`](https://github.com/eslint/eslint/commit/fa9429aac0ffed505f3f02e8fc75f646c69f5c61) Fix: don't count line after EOF in max-lines (#13735) (Milos Djermanovic) -* [`d973675`](https://github.com/eslint/eslint/commit/d973675a5c06a2bd4f8ce640c78b67842cfebfd4) Docs: Update anchor links to use existing linkrefs (refs #13715) (#13741) (Brandon Mills) -* [`2c6d774`](https://github.com/eslint/eslint/commit/2c6d774c89dcd14f386bd9d73d451fa2a892c3ef) Docs: Fix typos (#13730) (Frieder Bluemle) -* [`cc468c0`](https://github.com/eslint/eslint/commit/cc468c01021385a028de727eefcd442e7f34875c) Upgrade: eslint-visitor-keys@2.0.0 (#13732) (Milos Djermanovic) -* [`ab0ac6c`](https://github.com/eslint/eslint/commit/ab0ac6c532fb7b7d49779c8913146244d680743b) Docs: Fix anchor links (#13715) (Gary Moore) -* [`27f0de6`](https://github.com/eslint/eslint/commit/27f0de62e6281c28043be38ef051818c9edc15cd) Fix: account for linebreaks before postfix `++`/`--` in no-extra-parens (#13731) (Milos Djermanovic) -* [`da78fa1`](https://github.com/eslint/eslint/commit/da78fa11632a2908db4ac494012a16f5d5a88a64) Update: support async arrow fn in function-paren-newline (fixes #13728) (#13729) (Michal Dziekonski) -* [`fe301b8`](https://github.com/eslint/eslint/commit/fe301b8cc0762d7f4edd59603ca51ed0ec0c2a43) Docs: Add configuration comments in examples (#13738) (YeonJuan) -* [`504408c`](https://github.com/eslint/eslint/commit/504408cd65e9d8827b2b8bbeb8f589df90eee523) Sponsors: Sync README with website (ESLint Jenkins) -* [`3900659`](https://github.com/eslint/eslint/commit/390065985b2289ad4412a83598e3e833c382d27e) Sponsors: Sync README with website (ESLint Jenkins) -* [`c1974b3`](https://github.com/eslint/eslint/commit/c1974b3f7169a8e5fab7007df92d02d8c1a8d5a3) Sponsors: Sync README with website (ESLint Jenkins) -* [`6f4abe5`](https://github.com/eslint/eslint/commit/6f4abe5d5ade2711cc4c21bc8485af952763c2d3) Sponsors: Sync README with website (ESLint Jenkins) - -v7.10.0 - September 26, 2020 - -* [`6919fbb`](https://github.com/eslint/eslint/commit/6919fbb83f86552b0f49ae749da866e4edc7c46a) Docs: Clarify that ignorePattern should be a string (refs #13029) (#13718) (Brandon Mills) -* [`07d9bea`](https://github.com/eslint/eslint/commit/07d9bea7c6f953e8f754afffc9752edcee799431) Update: Add ignorePattern to no-inline-comments (#13029) (Edie Lemoine) -* [`d79bbe9`](https://github.com/eslint/eslint/commit/d79bbe982930b53358d34ad91cc6e5eaac8ddede) Docs: fix typo (#13717) (Alexander Liu) -* [`9b8490e`](https://github.com/eslint/eslint/commit/9b8490ee6391c986b1314540a92b71d8c1e0efc4) Docs: grammatical error (#13687) (rajdeep) -* [`cb44e93`](https://github.com/eslint/eslint/commit/cb44e93f4780e925a75a68ce2f7f6d065b5f756c) Fix: prefer-destructuring invalid autofix with computed property access (#13704) (Milos Djermanovic) -* [`46c73b1`](https://github.com/eslint/eslint/commit/46c73b159a5ceed2f7f26f254fd97e459fb0e81a) Upgrade: eslint-scope@5.1.1 (#13716) (Milos Djermanovic) -* [`b7b12ba`](https://github.com/eslint/eslint/commit/b7b12ba0bd4e9c66883f11e97de8ed84b600cdaa) Chore: Move comment to make tests more organized (#13707) (Yusuke Tanaka) -* [`51674a4`](https://github.com/eslint/eslint/commit/51674a4113a1ca877094606bbf4938ab06cc1aad) Docs: Add missing quotes (#13714) (Lucio Paiva) -* [`7c34a98`](https://github.com/eslint/eslint/commit/7c34a982aaf93a02348f56c9ce887c7dcf51b5bd) Chore: remove mistakenly added file (#13710) (Milos Djermanovic) -* [`30b76c9`](https://github.com/eslint/eslint/commit/30b76c9a13fae3dff59f7db406d6c66f11152973) Docs: Clarify package.json requirement in Getting Started (refs #13549) (#13696) (Nicholas C. Zakas) -* [`044560d`](https://github.com/eslint/eslint/commit/044560dcc74db98b28e293da2e2f3b41ecbf5884) Sponsors: Sync README with website (ESLint Jenkins) -* [`54000d1`](https://github.com/eslint/eslint/commit/54000d13f27d5255851b5ac0606ad027e2b8d331) Sponsors: Sync README with website (ESLint Jenkins) - -v7.9.0 - September 12, 2020 - -* [`3ca2700`](https://github.com/eslint/eslint/commit/3ca27004ece5016ba7aed775f01ad13bc9282296) Fix: Corrected notice for invalid (:) plugin names (#13473) (Josh Goldberg) -* [`fc5783d`](https://github.com/eslint/eslint/commit/fc5783d2ff9e3b0d7a1f9664928d49270b4a6c01) Docs: Fix leaky anchors in v4 migration page (#13635) (Timo Tijhof) -* [`f1d07f1`](https://github.com/eslint/eslint/commit/f1d07f112be96c64dfdaa154aa9ac81985b16238) Docs: Provide install commands for Yarn (#13661) (Nikita Baksalyar) -* [`29d1cdc`](https://github.com/eslint/eslint/commit/29d1cdceedd6c056a39149723cf9ff2fbb260cbf) Fix: prefer-destructuring removes comments (refs #13678) (#13682) (Milos Djermanovic) -* [`b4da0a7`](https://github.com/eslint/eslint/commit/b4da0a7ca7995435bdfc116fd374eb0649470131) Docs: fix typo in working with plugins docs (#13683) (啸生) -* [`6f87db7`](https://github.com/eslint/eslint/commit/6f87db7c318225e48ccbbf0bec8b3758ea839b82) Update: fix id-length false negatives on Object.prototype property names (#13670) (Milos Djermanovic) -* [`361ac4d`](https://github.com/eslint/eslint/commit/361ac4d895c15086fb4351d4dca1405b2fdc4bd5) Fix: NonOctalDecimalIntegerLiteral is decimal integer (fixes #13588) (#13664) (Milos Djermanovic) -* [`f260716`](https://github.com/eslint/eslint/commit/f260716695064e4b4193337107b60401bd4b3f20) Docs: update outdated link (#13677) (klkhan) -* [`5138c91`](https://github.com/eslint/eslint/commit/5138c913c256e4266ffb68278783af45bf70af84) Docs: add missing eslint directive comments in no-await-in-loop (#13673) (Milos Djermanovic) -* [`17b58b5`](https://github.com/eslint/eslint/commit/17b58b528df62bf96813d50c087cafdf83306810) Docs: clarify correct example in no-return-await (fixes #13656) (#13657) (Milos Djermanovic) -* [`9171f0a`](https://github.com/eslint/eslint/commit/9171f0a99bb4d7c53f109b1c2b215004a7c27713) Chore: fix typo (#13660) (Nitin Kumar) -* [`6d9f8fb`](https://github.com/eslint/eslint/commit/6d9f8fbb7ed4361b475fb50d04e6d25744d5b1a2) Sponsors: Sync README with website (ESLint Jenkins) -* [`97b0dd9`](https://github.com/eslint/eslint/commit/97b0dd9a1af1ae4ae3857adcfe6eeac7837101ed) Sponsors: Sync README with website (ESLint Jenkins) -* [`deab125`](https://github.com/eslint/eslint/commit/deab125fc9220dab43baeb32c6cf78942ad25a83) Sponsors: Sync README with website (ESLint Jenkins) -* [`bf2e367`](https://github.com/eslint/eslint/commit/bf2e367bf4f6fde9930af9de8b8d8bc3d8b5782f) Sponsors: Sync README with website (ESLint Jenkins) -* [`8929208`](https://github.com/eslint/eslint/commit/89292084bf91ba5ae5bf966c6c56fa3da139ce57) Sponsors: Sync README with website (ESLint Jenkins) - -v7.8.1 - September 1, 2020 - -* [`f542b5d`](https://github.com/eslint/eslint/commit/f542b5d0679b73326ad249fc44a54c3f848bd3e6) Fix: Update broken @eslint/eslintrc version (fixes #13641) (#13647) (Nicholas C. Zakas) -* [`c1b5696`](https://github.com/eslint/eslint/commit/c1b56966c2354e12d16e8394443de49fa54f4290) Sponsors: Sync README with website (ESLint Jenkins) -* [`8ddeda0`](https://github.com/eslint/eslint/commit/8ddeda01afdb1e9656a43853b8e25c9c4582e6ad) Sponsors: Sync README with website (ESLint Jenkins) -* [`e02e2fe`](https://github.com/eslint/eslint/commit/e02e2fe019a1ed9a34a7b96e4c8961c35093b0ce) Sponsors: Sync README with website (ESLint Jenkins) - -v7.8.0 - August 31, 2020 - -* [`58abd93`](https://github.com/eslint/eslint/commit/58abd9311900a8af5a3c0963daaf64675bdd8383) Update: support logical assignments in code path analysis (refs #13569) (#13612) (Milos Djermanovic) -* [`db7488e`](https://github.com/eslint/eslint/commit/db7488e6326fd1b7ea04c5062beb1c5f75fc15ed) Update: support logical assignments in core rules (refs #13569) (#13618) (Milos Djermanovic) -* [`3729219`](https://github.com/eslint/eslint/commit/372921924778f2e525535985e17c97b988546210) Docs: Update Step 1 of Development Environment documentation (klkhan) -* [`a320324`](https://github.com/eslint/eslint/commit/a32032430a0779a4e3b2d137d4d0682844084b82) Chore: Test formatted integers in no-dupe-keys (refs #13568) (#13626) (Brandon Mills) -* [`88a9ade`](https://github.com/eslint/eslint/commit/88a9ade7643bb166efbab45cee15f3269496f4be) Update: add es2021 environment (refs #13602) (#13603) (Milos Djermanovic) -* [`0003dc0`](https://github.com/eslint/eslint/commit/0003dc0f966f2b47555595586f84eb3163cb0179) Update: support numeric separators (refs #13568) (#13581) (Milos Djermanovic) -* [`96b11a0`](https://github.com/eslint/eslint/commit/96b11a0717bf32b94ec768611574372320fb774b) Update: Add exceptionPatterns to id-length rule (fixes #13094) (#13576) (sodam) -* [`3439fea`](https://github.com/eslint/eslint/commit/3439fea5c0ed330d01d874b0c9df51dd51ae792c) Update: support numeric-separator in no-loss-of-precision (refs #13568) (#13574) (Anix) -* [`ed64767`](https://github.com/eslint/eslint/commit/ed64767859d776145d68145419a61f5379b4dd63) Update: add comment to message in no-warning-comments (fixes #12327) (#13522) (Anix) -* [`e60ec07`](https://github.com/eslint/eslint/commit/e60ec07fad0c1d4c966f28d214c5379da753ff4e) Sponsors: Sync README with website (ESLint Jenkins) -* [`483bf7f`](https://github.com/eslint/eslint/commit/483bf7f3cc40e0d866798d6ca9ee1c19aa77ddd2) Docs: fix examples in object-curly-newline (#13605) (Soobin Bak) -* [`1c35d57`](https://github.com/eslint/eslint/commit/1c35d57b0a5f374cc55f1727a7561bcab1962e83) Docs: Remove stale Keybase 2FA instructions (#13622) (Brandon Mills) -* [`82669fa`](https://github.com/eslint/eslint/commit/82669fa66670a00988db5b1d10fe8f3bf30be84e) Chore: Extract some functionality to eslintrc (refs #13481) (#13613) (Nicholas C. Zakas) -* [`4111d21`](https://github.com/eslint/eslint/commit/4111d21a046b73892e2c84f92815a21ef4db63e1) Docs: Fix typo and missing article before noun in docs (#13611) (Patrice Sandhu) -* [`091e52a`](https://github.com/eslint/eslint/commit/091e52ae1ca408f3e668f394c14d214c9ce806e6) Upgrade: espree@7.3.0 (refs #13568) (#13609) (Kai Cataldo) -* [`05074fb`](https://github.com/eslint/eslint/commit/05074fb2c243e904e8c09d714ad9d084acdd80d2) Sponsors: Sync README with website (ESLint Jenkins) -* [`bdb65ec`](https://github.com/eslint/eslint/commit/bdb65ec2e672c9815bee356b61d1cd60a1072152) Chore: add 3rd party parsers in BUG_REPORT template (#13606) (YeonJuan) -* [`f954476`](https://github.com/eslint/eslint/commit/f954476fb6b0664679c73babd5e8a0647572b81f) Chore: add common 3rd party parsers to issue template (#13596) (Kai Cataldo) -* [`2bee6d2`](https://github.com/eslint/eslint/commit/2bee6d256ae0516c9a9003bb3fdca24ff93253b5) Chore: Mark config-related files (refs #13481) (#13597) (Nicholas C. Zakas) -* [`66442a9`](https://github.com/eslint/eslint/commit/66442a9faf9872db4a40f56dde28c48f4d02fc7b) Update: Add no-magic-numbers 'ignoreDefaultValues' option (#12611) (Dieter Luypaert) -* [`b487164`](https://github.com/eslint/eslint/commit/b487164d01dd0bf66fdf2df0e374ce1c3bdb0339) Docs: add exponentiation operators to operator-assignment documentation (#13577) (Milos Djermanovic) -* [`2f27836`](https://github.com/eslint/eslint/commit/2f27836e989f3dfe236e34054b490febc359bc48) Sponsors: Sync README with website (ESLint Jenkins) -* [`60eafc1`](https://github.com/eslint/eslint/commit/60eafc15075f38955cb6816bf1f0bcf6e6e6d3a6) Sponsors: Sync README with website (ESLint Jenkins) - -v7.7.0 - August 14, 2020 - -* [`b46f3ee`](https://github.com/eslint/eslint/commit/b46f3ee0dae4add9df99cae940b641ad8de58b9e) Update: allowFunctionParams option in no-underscore-dangle (fixes 12579) (#13545) (Sunghyun Cho) -* [`26aa245`](https://github.com/eslint/eslint/commit/26aa2452b5f407fabc25dad21182180e4d3be532) Docs: clarify "case" specifier in padding-line-between-statements (#13562) (Milos Djermanovic) -* [`082891c`](https://github.com/eslint/eslint/commit/082891c042d72953fe86cd3ce9c96e661760793d) Docs: Update semantic versioning policy (#13563) (Nicholas C. Zakas) -* [`4e0b672`](https://github.com/eslint/eslint/commit/4e0b672eb4bf39f7502a550b08b25a56a196f19f) Fix: revert "Update: disallow multiple options in comma-dangle schema" (#13564) (Kai Cataldo) -* [`254990e`](https://github.com/eslint/eslint/commit/254990e87914457ca25ea2d7ee012964e56fc9e5) Fix: indent for async arrow functions (fixes #13497) (#13544) (Anix) -* [`28ca339`](https://github.com/eslint/eslint/commit/28ca339259b07c96c73f2ef28cbf112b96395855) Sponsors: Sync README with website (ESLint Jenkins) -* [`2e4158d`](https://github.com/eslint/eslint/commit/2e4158d3ec9cfed6400bf70795fd7171e96ff9b3) Sponsors: Sync README with website (ESLint Jenkins) -* [`488d159`](https://github.com/eslint/eslint/commit/488d1595aef43c4d52cccdb2c97977884f0375a8) Sponsors: Sync README with website (ESLint Jenkins) -* [`c44306e`](https://github.com/eslint/eslint/commit/c44306e52778309a79232ceab8b55a9aa0f2dfda) Sponsors: Sync README with website (ESLint Jenkins) -* [`6677180`](https://github.com/eslint/eslint/commit/6677180495e16a02d150d0552e7e5d5f6b77fcc5) Sponsors: Sync README with website (ESLint Jenkins) -* [`07db7b8`](https://github.com/eslint/eslint/commit/07db7b8080c2f68ee28e7d447db356c33e6fddce) Sponsors: Sync README with website (ESLint Jenkins) -* [`d4ce4d3`](https://github.com/eslint/eslint/commit/d4ce4d3b8492c3e4654ed1f51f2c48e6c0ad272f) Sponsors: Sync README with website (ESLint Jenkins) -* [`284e954`](https://github.com/eslint/eslint/commit/284e954f93126c50e0aa9b88f42afb03a47ad967) Sponsors: Sync README with website (ESLint Jenkins) -* [`ae9b54e`](https://github.com/eslint/eslint/commit/ae9b54e59b01aa9f50ee31f5b6787d86e6b59de6) Sponsors: Sync README with website (ESLint Jenkins) -* [`9124a15`](https://github.com/eslint/eslint/commit/9124a1599638a1caf4b7e252d1cb66abdc5e51c6) Chore: remove leche (fixes #13287) (#13533) (Mark de Dios) -* [`5c4c7f5`](https://github.com/eslint/eslint/commit/5c4c7f515c2e8e83f2186a66ddce75d6477abeb0) Sponsors: Sync README with website (ESLint Jenkins) -* [`48d8ec8`](https://github.com/eslint/eslint/commit/48d8ec8cf320c69aed17c6b6c78f19e7c1e587ca) Sponsors: Sync README with website (ESLint Jenkins) - -v7.6.0 - July 31, 2020 - -* [`ecb2b73`](https://github.com/eslint/eslint/commit/ecb2b7343a0d14fb57d297a16be6c1b176fb3dbf) Update: require `meta` for fixable rules in RuleTester (refs #13349) (#13489) (Milos Djermanovic) -* [`6fb4edd`](https://github.com/eslint/eslint/commit/6fb4edde3b7a7ae2faf8ac956a7342fbf80865fc) Docs: fix broken links in developer guide (#13518) (Sam Chen) -* [`318fe10`](https://github.com/eslint/eslint/commit/318fe103dbf2548eee293ff456ef0b829dbe3db3) Fix: Do not output `undefined` as line and column when it's unavailable (#13519) (haya14busa) -* [`493b5b4`](https://github.com/eslint/eslint/commit/493b5b40cae7a076fdeb19740f8c88fb4ae9c1fb) Sponsors: Sync README with website (ESLint Jenkins) -* [`f100143`](https://github.com/eslint/eslint/commit/f100143fa5f529aacb2b50e650a00d2697ca4c54) Sponsors: Sync README with website (ESLint Jenkins) -* [`16b10fe`](https://github.com/eslint/eslint/commit/16b10fe8ba3c78939d5ada4a25caf2f0c9e6a058) Fix: Update the chatroom link to go directly to help channel (#13536) (Nicholas C. Zakas) -* [`f937eb9`](https://github.com/eslint/eslint/commit/f937eb95407f60d3772bcb956e227aaf99e48777) Sponsors: Sync README with website (ESLint Jenkins) -* [`e71e298`](https://github.com/eslint/eslint/commit/e71e2980cd2e319afc70d8c859c7ffd59cf4157b) Update: Change no-duplicate-case to comparing tokens (fixes #13485) (#13494) (Yosuke Ota) -* [`6c4aea4`](https://github.com/eslint/eslint/commit/6c4aea44fd78e1eecea5fe3c37e1921e3b1e98a6) Docs: add ECMAScript 2020 to README (#13510) (Milos Djermanovic) - -v7.5.0 - July 18, 2020 - -* [`6ea3178`](https://github.com/eslint/eslint/commit/6ea3178776eae0e40c3f5498893e8aab0e23686b) Update: optional chaining support (fixes #12642) (#13416) (Toru Nagashima) -* [`540b1af`](https://github.com/eslint/eslint/commit/540b1af77278ae649b621aa8d4bf8d6de03c3155) Chore: enable consistent-meta-messages internal rule (#13487) (Milos Djermanovic) -* [`885a145`](https://github.com/eslint/eslint/commit/885a1455691265db88dc0befe9b48a69d69e8b9c) Docs: clarify behavior if `meta.fixable` is omitted (refs #13349) (#13493) (Milos Djermanovic) -* [`1a01b42`](https://github.com/eslint/eslint/commit/1a01b420eaab0de03dab5cc190a9f2a860c21a84) Docs: Update technology sponsors in README (#13478) (Nicholas C. Zakas) -* [`6ed9e8e`](https://github.com/eslint/eslint/commit/6ed9e8e4ff038c0259b0e7fe7ab7f4fd4ec55801) Upgrade: lodash@4.17.19 (#13499) (Yohan Siguret) -* [`45cdf00`](https://github.com/eslint/eslint/commit/45cdf00da6aeff3d584d37b0710fc8d6ad9456d6) Sponsors: Sync README with website (ESLint Jenkins) -* [`f1cc725`](https://github.com/eslint/eslint/commit/f1cc725ba1b8646dcf06a83716d96ad9bb726172) Docs: fix linebreaks between versions in changelog (#13488) (Milos Djermanovic) -* [`f4d7b9e`](https://github.com/eslint/eslint/commit/f4d7b9e1a599346b2f21ff9de003b311b51411e6) Update: deprecate id-blacklist rule (#13465) (Dimitri Mitropoulos) -* [`e14a645`](https://github.com/eslint/eslint/commit/e14a645aa495558081490f990ba221e21aa6b27c) Chore: use espree.latestEcmaVersion in fuzzer (#13484) (Milos Djermanovic) -* [`61097fe`](https://github.com/eslint/eslint/commit/61097fe5cc275d414a0c8e19b31c6060cb5568b7) Docs: Update int rule level to string (#13483) (Brandon Mills) -* [`c8f9c82`](https://github.com/eslint/eslint/commit/c8f9c8210cf4b9da8f07922093d7b219abad9f10) Update: Improve report location no-irregular-whitespace (refs #12334) (#13462) (Milos Djermanovic) -* [`f2e68ec`](https://github.com/eslint/eslint/commit/f2e68ec1d6cee6299e8a5cdf76c522c11d3008dd) Build: update webpack resolve.mainFields to match website config (#13457) (Milos Djermanovic) -* [`a96bc5e`](https://github.com/eslint/eslint/commit/a96bc5ec06f3a48bfe458bccd68d4d3b2a280ed9) Fix: arrow-body-style fixer for `in` wrap (fixes #11849) (#13228) (Anix) -* [`748734f`](https://github.com/eslint/eslint/commit/748734fdd497fbf61f3a616ff4a09169135b9396) Upgrade: Updated puppeteer version to v4.0.0 (#13444) (odidev) -* [`e951457`](https://github.com/eslint/eslint/commit/e951457b7aaa1b12b135588d36e3f4db4d7b8463) Docs: fix wording in configuring.md (#13469) (Piper) -* [`0af1d28`](https://github.com/eslint/eslint/commit/0af1d2828d27885483737867653ba1659af72005) Update: add allowSeparatedGroups option to sort-imports (fixes #12951) (#13455) (Milos Djermanovic) -* [`1050ee7`](https://github.com/eslint/eslint/commit/1050ee78a95da9484ff333dc1c74dac64c05da6f) Update: Improve report location for no-unneeded-ternary (refs #12334) (#13456) (Milos Djermanovic) -* [`b77b420`](https://github.com/eslint/eslint/commit/b77b4202bd1d5d1306f6f645e88d7a41a51715db) Update: Improve report location for max-len (refs #12334) (#13458) (Milos Djermanovic) -* [`095194c`](https://github.com/eslint/eslint/commit/095194c0fc0eb02aa69fde6b4280696e0e4de214) Fix: add end location to reports in object-curly-newline (refs #12334) (#13460) (Milos Djermanovic) -* [`10251bb`](https://github.com/eslint/eslint/commit/10251bbaeba80ac15244f385fc42cf2f2a30e5d2) Fix: add end location to reports in keyword-spacing (refs #12334) (#13461) (Milos Djermanovic) -* [`2ea7ee5`](https://github.com/eslint/eslint/commit/2ea7ee51a4e05ee76a6dae5954c3b6263b0970a3) Sponsors: Sync README with website (ESLint Jenkins) -* [`b55fd3b`](https://github.com/eslint/eslint/commit/b55fd3b8c05a29a465a794a524b06c1a28cddf0c) Sponsors: Sync README with website (ESLint Jenkins) - -v7.4.0 - July 3, 2020 - -* [`f21bad2`](https://github.com/eslint/eslint/commit/f21bad2680406a2671b877f8dba47f4475d0cc64) Docs: fix description for `never` in multiline-ternary (fixes #13368) (#13452) (Milos Djermanovic) -* [`ada2c89`](https://github.com/eslint/eslint/commit/ada2c891298382f82dfabf37cacd59a1057b2bb7) Fix: support typescript generics in arrow-parens (fixes #12570) (#13451) (Milos Djermanovic) -* [`89ee01e`](https://github.com/eslint/eslint/commit/89ee01e083f1e02293bf8d1447f9b0fdb3cb9384) Fix: Revert config cloning (fixes #13447) (#13449) (薛定谔的猫) -* [`0a463db`](https://github.com/eslint/eslint/commit/0a463dbf7cc5a77d442879c9117204d4d38db972) Docs: fix no-multiple-empty-lines examples (fixes #13432) (#13433) (Milos Djermanovic) -* [`ff5317e`](https://github.com/eslint/eslint/commit/ff5317e93425f93cfdf808609551ee67b2032543) Update: Improve array-callback-return report message (#13395) (Philip (flip) Kromer) -* [`3f51930`](https://github.com/eslint/eslint/commit/3f51930eea7cddc921a9ee3cb0328c7b649c0f83) Fix: false positive new with member in no-extra-parens (fixes #12740) (#13375) (YeonJuan) -* [`825a5b9`](https://github.com/eslint/eslint/commit/825a5b98d3d84f6eb72b75f7d8519de763cc8898) Fix: Clarify documentation on implicit ignore behavior (fixes #12348) (#12600) (Scott Hardin) -* [`c139156`](https://github.com/eslint/eslint/commit/c1391566a5f765f25716527de7b5cdee16c0ce36) Sponsors: Sync README with website (ESLint Jenkins) -* [`0c17e9d`](https://github.com/eslint/eslint/commit/0c17e9d2ac307cc288eea6ed7971bd5a7d33321a) Sponsors: Sync README with website (ESLint Jenkins) -* [`c680387`](https://github.com/eslint/eslint/commit/c680387ba61f6dccf0390d24a85d871fa83e9fea) Sponsors: Sync README with website (ESLint Jenkins) -* [`bf3939b`](https://github.com/eslint/eslint/commit/bf3939bbd9a33d0eb96cebe6a53bf61c855f9ba6) Sponsors: Sync README with website (ESLint Jenkins) -* [`7baf02e`](https://github.com/eslint/eslint/commit/7baf02e983af909800261263f125cca901a5bd0f) Sponsors: Sync README with website (ESLint Jenkins) -* [`5c4c3fd`](https://github.com/eslint/eslint/commit/5c4c3fdfbda18a13223ad36f44283adbfee8c496) Sponsors: Sync README with website (ESLint Jenkins) -* [`53912aa`](https://github.com/eslint/eslint/commit/53912aab1856327b399cca26cbb2ba81fd01bfa2) Sponsors: Sync README with website (ESLint Jenkins) -* [`51e42ec`](https://github.com/eslint/eslint/commit/51e42eca3e87d8259815d736ffe81e604f184057) Update: Add option "ignoreGlobals" to camelcase rule (fixes #11716) (#12782) (David Gasperoni) -* [`0655f66`](https://github.com/eslint/eslint/commit/0655f66525d167ca1288167b79a77087cfc8fcf6) Update: improve report location in arrow-body-style (refs #12334) (#13424) (YeonJuan) -* [`d53d69a`](https://github.com/eslint/eslint/commit/d53d69af08cfe55f42e0a0ca725b1014dabccc21) Update: prefer-regex-literal detect regex literals (fixes #12840) (#12842) (Mathias Schreck) -* [`004adae`](https://github.com/eslint/eslint/commit/004adae3f959414f56e44e5884f6221e9dcda142) Update: rename id-blacklist to id-denylist (fixes #13407) (#13408) (Kai Cataldo) - -v7.3.1 - June 22, 2020 - -* [`de77c11`](https://github.com/eslint/eslint/commit/de77c11e7515f2097ff355ddc0d7b6db9c83c892) Fix: Replace Infinity with Number.MAX_SAFE_INTEGER (fixes #13427) (#13435) (Nicholas C. Zakas) - -v7.3.0 - June 19, 2020 - -* [`638a6d6`](https://github.com/eslint/eslint/commit/638a6d6be18b4a37cfdc7223e1f5acd3718694be) Update: add missing `additionalProperties: false` to some rules' schema (#13198) (Milos Djermanovic) -* [`949a5cd`](https://github.com/eslint/eslint/commit/949a5cd741c2e930cfb43d80a9b6b084f9d677c3) Update: fix operator-linebreak overrides schema (#13199) (Milos Djermanovic) -* [`9e1414e`](https://github.com/eslint/eslint/commit/9e1414ee16b8caf582920f8fdf3b6ee1eb0b7cd5) New: Add no-promise-executor-return rule (fixes #12640) (#12648) (Milos Djermanovic) -* [`09cc0a2`](https://github.com/eslint/eslint/commit/09cc0a2bb5bcf3bcb0766a3c989871f268518437) Update: max-lines reporting loc improvement (refs #12334) (#13318) (Anix) -* [`ee2fc2e`](https://github.com/eslint/eslint/commit/ee2fc2e90d0f9dfcdba852b0609156bee5280b92) Update: object-property-newline end location (refs #12334) (#13399) (Anix) -* [`d98152a`](https://github.com/eslint/eslint/commit/d98152a3d8c72e4f5ac4c6fa10a615b12090c8f7) Update: added empty error array check for false negative (#13200) (Anix) -* [`7fb45cf`](https://github.com/eslint/eslint/commit/7fb45cf13e9908d489bd6d5fba3b7243c01508b9) Fix: clone config before validating (fixes #12592) (#13034) (Anix) -* [`aed46f6`](https://github.com/eslint/eslint/commit/aed46f69d54da167d9838149954ceeb4b02be5fd) Sponsors: Sync README with website (ESLint Jenkins) -* [`7686d7f`](https://github.com/eslint/eslint/commit/7686d7feaccc7b8fee927eda6602d641d8de1e5c) Update: semi-spacing should check do-while statements (#13358) (Milos Djermanovic) -* [`cbd0d00`](https://github.com/eslint/eslint/commit/cbd0d00a1ec2824d7e025bbbc084855ed0bf08bb) Update: disallow multiple options in comma-dangle schema (fixes #13165) (#13166) (Milos Djermanovic) -* [`b550330`](https://github.com/eslint/eslint/commit/b550330d739c73a7a8f887064e7c911d05a95f9a) New: Add no-unreachable-loop rule (fixes #12381) (#12660) (Milos Djermanovic) -* [`13999d2`](https://github.com/eslint/eslint/commit/13999d292080f814fa4fb266e011d61c184197c4) Update: curly should check consequent `if` statements (#12947) (Milos Djermanovic) -* [`c42e548`](https://github.com/eslint/eslint/commit/c42e54893b79b470ca7745bd2a626ffd069e017b) Chore: enable exceptRange option in the yoda rule (#12857) (Milos Djermanovic) -* [`6cfbd03`](https://github.com/eslint/eslint/commit/6cfbd03b3f22edb4d1c9c61c64eea7c129da71aa) Update: Drop @typescript-eslint/eslint-recommended from `eslint --init` (#13340) (Minh Nguyen) -* [`796f269`](https://github.com/eslint/eslint/commit/796f269e448fdcbf8a5a62edf1990bd857efd1af) Chore: update eslint-config-eslint's required node version (#13379) (薛定谔的猫) -* [`9d0186e`](https://github.com/eslint/eslint/commit/9d0186e55bee769ea6aa08dc5a62682f58316412) Docs: Fix changelog versions (#13410) (Tony Brix) -* [`1ee3c42`](https://github.com/eslint/eslint/commit/1ee3c42ceeee56b650bcc4206ed783b795f65643) Docs: On maxEOF with eol-last (fixes #12742) (#13374) (Arthur Dias) -* [`2a21049`](https://github.com/eslint/eslint/commit/2a210499288ed14ec9a6fd72decabfb77504c197) Update: key-spacing loc changes for extra space (refs #12334) (#13362) (Anix) -* [`7ce7988`](https://github.com/eslint/eslint/commit/7ce7988f411da64248a64a9d9d2b7884d5ba39e0) Chore: Replace the inquirer dependency with enquirer (#13254) (Selwyn) -* [`0f1f5ed`](https://github.com/eslint/eslint/commit/0f1f5ed2a20b8fb575d4360316861cf4c2b9b7bc) Docs: Add security policy link to README (#13403) (Nicholas C. Zakas) -* [`9e9ba89`](https://github.com/eslint/eslint/commit/9e9ba897c566601cfe90522099c635ea316b235f) Sponsors: Sync README with website (ESLint Jenkins) -* [`ca59fb9`](https://github.com/eslint/eslint/commit/ca59fb95a395c0a02ed23768a70e086480ab1f6d) Sponsors: Sync README with website (ESLint Jenkins) - -v7.2.0 - June 5, 2020 - -* [`b735a48`](https://github.com/eslint/eslint/commit/b735a485e77bcc791e4c4c6b8716801d94e98b2c) Update: add enforceForFunctionPrototypeMethods option to no-extra-parens (#12895) (Milos Djermanovic) -* [`27ef73f`](https://github.com/eslint/eslint/commit/27ef73ffb7428d5eff792d443186a2313e417bda) Update: reporter locr of func-call-spacing (refs #12334) (#13311) (Anix) -* [`353bfe9`](https://github.com/eslint/eslint/commit/353bfe9760ec640f470859855d4018df084a4e88) Update: handle parentheses in multiline-ternary (fixes #13195) (#13367) (Milos Djermanovic) -* [`a7fd343`](https://github.com/eslint/eslint/commit/a7fd343991cde99d8a219e3b25616db5792fe9a9) Update: keyword-spacing unexpected space loc improve (refs #12334) (#13377) (Anix) -* [`e49732e`](https://github.com/eslint/eslint/commit/e49732eb41bff6347ca7718c3c5ca1d13f1cd2d3) Fix: Ignore import expressions in no-unused-expressions rule (#13387) (Veniamin Krol) -* [`220349f`](https://github.com/eslint/eslint/commit/220349f5404060effe02fb5ec176a92e1383c3b5) Chore: Remove duplicate health files (#13380) (Nicholas C. Zakas) -* [`dd949ae`](https://github.com/eslint/eslint/commit/dd949aedb81fa772e10568920156daf075d25ea2) Update: support `??` operator, import.meta, and `export * as ns` (#13196) (Toru Nagashima) -* [`d5fce9f`](https://github.com/eslint/eslint/commit/d5fce9fa07e37ce61010a1fbb65964f1f7aefd82) Update: enable es2020 environment in --init (#13357) (Milos Djermanovic) -* [`21b1583`](https://github.com/eslint/eslint/commit/21b15832e326f96d349c063cd7e85e72c3abb670) Docs: fixed broken hash link for working-with-rules.md (#13386) (Yosuke Ota) -* [`b76aef7`](https://github.com/eslint/eslint/commit/b76aef778befb32afe7ad249934b132dc49713d2) Update: Improve report location for template-tag-spacing (refs #12334) (#13203) (Milos Djermanovic) -* [`578efad`](https://github.com/eslint/eslint/commit/578efad331b797e28c0f5f1547ce4769d2ea23ee) Chore: update no-unused-vars caughtErrors in eslint-config-eslint (#13351) (Milos Djermanovic) -* [`426088c`](https://github.com/eslint/eslint/commit/426088c966dc79dc338b33100f3adf827b147d69) Fix: no-unused-vars updated location to last reference (fixes #13181) (#13354) (Anix) -* [`cb50b69`](https://github.com/eslint/eslint/commit/cb50b69c08d4393e32d5c42c537d769c51dd34d8) Update: Improve location for no-mixed-spaces-and-tabs (refs #12334) (#13365) (Milos Djermanovic) -* [`f858f2a`](https://github.com/eslint/eslint/commit/f858f2a8f83232484491bd90b0bc5001b5056ad0) Chore: Add Tidelift to funding.yml (#13371) (Nicholas C. Zakas) -* [`ee30e5d`](https://github.com/eslint/eslint/commit/ee30e5d8bb1a4c82a2a3fbe1b9ee9f979b55c5c4) Sponsors: Sync README with website (ESLint Jenkins) -* [`c29bd9f`](https://github.com/eslint/eslint/commit/c29bd9f75582e5b1a403a8ffd0aafd1ffc8c58e1) Chore: Add breaking/core change link to issue templates (#13344) (Kai Cataldo) -* [`d55490f`](https://github.com/eslint/eslint/commit/d55490fa73ff69416de375e4c1cd67b6edba531c) Sponsors: Sync README with website (ESLint Jenkins) - -v7.1.0 - May 22, 2020 - -* [`a93083a`](https://github.com/eslint/eslint/commit/a93083af89c6f9714dcdd4a7f27c8655a0b0dba6) Fix: astUtils.getNextLocation returns invalid location after CRLF (#13275) (Milos Djermanovic) -* [`df01af1`](https://github.com/eslint/eslint/commit/df01af184d93b3d64b37cee786cad59bd0d7aacb) Update: padded-blocks loc position changes (refs #12334) (#13328) (Anix) -* [`bd3f092`](https://github.com/eslint/eslint/commit/bd3f092efa579944f75bfbc277b35f85e6d966ed) Fix: max-lines-per-function flagging arrow IIFEs (fixes #13332) (#13336) (cherryblossom000) -* [`25462b2`](https://github.com/eslint/eslint/commit/25462b23eac4ed1ded97eeae6187b5d8baa58e78) Update: block-spacing changed loc for extra (refs #12334) (#13314) (Anix) -* [`de0aab9`](https://github.com/eslint/eslint/commit/de0aab95005f172db72196fc3fd18e91ee9a5880) Fix: report end loc in one-var-declaration-per-line (refs #12334) (#13326) (YeonJuan) -* [`1710296`](https://github.com/eslint/eslint/commit/1710296082083602a904b080908657bb431fb56c) Fix: no-new-symbol false positive with Symbol as an argument (#13337) (Milos Djermanovic) -* [`cc01451`](https://github.com/eslint/eslint/commit/cc014514c29626e556acb0a528e3478b3725e284) Fix: arrow-parens no reporting for comments inside (fixes #12995) (#13312) (Anix) -* [`a195141`](https://github.com/eslint/eslint/commit/a19514193a42f4f00732559ff828b33a6ec9d7c5) Update: reporting location for semi-spacing (refs #12334) (#13285) (Anix) -* [`e3e4c41`](https://github.com/eslint/eslint/commit/e3e4c41ab625a5af8d4614d1c6d32c656f104f6b) Fix: fix false positives of no-new-func (#13333) (Pig Fang) -* [`611c676`](https://github.com/eslint/eslint/commit/611c676dfd671013d81810724f184e2a9c5ad5d7) Docs: Update new rules policies (#13343) (Nicholas C. Zakas) -* [`3a5fbb3`](https://github.com/eslint/eslint/commit/3a5fbb3d634be688615950c0a5fa8aead6ff08b5) Chore: correct fileoverview doc in accessor-pairs (#13335) (YeonJuan) -* [`b0a6b81`](https://github.com/eslint/eslint/commit/b0a6b8134e3b399beeb69432a02232a1037f7c46) Update: Improve report location for rest-spread-spacing (refs #12334) (#13313) (Milos Djermanovic) -* [`68c8ee3`](https://github.com/eslint/eslint/commit/68c8ee3ab70187972aef4c4e866bcf29da70a207) Fix: Stop path analyzer on unknown nodes (#13305) (Ilya Volodin) -* [`89e1081`](https://github.com/eslint/eslint/commit/89e10811c4df666216aae58bff5f855cd9df738b) Update: Improve report location for linebreak-style (refs #12334) (#13317) (Milos Djermanovic) -* [`0891379`](https://github.com/eslint/eslint/commit/08913798b4ec420b261b8fbc470504f9f248c840) Docs: Document the "correct" way to build an array with values (#13246) (Ed S) -* [`88127d7`](https://github.com/eslint/eslint/commit/88127d74d56b88cc5a0758856995716050021131) Chore: remove checkbox from PR template prerequesites (#13330) (Kai Cataldo) -* [`c636d57`](https://github.com/eslint/eslint/commit/c636d5708c461a8ff1ea55e5df56d4f76f9c4044) New: no-loss-of-precision (fixes #11279) (#12747) (jmoore914) -* [`72a4e10`](https://github.com/eslint/eslint/commit/72a4e1044592057c4a3f39dbb1dbe61b00ea8af6) Chore: Mark SourceCode getComments() method as deprecated (fixes #13293) (#13296) (SuperOleg39) -* [`7f14846`](https://github.com/eslint/eslint/commit/7f1484690665b4f4b9cd9680ca8bb7b5cf56e48a) Docs: fix broken link in Node.js API docs (#13307) (Kai Cataldo) -* [`02aeba1`](https://github.com/eslint/eslint/commit/02aeba19afb301140514097235a9f2a00a9acb2a) Sponsors: Sync README with website (ESLint Jenkins) -* [`1f17533`](https://github.com/eslint/eslint/commit/1f175338cba29960aab67a540f516051f9d428c8) Docs: Gitter -> Discord URL (refs #13039) (#13308) (Nicholas C. Zakas) -* [`82a448a`](https://github.com/eslint/eslint/commit/82a448a7deff24e9207f60dfe77622c00102bd99) Docs: improve documentation of no-return-await (#13215) (Linus Unnebäck) -* [`742941d`](https://github.com/eslint/eslint/commit/742941d7fdc3fd79ff8c5d2588413e0d3a5a525b) Update: added typescript-eslint/recommended configs for init (#13235) (Anix) -* [`3d03df0`](https://github.com/eslint/eslint/commit/3d03df08c8000403a85baffe2a000287f3335114) Sponsors: Sync README with website (ESLint Jenkins) -* [`f44a6b4`](https://github.com/eslint/eslint/commit/f44a6b4fd92602af8e2c75d5852f796ec064aa8e) Chore: fix invalid syntax in require-await tests (#13277) (Milos Djermanovic) -* [`2c778fb`](https://github.com/eslint/eslint/commit/2c778fb6e31b7943bb27a47a6e15dcbfd8336f39) Fix: remove custom plugins from replacedBy metadata (#13274) (Kai Cataldo) -* [`0db3b1d`](https://github.com/eslint/eslint/commit/0db3b1d5cc5e4e1de21462679581b7a4d89ff36e) Sponsors: Sync README with website (ESLint Jenkins) - -v7.0.0 - May 8, 2020 - -* [`b98d8bd`](https://github.com/eslint/eslint/commit/b98d8bda4630fe8278c5aa2b6650630770568fe5) Upgrade: eslint-release@2.0.0 (#13271) (Kai Cataldo) -* [`4c0b028`](https://github.com/eslint/eslint/commit/4c0b028c55fc1674b374efe0bc6dd22c02b4ac88) Fix: remove Node.js and CommonJS category from build process (#13242) (Kai Cataldo) -* [`401a687`](https://github.com/eslint/eslint/commit/401a68799d9d15145e1c7d92ee04644abec2f15a) Chore: fix rules list for prereleases (#13230) (Kai Cataldo) -* [`4ef6158`](https://github.com/eslint/eslint/commit/4ef61580736353f700ab9e4e29f005b5ac552c78) Breaking: espree@7.0.0 (#13270) (Kai Cataldo) -* [`b5c8d73`](https://github.com/eslint/eslint/commit/b5c8d7389bb2c5d4eae850b866832d099187818b) Docs: update 7.0.0 migration guide for consistency (#13267) (Kai Cataldo) -* [`356fdb4`](https://github.com/eslint/eslint/commit/356fdb46aa118ba3d81cee93e8c058a7c98acaf9) Docs: add migration guide (#12692) (Toru Nagashima) -* [`015edf6`](https://github.com/eslint/eslint/commit/015edf6467e33c67b904db037a674d71957a6865) Sponsors: Sync README with website (ESLint Jenkins) -* [`fdfa364`](https://github.com/eslint/eslint/commit/fdfa364c1b0d88689d02cbe8ae848a3e323209aa) 7.0.0-rc.0 (ESLint Jenkins) -* [`8d1b4db`](https://github.com/eslint/eslint/commit/8d1b4db9932cf7c3289187afbb3866a83f9b3f8c) Build: changelog update for 7.0.0-rc.0 (ESLint Jenkins) -* [`0b1d65a`](https://github.com/eslint/eslint/commit/0b1d65a45aa5dfe08cd596c420490e81b546317e) Update: Improve report location for array-callback-return (refs #12334) (#13109) (Milos Djermanovic) -* [`d85e291`](https://github.com/eslint/eslint/commit/d85e291d1b56960373031f2562547df7285444f7) Fix: yoda left string fix for exceptRange (fixes #12883) (#13052) (Anix) -* [`2ce6bed`](https://github.com/eslint/eslint/commit/2ce6bed04cad376003f70447ece4b6578c142bfd) Chore: added tests for nested arrays (#13145) (Anix) -* [`d3aac53`](https://github.com/eslint/eslint/commit/d3aac532f6a24c633f85dedf0e552eabd22d0956) Update: report backtick loc in no-unexpected-multiline (refs #12334) (#13142) (Milos Djermanovic) -* [`8e7a2d9`](https://github.com/eslint/eslint/commit/8e7a2d93595cfe0c1597af0e7873853369251c0b) Fix: func-call-spacing "never" reports wrong message (fixes #13190) (#13193) (Milos Djermanovic) -* [`bcafd0f`](https://github.com/eslint/eslint/commit/bcafd0f8508e19ab8087a35fac7b97fc4295df3e) Update: Add ESLint API (refs eslint/rfcs#40) (#12939) (Kai Cataldo) -* [`3eeae56`](https://github.com/eslint/eslint/commit/3eeae565bfb0834a31e5d3a253a17bbf4027cf88) Upgrade: some (dev) deps (#13155) (薛定谔的猫) -* [`6b7030b`](https://github.com/eslint/eslint/commit/6b7030b1a1e1e3d1a3953cfa9722074d6a6fc1a9) Chore: Run tests on Node.js v14 (#13210) (fisker Cheung) -* [`ebc28d7`](https://github.com/eslint/eslint/commit/ebc28d76658f1f3e4e8d56e70a25752b5d4a6686) Fix: Remove default .js from --ext CLI option (#13176) (Brandon Mills) -* [`5c1bdeb`](https://github.com/eslint/eslint/commit/5c1bdebcf728062fd41583886830c89b65485df9) Update: Improve report location for getter-return (refs #12334) (#13164) (Milos Djermanovic) -* [`56d2bee`](https://github.com/eslint/eslint/commit/56d2beea0ea0b6395a6d4a3e116ea6a964ff92f3) Docs: fix typos (#13204) (Nitin Kumar) -* [`e13256e`](https://github.com/eslint/eslint/commit/e13256e395cc413ce45a66c8562621d48440d8f4) Chore: use espree.latestEcmaVersion in config-initializer (#13157) (Kai Cataldo) -* [`e4f57b7`](https://github.com/eslint/eslint/commit/e4f57b7d7b8b7441a2217a217dcda1e7bfff516a) Chore: add nested array tests for array-element-newline (#13161) (Anix) -* [`63ac918`](https://github.com/eslint/eslint/commit/63ac91877668205aaa50495a9615806967e6e4cf) Sponsors: Sync README with website (ESLint Jenkins) -* [`516f253`](https://github.com/eslint/eslint/commit/516f253729daeeb9da5de5e9b38606ff9c1aae71) Docs: Adds import example for object-curly-newline rule (refs #12018) (#13177) (Luke Lewis) -* [`5a0e84e`](https://github.com/eslint/eslint/commit/5a0e84e9498a946a3e8491a370e012354e087fe0) Sponsors: Sync README with website (ESLint Jenkins) -* [`b398e0b`](https://github.com/eslint/eslint/commit/b398e0b9ff455e4e7d70f19d5ccea5819c21eb86) Docs: add rule comment in prefer-rest-params doc (#13191) (YeonJuan) -* [`ffaa4ba`](https://github.com/eslint/eslint/commit/ffaa4ba5e2bb1a51a78a2b2c028cbe2efc9e5165) Sponsors: Sync README with website (ESLint Jenkins) -* [`932869b`](https://github.com/eslint/eslint/commit/932869b3251b04c4ad5fa72279cb2a56a3e67b55) Sponsors: Sync README with website (ESLint Jenkins) -* [`54630f0`](https://github.com/eslint/eslint/commit/54630f0063fa66318476473757b5912465d4caf2) Sponsors: Sync README with website (ESLint Jenkins) -* [`c9a5035`](https://github.com/eslint/eslint/commit/c9a503571a4662f6c2d31cabc7fd7819ec388150) Fix: newBasePath should be an absolute path (fixes #12850) (#13078) (Nick Harris) -* [`e7c1d4b`](https://github.com/eslint/eslint/commit/e7c1d4b2ac56149a517d4b0000230348a641f1d3) Update: deprecate Node.js & CommonJS rules (#12898) (Kai Cataldo) -* [`95e1c70`](https://github.com/eslint/eslint/commit/95e1c70cebde210a990ee786ec7ab1c8e522edb8) Upgrade: levn@0.4.1 (fixes #9366) (#13140) (Kai Cataldo) -* [`c41de38`](https://github.com/eslint/eslint/commit/c41de382a330d4789488fd2dcf6db5a3163bb5d2) Docs: fix curly multi-or-nest examples with comments (refs #12972) (#13151) (Milos Djermanovic) -* [`57221d5`](https://github.com/eslint/eslint/commit/57221d58c60e757062242f30ed574e0502fc7c31) Docs: fix eslint comment in no-inner-declarations examples (#13152) (Milos Djermanovic) -* [`301b450`](https://github.com/eslint/eslint/commit/301b450ecd1985ae84d1915124f4638ab2a2e6de) Fix: no-extra-parens export default sequence expression false positive (#13096) (Milos Djermanovic) -* [`af4472f`](https://github.com/eslint/eslint/commit/af4472fed794b86e63730702e4b27294a4118d09) Update: Improve report location for new-cap (refs #12334) (#13136) (Milos Djermanovic) -* [`bfa811c`](https://github.com/eslint/eslint/commit/bfa811ceee801fe8ba212a5c879e13743146e909) Fix: init error in extending recommended config (fixes #12707) (#12738) (YeonJuan) -* [`5dfd4eb`](https://github.com/eslint/eslint/commit/5dfd4eb50d84077a57950f119e5de8976070e49a) Docs: examples with arrow functions in no-return-assign (fixes #13135) (#13138) (Anix) -* [`adc8fa8`](https://github.com/eslint/eslint/commit/adc8fa88c9f223b984a3519ed159a055bf933b18) Docs: clarify exceptions in spaced-comment (fixes #13032) (#13126) (Anix) -* [`a784dac`](https://github.com/eslint/eslint/commit/a784dac8bc26f31edbca869b16d6ad91bd4e5cc4) Update: Improve report location newline-per-chained-call (refs #12334) (#13116) (Milos Djermanovic) -* [`5e07574`](https://github.com/eslint/eslint/commit/5e07574a91861fdcab6888b4c6829868030c3a39) Update: Improve report location for space-before-function-paren (#13128) (Chiawen Chen) -* [`d0d32a8`](https://github.com/eslint/eslint/commit/d0d32a8c2a6c60c7e6e2d32a054e5987efd4c263) Sponsors: Sync README with website (ESLint Jenkins) -* [`17e2fe4`](https://github.com/eslint/eslint/commit/17e2fe425168e675fe7607182615e50527eedf53) Update: Improve error message for fatal fixer errors (#13120) (Brad Zacher) -* [`7551f0c`](https://github.com/eslint/eslint/commit/7551f0c6fd12f0295cc7d6377bf1899c092e79d8) Fix: no check for shadowed Object (fixes #12809) (#13115) (Anix) -* [`988d842`](https://github.com/eslint/eslint/commit/988d8428811934943ce13b2d8b833d795ac2bb4a) Fix: add end location to report in no-useless-concat (refs #12334) (#13110) (Milos Djermanovic) -* [`0518ebb`](https://github.com/eslint/eslint/commit/0518ebb840b5bf2d646dbd8a9b3e246e7069eb79) Sponsors: Sync README with website (ESLint Jenkins) -* [`252fd41`](https://github.com/eslint/eslint/commit/252fd4133805f003151e0220b5d89bbb70cfacb1) Sponsors: Sync README with website (ESLint Jenkins) -* [`438dcbb`](https://github.com/eslint/eslint/commit/438dcbb981214d67e8848006ce45afc0fbfa1705) Update: Improve report location for comma-style (refs #12334) (#13111) (Chiawen Chen) -* [`85b7254`](https://github.com/eslint/eslint/commit/85b72548c0c893499c787b82f404348e1b50354d) Update: no-inner-declarations false negative in non-block (fixes #12222) (#13062) (Anix) -* [`6631ef1`](https://github.com/eslint/eslint/commit/6631ef1678bbdd48680fb3025c3692abd0aeec4a) Update: Improve report location for no-empty-function (refs #12334) (#13121) (Milos Djermanovic) -* [`b228f95`](https://github.com/eslint/eslint/commit/b228f958afaf507d6f6f99c90b2075b395733839) Docs: Update README team and sponsors (ESLint Jenkins) -* [`119b7ce`](https://github.com/eslint/eslint/commit/119b7ce97993b84df5af4e4f82e5102e430dfff1) 7.0.0-alpha.3 (ESLint Jenkins) -* [`2531b80`](https://github.com/eslint/eslint/commit/2531b802a1527ea1084905641a17befcb50350c7) Build: changelog update for 7.0.0-alpha.3 (ESLint Jenkins) -* [`78c8cda`](https://github.com/eslint/eslint/commit/78c8cda5a5d82f5f8548c4528a6438d29756bb71) Breaking: RuleTester Improvements (refs eslint/rfcs#25) (#12955) (Milos Djermanovic) -* [`e0f1b6c`](https://github.com/eslint/eslint/commit/e0f1b6c3d62f725b99b8c07654603b559ba43ba9) Update: stricter array index check in no-magic-numbers (fixes #12845) (#12851) (Milos Djermanovic) -* [`362713c`](https://github.com/eslint/eslint/commit/362713c04aa89092b2b98a77fa94a75b3c933fc6) Update: Improve report location for template-curly-spacing (#12813) (Milos Djermanovic) -* [`29f32db`](https://github.com/eslint/eslint/commit/29f32db68c921a857e17ae627923d87b9c8708de) Fix: Change error message logic for implicit file ignore (fixes #12873) (#12878) (Scott Hardin) -* [`eb1a43c`](https://github.com/eslint/eslint/commit/eb1a43ce3113c906800192c3ef766d2ff188776f) Fix: require-await ignore async generators (fixes #12459) (#13048) (Anix) -* [`920465b`](https://github.com/eslint/eslint/commit/920465b5d8d291df8bce7eef8a066b1dd43d8cae) Fix: getNameLocationInGlobalDirectiveComment end location (refs #12334) (#13086) (Milos Djermanovic) -* [`ae14a02`](https://github.com/eslint/eslint/commit/ae14a021bbea5117fe366ae4ed235e8f08dc65a8) Fix: add end location to report in no-extra-bind (refs #12334) (#13083) (Milos Djermanovic) -* [`105384c`](https://github.com/eslint/eslint/commit/105384ccc11dcd7303104fb5a347eda1d4d48357) Update: report operator location in operator-linebreak (refs #12334) (#13102) (Milos Djermanovic) -* [`081e240`](https://github.com/eslint/eslint/commit/081e24022a40d9a026ddd2a85c68cb8c3f18dc53) Update: support globalThis in no-implied-eval (fixes #12670) (#13105) (YeonJuan) -* [`185982d`](https://github.com/eslint/eslint/commit/185982d5615d325ae8b45c2360d5847df4098bda) Breaking: improve plugin resolving (refs eslint/rfcs#47) (#12922) (Toru Nagashima) -* [`0c20bc0`](https://github.com/eslint/eslint/commit/0c20bc068e608869981a10711bba88ffde1539d8) Fix: check assignment property target in camelcase (fixes #13025) (#13027) (YeonJuan) -* [`8d50a7d`](https://github.com/eslint/eslint/commit/8d50a7d82244d4912f3eab62a66c81c76c44a9da) Fix: add end location to report in no-prototype-builtins (refs #12334) (#13087) (Milos Djermanovic) -* [`3e4e7f8`](https://github.com/eslint/eslint/commit/3e4e7f8d429dc70b78c0aefaa37f9c22a1e5fc0f) Fix: incorrect logic for required parens in no-extra-boolean-cast fixer (#13061) (Milos Djermanovic) -* [`6c069f9`](https://github.com/eslint/eslint/commit/6c069f907a04268b671c7f949c04a508df9d42a3) Docs: Add comments to code block in example (#13089) (Kibeom Kwon) -* [`ee1f053`](https://github.com/eslint/eslint/commit/ee1f0531aa534ef9182cf8586f55ad82aaa55e75) Docs: Fix typo (#13092) (Max Coplan) -* [`76324ac`](https://github.com/eslint/eslint/commit/76324ace67893c3d7e38a369114d6128df9ffb65) Docs: Add further reading to rule (#13084) (Max Coplan) -* [`a1370ab`](https://github.com/eslint/eslint/commit/a1370abed72e1fb93e601816d981fa6e46204afb) Update: Report constructor calls in no-obj-calls (#12909) (Milos Djermanovic) -* [`2111c52`](https://github.com/eslint/eslint/commit/2111c52443e7641caad291e0daaea8e2fe6c4562) Upgrade: esquery@1.2.0 (#13076) (Milos Djermanovic) -* [`3f7c9bf`](https://github.com/eslint/eslint/commit/3f7c9bf19615122fb776cdd13da532d860bd945a) Docs: clarify variables option in no-use-before-define (fixes #12986) (#13017) (Anix) -* [`aef9488`](https://github.com/eslint/eslint/commit/aef9488c07d3da4becff6e8d6918824b53086d86) Fix: allow references to external globals in id-blacklist (fixes #12567) (#12987) (Milos Djermanovic) -* [`4955c50`](https://github.com/eslint/eslint/commit/4955c50dc9e89b4077b28e35f065d45e89bdccd7) Fix: remove type arguments in prefer-object-spread (fixes #13058) (#13063) (Milos Djermanovic) -* [`48b122f`](https://github.com/eslint/eslint/commit/48b122f450b14dd27afef4c8115c69fca4f02be1) Breaking: change relative paths with --config (refs eslint/rfcs#37) (#12887) (Toru Nagashima) -* [`085979f`](https://github.com/eslint/eslint/commit/085979fed9a5e24a87e4d92ee79272b59211d03f) Update: consider env in no-implied-eval (fixes #12733) (#12757) (YeonJuan) -* [`9ac5b9e`](https://github.com/eslint/eslint/commit/9ac5b9edf06d16a9216c2c9b02bb20b6aa8ed0ab) Docs: Clarify node_modules is ignored by default (fixes #13006) (#13054) (Mika Kuijpers) -* [`0de91f3`](https://github.com/eslint/eslint/commit/0de91f39a97cdf530cb64edbadde57a2bb41ca86) Docs: removed correct code from incorrect eg (#13060) (Anix) -* [`dbe357d`](https://github.com/eslint/eslint/commit/dbe357de199620675446464f6fd0e35064c4d247) Fix: check template literal in prefer-numeric-literals (fixes #13045) (#13046) (YeonJuan) -* [`2260611`](https://github.com/eslint/eslint/commit/2260611e616bdc2a0bf16d508b60a50772ce7fbb) Fix: added async in allow method in no-empty-function (fixes #12768) (#13036) (Anix) -* [`f3788af`](https://github.com/eslint/eslint/commit/f3788aff615edfbfb7afc4c491bb07d20737531b) Sponsors: Sync README with website (ESLint Jenkins) -* [`e90b29b`](https://github.com/eslint/eslint/commit/e90b29bb1f41d4e5767e33d03db5984f036586ed) Update: Allow testing Suggestions with data in RuleTester (fixes #12606) (#12635) (Milos Djermanovic) -* [`7224eee`](https://github.com/eslint/eslint/commit/7224eee3ff4b4378d3439deb038bf34b116fa48b) Fix: no-plusplus allow comma operands in for afterthought (fixes #13005) (#13024) (Milos Djermanovic) -* [`7598cf8`](https://github.com/eslint/eslint/commit/7598cf816bd854de1dd7d96cf00dec6ecc4564ac) Fix: Newline before eof when creating config via --init (#12952) (Andreas Lind) -* [`183e300`](https://github.com/eslint/eslint/commit/183e3006841c29efdd245c45a72e6cefac86ae35) Update: support globalThis (refs #12670) (#12774) (YeonJuan) -* [`af7af9d`](https://github.com/eslint/eslint/commit/af7af9d32ea8073d2d0d726cc8551351261a170f) Docs: Update governance (#13055) (Nicholas C. Zakas) -* [`31d5eb3`](https://github.com/eslint/eslint/commit/31d5eb3e60b6c2ee26976721f07cc89d60867659) Sponsors: Sync README with website (ESLint Jenkins) -* [`95613d4`](https://github.com/eslint/eslint/commit/95613d46b7900b3d9757a7f6959d5dfb262f29fc) Upgrade: espree@6.2.1 (#13026) (Kai Cataldo) -* [`f1525dc`](https://github.com/eslint/eslint/commit/f1525dc45dfdbbe31e724671270785b41cffc6bd) Sponsors: Sync README with website (ESLint Jenkins) -* [`0243549`](https://github.com/eslint/eslint/commit/0243549db4d237cb78e720d55a9cae89b91f6830) Fix: camelcase false positive with computed property (fixes #13022) (#13023) (Milos Djermanovic) -* [`bc0c02c`](https://github.com/eslint/eslint/commit/bc0c02cd0368559c7a7b1510eb4620022a4cc31c) Chore: added lock files to gitignore (#13015) (Anix) -* [`79ac6cd`](https://github.com/eslint/eslint/commit/79ac6cd2d8e4c32e03dfea10a957806845058573) Docs: added less confusing explanation for func-style (fixes #12900) (#13004) (Anix) -* [`26267ed`](https://github.com/eslint/eslint/commit/26267ed70270ef746b785c09e267f815bf7c596a) Chore: update GitHub Actions (#12984) (Pig Fang) -* [`1299705`](https://github.com/eslint/eslint/commit/12997058626b5167ba4b9d2ae0d0ea965a01c4be) Update: acorn version (#13016) (Idan Avrahami) -* [`6cef0d5`](https://github.com/eslint/eslint/commit/6cef0d50a0d131bc8897799a54e1af1d38606db4) Fix: Check division operator in astUtils.canTokensBeAdjacent (#12879) (Milos Djermanovic) -* [`fd8e1f5`](https://github.com/eslint/eslint/commit/fd8e1f52110cada542a120750236fd1ec8779336) Sponsors: Sync README with website (ESLint Jenkins) -* [`472025f`](https://github.com/eslint/eslint/commit/472025f2814d0360fe8d4cddbcba049982e1cd43) Chore: update space-before-function-paren in eslint-config-eslint (#12966) (Kai Cataldo) -* [`fd8c42a`](https://github.com/eslint/eslint/commit/fd8c42ada52f0ae2488ad96ee8fee675f63134ce) Sponsors: Sync README with website (ESLint Jenkins) -* [`c615eae`](https://github.com/eslint/eslint/commit/c615eae0be3c6c167c6f77ec7a73e7adca0ecef0) 7.0.0-alpha.2 (ESLint Jenkins) -* [`2e8f193`](https://github.com/eslint/eslint/commit/2e8f193ebc970f07ea37d267c8bce02d74c285a8) Build: changelog update for 7.0.0-alpha.2 (ESLint Jenkins) -* [`a5b41a7`](https://github.com/eslint/eslint/commit/a5b41a75b57572e97476b06ad39b768e15b9d844) Update: no-restricted-modules handle TemplateLiteral (fixes #12926) (#12927) (Michal Piechowiak) -* [`051567a`](https://github.com/eslint/eslint/commit/051567adca7ca56d691bcda76f54ed72e3eae367) Update: check identifier in array pattern in id-length (fixes #12832) (#12839) (YeonJuan) -* [`4af06fc`](https://github.com/eslint/eslint/commit/4af06fc49029dac5c9acfd53f01fd9527bfbb4aa) Breaking: Test with an unknown error property should fail in RuleTester (#12096) (Milos Djermanovic) -* [`9038a29`](https://github.com/eslint/eslint/commit/9038a29569548c0563c29dbe9f7dae280ff3addd) Update: func-names `as-needed` false negative with AssignmentPattern (#12932) (Milos Djermanovic) -* [`afde78b`](https://github.com/eslint/eslint/commit/afde78b125747ce5ad9e5f871122a0d370dd0152) Fix: curly removes necessary braces between if and else (fixes #12928) (#12943) (Milos Djermanovic) -* [`4797fb2`](https://github.com/eslint/eslint/commit/4797fb2c29db97bc5cd23b40e5a9235fef1ea06a) Fix: arrow-body-style crash with object literal body (fixes #12884) (#12886) (Milos Djermanovic) -* [`afa9aac`](https://github.com/eslint/eslint/commit/afa9aac6de9444e935a55b46311e5b5a58f86063) Breaking: class default `true` computed-property-spacing (fixes #12812) (#12915) (Milos Djermanovic) -* [`b8e20d3`](https://github.com/eslint/eslint/commit/b8e20d33b7d6645266beef09cd231afaf5054328) Docs: Mention TypeScript's compiler check (#12903) (Benny Neugebauer) -* [`de14d1c`](https://github.com/eslint/eslint/commit/de14d1ce0cf422b4100a686abb906f53fbf905b3) Fix: wrap-iife autofix removes mandatory parentheses (#12905) (Milos Djermanovic) -* [`5775b06`](https://github.com/eslint/eslint/commit/5775b06a74573cbe068bea56b1d2376421f5e831) Fix: Optionally allow underscores in member names (#11972) (Edgardo Avilés) -* [`e997f32`](https://github.com/eslint/eslint/commit/e997f32b936463ac38e8b0034f764c47502e56a8) Docs: Updated arrow-parens for minor grammar issue (#12962) (Tom) -* [`7d52151`](https://github.com/eslint/eslint/commit/7d52151bcd5d5524f240588436a8808162be187f) Breaking: classes default `true` in accessor-pairs (fixes #12811) (#12919) (Milos Djermanovic) -* [`cf14355`](https://github.com/eslint/eslint/commit/cf14355e34a6757e15806f8e493553bd7110fb36) Docs: Fix links to custom parsers doc (#12965) (Brandon Mills) -* [`0dfc3ff`](https://github.com/eslint/eslint/commit/0dfc3ff9fb228e1d9b1df99de50033ce9140ac24) Fix: add end location to report in no-eval (#12960) (Milos Djermanovic) -* [`f479f6f`](https://github.com/eslint/eslint/commit/f479f6fe2eb95156e22bebfccb39a7fc1f19e9c0) Docs: References correct config file name (#12885) (Patrick Kilgore) -* [`78182e4`](https://github.com/eslint/eslint/commit/78182e45e0178d9eac2591944ef4daee21d2cb44) Breaking: Add new rules to eslint:recommended (fixes #12911) (#12920) (Milos Djermanovic) -* [`8d5c434`](https://github.com/eslint/eslint/commit/8d5c434f721142be74c7515aaa935668a15b79b1) Docs: fix category descriptions for site generation (fixes #12894) (#12930) (Kai Cataldo) -* [`05380e6`](https://github.com/eslint/eslint/commit/05380e6e7e19a79d26ea6d6b44a8d5ee7cde51c8) Docs: Remove claim about semicolons from docs (#12944) (Luke Sikina) -* [`aa9d725`](https://github.com/eslint/eslint/commit/aa9d72525054e641231a2960a2e37b3716228056) Sponsors: Sync README with website (ESLint Jenkins) -* [`7747177`](https://github.com/eslint/eslint/commit/7747177f8504961059b7c56bdb70a820bd1114c1) Update: report rename id destructuring in id-blacklist (fixes #12807) (#12923) (YeonJuan) -* [`6423e11`](https://github.com/eslint/eslint/commit/6423e11c0bedd3b4e661ab554316bdeb1fc1ee3c) Breaking: check unnamed default export in func-names (fixes #12194) (#12195) (Chiawen Chen) -* [`77df505`](https://github.com/eslint/eslint/commit/77df505d9a08496a8eaefeca4f885f54a21d5c5e) Update: check renaming identifier in object destructuring (fixes 12827) (#12881) (YeonJuan) -* [`41de9df`](https://github.com/eslint/eslint/commit/41de9df41a30a4300243bfe4ca26f716a787b2fc) Update: enforceForLogicalOperands no-extra-boolean-cast (fixes #12137) (#12734) (jmoore914) -* [`98a9b01`](https://github.com/eslint/eslint/commit/98a9b019e52f344c1a6bc2f704c227f89692afe3) 7.0.0-alpha.1 (ESLint Jenkins) -* [`e9f1073`](https://github.com/eslint/eslint/commit/e9f1073f748f8c22f754d145b1ba193e7ce82215) Build: changelog update for 7.0.0-alpha.1 (ESLint Jenkins) -* [`f702b1a`](https://github.com/eslint/eslint/commit/f702b1a54820d2b4e4993dcded99f551a98b490f) Add missing plugin reference (#12796) (Eduard Bardají Puig) -* [`1f1424c`](https://github.com/eslint/eslint/commit/1f1424cb200e609d58645f6c54739e11469e6265) Fix: fix inconsistently works option in no-extra-parens (fixes #12717) (#12843) (YeonJuan) -* [`b5adcaa`](https://github.com/eslint/eslint/commit/b5adcaab93f388f1d8e9d35d6f5e8c2994240850) Fix: make YieldExpression throwable (fixes #12880) (#12897) (YeonJuan) -* [`4293229`](https://github.com/eslint/eslint/commit/4293229709dde105692347241513766e953664dd) Breaking: use-isnan enforceForSwitchCase default `true` (fixes #12810) (#12913) (Milos Djermanovic) -* [`cf38d0d`](https://github.com/eslint/eslint/commit/cf38d0d939b62f3670cdd59f0143fd896fccd771) Breaking: change default ignore pattern (refs eslint/rfcs#51) (#12888) (Toru Nagashima) -* [`bfe1dc4`](https://github.com/eslint/eslint/commit/bfe1dc4e614640cb69032afbb5851c1493f537e3) Breaking: no-dupe-class-members checks some computed keys (fixes #12808) (#12837) (Milos Djermanovic) -* [`1ee6b63`](https://github.com/eslint/eslint/commit/1ee6b6388305a8671c8d4c3cf30c2dbf18a1ff7e) Update: check template literal in yoda (fixes #12863) (#12876) (YeonJuan) -* [`0ae7041`](https://github.com/eslint/eslint/commit/0ae70417af70ad565450d9e779ae78c05f6a51e2) Sponsors: Sync README with website (ESLint Jenkins) -* [`1907e57`](https://github.com/eslint/eslint/commit/1907e57362f7d5f7a02a5a78f24ac3347f868e93) Chore: add Twitter and Open Collective badge (#12877) (Kai Cataldo) -* [`95e0586`](https://github.com/eslint/eslint/commit/95e0586c95e6953d11983d1d11891ed30318109a) Fix: id-blacklist false positives on renamed imports (#12831) (Milos Djermanovic) -* [`b7f0d20`](https://github.com/eslint/eslint/commit/b7f0d200c125b3d233ccafaabdaa61c66dc60e3c) Chore: Use consistent badge style (#12825) (fisker Cheung) -* [`3734a66`](https://github.com/eslint/eslint/commit/3734a669983de7d5107ba8f39b291c6e3116489f) Chore: use ids for messages (#12859) (Gareth Jones) -* [`824d235`](https://github.com/eslint/eslint/commit/824d23585c205f2993716585cb6f55dfbe4a33f0) Docs: add errorOnUnmatchedPattern option to CLIEngine (#12834) (Arthur Denner) -* [`439c833`](https://github.com/eslint/eslint/commit/439c83342c364ba3ce5168d54e165b1fe3e35630) Update: array-callback-return checks Array.forEach (fixes #12551) (#12646) (Gabriel R Sezefredo) -* [`33efd71`](https://github.com/eslint/eslint/commit/33efd71d7c3496b4b9cbfe006280527064940826) Docs: Fix spelling mistakes (#12861) (Bryan Mishkin) -* [`a5b3c5f`](https://github.com/eslint/eslint/commit/a5b3c5fa4edc2312534af0d9f0911f68144f8baf) Docs: Update README team and sponsors (ESLint Jenkins) -* [`0cae920`](https://github.com/eslint/eslint/commit/0cae9203a8077184ad6beb00028fd376cc806f34) Chore: rename shadowed global (#12862) (Tony Brix) -* [`055b80d`](https://github.com/eslint/eslint/commit/055b80dc89bba2a5ab22f7a27deb40135b5cacfa) Chore: Fix typo in complexity.js (#12864) (Kyle Shevlin) -* [`d6c313d`](https://github.com/eslint/eslint/commit/d6c313de794ea0671d35b5027288cd2ea456c0b5) Docs: add missing eslint comments in prefer-regex-literals examples (#12858) (Milos Djermanovic) -* [`7d551ab`](https://github.com/eslint/eslint/commit/7d551ab8cbf2d3a802b0d0685379aa075fe9d7c0) Sponsors: Sync README with website (ESLint Jenkins) -* [`540de8e`](https://github.com/eslint/eslint/commit/540de8e34d08f4b17b66b06d13927acb7552357a) Sponsors: Sync README with website (ESLint Jenkins) -* [`ac5d515`](https://github.com/eslint/eslint/commit/ac5d515252c226f030fa646bf7635a12a3b856fe) Sponsors: Sync README with website (ESLint Jenkins) -* [`dadc892`](https://github.com/eslint/eslint/commit/dadc8927820576c60b48bcbc7d5a9056a6279d30) Fix: operator-assignment crash on adjacent division assignment (#12844) (Milos Djermanovic) -* [`9f39ef0`](https://github.com/eslint/eslint/commit/9f39ef0d4b398c7c09ceef89128da448680d587c) Chore: typo in PULL_REQUEST_TEMPLATE.md (#12848) (Balázs Orbán) -* [`a60d5cd`](https://github.com/eslint/eslint/commit/a60d5cd2325ca72fa1b272b0b90ccd7904b92062) Chore: typo in no-irregular-whitespace.js (#12847) (Balázs Orbán) -* [`691d19a`](https://github.com/eslint/eslint/commit/691d19a2872bffab50c0024d488b8cb33504cc83) Chore: add missing `ecmaVersion` 2020/11 type value (#12833) (Piotr Błażejewicz (Peter Blazejewicz)) -* [`516ddb3`](https://github.com/eslint/eslint/commit/516ddb37d39502e5a8c88a017ae3bad05046f41d) Sponsors: Sync README with website (ESLint Jenkins) -* [`a9d92f9`](https://github.com/eslint/eslint/commit/a9d92f991d69902a9150db373590e2ed54dec988) Fix: radix rule crash on disabled globals (#12824) (Milos Djermanovic) -* [`03a69db`](https://github.com/eslint/eslint/commit/03a69dbe86d5b5768a310105416ae726822e3c1c) Update: check template literal in no-proto, no-iterator (fixes #12801) (#12806) (YeonJuan) -* [`562e784`](https://github.com/eslint/eslint/commit/562e7845946a490f2e173a0bcd1af631070a4eef) Update: fix no-magic-numbers false negative with ignoreArrayIndexes (#12805) (Milos Djermanovic) -* [`f5b9656`](https://github.com/eslint/eslint/commit/f5b96564f732962f46755adbb33c49fae9af6a92) Chore: add test for no-constant-condition (#12836) (Milos Djermanovic) -* [`533c114`](https://github.com/eslint/eslint/commit/533c1140dc98bebdc3ae8334ab2e6c27c7df0c21) Fix: multiline-comment-style rule add extra space after * (fixes #12785) (#12823) (Karthik Priyadarshan) -* [`0460748`](https://github.com/eslint/eslint/commit/0460748cda67ddc4a4cb0db3cdf187a742d09bf8) Update: check template literal in no-constant-condition (fixes #12815) (#12816) (YeonJuan) -* [`80309c3`](https://github.com/eslint/eslint/commit/80309c3791188ac5d1c4eebc99ede323a55336e6) Fix: no-constant-condition doesn't introspect arrays (fixes #12225) (#12307) (Sean Gray) -* [`10a79a6`](https://github.com/eslint/eslint/commit/10a79a672b42d51539bcd6ace482be7afa5f34f8) Chore: Adopt `eslint-plugin/require-meta-docs-description` internally (#12762) (Bryan Mishkin) -* [`aea1729`](https://github.com/eslint/eslint/commit/aea172998ec4e2af1d9186b6767c3f34428945f4) Docs: Fix anchor links in Node.js API TOC (#12821) (Matija Marohnić) -* [`1b8a3ce`](https://github.com/eslint/eslint/commit/1b8a3ce15237b9085f2761dcf73655207e6169a6) Sponsors: Sync README with website (ESLint Jenkins) -* [`c2217c0`](https://github.com/eslint/eslint/commit/c2217c04d6c82b160a21b00fca39c8acec543403) Breaking: make `radix` rule stricter (#12608) (fisker Cheung) -* [`e03a7b3`](https://github.com/eslint/eslint/commit/e03a7b311cb9ddf55914b1496683609bd564de2f) 7.0.0-alpha.0 (ESLint Jenkins) -* [`c8c1b2b`](https://github.com/eslint/eslint/commit/c8c1b2b2efadfcd3c04aaf15bd793c5b4dd84cb6) Build: changelog update for 7.0.0-alpha.0 (ESLint Jenkins) -* [`1aa021d`](https://github.com/eslint/eslint/commit/1aa021d77fdd2c68d7b7d2f4603252110c414b32) Breaking: lint `overrides` files (fixes #10828, refs eslint/rfcs#20) (#12677) (Toru Nagashima) -* [`e59d775`](https://github.com/eslint/eslint/commit/e59d77536bd8db57e8a75cd5245f6f320aa699f8) Update: Separate pattern/expression options for array-element-newline (#11796) (jacobparish) -* [`f8f115a`](https://github.com/eslint/eslint/commit/f8f115af6e10539e6cad485588187cb11917f8c9) Update: treat comment tokens in template-curly-spacing (fixes #12744) (#12775) (YeonJuan) -* [`b50179d`](https://github.com/eslint/eslint/commit/b50179def3fedbd95fdeab25e32c2511867eb760) Breaking: Check assignment targets in no-extra-parens (#12490) (Milos Djermanovic) -* [`de4fa7c`](https://github.com/eslint/eslint/commit/de4fa7c65c7befefa64d1605550267071ee56a5d) Fix: wrong indent at tagged template in indent (fixes #12122) (#12596) (YeonJuan) -* [`d86a5bb`](https://github.com/eslint/eslint/commit/d86a5bbb1987d858d4963f647b0af5c1fd924b4f) Breaking: Check flatMap in array-callback-return (fixes #12235) (#12765) (Milos Djermanovic) -* [`cf46df7`](https://github.com/eslint/eslint/commit/cf46df70158a4ed4c09d5c9d655c07dc6df3ff5e) Breaking: description in directive comments (refs eslint/rfcs#33) (#12699) (Toru Nagashima) -* [`7350589`](https://github.com/eslint/eslint/commit/7350589a5bdfc9d75d1ff19364f476eec44c3911) Breaking: some rules recognize bigint literals (fixes #11803) (#12701) (Toru Nagashima) -* [`16a1c1f`](https://github.com/eslint/eslint/commit/16a1c1f79bc0a4cc1c3a87e98d220041de88bb93) Fix: prefer-object-spread false positives with accessors (fixes #12086) (#12784) (Milos Djermanovic) -* [`f9774ec`](https://github.com/eslint/eslint/commit/f9774ec11b0ebe63fb16a97b97890efb84699548) New: Add default-case-last rule (fixes #12665) (#12668) (Milos Djermanovic) -* [`9a93d9e`](https://github.com/eslint/eslint/commit/9a93d9ef389c49a133c4df4f9843927f5f806423) Update: fix no-restricted-imports export * false negative (fixes #12737) (#12798) (Milos Djermanovic) -* [`0d8c0af`](https://github.com/eslint/eslint/commit/0d8c0affe1ae7ecf228cdf91b490921f7e9d1fdb) Fix: improve report location for computed-property-spacing (#12795) (Milos Djermanovic) -* [`756b95d`](https://github.com/eslint/eslint/commit/756b95d59fb97cd9b3f3adf98cebf529fe4842a2) Fix: id-blacklist should ignore ObjectPatterns (fixes #12787) (#12792) (JP Ramassini) -* [`561b6d4`](https://github.com/eslint/eslint/commit/561b6d4726f3e77dd40ba0d340ca7f08429cd2eb) Chore: add prerequisites checklist to PR template (#12790) (Kai Cataldo) -* [`01ff791`](https://github.com/eslint/eslint/commit/01ff7910af86fc45b76e883bc9ab00c9be3b50ac) Fix: Display pipe character correctly in test output (#12771) (Brad Zacher) -* [`68becbd`](https://github.com/eslint/eslint/commit/68becbd84e8a0693409d36f2be10679c483e233a) Update: fix no-restricted-imports importNames reporting (fixes #12282) (#12711) (Andrey Alexandrov) -* [`ae959b6`](https://github.com/eslint/eslint/commit/ae959b691fb148ac8b474c924c8cb01ef61c436d) Update: report double extra parens in no-extra-parens (fixes #12127) (#12697) (YeonJuan) -* [`02fcc05`](https://github.com/eslint/eslint/commit/02fcc055710e8d69d986f1e682cae2014ad881e2) Docs: Improve sort-keys (#12791) (Steven Vachon) -* [`35cd958`](https://github.com/eslint/eslint/commit/35cd95893be0afd8c954cbcf9268c2aa045b7d5b) Sponsors: Sync README with website (ESLint Jenkins) -* [`a1d999c`](https://github.com/eslint/eslint/commit/a1d999c6b4e51c317ad409110be7be214ff9f7c6) New: Add no-useless-backreference rule (fixes #12673) (#12690) (Milos Djermanovic) -* [`b2c6209`](https://github.com/eslint/eslint/commit/b2c62096a8b318765d618cab222240f87d73063b) Update: fix no-extra-parens CallExpression#callee false negatives (#12743) (Milos Djermanovic) -* [`14b42c3`](https://github.com/eslint/eslint/commit/14b42c386be3387c415267b789f277e1294d4567) Update: fix counting jsx comment len in max-len (fixes #12213) (#12661) (YeonJuan) -* [`e632c31`](https://github.com/eslint/eslint/commit/e632c31d7e5363f1347b787702ecd4a85f5c11a2) Upgrade: several dependencies (#12753) (Toru Nagashima) -* [`25eb703`](https://github.com/eslint/eslint/commit/25eb703c8758563988ffb497a53f89a3ed345399) Docs: fix dead link in max-lines rule docs (#12766) (Christian Bundy) -* [`9dfc850`](https://github.com/eslint/eslint/commit/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d) Chore: Refactor to use messageId in a number of rules (#12715) (Brad Zacher) -* [`1118fce`](https://github.com/eslint/eslint/commit/1118fceb49af3436b8dcd0c6089f913cedf9a329) Breaking: runtime-deprecation on '~/.eslintrc' (refs eslint/rfcs#32) (#12678) (Toru Nagashima) -* [`2c28fbb`](https://github.com/eslint/eslint/commit/2c28fbbb563a44282bef0c9fcc9be29d611cc83b) Breaking: drop Node.js 8 support (refs eslint/rfcs#44) (#12700) (Toru Nagashima) -* [`098b67d`](https://github.com/eslint/eslint/commit/098b67d04a4b4dc8ef4faa6434c6ef5abbde3ed3) Docs: fix minor typo in brace-style.md (#12749) (Marko Kaznovac) -* [`313f70a`](https://github.com/eslint/eslint/commit/313f70ac9a3cf5d1558d2427b00dd75666e18cf4) Update: add outerIIFEBody: "off" to indent rule (fixes #11377) (#12706) (Kai Cataldo) -* [`b77b858`](https://github.com/eslint/eslint/commit/b77b8585e33fc4bb438a0e11ca8177c7eb91dbd8) Chore: fix separateRequires tests for one-var rule (#12709) (Milos Djermanovic) -* [`e4df7df`](https://github.com/eslint/eslint/commit/e4df7dfb0199badb61d2c03ff4f7e4be735279d9) Chore: add JSDoc types for RuleTester test cases (#12325) (Chiawen Chen) -* [`b23ad0d`](https://github.com/eslint/eslint/commit/b23ad0d789a909baf8d7c41a35bc53df932eaf30) Docs: change a broken link in working-with-rules.md (#12732) (Damien Cassou) -* [`3fa39a6`](https://github.com/eslint/eslint/commit/3fa39a633b37544fec7cedfc1f2b0e62e9312a72) Update: Handle locally unsupported regex in computed property keys (#12056) (Milos Djermanovic) -* [`4744397`](https://github.com/eslint/eslint/commit/474439720258b1a64b305c31588f803104fa4aaf) Chore: remove unused code in max-lines-per-function (#12659) (YeonJuan) -* [`4e16957`](https://github.com/eslint/eslint/commit/4e169576a526023ee297d5bc8b37eedba229f63d) Build: update browser build (#12693) (Toru Nagashima) -* [`00ddfff`](https://github.com/eslint/eslint/commit/00ddfffe6b4b4244e4680b0f92f2c6697fad136f) Fix: Windows path parsing for JUnit (fixes #12507) (#12509) (Michael Wall) -* [`985dac3`](https://github.com/eslint/eslint/commit/985dac35e3c367f0f99d1f0e766e06a1d9818dd4) New: Add no-restricted-exports rule (fixes #10428) (#12546) (Milos Djermanovic) -* [`1aff21b`](https://github.com/eslint/eslint/commit/1aff21bb54da44cef0b6e378a34a74265863b930) Fix: no-mixed-spaces-and-tabs reports multiline strings (#12566) (Milos Djermanovic) -* [`8f1020f`](https://github.com/eslint/eslint/commit/8f1020ff711b0c57d590bf666e2841f64186d083) Update: no-void add an option to allow void as a statement (#12613) (Brad Zacher) -* [`bb6cf50`](https://github.com/eslint/eslint/commit/bb6cf5082623ffb67bb1495fee52c0610ee5f421) Update: Add offsetTernaryExpressions option for indent rule (#12556) (Adam Stankiewicz) -* [`39f5a45`](https://github.com/eslint/eslint/commit/39f5a453579b2ad732212edeb71f84ecb0991f97) Chore: add test cases for for-direction (#12698) (YeonJuan) -* [`b340304`](https://github.com/eslint/eslint/commit/b3403045e535921df6d34785a4ce053e14ba27fd) Chore: Add extra test, improve docs (#12492) (Kevin Partington) -* [`827259e`](https://github.com/eslint/eslint/commit/827259ea009f98a0fdf3f7ebf1bfb6cd661ce28d) Build: package.json update for eslint-config-eslint release (ESLint Jenkins) - -v7.0.0-rc.0 - April 24, 2020 - -* [`0b1d65a`](https://github.com/eslint/eslint/commit/0b1d65a45aa5dfe08cd596c420490e81b546317e) Update: Improve report location for array-callback-return (refs #12334) (#13109) (Milos Djermanovic) -* [`d85e291`](https://github.com/eslint/eslint/commit/d85e291d1b56960373031f2562547df7285444f7) Fix: yoda left string fix for exceptRange (fixes #12883) (#13052) (Anix) -* [`2ce6bed`](https://github.com/eslint/eslint/commit/2ce6bed04cad376003f70447ece4b6578c142bfd) Chore: added tests for nested arrays (#13145) (Anix) -* [`d3aac53`](https://github.com/eslint/eslint/commit/d3aac532f6a24c633f85dedf0e552eabd22d0956) Update: report backtick loc in no-unexpected-multiline (refs #12334) (#13142) (Milos Djermanovic) -* [`8e7a2d9`](https://github.com/eslint/eslint/commit/8e7a2d93595cfe0c1597af0e7873853369251c0b) Fix: func-call-spacing "never" reports wrong message (fixes #13190) (#13193) (Milos Djermanovic) -* [`bcafd0f`](https://github.com/eslint/eslint/commit/bcafd0f8508e19ab8087a35fac7b97fc4295df3e) Update: Add ESLint API (refs eslint/rfcs#40) (#12939) (Kai Cataldo) -* [`3eeae56`](https://github.com/eslint/eslint/commit/3eeae565bfb0834a31e5d3a253a17bbf4027cf88) Upgrade: some (dev) deps (#13155) (薛定谔的猫) -* [`6b7030b`](https://github.com/eslint/eslint/commit/6b7030b1a1e1e3d1a3953cfa9722074d6a6fc1a9) Chore: Run tests on Node.js v14 (#13210) (fisker Cheung) -* [`ebc28d7`](https://github.com/eslint/eslint/commit/ebc28d76658f1f3e4e8d56e70a25752b5d4a6686) Fix: Remove default .js from --ext CLI option (#13176) (Brandon Mills) -* [`5c1bdeb`](https://github.com/eslint/eslint/commit/5c1bdebcf728062fd41583886830c89b65485df9) Update: Improve report location for getter-return (refs #12334) (#13164) (Milos Djermanovic) -* [`56d2bee`](https://github.com/eslint/eslint/commit/56d2beea0ea0b6395a6d4a3e116ea6a964ff92f3) Docs: fix typos (#13204) (Nitin Kumar) -* [`e13256e`](https://github.com/eslint/eslint/commit/e13256e395cc413ce45a66c8562621d48440d8f4) Chore: use espree.latestEcmaVersion in config-initializer (#13157) (Kai Cataldo) -* [`e4f57b7`](https://github.com/eslint/eslint/commit/e4f57b7d7b8b7441a2217a217dcda1e7bfff516a) Chore: add nested array tests for array-element-newline (#13161) (Anix) -* [`63ac918`](https://github.com/eslint/eslint/commit/63ac91877668205aaa50495a9615806967e6e4cf) Sponsors: Sync README with website (ESLint Jenkins) -* [`516f253`](https://github.com/eslint/eslint/commit/516f253729daeeb9da5de5e9b38606ff9c1aae71) Docs: Adds import example for object-curly-newline rule (refs #12018) (#13177) (Luke Lewis) -* [`5a0e84e`](https://github.com/eslint/eslint/commit/5a0e84e9498a946a3e8491a370e012354e087fe0) Sponsors: Sync README with website (ESLint Jenkins) -* [`b398e0b`](https://github.com/eslint/eslint/commit/b398e0b9ff455e4e7d70f19d5ccea5819c21eb86) Docs: add rule comment in prefer-rest-params doc (#13191) (YeonJuan) -* [`ffaa4ba`](https://github.com/eslint/eslint/commit/ffaa4ba5e2bb1a51a78a2b2c028cbe2efc9e5165) Sponsors: Sync README with website (ESLint Jenkins) -* [`932869b`](https://github.com/eslint/eslint/commit/932869b3251b04c4ad5fa72279cb2a56a3e67b55) Sponsors: Sync README with website (ESLint Jenkins) -* [`54630f0`](https://github.com/eslint/eslint/commit/54630f0063fa66318476473757b5912465d4caf2) Sponsors: Sync README with website (ESLint Jenkins) -* [`c9a5035`](https://github.com/eslint/eslint/commit/c9a503571a4662f6c2d31cabc7fd7819ec388150) Fix: newBasePath should be an absolute path (fixes #12850) (#13078) (Nick Harris) -* [`e7c1d4b`](https://github.com/eslint/eslint/commit/e7c1d4b2ac56149a517d4b0000230348a641f1d3) Update: deprecate Node.js & CommonJS rules (#12898) (Kai Cataldo) -* [`95e1c70`](https://github.com/eslint/eslint/commit/95e1c70cebde210a990ee786ec7ab1c8e522edb8) Upgrade: levn@0.4.1 (fixes #9366) (#13140) (Kai Cataldo) -* [`c41de38`](https://github.com/eslint/eslint/commit/c41de382a330d4789488fd2dcf6db5a3163bb5d2) Docs: fix curly multi-or-nest examples with comments (refs #12972) (#13151) (Milos Djermanovic) -* [`57221d5`](https://github.com/eslint/eslint/commit/57221d58c60e757062242f30ed574e0502fc7c31) Docs: fix eslint comment in no-inner-declarations examples (#13152) (Milos Djermanovic) -* [`301b450`](https://github.com/eslint/eslint/commit/301b450ecd1985ae84d1915124f4638ab2a2e6de) Fix: no-extra-parens export default sequence expression false positive (#13096) (Milos Djermanovic) -* [`af4472f`](https://github.com/eslint/eslint/commit/af4472fed794b86e63730702e4b27294a4118d09) Update: Improve report location for new-cap (refs #12334) (#13136) (Milos Djermanovic) -* [`bfa811c`](https://github.com/eslint/eslint/commit/bfa811ceee801fe8ba212a5c879e13743146e909) Fix: init error in extending recommended config (fixes #12707) (#12738) (YeonJuan) -* [`5dfd4eb`](https://github.com/eslint/eslint/commit/5dfd4eb50d84077a57950f119e5de8976070e49a) Docs: examples with arrow functions in no-return-assign (fixes #13135) (#13138) (Anix) -* [`adc8fa8`](https://github.com/eslint/eslint/commit/adc8fa88c9f223b984a3519ed159a055bf933b18) Docs: clarify exceptions in spaced-comment (fixes #13032) (#13126) (Anix) -* [`a784dac`](https://github.com/eslint/eslint/commit/a784dac8bc26f31edbca869b16d6ad91bd4e5cc4) Update: Improve report location newline-per-chained-call (refs #12334) (#13116) (Milos Djermanovic) -* [`5e07574`](https://github.com/eslint/eslint/commit/5e07574a91861fdcab6888b4c6829868030c3a39) Update: Improve report location for space-before-function-paren (#13128) (Chiawen Chen) -* [`d0d32a8`](https://github.com/eslint/eslint/commit/d0d32a8c2a6c60c7e6e2d32a054e5987efd4c263) Sponsors: Sync README with website (ESLint Jenkins) -* [`17e2fe4`](https://github.com/eslint/eslint/commit/17e2fe425168e675fe7607182615e50527eedf53) Update: Improve error message for fatal fixer errors (#13120) (Brad Zacher) -* [`7551f0c`](https://github.com/eslint/eslint/commit/7551f0c6fd12f0295cc7d6377bf1899c092e79d8) Fix: no check for shadowed Object (fixes #12809) (#13115) (Anix) -* [`988d842`](https://github.com/eslint/eslint/commit/988d8428811934943ce13b2d8b833d795ac2bb4a) Fix: add end location to report in no-useless-concat (refs #12334) (#13110) (Milos Djermanovic) -* [`0518ebb`](https://github.com/eslint/eslint/commit/0518ebb840b5bf2d646dbd8a9b3e246e7069eb79) Sponsors: Sync README with website (ESLint Jenkins) -* [`252fd41`](https://github.com/eslint/eslint/commit/252fd4133805f003151e0220b5d89bbb70cfacb1) Sponsors: Sync README with website (ESLint Jenkins) -* [`438dcbb`](https://github.com/eslint/eslint/commit/438dcbb981214d67e8848006ce45afc0fbfa1705) Update: Improve report location for comma-style (refs #12334) (#13111) (Chiawen Chen) -* [`85b7254`](https://github.com/eslint/eslint/commit/85b72548c0c893499c787b82f404348e1b50354d) Update: no-inner-declarations false negative in non-block (fixes #12222) (#13062) (Anix) -* [`6631ef1`](https://github.com/eslint/eslint/commit/6631ef1678bbdd48680fb3025c3692abd0aeec4a) Update: Improve report location for no-empty-function (refs #12334) (#13121) (Milos Djermanovic) -* [`b228f95`](https://github.com/eslint/eslint/commit/b228f958afaf507d6f6f99c90b2075b395733839) Docs: Update README team and sponsors (ESLint Jenkins) - -v7.0.0-alpha.3 - March 27, 2020 - -* [`78c8cda`](https://github.com/eslint/eslint/commit/78c8cda5a5d82f5f8548c4528a6438d29756bb71) Breaking: RuleTester Improvements (refs eslint/rfcs#25) (#12955) (Milos Djermanovic) -* [`e0f1b6c`](https://github.com/eslint/eslint/commit/e0f1b6c3d62f725b99b8c07654603b559ba43ba9) Update: stricter array index check in no-magic-numbers (fixes #12845) (#12851) (Milos Djermanovic) -* [`362713c`](https://github.com/eslint/eslint/commit/362713c04aa89092b2b98a77fa94a75b3c933fc6) Update: Improve report location for template-curly-spacing (#12813) (Milos Djermanovic) -* [`29f32db`](https://github.com/eslint/eslint/commit/29f32db68c921a857e17ae627923d87b9c8708de) Fix: Change error message logic for implicit file ignore (fixes #12873) (#12878) (Scott Hardin) -* [`eb1a43c`](https://github.com/eslint/eslint/commit/eb1a43ce3113c906800192c3ef766d2ff188776f) Fix: require-await ignore async generators (fixes #12459) (#13048) (Anix) -* [`920465b`](https://github.com/eslint/eslint/commit/920465b5d8d291df8bce7eef8a066b1dd43d8cae) Fix: getNameLocationInGlobalDirectiveComment end location (refs #12334) (#13086) (Milos Djermanovic) -* [`ae14a02`](https://github.com/eslint/eslint/commit/ae14a021bbea5117fe366ae4ed235e8f08dc65a8) Fix: add end location to report in no-extra-bind (refs #12334) (#13083) (Milos Djermanovic) -* [`105384c`](https://github.com/eslint/eslint/commit/105384ccc11dcd7303104fb5a347eda1d4d48357) Update: report operator location in operator-linebreak (refs #12334) (#13102) (Milos Djermanovic) -* [`081e240`](https://github.com/eslint/eslint/commit/081e24022a40d9a026ddd2a85c68cb8c3f18dc53) Update: support globalThis in no-implied-eval (fixes #12670) (#13105) (YeonJuan) -* [`185982d`](https://github.com/eslint/eslint/commit/185982d5615d325ae8b45c2360d5847df4098bda) Breaking: improve plugin resolving (refs eslint/rfcs#47) (#12922) (Toru Nagashima) -* [`0c20bc0`](https://github.com/eslint/eslint/commit/0c20bc068e608869981a10711bba88ffde1539d8) Fix: check assignment property target in camelcase (fixes #13025) (#13027) (YeonJuan) -* [`8d50a7d`](https://github.com/eslint/eslint/commit/8d50a7d82244d4912f3eab62a66c81c76c44a9da) Fix: add end location to report in no-prototype-builtins (refs #12334) (#13087) (Milos Djermanovic) -* [`3e4e7f8`](https://github.com/eslint/eslint/commit/3e4e7f8d429dc70b78c0aefaa37f9c22a1e5fc0f) Fix: incorrect logic for required parens in no-extra-boolean-cast fixer (#13061) (Milos Djermanovic) -* [`6c069f9`](https://github.com/eslint/eslint/commit/6c069f907a04268b671c7f949c04a508df9d42a3) Docs: Add comments to code block in example (#13089) (Kibeom Kwon) -* [`ee1f053`](https://github.com/eslint/eslint/commit/ee1f0531aa534ef9182cf8586f55ad82aaa55e75) Docs: Fix typo (#13092) (Max Coplan) -* [`76324ac`](https://github.com/eslint/eslint/commit/76324ace67893c3d7e38a369114d6128df9ffb65) Docs: Add further reading to rule (#13084) (Max Coplan) -* [`a1370ab`](https://github.com/eslint/eslint/commit/a1370abed72e1fb93e601816d981fa6e46204afb) Update: Report constructor calls in no-obj-calls (#12909) (Milos Djermanovic) -* [`2111c52`](https://github.com/eslint/eslint/commit/2111c52443e7641caad291e0daaea8e2fe6c4562) Upgrade: esquery@1.2.0 (#13076) (Milos Djermanovic) -* [`3f7c9bf`](https://github.com/eslint/eslint/commit/3f7c9bf19615122fb776cdd13da532d860bd945a) Docs: clarify variables option in no-use-before-define (fixes #12986) (#13017) (Anix) -* [`aef9488`](https://github.com/eslint/eslint/commit/aef9488c07d3da4becff6e8d6918824b53086d86) Fix: allow references to external globals in id-blacklist (fixes #12567) (#12987) (Milos Djermanovic) -* [`4955c50`](https://github.com/eslint/eslint/commit/4955c50dc9e89b4077b28e35f065d45e89bdccd7) Fix: remove type arguments in prefer-object-spread (fixes #13058) (#13063) (Milos Djermanovic) -* [`48b122f`](https://github.com/eslint/eslint/commit/48b122f450b14dd27afef4c8115c69fca4f02be1) Breaking: change relative paths with --config (refs eslint/rfcs#37) (#12887) (Toru Nagashima) -* [`085979f`](https://github.com/eslint/eslint/commit/085979fed9a5e24a87e4d92ee79272b59211d03f) Update: consider env in no-implied-eval (fixes #12733) (#12757) (YeonJuan) -* [`9ac5b9e`](https://github.com/eslint/eslint/commit/9ac5b9edf06d16a9216c2c9b02bb20b6aa8ed0ab) Docs: Clarify node_modules is ignored by default (fixes #13006) (#13054) (Mika Kuijpers) -* [`0de91f3`](https://github.com/eslint/eslint/commit/0de91f39a97cdf530cb64edbadde57a2bb41ca86) Docs: removed correct code from incorrect eg (#13060) (Anix) -* [`dbe357d`](https://github.com/eslint/eslint/commit/dbe357de199620675446464f6fd0e35064c4d247) Fix: check template literal in prefer-numeric-literals (fixes #13045) (#13046) (YeonJuan) -* [`2260611`](https://github.com/eslint/eslint/commit/2260611e616bdc2a0bf16d508b60a50772ce7fbb) Fix: added async in allow method in no-empty-function (fixes #12768) (#13036) (Anix) -* [`f3788af`](https://github.com/eslint/eslint/commit/f3788aff615edfbfb7afc4c491bb07d20737531b) Sponsors: Sync README with website (ESLint Jenkins) -* [`e90b29b`](https://github.com/eslint/eslint/commit/e90b29bb1f41d4e5767e33d03db5984f036586ed) Update: Allow testing Suggestions with data in RuleTester (fixes #12606) (#12635) (Milos Djermanovic) -* [`7224eee`](https://github.com/eslint/eslint/commit/7224eee3ff4b4378d3439deb038bf34b116fa48b) Fix: no-plusplus allow comma operands in for afterthought (fixes #13005) (#13024) (Milos Djermanovic) -* [`7598cf8`](https://github.com/eslint/eslint/commit/7598cf816bd854de1dd7d96cf00dec6ecc4564ac) Fix: Newline before eof when creating config via --init (#12952) (Andreas Lind) -* [`183e300`](https://github.com/eslint/eslint/commit/183e3006841c29efdd245c45a72e6cefac86ae35) Update: support globalThis (refs #12670) (#12774) (YeonJuan) -* [`af7af9d`](https://github.com/eslint/eslint/commit/af7af9d32ea8073d2d0d726cc8551351261a170f) Docs: Update governance (#13055) (Nicholas C. Zakas) -* [`31d5eb3`](https://github.com/eslint/eslint/commit/31d5eb3e60b6c2ee26976721f07cc89d60867659) Sponsors: Sync README with website (ESLint Jenkins) -* [`95613d4`](https://github.com/eslint/eslint/commit/95613d46b7900b3d9757a7f6959d5dfb262f29fc) Upgrade: espree@6.2.1 (#13026) (Kai Cataldo) -* [`f1525dc`](https://github.com/eslint/eslint/commit/f1525dc45dfdbbe31e724671270785b41cffc6bd) Sponsors: Sync README with website (ESLint Jenkins) -* [`0243549`](https://github.com/eslint/eslint/commit/0243549db4d237cb78e720d55a9cae89b91f6830) Fix: camelcase false positive with computed property (fixes #13022) (#13023) (Milos Djermanovic) -* [`bc0c02c`](https://github.com/eslint/eslint/commit/bc0c02cd0368559c7a7b1510eb4620022a4cc31c) Chore: added lock files to gitignore (#13015) (Anix) -* [`79ac6cd`](https://github.com/eslint/eslint/commit/79ac6cd2d8e4c32e03dfea10a957806845058573) Docs: added less confusing explanation for func-style (fixes #12900) (#13004) (Anix) -* [`26267ed`](https://github.com/eslint/eslint/commit/26267ed70270ef746b785c09e267f815bf7c596a) Chore: update GitHub Actions (#12984) (Pig Fang) -* [`1299705`](https://github.com/eslint/eslint/commit/12997058626b5167ba4b9d2ae0d0ea965a01c4be) Update: acorn version (#13016) (Idan Avrahami) -* [`6cef0d5`](https://github.com/eslint/eslint/commit/6cef0d50a0d131bc8897799a54e1af1d38606db4) Fix: Check division operator in astUtils.canTokensBeAdjacent (#12879) (Milos Djermanovic) -* [`fd8e1f5`](https://github.com/eslint/eslint/commit/fd8e1f52110cada542a120750236fd1ec8779336) Sponsors: Sync README with website (ESLint Jenkins) -* [`472025f`](https://github.com/eslint/eslint/commit/472025f2814d0360fe8d4cddbcba049982e1cd43) Chore: update space-before-function-paren in eslint-config-eslint (#12966) (Kai Cataldo) -* [`fd8c42a`](https://github.com/eslint/eslint/commit/fd8c42ada52f0ae2488ad96ee8fee675f63134ce) Sponsors: Sync README with website (ESLint Jenkins) - -v7.0.0-alpha.2 - February 28, 2020 - -* [`a5b41a7`](https://github.com/eslint/eslint/commit/a5b41a75b57572e97476b06ad39b768e15b9d844) Update: no-restricted-modules handle TemplateLiteral (fixes #12926) (#12927) (Michal Piechowiak) -* [`051567a`](https://github.com/eslint/eslint/commit/051567adca7ca56d691bcda76f54ed72e3eae367) Update: check identifier in array pattern in id-length (fixes #12832) (#12839) (YeonJuan) -* [`4af06fc`](https://github.com/eslint/eslint/commit/4af06fc49029dac5c9acfd53f01fd9527bfbb4aa) Breaking: Test with an unknown error property should fail in RuleTester (#12096) (Milos Djermanovic) -* [`9038a29`](https://github.com/eslint/eslint/commit/9038a29569548c0563c29dbe9f7dae280ff3addd) Update: func-names `as-needed` false negative with AssignmentPattern (#12932) (Milos Djermanovic) -* [`afde78b`](https://github.com/eslint/eslint/commit/afde78b125747ce5ad9e5f871122a0d370dd0152) Fix: curly removes necessary braces between if and else (fixes #12928) (#12943) (Milos Djermanovic) -* [`4797fb2`](https://github.com/eslint/eslint/commit/4797fb2c29db97bc5cd23b40e5a9235fef1ea06a) Fix: arrow-body-style crash with object literal body (fixes #12884) (#12886) (Milos Djermanovic) -* [`afa9aac`](https://github.com/eslint/eslint/commit/afa9aac6de9444e935a55b46311e5b5a58f86063) Breaking: class default `true` computed-property-spacing (fixes #12812) (#12915) (Milos Djermanovic) -* [`b8e20d3`](https://github.com/eslint/eslint/commit/b8e20d33b7d6645266beef09cd231afaf5054328) Docs: Mention TypeScript's compiler check (#12903) (Benny Neugebauer) -* [`de14d1c`](https://github.com/eslint/eslint/commit/de14d1ce0cf422b4100a686abb906f53fbf905b3) Fix: wrap-iife autofix removes mandatory parentheses (#12905) (Milos Djermanovic) -* [`5775b06`](https://github.com/eslint/eslint/commit/5775b06a74573cbe068bea56b1d2376421f5e831) Fix: Optionally allow underscores in member names (#11972) (Edgardo Avilés) -* [`e997f32`](https://github.com/eslint/eslint/commit/e997f32b936463ac38e8b0034f764c47502e56a8) Docs: Updated arrow-parens for minor grammar issue (#12962) (Tom) -* [`7d52151`](https://github.com/eslint/eslint/commit/7d52151bcd5d5524f240588436a8808162be187f) Breaking: classes default `true` in accessor-pairs (fixes #12811) (#12919) (Milos Djermanovic) -* [`cf14355`](https://github.com/eslint/eslint/commit/cf14355e34a6757e15806f8e493553bd7110fb36) Docs: Fix links to custom parsers doc (#12965) (Brandon Mills) -* [`0dfc3ff`](https://github.com/eslint/eslint/commit/0dfc3ff9fb228e1d9b1df99de50033ce9140ac24) Fix: add end location to report in no-eval (#12960) (Milos Djermanovic) -* [`f479f6f`](https://github.com/eslint/eslint/commit/f479f6fe2eb95156e22bebfccb39a7fc1f19e9c0) Docs: References correct config file name (#12885) (Patrick Kilgore) -* [`78182e4`](https://github.com/eslint/eslint/commit/78182e45e0178d9eac2591944ef4daee21d2cb44) Breaking: Add new rules to eslint:recommended (fixes #12911) (#12920) (Milos Djermanovic) -* [`8d5c434`](https://github.com/eslint/eslint/commit/8d5c434f721142be74c7515aaa935668a15b79b1) Docs: fix category descriptions for site generation (fixes #12894) (#12930) (Kai Cataldo) -* [`05380e6`](https://github.com/eslint/eslint/commit/05380e6e7e19a79d26ea6d6b44a8d5ee7cde51c8) Docs: Remove claim about semicolons from docs (#12944) (Luke Sikina) -* [`aa9d725`](https://github.com/eslint/eslint/commit/aa9d72525054e641231a2960a2e37b3716228056) Sponsors: Sync README with website (ESLint Jenkins) -* [`7747177`](https://github.com/eslint/eslint/commit/7747177f8504961059b7c56bdb70a820bd1114c1) Update: report rename id destructuring in id-blacklist (fixes #12807) (#12923) (YeonJuan) -* [`6423e11`](https://github.com/eslint/eslint/commit/6423e11c0bedd3b4e661ab554316bdeb1fc1ee3c) Breaking: check unnamed default export in func-names (fixes #12194) (#12195) (Chiawen Chen) -* [`77df505`](https://github.com/eslint/eslint/commit/77df505d9a08496a8eaefeca4f885f54a21d5c5e) Update: check renaming identifier in object destructuring (fixes 12827) (#12881) (YeonJuan) -* [`41de9df`](https://github.com/eslint/eslint/commit/41de9df41a30a4300243bfe4ca26f716a787b2fc) Update: enforceForLogicalOperands no-extra-boolean-cast (fixes #12137) (#12734) (jmoore914) - -v7.0.0-alpha.1 - February 14, 2020 - -* [`f702b1a`](https://github.com/eslint/eslint/commit/f702b1a54820d2b4e4993dcded99f551a98b490f) Add missing plugin reference (#12796) (Eduard Bardají Puig) -* [`1f1424c`](https://github.com/eslint/eslint/commit/1f1424cb200e609d58645f6c54739e11469e6265) Fix: fix inconsistently works option in no-extra-parens (fixes #12717) (#12843) (YeonJuan) -* [`b5adcaa`](https://github.com/eslint/eslint/commit/b5adcaab93f388f1d8e9d35d6f5e8c2994240850) Fix: make YieldExpression throwable (fixes #12880) (#12897) (YeonJuan) -* [`4293229`](https://github.com/eslint/eslint/commit/4293229709dde105692347241513766e953664dd) Breaking: use-isnan enforceForSwitchCase default `true` (fixes #12810) (#12913) (Milos Djermanovic) -* [`cf38d0d`](https://github.com/eslint/eslint/commit/cf38d0d939b62f3670cdd59f0143fd896fccd771) Breaking: change default ignore pattern (refs eslint/rfcs#51) (#12888) (Toru Nagashima) -* [`bfe1dc4`](https://github.com/eslint/eslint/commit/bfe1dc4e614640cb69032afbb5851c1493f537e3) Breaking: no-dupe-class-members checks some computed keys (fixes #12808) (#12837) (Milos Djermanovic) -* [`1ee6b63`](https://github.com/eslint/eslint/commit/1ee6b6388305a8671c8d4c3cf30c2dbf18a1ff7e) Update: check template literal in yoda (fixes #12863) (#12876) (YeonJuan) -* [`0ae7041`](https://github.com/eslint/eslint/commit/0ae70417af70ad565450d9e779ae78c05f6a51e2) Sponsors: Sync README with website (ESLint Jenkins) -* [`1907e57`](https://github.com/eslint/eslint/commit/1907e57362f7d5f7a02a5a78f24ac3347f868e93) Chore: add Twitter and Open Collective badge (#12877) (Kai Cataldo) -* [`95e0586`](https://github.com/eslint/eslint/commit/95e0586c95e6953d11983d1d11891ed30318109a) Fix: id-blacklist false positives on renamed imports (#12831) (Milos Djermanovic) -* [`b7f0d20`](https://github.com/eslint/eslint/commit/b7f0d200c125b3d233ccafaabdaa61c66dc60e3c) Chore: Use consistent badge style (#12825) (fisker Cheung) -* [`3734a66`](https://github.com/eslint/eslint/commit/3734a669983de7d5107ba8f39b291c6e3116489f) Chore: use ids for messages (#12859) (Gareth Jones) -* [`824d235`](https://github.com/eslint/eslint/commit/824d23585c205f2993716585cb6f55dfbe4a33f0) Docs: add errorOnUnmatchedPattern option to CLIEngine (#12834) (Arthur Denner) -* [`439c833`](https://github.com/eslint/eslint/commit/439c83342c364ba3ce5168d54e165b1fe3e35630) Update: array-callback-return checks Array.forEach (fixes #12551) (#12646) (Gabriel R Sezefredo) -* [`33efd71`](https://github.com/eslint/eslint/commit/33efd71d7c3496b4b9cbfe006280527064940826) Docs: Fix spelling mistakes (#12861) (Bryan Mishkin) -* [`a5b3c5f`](https://github.com/eslint/eslint/commit/a5b3c5fa4edc2312534af0d9f0911f68144f8baf) Docs: Update README team and sponsors (ESLint Jenkins) -* [`0cae920`](https://github.com/eslint/eslint/commit/0cae9203a8077184ad6beb00028fd376cc806f34) Chore: rename shadowed global (#12862) (Tony Brix) -* [`055b80d`](https://github.com/eslint/eslint/commit/055b80dc89bba2a5ab22f7a27deb40135b5cacfa) Chore: Fix typo in complexity.js (#12864) (Kyle Shevlin) -* [`d6c313d`](https://github.com/eslint/eslint/commit/d6c313de794ea0671d35b5027288cd2ea456c0b5) Docs: add missing eslint comments in prefer-regex-literals examples (#12858) (Milos Djermanovic) -* [`7d551ab`](https://github.com/eslint/eslint/commit/7d551ab8cbf2d3a802b0d0685379aa075fe9d7c0) Sponsors: Sync README with website (ESLint Jenkins) -* [`540de8e`](https://github.com/eslint/eslint/commit/540de8e34d08f4b17b66b06d13927acb7552357a) Sponsors: Sync README with website (ESLint Jenkins) -* [`ac5d515`](https://github.com/eslint/eslint/commit/ac5d515252c226f030fa646bf7635a12a3b856fe) Sponsors: Sync README with website (ESLint Jenkins) -* [`dadc892`](https://github.com/eslint/eslint/commit/dadc8927820576c60b48bcbc7d5a9056a6279d30) Fix: operator-assignment crash on adjacent division assignment (#12844) (Milos Djermanovic) -* [`9f39ef0`](https://github.com/eslint/eslint/commit/9f39ef0d4b398c7c09ceef89128da448680d587c) Chore: typo in PULL_REQUEST_TEMPLATE.md (#12848) (Balázs Orbán) -* [`a60d5cd`](https://github.com/eslint/eslint/commit/a60d5cd2325ca72fa1b272b0b90ccd7904b92062) Chore: typo in no-irregular-whitespace.js (#12847) (Balázs Orbán) -* [`691d19a`](https://github.com/eslint/eslint/commit/691d19a2872bffab50c0024d488b8cb33504cc83) Chore: add missing `ecmaVersion` 2020/11 type value (#12833) (Piotr Błażejewicz (Peter Blazejewicz)) -* [`516ddb3`](https://github.com/eslint/eslint/commit/516ddb37d39502e5a8c88a017ae3bad05046f41d) Sponsors: Sync README with website (ESLint Jenkins) -* [`a9d92f9`](https://github.com/eslint/eslint/commit/a9d92f991d69902a9150db373590e2ed54dec988) Fix: radix rule crash on disabled globals (#12824) (Milos Djermanovic) -* [`03a69db`](https://github.com/eslint/eslint/commit/03a69dbe86d5b5768a310105416ae726822e3c1c) Update: check template literal in no-proto, no-iterator (fixes #12801) (#12806) (YeonJuan) -* [`562e784`](https://github.com/eslint/eslint/commit/562e7845946a490f2e173a0bcd1af631070a4eef) Update: fix no-magic-numbers false negative with ignoreArrayIndexes (#12805) (Milos Djermanovic) -* [`f5b9656`](https://github.com/eslint/eslint/commit/f5b96564f732962f46755adbb33c49fae9af6a92) Chore: add test for no-constant-condition (#12836) (Milos Djermanovic) -* [`533c114`](https://github.com/eslint/eslint/commit/533c1140dc98bebdc3ae8334ab2e6c27c7df0c21) Fix: multiline-comment-style rule add extra space after * (fixes #12785) (#12823) (Karthik Priyadarshan) -* [`0460748`](https://github.com/eslint/eslint/commit/0460748cda67ddc4a4cb0db3cdf187a742d09bf8) Update: check template literal in no-constant-condition (fixes #12815) (#12816) (YeonJuan) -* [`80309c3`](https://github.com/eslint/eslint/commit/80309c3791188ac5d1c4eebc99ede323a55336e6) Fix: no-constant-condition doesn't introspect arrays (fixes #12225) (#12307) (Sean Gray) -* [`10a79a6`](https://github.com/eslint/eslint/commit/10a79a672b42d51539bcd6ace482be7afa5f34f8) Chore: Adopt `eslint-plugin/require-meta-docs-description` internally (#12762) (Bryan Mishkin) -* [`aea1729`](https://github.com/eslint/eslint/commit/aea172998ec4e2af1d9186b6767c3f34428945f4) Docs: Fix anchor links in Node.js API TOC (#12821) (Matija Marohnić) -* [`1b8a3ce`](https://github.com/eslint/eslint/commit/1b8a3ce15237b9085f2761dcf73655207e6169a6) Sponsors: Sync README with website (ESLint Jenkins) -* [`c2217c0`](https://github.com/eslint/eslint/commit/c2217c04d6c82b160a21b00fca39c8acec543403) Breaking: make `radix` rule stricter (#12608) (fisker Cheung) - -v7.0.0-alpha.0 - January 17, 2020 - -* [`1aa021d`](https://github.com/eslint/eslint/commit/1aa021d77fdd2c68d7b7d2f4603252110c414b32) Breaking: lint `overrides` files (fixes #10828, refs eslint/rfcs#20) (#12677) (Toru Nagashima) -* [`e59d775`](https://github.com/eslint/eslint/commit/e59d77536bd8db57e8a75cd5245f6f320aa699f8) Update: Separate pattern/expression options for array-element-newline (#11796) (jacobparish) -* [`f8f115a`](https://github.com/eslint/eslint/commit/f8f115af6e10539e6cad485588187cb11917f8c9) Update: treat comment tokens in template-curly-spacing (fixes #12744) (#12775) (YeonJuan) -* [`b50179d`](https://github.com/eslint/eslint/commit/b50179def3fedbd95fdeab25e32c2511867eb760) Breaking: Check assignment targets in no-extra-parens (#12490) (Milos Djermanovic) -* [`de4fa7c`](https://github.com/eslint/eslint/commit/de4fa7c65c7befefa64d1605550267071ee56a5d) Fix: wrong indent at tagged template in indent (fixes #12122) (#12596) (YeonJuan) -* [`d86a5bb`](https://github.com/eslint/eslint/commit/d86a5bbb1987d858d4963f647b0af5c1fd924b4f) Breaking: Check flatMap in array-callback-return (fixes #12235) (#12765) (Milos Djermanovic) -* [`cf46df7`](https://github.com/eslint/eslint/commit/cf46df70158a4ed4c09d5c9d655c07dc6df3ff5e) Breaking: description in directive comments (refs eslint/rfcs#33) (#12699) (Toru Nagashima) -* [`7350589`](https://github.com/eslint/eslint/commit/7350589a5bdfc9d75d1ff19364f476eec44c3911) Breaking: some rules recognize bigint literals (fixes #11803) (#12701) (Toru Nagashima) -* [`16a1c1f`](https://github.com/eslint/eslint/commit/16a1c1f79bc0a4cc1c3a87e98d220041de88bb93) Fix: prefer-object-spread false positives with accessors (fixes #12086) (#12784) (Milos Djermanovic) -* [`f9774ec`](https://github.com/eslint/eslint/commit/f9774ec11b0ebe63fb16a97b97890efb84699548) New: Add default-case-last rule (fixes #12665) (#12668) (Milos Djermanovic) -* [`9a93d9e`](https://github.com/eslint/eslint/commit/9a93d9ef389c49a133c4df4f9843927f5f806423) Update: fix no-restricted-imports export * false negative (fixes #12737) (#12798) (Milos Djermanovic) -* [`0d8c0af`](https://github.com/eslint/eslint/commit/0d8c0affe1ae7ecf228cdf91b490921f7e9d1fdb) Fix: improve report location for computed-property-spacing (#12795) (Milos Djermanovic) -* [`756b95d`](https://github.com/eslint/eslint/commit/756b95d59fb97cd9b3f3adf98cebf529fe4842a2) Fix: id-blacklist should ignore ObjectPatterns (fixes #12787) (#12792) (JP Ramassini) -* [`561b6d4`](https://github.com/eslint/eslint/commit/561b6d4726f3e77dd40ba0d340ca7f08429cd2eb) Chore: add prerequisites checklist to PR template (#12790) (Kai Cataldo) -* [`01ff791`](https://github.com/eslint/eslint/commit/01ff7910af86fc45b76e883bc9ab00c9be3b50ac) Fix: Display pipe character correctly in test output (#12771) (Brad Zacher) -* [`68becbd`](https://github.com/eslint/eslint/commit/68becbd84e8a0693409d36f2be10679c483e233a) Update: fix no-restricted-imports importNames reporting (fixes #12282) (#12711) (Andrey Alexandrov) -* [`ae959b6`](https://github.com/eslint/eslint/commit/ae959b691fb148ac8b474c924c8cb01ef61c436d) Update: report double extra parens in no-extra-parens (fixes #12127) (#12697) (YeonJuan) -* [`02fcc05`](https://github.com/eslint/eslint/commit/02fcc055710e8d69d986f1e682cae2014ad881e2) Docs: Improve sort-keys (#12791) (Steven Vachon) -* [`35cd958`](https://github.com/eslint/eslint/commit/35cd95893be0afd8c954cbcf9268c2aa045b7d5b) Sponsors: Sync README with website (ESLint Jenkins) -* [`a1d999c`](https://github.com/eslint/eslint/commit/a1d999c6b4e51c317ad409110be7be214ff9f7c6) New: Add no-useless-backreference rule (fixes #12673) (#12690) (Milos Djermanovic) -* [`b2c6209`](https://github.com/eslint/eslint/commit/b2c62096a8b318765d618cab222240f87d73063b) Update: fix no-extra-parens CallExpression#callee false negatives (#12743) (Milos Djermanovic) -* [`14b42c3`](https://github.com/eslint/eslint/commit/14b42c386be3387c415267b789f277e1294d4567) Update: fix counting jsx comment len in max-len (fixes #12213) (#12661) (YeonJuan) -* [`e632c31`](https://github.com/eslint/eslint/commit/e632c31d7e5363f1347b787702ecd4a85f5c11a2) Upgrade: several dependencies (#12753) (Toru Nagashima) -* [`25eb703`](https://github.com/eslint/eslint/commit/25eb703c8758563988ffb497a53f89a3ed345399) Docs: fix dead link in max-lines rule docs (#12766) (Christian Bundy) -* [`9dfc850`](https://github.com/eslint/eslint/commit/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d) Chore: Refactor to use messageId in a number of rules (#12715) (Brad Zacher) -* [`1118fce`](https://github.com/eslint/eslint/commit/1118fceb49af3436b8dcd0c6089f913cedf9a329) Breaking: runtime-deprecation on '~/.eslintrc' (refs eslint/rfcs#32) (#12678) (Toru Nagashima) -* [`2c28fbb`](https://github.com/eslint/eslint/commit/2c28fbbb563a44282bef0c9fcc9be29d611cc83b) Breaking: drop Node.js 8 support (refs eslint/rfcs#44) (#12700) (Toru Nagashima) -* [`098b67d`](https://github.com/eslint/eslint/commit/098b67d04a4b4dc8ef4faa6434c6ef5abbde3ed3) Docs: fix minor typo in brace-style.md (#12749) (Marko Kaznovac) -* [`313f70a`](https://github.com/eslint/eslint/commit/313f70ac9a3cf5d1558d2427b00dd75666e18cf4) Update: add outerIIFEBody: "off" to indent rule (fixes #11377) (#12706) (Kai Cataldo) -* [`b77b858`](https://github.com/eslint/eslint/commit/b77b8585e33fc4bb438a0e11ca8177c7eb91dbd8) Chore: fix separateRequires tests for one-var rule (#12709) (Milos Djermanovic) -* [`e4df7df`](https://github.com/eslint/eslint/commit/e4df7dfb0199badb61d2c03ff4f7e4be735279d9) Chore: add JSDoc types for RuleTester test cases (#12325) (Chiawen Chen) -* [`b23ad0d`](https://github.com/eslint/eslint/commit/b23ad0d789a909baf8d7c41a35bc53df932eaf30) Docs: change a broken link in working-with-rules.md (#12732) (Damien Cassou) -* [`3fa39a6`](https://github.com/eslint/eslint/commit/3fa39a633b37544fec7cedfc1f2b0e62e9312a72) Update: Handle locally unsupported regex in computed property keys (#12056) (Milos Djermanovic) -* [`4744397`](https://github.com/eslint/eslint/commit/474439720258b1a64b305c31588f803104fa4aaf) Chore: remove unused code in max-lines-per-function (#12659) (YeonJuan) -* [`4e16957`](https://github.com/eslint/eslint/commit/4e169576a526023ee297d5bc8b37eedba229f63d) Build: update browser build (#12693) (Toru Nagashima) -* [`00ddfff`](https://github.com/eslint/eslint/commit/00ddfffe6b4b4244e4680b0f92f2c6697fad136f) Fix: Windows path parsing for JUnit (fixes #12507) (#12509) (Michael Wall) -* [`985dac3`](https://github.com/eslint/eslint/commit/985dac35e3c367f0f99d1f0e766e06a1d9818dd4) New: Add no-restricted-exports rule (fixes #10428) (#12546) (Milos Djermanovic) -* [`1aff21b`](https://github.com/eslint/eslint/commit/1aff21bb54da44cef0b6e378a34a74265863b930) Fix: no-mixed-spaces-and-tabs reports multiline strings (#12566) (Milos Djermanovic) -* [`8f1020f`](https://github.com/eslint/eslint/commit/8f1020ff711b0c57d590bf666e2841f64186d083) Update: no-void add an option to allow void as a statement (#12613) (Brad Zacher) -* [`bb6cf50`](https://github.com/eslint/eslint/commit/bb6cf5082623ffb67bb1495fee52c0610ee5f421) Update: Add offsetTernaryExpressions option for indent rule (#12556) (Adam Stankiewicz) -* [`39f5a45`](https://github.com/eslint/eslint/commit/39f5a453579b2ad732212edeb71f84ecb0991f97) Chore: add test cases for for-direction (#12698) (YeonJuan) -* [`b340304`](https://github.com/eslint/eslint/commit/b3403045e535921df6d34785a4ce053e14ba27fd) Chore: Add extra test, improve docs (#12492) (Kevin Partington) -* [`827259e`](https://github.com/eslint/eslint/commit/827259ea009f98a0fdf3f7ebf1bfb6cd661ce28d) Build: package.json update for eslint-config-eslint release (ESLint Jenkins) - -v6.8.0 - December 20, 2019 - -* [`c5c7086`](https://github.com/eslint/eslint/commit/c5c708666b450fb69522a55aa375626f9297dc6f) Fix: ignore aligning single line in key-spacing (fixes #11414) (#12652) (YeonJuan) -* [`9986d9e`](https://github.com/eslint/eslint/commit/9986d9e0baed0d3586bbee472fe2fae2ed625f5d) Chore: add object option test cases in yield-star-spacing (#12679) (YeonJuan) -* [`1713d07`](https://github.com/eslint/eslint/commit/1713d0758b083f3840d724505f997a7cb20ff384) New: Add no-error-on-unmatched-pattern flag (fixes #10587) (#12377) (ncraley) -* [`5c25a26`](https://github.com/eslint/eslint/commit/5c25a26608fbd9a1d0127c9a3653609aa4b63e86) Update: autofix bug in lines-between-class-members (fixes #12391) (#12632) (YeonJuan) -* [`4b3cc5c`](https://github.com/eslint/eslint/commit/4b3cc5cd2459f04eae149faea0651785d7f9db0b) Chore: enable prefer-regex-literals in eslint codebase (#12268) (薛定谔的猫) -* [`05faebb`](https://github.com/eslint/eslint/commit/05faebb943456ad2b20117f3c8b3eccbe2e2fb03) Update: improve suggestion testing experience (#12602) (Brad Zacher) -* [`05f7dd5`](https://github.com/eslint/eslint/commit/05f7dd53ed91a6e3be9eb40825fb6d2207f82209) Update: Add suggestions for no-unsafe-negation (fixes #12591) (#12609) (Milos Djermanovic) -* [`d3e43f1`](https://github.com/eslint/eslint/commit/d3e43f1c10c5e19f40e7b3d3944b87f1b0c9c075) Docs: Update no-multi-assign explanation (#12615) (Yuping Zuo) -* [`272e4db`](https://github.com/eslint/eslint/commit/272e4db6074283bc01cc6ec72c9e396bb3c110e6) Fix: no-multiple-empty-lines: Adjust reported `loc` (#12594) (Tobias Bieniek) -* [`a258039`](https://github.com/eslint/eslint/commit/a258039e556075d7d1f955a79d094ea103ec165a) Fix: no-restricted-imports schema allows multiple paths/patterns objects (#12639) (Milos Djermanovic) -* [`51f9620`](https://github.com/eslint/eslint/commit/51f9620cc55cc091fe38dbe68e4633de06297b8c) Fix: improve report location for array-bracket-spacing (#12653) (Milos Djermanovic) -* [`45364af`](https://github.com/eslint/eslint/commit/45364afc9c7f0251348cd1a7a13656c3816435d7) Fix: prefer-numeric-literals doesn't check types of literal arguments (#12655) (Milos Djermanovic) -* [`e3c570e`](https://github.com/eslint/eslint/commit/e3c570eaf3d1d44fb57bf42f1870887856e4c5a0) Docs: Add example for expression option (#12694) (Arnaud Barré) -* [`6b774ef`](https://github.com/eslint/eslint/commit/6b774ef0d849ccf5c1127b25e1fe7c3e438d586b) Docs: Add spacing in comments for no-console rule (#12696) (Nikki Nikkhoui) -* [`7171fca`](https://github.com/eslint/eslint/commit/7171fca6ef4e0e8f267658fc7d8f603f00eddd84) Chore: refactor regex in config comment parser (#12662) (Milos Djermanovic) -* [`1600648`](https://github.com/eslint/eslint/commit/1600648d2880ffb1e9e414b31ff0f66ead7167f9) Update: Allow $schema in config (#12612) (Yordis Prieto) -* [`acc0e47`](https://github.com/eslint/eslint/commit/acc0e47572a9390292b4e313b4a4bf360d236358) Update: support .eslintrc.cjs (refs eslint/rfcs#43) (#12321) (Evan Plaice) -* [`49c1658`](https://github.com/eslint/eslint/commit/49c1658544ace24b9aaaa301af0fc07a2ef3bf30) Chore: remove bundling of ESLint during release (#12676) (Kai Cataldo) -* [`257f3d6`](https://github.com/eslint/eslint/commit/257f3d67905a52bf8602a5a5707c893cc90d7ca7) Chore: complete to move to GitHub Actions (#12625) (Toru Nagashima) -* [`ab912f0`](https://github.com/eslint/eslint/commit/ab912f0ef709a916ab9a27ea09d9d7adf046fb2d) Docs: 1tbs with allowSingleLine edge cases (refs #12284) (#12314) (Ari Kardasis) -* [`dd1c30e`](https://github.com/eslint/eslint/commit/dd1c30e35f05ed332e2abbd3d4d53635efde74b8) Sponsors: Sync README with website (ESLint Jenkins) -* [`a230f84`](https://github.com/eslint/eslint/commit/a230f8404e4f2423dd79378b065d24c12776775b) Update: include node version in cache (#12582) (Eric Wang) -* [`8b65f17`](https://github.com/eslint/eslint/commit/8b65f175dfb4fac11ed7184537be400ed14996fb) Chore: remove references to parser demo (#12644) (Kai Cataldo) -* [`e9cef99`](https://github.com/eslint/eslint/commit/e9cef99e6ebec1faefdb576ca597e81ae4f04afd) Docs: wrap {{}} in raw liquid tags to prevent interpolation (#12643) (Kai Cataldo) -* [`e707453`](https://github.com/eslint/eslint/commit/e70745325ff9e085acc6843dd8bfae5550645d4f) Docs: Fix configuration example in no-restricted-imports (fixes #11717) (#12638) (Milos Djermanovic) -* [`19194ce`](https://github.com/eslint/eslint/commit/19194cec724e016df02376bbeae31171be6f0bdf) Chore: Add tests to cover default object options in comma-dangle (#12627) (YeonJuan) -* [`6e36d12`](https://github.com/eslint/eslint/commit/6e36d12d95e76022172fd0ec8a5e85c22fde6a8a) Update: do not recommend require-atomic-updates (refs #11899) (#12599) (Kai Cataldo) - -v6.7.2 - November 30, 2019 - -* [`bc435a9`](https://github.com/eslint/eslint/commit/bc435a93afd6ba4def1b53993ef7cf8220f3f070) Fix: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) (#12616) (Toru Nagashima) -* [`4928d51`](https://github.com/eslint/eslint/commit/4928d513b4fe716c7ed958c294a10ef8517be25e) Fix: don't ignore the entry directory (fixes #12604) (#12607) (Toru Nagashima) -* [`b41677a`](https://github.com/eslint/eslint/commit/b41677ae2a143790b19b0e70391a46ec6c8f5de1) Docs: Clarify suggestion's data in Working with Rules (refs #12606) (#12617) (Milos Djermanovic) -* [`ea16de4`](https://github.com/eslint/eslint/commit/ea16de4e7c6f661398b0b7843f95e5f307c89551) Fix: Support tagged template literal generics in no-unexpected-multiline (#11698) (Brad Zacher) -* [`fa6415d`](https://github.com/eslint/eslint/commit/fa6415d5b877370374a6a530a5190ab5a411b4dc) Sponsors: Sync README with website (ESLint Jenkins) -* [`e1e158b`](https://github.com/eslint/eslint/commit/e1e158b4d7bd61e812723b378d2c391295da43a5) Sponsors: Sync README with website (ESLint Jenkins) - -v6.7.1 - November 24, 2019 - -* [`dd1e9f4`](https://github.com/eslint/eslint/commit/dd1e9f4df2103c43509a54b0ad5f9106557997f9) Fix: revert changes to key-spacing due to regression (#12598) (Kai Cataldo) -* [`c644b54`](https://github.com/eslint/eslint/commit/c644b5429e5bc8a050afd70c99ec82035eb611fa) Docs: Update README team and sponsors (ESLint Jenkins) - -v6.7.0 - November 22, 2019 - -* [`312a88f`](https://github.com/eslint/eslint/commit/312a88f2230082d898b7d8d82f8af63cb352e55a) New: Add grouped-accessor-pairs rule (fixes #12277) (#12331) (Milos Djermanovic) -* [`5c68f5f`](https://github.com/eslint/eslint/commit/5c68f5feeb4a6c0cb53ff76b2fd255b5bfa69c93) Update: Add 'lexicalBindings' to no-implicit-globals and change messages (#11996) (Milos Djermanovic) -* [`6eaad96`](https://github.com/eslint/eslint/commit/6eaad964ff159d0a38de96c1104782ffe6858c78) New: Add suggestions API (#12384) (Will Douglas) -* [`b336fbe`](https://github.com/eslint/eslint/commit/b336fbedecd85731611fdc2dfd8edb635a8b1c39) Fix: indent rule with JSX spread props (#12581) (Nathan Woltman) -* [`97c745d`](https://github.com/eslint/eslint/commit/97c745dc277febbea82552a4d9186e3df847f860) Update: Report assignment expression location in no-cond-assign (#12465) (Milos Djermanovic) -* [`0f01f3d`](https://github.com/eslint/eslint/commit/0f01f3d0807c580631c2fdcff29192a64a870637) Update: Check member expressions with `this` in operator-assignment (#12495) (Milos Djermanovic) -* [`62c7038`](https://github.com/eslint/eslint/commit/62c7038a493d89e4a7b14ac673a063d09d04057b) Fix: invalid token checking in computed-property-spacing (fixes #12198) (#12533) (YeonJuan) -* [`4f8a1ee`](https://github.com/eslint/eslint/commit/4f8a1ee1c26ccb5882e5e83ea7eab2f406c7476b) Update: Add enforceForClassMembers option to no-useless-computed-key (#12110) (ark120202) -* [`1a2eb99`](https://github.com/eslint/eslint/commit/1a2eb99f11c65813bba11d6576a06cff2b823cc9) New: new rule no-constructor-return (fixes #12481) (#12529) (Pig Fang) -* [`ca3b2a6`](https://github.com/eslint/eslint/commit/ca3b2a62c9e829dc4534bca3643d6bc729b46df0) New: ignorePatterns in config files (refs eslint/rfcs#22) (#12274) (Toru Nagashima) -* [`60204a3`](https://github.com/eslint/eslint/commit/60204a3620e33a078c1c35fa2e5d839a16c627ff) Docs: Added another Textmate 2 bundle. (#12580) (Ryan Fitzer) -* [`62623f9`](https://github.com/eslint/eslint/commit/62623f9f611a3adb79696304760a2fd14be8afbc) Fix: preserve whitespace in multiline-comment-style (fixes #12312) (#12316) (Kai Cataldo) -* [`17a8849`](https://github.com/eslint/eslint/commit/17a8849491a983f6cb8e98da8c0c9d52ff5f2aa6) New: Add no-dupe-else-if rule (fixes #12469) (#12504) (Milos Djermanovic) -* [`41a78fd`](https://github.com/eslint/eslint/commit/41a78fd7ce245cad8ff6a96c42f5840688849427) Update: improve location for semi and comma-dangle (#12380) (Chiawen Chen) -* [`0a480f8`](https://github.com/eslint/eslint/commit/0a480f8307a0e438032f484254941e6426748143) Docs: Change "Code Conventions" link in pull-requests.md (#12401) (Denis Sikuler) -* [`fed20bb`](https://github.com/eslint/eslint/commit/fed20bb039cf9f53adfcf93e467f418c5e958f45) Fix: require-await crash on global await (#12571) (Brad Zacher) -* [`b8030fc`](https://github.com/eslint/eslint/commit/b8030fc23e88f57a04d955b3befd1ab0fc2c5d10) Update: deprecate personal config (fixes #11914, refs eslint/rfcs#32) (#12426) (Toru Nagashima) -* [`40c8c32`](https://github.com/eslint/eslint/commit/40c8c3264c7c383d98c9faf9c4cb4f8b75aee40f) Fix: improve report location for object-curly-spacing (#12563) (Milos Djermanovic) -* [`1110045`](https://github.com/eslint/eslint/commit/1110045e0d28a461e75d2f57d5f01533d59ef239) Fix: ignore marker-only comments in spaced-comment (fixes #12036) (#12558) (Milos Djermanovic) -* [`6503cb8`](https://github.com/eslint/eslint/commit/6503cb8d99e549fece53b80b110e890a7978b9fd) Update: Fix uglified object align in key-spacing (fixes #11414) (#12472) (YeonJuan) -* [`40791af`](https://github.com/eslint/eslint/commit/40791af69efde1701690637603ad37d41e15a727) Docs: clarify ignoreDestructuring option in the camelcase rule (#12553) (Milos Djermanovic) -* [`07d398d`](https://github.com/eslint/eslint/commit/07d398d91d5b6d0247e58b1f8ea64bb5acd570a8) Chore: Add GitHub organization to Sponsor button (#12562) (Brandon Mills) -* [`a477707`](https://github.com/eslint/eslint/commit/a47770706ac59633dcd73e886d1a7282b324ee06) Chore: Format style guide links so they can be clicked (#12189) (Ivan V) -* [`0f7edef`](https://github.com/eslint/eslint/commit/0f7edefdc1576d5e3e7ef89083002b0a4a31f039) Update: add react plugin config for eslint init (#12446) (Ibrahim Rouis) -* [`448ff1e`](https://github.com/eslint/eslint/commit/448ff1e53734c503fb9e7e6802c1c7e441d4c019) Update: Report '\08' and '\09' in no-octal-escape (fixes #12080) (#12526) (Milos Djermanovic) -* [`45aa6a3`](https://github.com/eslint/eslint/commit/45aa6a3ba3486f1b116c5daab6432d144e5ea574) New: Add no-setter-return rule (fixes #12285) (#12346) (Milos Djermanovic) -* [`0afb518`](https://github.com/eslint/eslint/commit/0afb518d1f139376245613dddd8eaef32b52d619) Fix: invalid autofix in function-call-argument-newline (fixes #12454) (#12539) (YeonJuan) -* [`90305e0`](https://github.com/eslint/eslint/commit/90305e017c2c5fba0b4b62f41b180910b4baeedb) Update: Depcrecate isSpaceBetweenTokens() (#12519) (Kai Cataldo) -* [`41b1e43`](https://github.com/eslint/eslint/commit/41b1e4308c1cb01c8b00cc8adc36440e77854117) New: add option for camelcase (fixes #12527) (#12528) (Pig Fang) -* [`f49f1e0`](https://github.com/eslint/eslint/commit/f49f1e0a69afa49f6548af7b2c0e6347e1ea022d) Upgrade: upgrade optionator to avoid license issue (fixes #11536) (#12537) (Pig Fang) -* [`0286b57`](https://github.com/eslint/eslint/commit/0286b5730501b391c74e069db46849f0de0885d2) Docs: Clean up Getting Started Guide (#12544) (Nicholas C. Zakas) -* [`575a98d`](https://github.com/eslint/eslint/commit/575a98d724b2688f1e9c83744c5dc9ffe9a7bfb4) Chore: Add funding field to package.json (#12543) (Nicholas C. Zakas) -* [`9e29e18`](https://github.com/eslint/eslint/commit/9e29e189752f06362fd1956659e07834efb746a5) Fix: sourceCode#isSpaceBetweenTokens() checks non-adjacent tokens (#12491) (Kai Cataldo) -* [`5868550`](https://github.com/eslint/eslint/commit/586855060afb3201f4752be8820dc85703b523a6) Docs: add notice about `function` keyword in keyword-spacing (#12524) (Pig Fang) -* [`bb556d5`](https://github.com/eslint/eslint/commit/bb556d5fd735ad2dcea322082edcc07a58105ce9) Fix: curly `multi` reports single lexical declarations (fixes #11908) (#12513) (Milos Djermanovic) -* [`ac60621`](https://github.com/eslint/eslint/commit/ac606217d4beebc35b865d14a7f9723fd21faa48) Fix: unexpected autofix in prefer-const (fixes #12514) (#12521) (YeonJuan) -* [`990065e`](https://github.com/eslint/eslint/commit/990065e5f58b6cc6922ab6cee5b97bfc56a6237a) Update: curly multi-or-nest flagging semis on next line (fixes #12370) (#12378) (cherryblossom000) -* [`084a8a6`](https://github.com/eslint/eslint/commit/084a8a63a749232681fefe9bdac6802efdcdc8a8) Fix: no-cond-assign with `always` option reports switch case clauses (#12470) (Milos Djermanovic) -* [`7e41355`](https://github.com/eslint/eslint/commit/7e41355b19a8ef347620dd7c0dde491c3460937b) Update: improve report location for space-infix-ops (#12324) (Chiawen Chen) -* [`94ff921`](https://github.com/eslint/eslint/commit/94ff921689115f856578159564ee1968b4b914be) Update: Add capIsConstructor option to no-invalid-this (fixes #12271) (#12308) (Milos Djermanovic) -* [`de65de6`](https://github.com/eslint/eslint/commit/de65de6e488112a602949e6a5d27dd4c754b003c) New: Add prefer-exponentiation-operator rule (fixes #10482) (#12360) (Milos Djermanovic) -* [`c78f4a7`](https://github.com/eslint/eslint/commit/c78f4a73de68f81cd41132b46d4840b91599d599) Update: Allow JSX exception in no-inline-comments (fixes #11270) (#12388) (Milos Djermanovic) -* [`e17fb90`](https://github.com/eslint/eslint/commit/e17fb90f5817d16081e690eb06b7720afcb9fa2a) New: allowAfterThisConstructor for no-underscore-dangle (fixes #11488) (#11489) (sripberger) -* [`287ca56`](https://github.com/eslint/eslint/commit/287ca562811d037bde09a47af7f5b9c7b741e022) Build: update CI for Node.js 13 (#12496) (Toru Nagashima) -* [`98e1d50`](https://github.com/eslint/eslint/commit/98e1d50273f31c2a7b59772298280ed7305274c8) Upgrade: globals to v12.1.0 (#12296) (Tony Brix) -* [`8ac71a3`](https://github.com/eslint/eslint/commit/8ac71a3c89a9db13706a44b23d1b509b65185113) Sponsors: Sync README with website (ESLint Jenkins) -* [`4e142ea`](https://github.com/eslint/eslint/commit/4e142ea411dfb692b6e2a69cd5f1204ade4dd58a) Docs: Update README team and sponsors (ESLint Jenkins) - -v6.6.0 - October 25, 2019 - -* [`39dfe08`](https://github.com/eslint/eslint/commit/39dfe0880fa934e287e8ea1f7b56d5cba8d43765) Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara) -* [`4d84210`](https://github.com/eslint/eslint/commit/4d842105c9c82026be668d7425213138903d4d41) Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic) -* [`c6a7745`](https://github.com/eslint/eslint/commit/c6a7745a1371a85932bfae5fec039d1b6fcfc128) Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic) -* [`0bffe95`](https://github.com/eslint/eslint/commit/0bffe953d2752dd2d3045f2f8771c96b6cee8fc4) Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic) -* [`c6a9a3b`](https://github.com/eslint/eslint/commit/c6a9a3bc58b69dbf9be9cd09b0283c081ca211e7) Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic) -* [`364877b`](https://github.com/eslint/eslint/commit/364877b2504e8f7ece04770b93d517e2f27458d0) Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov) -* [`1744fab`](https://github.com/eslint/eslint/commit/1744faba3c93c869f7dbbf0a704d32e2692d6856) Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic) -* [`52ca11a`](https://github.com/eslint/eslint/commit/52ca11a66ab6c2fb5a71d8b9869482f14f98cb9d) Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic) -* [`0f6d0dc`](https://github.com/eslint/eslint/commit/0f6d0dcdf5adc30079a7379bbf605a4ef3887a85) Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima) -* [`923a8cb`](https://github.com/eslint/eslint/commit/923a8cb752b8dee1e622c5fd36f3f53288e30602) Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills) -* [`aac3be4`](https://github.com/eslint/eslint/commit/aac3be435cccc241781150fcac728df04d086fa8) Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett) -* [`e5382d6`](https://github.com/eslint/eslint/commit/e5382d6e4eb1344f537b6f107535269e9939fcb8) Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic) -* [`49faefb`](https://github.com/eslint/eslint/commit/49faefbee3fc7daaf2482d9d7d23513d6ffda9e8) Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima) -* [`b3dbd96`](https://github.com/eslint/eslint/commit/b3dbd9657bbeac6571111a4429b03fc085ba6655) Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima) -* [`cd7c29b`](https://github.com/eslint/eslint/commit/cd7c29b17085c14c9cf6345201c72a192c0d0e0c) Sponsors: Sync README with website (ESLint Jenkins) -* [`8233873`](https://github.com/eslint/eslint/commit/8233873b8e5facd80ab7b172bff1e896a9c5fd39) Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas) -* [`89e8aaf`](https://github.com/eslint/eslint/commit/89e8aafcc622a4763bed6b9d62f148ef95798f38) Fix: improve report location for no-tabs (#12471) (Milos Djermanovic) -* [`7dffe48`](https://github.com/eslint/eslint/commit/7dffe482d646d4e5f94fa87a22f3b5b2e0a4b189) Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan) -* [`e15e1f9`](https://github.com/eslint/eslint/commit/e15e1f933f287d274a726e7f0f0a1dd80f0964af) Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae) -* [`b1dc58f`](https://github.com/eslint/eslint/commit/b1dc58f0a717cb3d19300c845ca23a21ceb610d3) Sponsors: Sync README with website (ESLint Jenkins) -* [`61749c9`](https://github.com/eslint/eslint/commit/61749c94bd8a2ebcdfb89e0cd48c4a029a945079) Chore: Provide debug log for parser errors (#12474) (Brad Zacher) -* [`7c8bbe0`](https://github.com/eslint/eslint/commit/7c8bbe0391944e1f92e083a04715bf4b3fe6be5d) Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae) -* [`349ed67`](https://github.com/eslint/eslint/commit/349ed6700e1155384597e1e6035550a96cb8a42d) Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen) -* [`a102eaa`](https://github.com/eslint/eslint/commit/a102eaa9ac19e1c6d92f79a4033e9048cfb64c0d) Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic) -* [`6e7c18d`](https://github.com/eslint/eslint/commit/6e7c18ddb30b32ee5b2e842cc8258aa7aebb7445) Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic) -* [`51fbbd7`](https://github.com/eslint/eslint/commit/51fbbd78f98f223d17071650f5117d07f60dadc2) Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic) -* [`e657d4c`](https://github.com/eslint/eslint/commit/e657d4ccb9f3dd5cacceaaa40ffe24ac29a1349a) Fix: report full dot location in dot-location (#12452) (Milos Djermanovic) -* [`2d6e345`](https://github.com/eslint/eslint/commit/2d6e345e3c2626b0f2252f22cfaffdf53ea0871a) Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan) -* [`84f71de`](https://github.com/eslint/eslint/commit/84f71de0e686e0fe37b83d6728ce1825caaa44fb) Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan) -* [`18a0b0e`](https://github.com/eslint/eslint/commit/18a0b0e3df927428a22b5b5295f9faee4bd57246) Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen) -* [`d61c8a5`](https://github.com/eslint/eslint/commit/d61c8a5a75447a36276f2d4f84afb3e1129618da) Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen) -* [`561093f`](https://github.com/eslint/eslint/commit/561093fc4267a4ae317d63bc9f103020fad88802) Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham) -* [`fb633b2`](https://github.com/eslint/eslint/commit/fb633b2bbd0a390b247047524fdd1f612dbab803) Chore: Add a script for testing with more control (#12444) (Eric Wang) -* [`012ec51`](https://github.com/eslint/eslint/commit/012ec5151113a2be06fc0e4cd208d714e52dbc57) Sponsors: Sync README with website (ESLint Jenkins) -* [`874fe16`](https://github.com/eslint/eslint/commit/874fe1642a10a0fb937ccccdd4d22343b84f80dc) New: pass cwd from cli engine (#12389) (Eric Wang) -* [`b962775`](https://github.com/eslint/eslint/commit/b962775b8cb7c90985a5ab63e56744bb2ba79644) Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy) -* [`02977f2`](https://github.com/eslint/eslint/commit/02977f25a922dd0b8617c16116bb4364d0f30e94) Docs: Clarify `eslint:recommended` semver policy (#12429) (Kevin Partington) -* [`97045ae`](https://github.com/eslint/eslint/commit/97045ae0805e6503887eef0b131dcb9e70b6d185) Docs: Fixes object type for `rules` in "Use a Plugin" (#12409) (Daisy Develops) -* [`24ca088`](https://github.com/eslint/eslint/commit/24ca088fdc901feef8f10b050414fbde64b55c7d) Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag) -* [`b094008`](https://github.com/eslint/eslint/commit/b094008fb196dc1de5b4c27b7dbf0bcbb4b7b352) Chore: update version parameter name (#12402) (Toru Nagashima) -* [`e5637ba`](https://github.com/eslint/eslint/commit/e5637badd42f087d115f81575b832097fe6fe554) Chore: enable jsdoc/require-description (#12365) (Kai Cataldo) -* [`d31f337`](https://github.com/eslint/eslint/commit/d31f3370396ec4868722bdc044aa697b135ac183) Sponsors: Sync README with website (ESLint Jenkins) -* [`7ffb22f`](https://github.com/eslint/eslint/commit/7ffb22f61cf1622511a7fe42b5ead7c3b216df5e) Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge) -* [`84467c0`](https://github.com/eslint/eslint/commit/84467c07461cc47ee43807ba9014e13700473c5c) Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo) -* [`3642342`](https://github.com/eslint/eslint/commit/364234262efabd91fa8bd53161d9d3e1e37e7944) Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000) -* [`c47fa0d`](https://github.com/eslint/eslint/commit/c47fa0dfc76211b3b0e5649c63acdd9606ce0eca) Docs: Fix missing word in sentence (#12361) (Dan Boulet) -* [`8108f49`](https://github.com/eslint/eslint/commit/8108f49f9fa0c2de80b3b66c847551beff585951) Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo) -* [`b718d2e`](https://github.com/eslint/eslint/commit/b718d2e6c9fe3fc56aa7cfc68b1a40b5cd8a7c01) Chore: update issue template with --eslint-fix flag (#12352) (James George) -* [`20ba14d`](https://github.com/eslint/eslint/commit/20ba14dc78fc2654b2920d14877dde21c6c10da4) Sponsors: Sync README with website (ESLint Jenkins) -* [`566a947`](https://github.com/eslint/eslint/commit/566a947f67c8038a50e204d68723519778a78a0f) Sponsors: Sync README with website (ESLint Jenkins) -* [`070cbd0`](https://github.com/eslint/eslint/commit/070cbd0a2ec07831962a25c4276d08e097302416) Sponsors: Sync README with website (ESLint Jenkins) - -v6.5.1 - September 30, 2019 - -* [`0d3d7d9`](https://github.com/eslint/eslint/commit/0d3d7d9cdd83a7f0e035c95f716a91b9ecc4868b) Docs: fix typo in no-magic-numbers (#12345) (Josiah Rooney) -* [`447ac87`](https://github.com/eslint/eslint/commit/447ac877e8ca2858d61b1e983f72d39e3e2ca74d) Fix: no-useless-rename handles ExperimentalRestProperty (fixes #12335) (#12339) (Kai Cataldo) -* [`b6ff73c`](https://github.com/eslint/eslint/commit/b6ff73cad13282fbfc91186cf4bc2f20278a8936) Sponsors: Sync README with website (ESLint Jenkins) - -v6.5.0 - September 29, 2019 - -* [`73596cb`](https://github.com/eslint/eslint/commit/73596cbdf0a12e2878b2994783f9b969b0c5fbeb) Update: Add enforceForSwitchCase option to use-isnan (#12106) (Milos Djermanovic) -* [`d592a24`](https://github.com/eslint/eslint/commit/d592a248d67920f7200925c003f10853d29f1f8d) Fix: exclude `\u000d` so new line won't convert to text (fixes #12027) (#12031) (zamboney) -* [`e85d27a`](https://github.com/eslint/eslint/commit/e85d27af427d6185ac553a0d801b5103153426d4) Fix: no-regex-spaces false positives and invalid autofix (fixes #12226) (#12231) (Milos Djermanovic) -* [`b349bf7`](https://github.com/eslint/eslint/commit/b349bf79ad56dded826bc99cb52c3551af34fa63) Fix: prefer-named-capture-group incorrect locations (fixes #12233) (#12247) (Milos Djermanovic) -* [`7dc1ea9`](https://github.com/eslint/eslint/commit/7dc1ea9a1b9a21daaffcf712ba9c0e91af81b906) Fix: no-useless-return autofix removes comments (#12292) (Milos Djermanovic) -* [`0e68677`](https://github.com/eslint/eslint/commit/0e68677ec0aaf060a071ecf71e4af954dddb6af0) Fix: no-extra-bind autofix removes comments (#12293) (Milos Djermanovic) -* [`6ad7e86`](https://github.com/eslint/eslint/commit/6ad7e864303e56a39c89569d50c6caf80752ee21) Fix: no-extra-label autofix removes comments (#12298) (Milos Djermanovic) -* [`acec201`](https://github.com/eslint/eslint/commit/acec201f06df780791179ad92cfc484f9b6d23d4) Fix: no-undef-init autofix removes comments (#12299) (Milos Djermanovic) -* [`d89390b`](https://github.com/eslint/eslint/commit/d89390b75e3e9993f347387a49b0ac5550f45c7f) Fix: use async reading of stdin in bin/eslint.js (fixes #12212) (#12230) (Barrie Treloar) -* [`334ca7c`](https://github.com/eslint/eslint/commit/334ca7c8b9c18ac097849c1cefaa43097a4e51dc) Update: no-useless-rename also reports default values (fixes #12301) (#12322) (Kai Cataldo) -* [`41bfe91`](https://github.com/eslint/eslint/commit/41bfe919c06932b7e58cd9ead20157e06656160a) Update: Fix handling of chained new expressions in new-parens (#12303) (Milos Djermanovic) -* [`160b7c4`](https://github.com/eslint/eslint/commit/160b7c46b556ccb6023eb411a8be8801a4bda6df) Chore: add autofix npm script (#12330) (Kai Cataldo) -* [`04b6adb`](https://github.com/eslint/eslint/commit/04b6adb7f1bcb2b6cb3fa377b1ca4cecd810630e) Chore: enable eslint-plugin-jsdoc (refs #11146) (#12332) (Kai Cataldo) -* [`9b86167`](https://github.com/eslint/eslint/commit/9b86167e6f053e4a72bf68ebc79db53903f7f8c3) Docs: Add new ES environments to Configuring ESLint (#12289) (Milos Djermanovic) -* [`c9aeab2`](https://github.com/eslint/eslint/commit/c9aeab21a71c6743f51163b7a8fdf4f0cbfcdbde) Docs: Add supported ECMAScript version to README (#12290) (Milos Djermanovic) -* [`8316e7b`](https://github.com/eslint/eslint/commit/8316e7be5a9429513d7ecf2ee2afc40ab4415b8f) Fix: no-useless-rename autofix removes comments (#12300) (Milos Djermanovic) -* [`29c12f1`](https://github.com/eslint/eslint/commit/29c12f18726a3afb21fc89ab1bdacc6972d49e68) Chore: cache results in runtime-info (#12320) (Kai Cataldo) -* [`f5537b2`](https://github.com/eslint/eslint/commit/f5537b2ed0b0b5e51a34c22cdd4ebfd024eaea3d) Fix: prefer-numeric-literals autofix removes comments (#12313) (Milos Djermanovic) -* [`11ae6fc`](https://github.com/eslint/eslint/commit/11ae6fcb5d5503e5dea41c02780369efe51f0bb9) Update: Fix call, new and member expressions in no-extra-parens (#12302) (Milos Djermanovic) -* [`a7894eb`](https://github.com/eslint/eslint/commit/a7894ebb43523152d36720efa770bb1fe8b58c07) New: add --env-info flag to CLI (#12270) (Kai Cataldo) -* [`61392ff`](https://github.com/eslint/eslint/commit/61392ff5ec660bfc01ac2ff0e9660d259cf88fd6) Sponsors: Sync README with website (ESLint Jenkins) -* [`2c6bf8e`](https://github.com/eslint/eslint/commit/2c6bf8ea9c8a8f94746f980bd5bea0a8c5c4d6b7) Docs: English fix (#12306) (Daniel Nixon) -* [`6f11877`](https://github.com/eslint/eslint/commit/6f118778366613fc53036cb6a7537e1b4c6e7af8) Sponsors: Sync README with website (ESLint Jenkins) -* [`2e202ca`](https://github.com/eslint/eslint/commit/2e202ca2228846e6226aa8dd99c614d572fb86a8) Docs: fix links in array-callback-return (#12288) (Milos Djermanovic) -* [`e39c631`](https://github.com/eslint/eslint/commit/e39c6318af0fd27edd5fd2aaf2b24a3e204005dd) Docs: add example for CLIEngine#executeOnText 3rd arg (#12286) (Kai Cataldo) -* [`d4f9a16`](https://github.com/eslint/eslint/commit/d4f9a16af7e00021e2ed63823d9c2f149bc985d6) Update: add support for JSXFragments in indent rule (fixes #12208) (#12210) (Kai Cataldo) -* [`c6af95f`](https://github.com/eslint/eslint/commit/c6af95f5bf1ef10f08545d54fd52b98e85fdf7f7) Sponsors: Sync README with website (ESLint Jenkins) -* [`8cadd52`](https://github.com/eslint/eslint/commit/8cadd5229b7372aed0d4785dcae15532a399bf55) Sponsors: Sync README with website (ESLint Jenkins) -* [`f9fc695`](https://github.com/eslint/eslint/commit/f9fc695d77c19cd5ecb3f0e97e1ea124c8543409) Chore: enable default-param-last (#12244) (薛定谔的猫) -* [`9984c3e`](https://github.com/eslint/eslint/commit/9984c3e27c92de76b8c05a58525dbcea12b10b83) Docs: Update README team and sponsors (ESLint Jenkins) - -v6.4.0 - September 13, 2019 - -* [`e915fff`](https://github.com/eslint/eslint/commit/e915fffb6089a23ff1cae926cc607f9b87dc1819) Docs: Improve examples and clarify default option (#12067) (Yuping Zuo) -* [`540296f`](https://github.com/eslint/eslint/commit/540296fcecd232a09dc873a5a22f5839b59b7842) Update: enforceForClassMembers option to accessor-pairs (fixes #12063) (#12192) (Milos Djermanovic) -* [`d3c2334`](https://github.com/eslint/eslint/commit/d3c2334646eae9287d5be9e457d041e445efb512) Update: flag nested block with declaration as error (#12193) (David Waller) -* [`b2498d2`](https://github.com/eslint/eslint/commit/b2498d284b9c30ed1543429c2f45d9014e12fe22) Update: Fix handling of property names in no-self-assign (#12105) (Milos Djermanovic) -* [`1ee61b0`](https://github.com/eslint/eslint/commit/1ee61b06715fcc750be2c923034a1e59ba663287) Update: enforceForClassMembers computed-property-spacing (fixes #12049) (#12214) (Milos Djermanovic) -* [`520c922`](https://github.com/eslint/eslint/commit/520c92270eed6e90c1a796e8af275980f01705e0) Docs: Added naming convention details to plugin usage (#12202) (Henrique Barcelos) -* [`f826eab`](https://github.com/eslint/eslint/commit/f826eabbeecddb047f58f4e7308a14c18148d369) Fix: Allow line comment exception in object-curly-spacing (fixes #11902) (#12216) (Milos Djermanovic) -* [`db2a29b`](https://github.com/eslint/eslint/commit/db2a29beb0fa28183f65bf9e659c66c03a8918b5) Update: indentation of comment followed by semicolon (fixes #12232) (#12243) (Kai Cataldo) -* [`ae17d1c`](https://github.com/eslint/eslint/commit/ae17d1ca59dd466aa64da0680ec2453c2dc3b80d) Fix: no-sequences is reporting incorrect locations (#12241) (Milos Djermanovic) -* [`365331a`](https://github.com/eslint/eslint/commit/365331a42e22af5a77ac9cfa9673d6a8f653eb5a) Fix: object-shorthand providing invalid fixes for typescript (#12260) (Brad Zacher) -* [`1c921c6`](https://github.com/eslint/eslint/commit/1c921c6dfd7ddfb0308c8103e53d32c1241475f0) New: add no-import-assign (fixes #12237) (#12252) (Toru Nagashima) -* [`3be04fd`](https://github.com/eslint/eslint/commit/3be04fd6a4e7b3f5a5ecb845a29cf29b71fe2dfb) New: Add prefer-regex-literals rule (fixes #12238) (#12254) (Milos Djermanovic) -* [`37c0fde`](https://github.com/eslint/eslint/commit/37c0fdeb87b92a0b779b125adf45535b79b65757) Update: Report global Atomics calls in no-obj-calls (fixes #12234) (#12258) (Milos Djermanovic) -* [`985c9e5`](https://github.com/eslint/eslint/commit/985c9e5eba351965a8a1491a41dbdcc78154b8f4) Fix: space-before-function-paren autofix removes comments (fixes #12259) (#12264) (Milos Djermanovic) -* [`01da7d0`](https://github.com/eslint/eslint/commit/01da7d04c4e5a7376cf241ec02db7971726a1bf9) Fix: eqeqeq rule reports incorrect locations (#12265) (Milos Djermanovic) -* [`319e4d8`](https://github.com/eslint/eslint/commit/319e4d8386ea846928f0f906c251b46043a53491) Docs: adding finally example (#12256) (Jens Melgaard) -* [`d52328f`](https://github.com/eslint/eslint/commit/d52328f012f3704c7d1ce39427e63f80531c7979) Docs: fix no-sequences `with` examples (#12239) (Milos Djermanovic) -* [`a41fdc0`](https://github.com/eslint/eslint/commit/a41fdc07404a7675d14183fab245fb8f49dcb858) Fix: Remove autofixer for no-unsafe-negation (#12157) (Milos Djermanovic) -* [`e38f5fd`](https://github.com/eslint/eslint/commit/e38f5fdfc786363a3eae642f1a69a8725600aa61) Update: fix no-octal-escape false negatives after \0 (#12079) (Milos Djermanovic) -* [`9418fbe`](https://github.com/eslint/eslint/commit/9418fbe0eb31cace3debe27b620709628df2fad7) Sponsors: Sync README with website (ESLint Jenkins) -* [`acc5ec5`](https://github.com/eslint/eslint/commit/acc5ec5082aed466a29899f651e6767b39155aec) Sponsors: Sync README with website (ESLint Jenkins) -* [`460c5ad`](https://github.com/eslint/eslint/commit/460c5ad176eaf39ff579cd96b3bcbe0539093f8f) Sponsors: Sync README with website (ESLint Jenkins) -* [`0313441`](https://github.com/eslint/eslint/commit/0313441d016c8aa0674c135f9da67a676e766ec5) New: add rule default-param-last (fixes #11361) (#12188) (Chiawen Chen) -* [`7621f5d`](https://github.com/eslint/eslint/commit/7621f5d2aa7d87e798b75ca47d6889c280597e99) Update: add more specific linting messages to space-in-parens (#11121) (Che Fisher) -* [`21eb904`](https://github.com/eslint/eslint/commit/21eb9044135c01b6c12188517bba840614483fc6) Fix: basePath of OverrideTester (fixes #12032) (#12205) (Toru Nagashima) -* [`86e5e65`](https://github.com/eslint/eslint/commit/86e5e657ea3fbf12b10524abcbc197afd215a060) Sponsors: Sync README with website (ESLint Jenkins) -* [`2b1a13f`](https://github.com/eslint/eslint/commit/2b1a13fa0de8360586857f3ced8da514c971297d) Fix: no-extra-boolean-cast reports wrong negation node (fixes #11324) (#12197) (Milos Djermanovic) -* [`ba8c2aa`](https://github.com/eslint/eslint/commit/ba8c2aa0154561fbeca33db0343cb39a7fbd9b4f) Sponsors: Sync README with website (ESLint Jenkins) -* [`a0a9746`](https://github.com/eslint/eslint/commit/a0a9746724ccd22c721ddc1b25c566aa9acea154) Docs: Fix link in no-irregular-whitespace.md (#12196) (Timo Tijhof) -* [`e10eeba`](https://github.com/eslint/eslint/commit/e10eebab4abd193dee697c4de7fb2d95bbab2d8c) Fix: quotes autofix produces syntax error with octal escape sequences (#12118) (Milos Djermanovic) - -v6.3.0 - August 30, 2019 - -* [`0acdefb`](https://github.com/eslint/eslint/commit/0acdefb97f35bb09db2910540c70dc377a01ad62) Chore: refactor code (#12113) (James George) -* [`52e2cf5`](https://github.com/eslint/eslint/commit/52e2cf50b35d57fb8466e0bcd0581eff1590fb4c) New: reportUnusedDisableDirectives in config (refs eslint/rfcs#22) (#12151) (Toru Nagashima) -* [`020f952`](https://github.com/eslint/eslint/commit/020f9526b618a191566acea3e17e20815d484c58) Update: enforceForSequenceExpressions to no-extra-parens (fixes #11916) (#12142) (Milos Djermanovic) -* [`aab1b84`](https://github.com/eslint/eslint/commit/aab1b840f9cffb2a76a5c9fe1852961be71dc184) Fix: reset to the default color (#12174) (Ricardo Gobbo de Souza) -* [`4009d39`](https://github.com/eslint/eslint/commit/4009d39aa59451510aa24911e758d664f216289a) Fix: yoda rule produces invalid autofix with preceding yield (#12166) (Milos Djermanovic) -* [`febb660`](https://github.com/eslint/eslint/commit/febb6605d350c936d64cb73e694482cfbb20b29c) Fix: no-extra-boolean-cast invalid autofix with yield before negation (#12164) (Milos Djermanovic) -* [`4c0b70b`](https://github.com/eslint/eslint/commit/4c0b70b869c16647f7af6de9d5c5479fc19f49db) New: support TypeScript at config initializer (fixes #11789) (#12172) (Pig Fang) -* [`94e39d9`](https://github.com/eslint/eslint/commit/94e39d9f782f45db86a079e07508d63040118ef1) Chore: use GitHub Actions (#12144) (Toru Nagashima) -* [`e88f305`](https://github.com/eslint/eslint/commit/e88f305df9d454868624c559fd93b981a680c215) Chore: support es2020 in fuzz (#12180) (薛定谔的猫) -* [`00d2c5b`](https://github.com/eslint/eslint/commit/00d2c5be9a89efd90135c4368a9589f33df3f7ba) Docs: corrected class extension example (#12176) (Marius M) -* [`31e5428`](https://github.com/eslint/eslint/commit/31e542819967b2aa1191e1abaa1c4a49fddbe3cf) Chore: Fix wrong error object keys in test files (#12162) (Milos Djermanovic) -* [`197f443`](https://github.com/eslint/eslint/commit/197f4432fca70a574028e5568c48afad12213224) Fix: func-name-matching crash on descriptor-like arguments (#12100) (Milos Djermanovic) -* [`644ce33`](https://github.com/eslint/eslint/commit/644ce3306748a33b74fc6a94be0267c2c9f19348) Fix: no-self-assign false positive with rest and spread in array (#12099) (Milos Djermanovic) -* [`a81d263`](https://github.com/eslint/eslint/commit/a81d2636ce41fb34d6826c2e9857814e11cb9c30) Fix: fix message of function-paren-newline (#12136) (Pig Fang) -* [`77f8ed1`](https://github.com/eslint/eslint/commit/77f8ed1ad9656c526217ce54a6717fa232d522c8) Chore: update blogpost template (#12154) (Toru Nagashima) -* [`6abc7b7`](https://github.com/eslint/eslint/commit/6abc7b72dfb824a372379708ca39340b2c7abc03) Docs: Document the exception in no-unsafe-negation (#12161) (Milos Djermanovic) - -v6.2.2 - August 23, 2019 - -* [`0e0b784`](https://github.com/eslint/eslint/commit/0e0b784b922051c2a1d39dd8160382114b645800) Upgrade: espree@^6.1.1 (#12158) (Kevin Partington) -* [`04e859f`](https://github.com/eslint/eslint/commit/04e859f228d081efd3af6edb22563dbc775f8d1d) Sponsors: Sync README with website (ESLint Jenkins) -* [`34783d1`](https://github.com/eslint/eslint/commit/34783d10ff9b58a3c1e39a36e10864caeb9f66e0) Sponsors: Sync README with website (ESLint Jenkins) -* [`b809e72`](https://github.com/eslint/eslint/commit/b809e72221bc658e5a42bfd4b8723d3771571f9e) Docs: Update README team and sponsors (ESLint Jenkins) - -v6.2.1 - August 20, 2019 - -* [`8c021b5`](https://github.com/eslint/eslint/commit/8c021b5917b3aa3c578ffe3972106d0a6bcf0838) Upgrade: eslint-utils 1.4.2 (#12131) (Toru Nagashima) -* [`e82388b`](https://github.com/eslint/eslint/commit/e82388bd87717430200ec554634cc08806e38d3c) Sponsors: Sync README with website (ESLint Jenkins) -* [`4aeeeed`](https://github.com/eslint/eslint/commit/4aeeeedb656ee3519ea82ebf0cb41ca801215046) Docs: update docs for ecmaVersion 2020 (#12120) (silverwind) -* [`6886148`](https://github.com/eslint/eslint/commit/6886148d1f528659ec3e125f61ef7a5f4c67556d) Docs: Add duplicate keys limitation to accessor-pairs (#12124) (Milos Djermanovic) - -v6.2.0 - August 18, 2019 - -* [`fee6acb`](https://github.com/eslint/eslint/commit/fee6acbe13cecd4c028e681e185fc6a6d6ba9452) Update: support bigint and dynamic import (refs #11803) (#11983) (Toru Nagashima) -* [`afd8012`](https://github.com/eslint/eslint/commit/afd8012c2797f2f5bf3c360cb241ea2ba6e1a489) New: noInlineConfig setting (refs eslint/rfcs#22) (#12091) (Toru Nagashima) -* [`3d12378`](https://github.com/eslint/eslint/commit/3d12378221961439c27ddae0ecda9845ac575107) Update: Fix accessor-pairs to enforce pairs per property in literals (#12062) (Milos Djermanovic) -* [`8cd00b3`](https://github.com/eslint/eslint/commit/8cd00b308987e0db0bdb2e242bf13b2b07b350bd) New: function-call-argument-newline (#12024) (finico) -* [`30ebf92`](https://github.com/eslint/eslint/commit/30ebf929f60684520b1201c1adfd86214c19d614) Fix: prefer-template autofix produces syntax error with octal escapes (#12085) (Milos Djermanovic) -* [`13c3988`](https://github.com/eslint/eslint/commit/13c3988a4001ae368ea7b6c8d3dd0abfa7c6cf64) Fix: Check literal type explicitly in dot-notation (#12095) (Milos Djermanovic) -* [`3e5ceca`](https://github.com/eslint/eslint/commit/3e5ceca4d2284b55a2292a1d3de9aa4cdf6fa213) Fix: Handle empty string property names in getFunctionNameWithKind (#12104) (Milos Djermanovic) -* [`9a043ff`](https://github.com/eslint/eslint/commit/9a043ffbb864fc65baeb16fe5668435e3b7cfe34) Fix: no-duplicate-case false positives on Object.prototype keys (#12107) (Milos Djermanovic) -* [`fe631af`](https://github.com/eslint/eslint/commit/fe631afee59641876598d19b1935967099cc6fa0) Chore: minor typo fix (#12112) (James George) -* [`4cb7877`](https://github.com/eslint/eslint/commit/4cb78774f6cc687a3c8701462f8c7f7b587ecaf0) Fix: fix no-extra-parens ignores some nodes (#11909) (Pig Fang) -* [`2dc23b8`](https://github.com/eslint/eslint/commit/2dc23b81e54defbce7a70a7f26c2e4c7b692cf58) Update: fix no-dupe-keys false negatives on empty string names (#12069) (Milos Djermanovic) -* [`19ab666`](https://github.com/eslint/eslint/commit/19ab6666e8e4142a183bdee2be96e5bafbac0e21) Fix: yoda exceptRange false positives on empty string property names (#12071) (Milos Djermanovic) -* [`d642150`](https://github.com/eslint/eslint/commit/d642150fe016608e71a1df2a72960e915b3cfbad) Update: Check empty string property names in sort-keys (#12073) (Milos Djermanovic) -* [`acce6de`](https://github.com/eslint/eslint/commit/acce6de940e2b089ff5ba59e4518a54af1682d5e) Fix: class-methods-use-this reports 'undefined' names (#12103) (Milos Djermanovic) -* [`92ec2cb`](https://github.com/eslint/eslint/commit/92ec2cb1731b7b6e0ac66336d583fbb782504290) Fix: Allow bind call with a single spread element in no-extra-bind (#12088) (Milos Djermanovic) -* [`bfdb0c9`](https://github.com/eslint/eslint/commit/bfdb0c97003fc0e045aa6ed10b177c35305a6e46) Fix: no-extra-boolean-cast invalid autofix for Boolean() without args (#12076) (Milos Djermanovic) -* [`34ccc0c`](https://github.com/eslint/eslint/commit/34ccc0cd81f495190e585c6efa8ae233d45bd3ed) Chore: Remove TDZ scope type condition from no-unused-vars (#12055) (Milos Djermanovic) -* [`01d38ce`](https://github.com/eslint/eslint/commit/01d38ce2faf0abbc9dd5d25694baeee131036165) Docs: Remove TDZ scope from the scope manager interface documentation (#12054) (Milos Djermanovic) -* [`1aff8fc`](https://github.com/eslint/eslint/commit/1aff8fc4f9394cd9126654a55f7f3a43ab1cf8f0) Update: warn about mixing ternary and logical operators (fixes #11704) (#12001) (Karthik Priyadarshan) -* [`11be2f8`](https://github.com/eslint/eslint/commit/11be2f8513bd61499f6247392a33ac0a26901c90) Docs: do not recommend global-installed usage (#12016) (薛定谔的猫) -* [`cf31dab`](https://github.com/eslint/eslint/commit/cf31dab5d5982151e0cfcc32879e69a83180ec70) Fix: no-restricted-syntax - correct the schema (#12051) (Brad Zacher) -* [`fbec99e`](https://github.com/eslint/eslint/commit/fbec99ea3e39316791685652c66e522d698f52d8) Update: fix class-methods-use-this false negatives with exceptMethods (#12077) (Milos Djermanovic) -* [`fb08b7c`](https://github.com/eslint/eslint/commit/fb08b7c9d28bc68864eb940e26df274059228b6a) Docs: Remove readonly/writable global logic from no-undef (fixes #11963) (#12053) (Milos Djermanovic) -* [`5b5934b`](https://github.com/eslint/eslint/commit/5b5934b9513f9114f5bf8e12ff4f4981590d64d3) Sponsors: Sync README with website (ESLint Jenkins) -* [`9156760`](https://github.com/eslint/eslint/commit/915676022a100ae5dba788fa3329d34b3c1f18d3) Sponsors: Sync README with website (ESLint Jenkins) -* [`f5e0cc4`](https://github.com/eslint/eslint/commit/f5e0cc40795f175692acb05daaadb91e9e5ae5d3) Update: Check computed method keys in no-extra-parens (#11973) (Milos Djermanovic) -* [`d961438`](https://github.com/eslint/eslint/commit/d9614388df8cfb977842ed7ac4725d76a3e05df3) Docs: Fix Incorrect Documentation (#12045) (Michael Miceli) -* [`887d08c`](https://github.com/eslint/eslint/commit/887d08c244e32f1fc18359e63380e2cdb0cb3797) Sponsors: Sync README with website (ESLint Jenkins) -* [`d90183f`](https://github.com/eslint/eslint/commit/d90183ff6757cff854f4ca4d25b835143dfb4b21) Docs: add a case to func-names (#12038) (Chiawen Chen) -* [`8a5b62d`](https://github.com/eslint/eslint/commit/8a5b62de2ae574f416c0f8ad91205da9b1837275) Docs: no use eslint.linter in code example (#12037) (薛定谔的猫) -* [`5831767`](https://github.com/eslint/eslint/commit/58317673210e48be3975e317c2c566fae155c94f) Update: report location of func-names (fixes #12022) (#12028) (Pig Fang) - -v6.1.0 - July 20, 2019 - -* [`8f86cca`](https://github.com/eslint/eslint/commit/8f86ccaa89daf10123370868c5dcb48c1fcbef7d) Upgrade: eslint-scope@^5.0.0 (#12011) (Kevin Partington) -* [`d08683e`](https://github.com/eslint/eslint/commit/d08683e3c807f92daf266894093c70f8d5ac6afa) Fix: glob processing (fixes #11940) (#11986) (Toru Nagashima) -* [`bfcf8b2`](https://github.com/eslint/eslint/commit/bfcf8b21011466b570b536ca31ec10fd228b3dca) Fix: dot-location errors with parenthesized objects (fixes #11868) (#11933) (Milos Djermanovic) -* [`79e8d09`](https://github.com/eslint/eslint/commit/79e8d099bbbebfa4d804484eeeeea9c074ede870) Fix: add parens for sequence expr in arrow-body-style (fixes #11917) (#11918) (Pig Fang) -* [`105c098`](https://github.com/eslint/eslint/commit/105c098f3cece8b83ab8d1566b8ea41dd94a60b9) Docs: update docs for object-curly-spacing (fixes #11634) (#12009) (Chiawen Chen) -* [`c90a12c`](https://github.com/eslint/eslint/commit/c90a12c283698befcafd2c86f8bd8942428fe80b) Chore: update release script for new website repo (#12006) (Kai Cataldo) -* [`e2c08a9`](https://github.com/eslint/eslint/commit/e2c08a9c8d86238955ecc8fd5a626584ee91eba5) Sponsors: Sync README with website (ESLint Jenkins) -* [`b974fcb`](https://github.com/eslint/eslint/commit/b974fcbd3321ab382a914520018d4c051b2e5c62) Update: Check computed property keys in no-extra-parens (#11952) (Milos Djermanovic) -* [`222d27c`](https://github.com/eslint/eslint/commit/222d27c32a6d6d8828233b3b99e93ecefa94c603) Update: Add for-in and for-of checks for props in no-param-reassign (#11941) (Milos Djermanovic) -* [`e4c450f`](https://github.com/eslint/eslint/commit/e4c450febc9bd77b33f6473667afa9f955be6b71) Fix: no-extra-parens autofix with `in` in a for-loop init (fixes #11706) (#11848) (Milos Djermanovic) -* [`2dafe2d`](https://github.com/eslint/eslint/commit/2dafe2d288d1e0d353bb938d12a5da888091cfdb) Fix: prefer-const produces invalid autofix (fixes #11699) (#11827) (Milos Djermanovic) -* [`cb475fd`](https://github.com/eslint/eslint/commit/cb475fd8c0bbfcb00340459966b6780f39ea87a7) Fix: Cache file error handling on read-only file system. (fixes #11945) (#11946) (Cuki) -* [`89412c3`](https://github.com/eslint/eslint/commit/89412c3cbc52e556dba590fa94e10bf40faf1fdf) Docs: Fixed a typo (fixes #11999) (#12000) (Eddie Olson) -* [`6669f78`](https://github.com/eslint/eslint/commit/6669f78a3dd305aef6191e7eea24fae2ae4fd2e8) Fix: --init with Vue.js failed (fixes #11970) (#11985) (Toru Nagashima) -* [`93633c2`](https://github.com/eslint/eslint/commit/93633c2b3716b17816bcb3dc221c49b75db41317) Upgrade: Upgrade lodash dependency (fixes #11992) (#11994) (Cyd La Luz) -* [`776dae7`](https://github.com/eslint/eslint/commit/776dae71f2f5c7b5f0650ea3c277eca26e324e41) Docs: fix wrong Node.js version in getting started (#11993) (Toru Nagashima) -* [`4448261`](https://github.com/eslint/eslint/commit/4448261f5d217d8a06eb0ef898401928b54a34e3) Docs: some typos and optimization points (#11960) (Jason Lee) -* [`2a10856`](https://github.com/eslint/eslint/commit/2a10856d1ed5880a09a5ba452bd80d49c1be4e6c) Chore: Add temporary test files to .gitignore (#11978) (Milos Djermanovic) -* [`d83b233`](https://github.com/eslint/eslint/commit/d83b23382de3b80056a7e6330ed5846316c94147) Chore: update path for release bundles (#11977) (Kai Cataldo) -* [`1fb3620`](https://github.com/eslint/eslint/commit/1fb362093a65b99456a11029967d9ee0c31fd697) Fix: creating of enabledGlobals object without prototype (fixes #11929) (#11935) (finico) -* [`c2f2db9`](https://github.com/eslint/eslint/commit/c2f2db97c6d6a415b78ee7b3e8924853d465e757) Docs: Replace global true and false with writable and readonly in rules (#11956) (Milos Djermanovic) -* [`19335b8`](https://github.com/eslint/eslint/commit/19335b8f47029b2f742d5507ba39484eaf68d07b) Fix: actual messageId and expected messageId are switched in rule tester (#11928) (Milos Djermanovic) -* [`8b216e0`](https://github.com/eslint/eslint/commit/8b216e04fb0dd0a1a4d3730ebe4b24780020b09c) Docs: Fix incorrect example comments for unicode-bom rule (fixes #11937) (#11938) (Brandon Yeager) -* [`cc3885b`](https://github.com/eslint/eslint/commit/cc3885b028e29ebc575c900f43af81cb0dabffb6) Chore: add v8-compile-cache to speed up instantiation time (#11921) (薛定谔的猫) -* [`d8f2688`](https://github.com/eslint/eslint/commit/d8f26886f19a17f2e1cdcb91e2db84fc7ba3fdfb) Upgrade: deps (#11904) (薛定谔的猫) -* [`e5f1ccc`](https://github.com/eslint/eslint/commit/e5f1ccc9e2d07ad0acf149027ffc382021d54da1) Docs: add 'stricter rule config validating' in migrating docs (#11905) (薛定谔的猫) - -v6.0.1 - June 24, 2019 - -* [`b5bde06`](https://github.com/eslint/eslint/commit/b5bde0669bd6a7a6b8e38cdf204d8d4b932cea63) Fix: --rulesdir option didn't work (fixes #11888) (#11890) (Toru Nagashima) -* [`13f0418`](https://github.com/eslint/eslint/commit/13f041897ee31982808a57b4d06450b57c9b27dc) Fix: improve error message on --print-config (fixes #11874) (#11885) (Toru Nagashima) -* [`056c2aa`](https://github.com/eslint/eslint/commit/056c2aaf39a5f8d06de24f06946dda95032a0361) Fix: improve diagnostics for shareable-config-missing errors (#11880) (Teddy Katz) -* [`566b7aa`](https://github.com/eslint/eslint/commit/566b7aa5d61fb31cd47fe4da7820b07cf9bde1ec) Docs: Update no-confusing-arrow with the new default option (#11886) (Yuping Zuo) -* [`d07f3fa`](https://github.com/eslint/eslint/commit/d07f3fae19b901c30cf4998f10722cb3182bd237) Fix: CLIEngine#getRules() contains plugin rules (fixes #11871) (#11872) (Toru Nagashima) -* [`21f4a80`](https://github.com/eslint/eslint/commit/21f4a8057ccc941f72bb617ae3b5c135a774f6c0) Docs: Fix inconsistent linking in migration guide (#11881) (Teddy Katz) -* [`f3a0774`](https://github.com/eslint/eslint/commit/f3a0774a8879b08777a4aedc76677f13d5156242) Docs: Fix typo in 6.0.0 migration guide (#11870) (Kevin Partington) - -v6.0.0 - June 21, 2019 - -* [`81aa06b`](https://github.com/eslint/eslint/commit/81aa06b4cc49e9c15234a2c4d27659a03fea53d8) Upgrade: espree@6.0.0 (#11869) (Teddy Katz) -* [`5f022bc`](https://github.com/eslint/eslint/commit/5f022bc91d0d93d140876ceb1ee4e08b1b7cfd49) Fix: no-else-return autofix produces name collisions (fixes #11069) (#11867) (Milos Djermanovic) -* [`ded9548`](https://github.com/eslint/eslint/commit/ded9548d881b15e771ca79b844e8159601f30f70) Fix: multiline-comment-style incorrect message (#11864) (golopot) -* [`cad074d`](https://github.com/eslint/eslint/commit/cad074d4ddb34a59183b5965ca50170713b5a711) Docs: Add JSHint W047 compat to no-floating-decimal (#11861) (Timo Tijhof) -* [`41f6304`](https://github.com/eslint/eslint/commit/41f6304ce641a82ee729251b448dceb9fb0d501d) Upgrade: sinon (#11855) (Toru Nagashima) -* [`167ce87`](https://github.com/eslint/eslint/commit/167ce87e908ec04b0d3d79960278d45c883c4285) Chore: remove unuseable profile command (#11854) (Toru Nagashima) -* [`c844c6f`](https://github.com/eslint/eslint/commit/c844c6f2ff314cfa8c6ca0e35a1ef58b7e297b79) Fix: max-len properly ignore trailing comments (fixes #11838) (#11841) (ZYSzys) -* [`1b5661a`](https://github.com/eslint/eslint/commit/1b5661ae467c227c0239e06cc1466480004aa799) Fix: no-var should not fix variables named 'let' (fixes #11830) (#11832) (Milos Djermanovic) -* [`4d75956`](https://github.com/eslint/eslint/commit/4d75956147b6fd662ee90eb21d3f762816463b88) Build: CI with Azure Pipelines (#11845) (Toru Nagashima) -* [`1db3462`](https://github.com/eslint/eslint/commit/1db346220889305a427b45a00afcf362b81b3767) Chore: rm superfluous argument & fix perf-multifiles-targets (#11834) (薛定谔的猫) -* [`c57a4a4`](https://github.com/eslint/eslint/commit/c57a4a4a993193c4208c6419df331a7bc644a536) Upgrade: @babel/polyfill => core-js v3 (#11833) (薛定谔的猫) -* [`65faa04`](https://github.com/eslint/eslint/commit/65faa04e8b42eecd4505111bbff296951179f033) Docs: Clarify prefer-destructuring array/object difference (fixes #9970) (#11851) (Oliver Sieweke) -* [`81c3823`](https://github.com/eslint/eslint/commit/81c382378923a45015bafe58362f6c8faa5c3d5f) Fix: require-atomic-updates reports parameters (fixes #11723) (#11774) (Toru Nagashima) -* [`aef8ea1`](https://github.com/eslint/eslint/commit/aef8ea1a44b9f13d468f48536c4c93f79f201d9b) Sponsors: Sync README with website (ESLint Jenkins) - -v6.0.0-rc.0 - June 9, 2019 - -* [`f403b07`](https://github.com/eslint/eslint/commit/f403b07283f91f1285d8318d6acea851dd765755) Update: introduce minKeys option to sort-keys rule (fixes #11624) (#11625) (Christian) -* [`87451f4`](https://github.com/eslint/eslint/commit/87451f4779bc4c0ec874042b6854920f947ee258) Fix: no-octal should report NonOctalDecimalIntegerLiteral (fixes #11794) (#11805) (Milos Djermanovic) -* [`e4ab053`](https://github.com/eslint/eslint/commit/e4ab0531c4e44c23494c6a802aa2329d15ac90e5) Update: support "bigint" in valid-typeof rule (#11802) (Colin Ihrig) -* [`e0fafc8`](https://github.com/eslint/eslint/commit/e0fafc8ef59a80a6137f4170bbe46582d6fbcafc) Chore: removes unnecessary assignment in loop (#11780) (Dimitri Mitropoulos) -* [`20908a3`](https://github.com/eslint/eslint/commit/20908a38f489c285abf8fceef4d9d13bf8b87f22) Docs: removed '>' prefix from from docs/working-with-rules (#11818) (Alok Takshak) -* [`1c43eef`](https://github.com/eslint/eslint/commit/1c43eef605a9cf02a157881424ea62dcae747f69) Sponsors: Sync README with website (ESLint Jenkins) -* [`21f3131`](https://github.com/eslint/eslint/commit/21f3131aa1636afa8e5c01053e0e870f968425b1) Fix: `overrides` handle relative paths as expected (fixes #11577) (#11799) (Toru Nagashima) -* [`5509cdf`](https://github.com/eslint/eslint/commit/5509cdfa1b3d575248eef89a935f79c82e3f3071) Fix: fails the test case if autofix made syntax error (fixes #11615) (#11798) (Toru Nagashima) -* [`cb1922b`](https://github.com/eslint/eslint/commit/cb1922bdc07e58de0e55c13fd992dd8faf3292a4) Fix: show custom message for namespace import (fixes #11580) (#11791) (Pig Fang) -* [`37e5193`](https://github.com/eslint/eslint/commit/37e5193102d7544f155cdcb09c7c50dc602914d4) Update: add `endColumn` to no-useless-escape (fixes #11629) (#11790) (Pig Fang) -* [`ad4b048`](https://github.com/eslint/eslint/commit/ad4b048c6d034cbd7fd97deb4390d059bde8803f) Build: Fix typo in blog post template (fixes #11614) (#11782) (Kai Cataldo) -* [`9590587`](https://github.com/eslint/eslint/commit/9590587cef74c936ef9b7ce2d22a71e2fd0fbbc4) Update: improve reported location of arrow-parens (fixes #11773) (#11775) (Pig Fang) -* [`d662b17`](https://github.com/eslint/eslint/commit/d662b178c7dad193201564d16f7977af2f81ebcf) New: Add classname attribute to JUnit testcase (refs #11068) (#11683) (Fabio Pitino) -* [`8eaa9b2`](https://github.com/eslint/eslint/commit/8eaa9b259dc08dfb48269b1e4413d0d47698ed87) Chore: remove incorrect comment (#11769) (薛定谔的猫) -* [`4039a49`](https://github.com/eslint/eslint/commit/4039a49177f2fefacd747050b420c0c4560b7d4b) Chore: add .github/funding.yml (#11764) (Toru Nagashima) - -v6.0.0-alpha.2 - May 25, 2019 - -* [`9b87fee`](https://github.com/eslint/eslint/commit/9b87fee9dc7b1d99a50b924cb6b81255ebb5c4a2) Chore: Fix formatter documentation generation (#11767) (Ilya Volodin) -* [`f116208`](https://github.com/eslint/eslint/commit/f11620848733a3a6f58811d9bb2c3e748d6135ac) Chore: Fix site generation script for releases (#11766) (Ilya Volodin) -* [`cf9cce8`](https://github.com/eslint/eslint/commit/cf9cce81aa68e9bc23840530cb33f4c3f551fb1e) Update: Add never option for new-parens (refs #10034) (#11379) (pfgithub) -* [`b5fa149`](https://github.com/eslint/eslint/commit/b5fa1491d2371a721e4b5029e797ae98fd30fed2) New: multiple processors support (fixes #11035, fixes #11725) (#11552) (Toru Nagashima) -* [`2d32a9e`](https://github.com/eslint/eslint/commit/2d32a9e8dd10a5927576bd50d184876c775da4af) Breaking: stricter rule config validating (fixes #9505) (#11742) (薛定谔的猫) -* [`71716eb`](https://github.com/eslint/eslint/commit/71716eba3155266d777b994a38af524952e97696) Update: add fixer for no-div-regex rule (fixes #11355) (#11744) (joe-re) -* [`53f7f4c`](https://github.com/eslint/eslint/commit/53f7f4cf8d8b66a1911db56e4f72764388a21cc4) Update: Uniform messages for the rules in "complexity" section (#11759) (Igor Novozhilov) -* [`0a801d7`](https://github.com/eslint/eslint/commit/0a801d702dc41dae7eac0c802b822493ddc3ac41) Chore: improve perf test (#11756) (薛定谔的猫) -* [`45bd336`](https://github.com/eslint/eslint/commit/45bd336e647a6fa8a502488e5cbd27ba02712083) Docs: add about RuleTester's parser to migration guide (fixes #11728) (#11761) (Toru Nagashima) -* [`1374be4`](https://github.com/eslint/eslint/commit/1374be44f7ec4b8c913c52cc84debc4012c4f3ea) Docs: add table of contents in readme (#11765) (薛定谔的猫) -* [`54e6eda`](https://github.com/eslint/eslint/commit/54e6edaa2f881aab530fa14e63d92e5e0e2ca55c) New: extends in glob-based config (fixes #8813) (#11554) (Toru Nagashima) -* [`ec105b2`](https://github.com/eslint/eslint/commit/ec105b24f7e036ecdc4267f018529ac3765e29d5) Chore: typo in JSDoc on timing.display's return value (#11755) (Dimitri Mitropoulos) -* [`e45cc3f`](https://github.com/eslint/eslint/commit/e45cc3f3dc44f3a5b6b713a1bf5ce6e46d87ca49) Docs: updated no-proto rule (fixes #11743) (#11746) (Francesco Trotta) -* [`15c6c63`](https://github.com/eslint/eslint/commit/15c6c6374c0425d5402142d012a541fa208bc9da) Chore: eslint-config-eslint require node >= 8 (#11718) (薛定谔的猫) -* [`f9790ca`](https://github.com/eslint/eslint/commit/f9790ca1baec1275f3c946586766a5713258ac32) Fix: typo: missing word in docs (#11750) (Dimitri Mitropoulos) -* [`219aecb`](https://github.com/eslint/eslint/commit/219aecb78bc646d44bad27dc775a9b3d3dc58232) Chore: restructure files (#11555) (Toru Nagashima) -* [`5dad0b1`](https://github.com/eslint/eslint/commit/5dad0b1d80c9cf380c49f46266c35d461d3cecad) Fix: Unignoring directories in .eslintignore (fixes #11684) (#11685) (Mykola Bilochub) -* [`4625090`](https://github.com/eslint/eslint/commit/462509058e46770cf70307cf8dba279f0e73b967) Docs: small fix about the migration guide (#11729) (Toru Nagashima) -* [`0e89c73`](https://github.com/eslint/eslint/commit/0e89c73177398eaf978a50d5b0f79ff8e43512f2) Sponsors: Sync README with website (ESLint Jenkins) -* [`5a296fa`](https://github.com/eslint/eslint/commit/5a296fa0c9345ad1a55e2b257e5f6c9f05fff362) Sponsors: Sync README with website (ESLint Jenkins) -* [`7c8e86b`](https://github.com/eslint/eslint/commit/7c8e86bf2c900cec7cd1dfd529a8c77cc81ef34c) Fix: wrong 'plugin-missing' error on Node.js 12 (fixes #11720) (#11722) (Toru Nagashima) -* [`67c671f`](https://github.com/eslint/eslint/commit/67c671fdc1c8b08cb8d263a9bb2151e3108c88b4) Chore: ignore deprecated rules in fuzz tests (#11710) (Pig Fang) -* [`af81cb3`](https://github.com/eslint/eslint/commit/af81cb3ecc5e6bf43a6a2d8f326103350513a1b8) Chore: make fuzzer produce minimal reproducible examples of bugs (#11700) (Teddy Katz) - -v6.0.0-alpha.1 - May 10, 2019 - -* [`e84b6f8`](https://github.com/eslint/eslint/commit/e84b6f8b171ba4266164688f76d5ee45d278e5c2) Docs: fix example in object-curly-newline docs (#11633) (golopot) -* [`252efd3`](https://github.com/eslint/eslint/commit/252efd337b1441debb6d2cc8f51a625549b2c535) Fix: delete unnecessary duplicated question (fixes #11617) (#11618) (HelloRusk) -* [`21dd211`](https://github.com/eslint/eslint/commit/21dd2116c70b93aa8dd50d2b15e202724b11486a) New: add --resolve-plugins-relative-to flag (#11696) (Teddy Katz) -* [`1a3a88d`](https://github.com/eslint/eslint/commit/1a3a88df2f952c34631d8e1d83de47178826fce0) Fix: Curly rule incorrectly flagging lexical declarations (fixes #11663) (#11675) (Brian Kurek) -* [`f42d0af`](https://github.com/eslint/eslint/commit/f42d0afd89874b459fce1eb1998247d53f9aa42b) Chore: lazy loading for rules (#11705) (Toru Nagashima) -* [`f47d72c`](https://github.com/eslint/eslint/commit/f47d72ce2f2edb80cd38810894b9d4bda896bb29) Fix: not set ecmaVersion to 6 when sourceType=module (fixes #9687) (#11649) (薛定谔的猫) -* [`9484e9e`](https://github.com/eslint/eslint/commit/9484e9ea188ff70683c3112e397c7fddcc3f8095) Fix: ignore return statements in dead code (fixes #11647) (#11688) (Toru Nagashima) -* [`aae6f65`](https://github.com/eslint/eslint/commit/aae6f6525557ba06e73f051511646056313fcf91) Fix: don't use deprecated API (#11689) (Toru Nagashima) -* [`483239e`](https://github.com/eslint/eslint/commit/483239ec74a0c13529fc99547a784b749f41dd54) Docs: updated ImportDeclaration in docs-rules-indent (#11679) (Alok Takshak) -* [`f5bae78`](https://github.com/eslint/eslint/commit/f5bae78c19d5359f67969a2ff344025082e253f4) Chore: fix CLIEngine tests when os.tmpdir is a symlink (#11697) (Teddy Katz) -* [`e4400b5`](https://github.com/eslint/eslint/commit/e4400b5a02602bba7f67ea4cb874c231903c546a) Fix: require-atomic-updates false positive (fixes #11194, fixes #11687) (#11224) (Toru Nagashima) -* [`6ae21a4`](https://github.com/eslint/eslint/commit/6ae21a4bfe5a1566f787fbad798182a524b96d28) Breaking: fix config loading (fixes #11510, fixes #11559, fixes #11586) (#11546) (Toru Nagashima) -* [`bc0819c`](https://github.com/eslint/eslint/commit/bc0819c94aad14f7fad3cbc2338ea15658b0f272) Sponsors: Sync README with website (ESLint Jenkins) -* [`036a188`](https://github.com/eslint/eslint/commit/036a188143677384f720ff18071fc4206c54500b) Sponsors: Sync README with website (ESLint Jenkins) -* [`4b3b036`](https://github.com/eslint/eslint/commit/4b3b036d6240cdbc2d52e670de36b1117f5f34d7) Docs: replace `var` with `const` in code examples (#11655) (Niyaz Akhmetov) -* [`e4a08ba`](https://github.com/eslint/eslint/commit/e4a08bae82788136b6899262cb8b9ed4fe7964e6) Chore: update eslint-plugin-node to 9.0.0 (#11670) (Toru Nagashima) -* [`f2e7828`](https://github.com/eslint/eslint/commit/f2e78281d057f38b18cc160e81ed1bb54a5b9565) Docs: Fix Node 6 LTS EOL date (#11676) (James Ross) -* [`4052bfe`](https://github.com/eslint/eslint/commit/4052bfebb87850b901f2eb8687edfbe49c01d68f) Sponsors: Sync README with website (ESLint Jenkins) -* [`f6fc045`](https://github.com/eslint/eslint/commit/f6fc0450e749707bed44118c1205fb4e73e65628) Sponsors: Sync README with website (ESLint Jenkins) -* [`1ebf21b`](https://github.com/eslint/eslint/commit/1ebf21bc18769956366110bb62ff677639e633ae) Sponsors: Sync README with website (ESLint Jenkins) -* [`776b0fe`](https://github.com/eslint/eslint/commit/776b0fe3d93da958517ac7752682091f22eb30b4) Fix: update rule message of no-throw-literal (fixes #11637) (#11638) (Pig Fang) -* [`67c08b6`](https://github.com/eslint/eslint/commit/67c08b67509c54acd96aab2cec22efb53bfe6265) Fix: consider comments in object-curly-spacing (fixes #11656) (#11657) (Pig Fang) -* [`b6d41cb`](https://github.com/eslint/eslint/commit/b6d41cbe28a8b28b1c1d9aa36cb4c349c73f6f1d) Fix: check token before using in no-cond-assign (fixes #11611) (#11619) (Pig Fang) -* [`7f290a9`](https://github.com/eslint/eslint/commit/7f290a9044ca795884ac2e495cd31b2a35f109a6) Chore: add eslint as a devDependeny (#11654) (Toru Nagashima) -* [`139fd2f`](https://github.com/eslint/eslint/commit/139fd2f1254bcc524738f8c2645e0847df95e0d0) Chore: add markdownlint-cli (#11653) (Toru Nagashima) -* [`adc6585`](https://github.com/eslint/eslint/commit/adc6585ce074e03fc8a842e8ebc5b082a0ed0b65) Docs: update status of breaking changes in migration guide (#11652) (Teddy Katz) -* [`eef71e4`](https://github.com/eslint/eslint/commit/eef71e455e67040168c8df8a6c9c2b4fbe805a50) Docs: add missing items to migration guide (#11628) (Teddy Katz) -* [`0fc8e62`](https://github.com/eslint/eslint/commit/0fc8e62818bc8d0a0a804b59c6110818844df5f3) Breaking: eslint:recommended changes (fixes #10768) (#11518) (薛定谔的猫) -* [`1c34d4a`](https://github.com/eslint/eslint/commit/1c34d4a6313c399761281282fff3a1bbe5e17b6d) Sponsors: Sync README with website (ESLint Jenkins) -* [`33695e7`](https://github.com/eslint/eslint/commit/33695e7f7048306ac196eff6e5a16e165ad03090) Sponsors: Sync README with website (ESLint Jenkins) -* [`c94cf21`](https://github.com/eslint/eslint/commit/c94cf212d31513fde74e0ea88b79e5e0f89a18a4) Sponsors: Sync README with website (ESLint Jenkins) -* [`f62a451`](https://github.com/eslint/eslint/commit/f62a4510b007172c7160f007a6ec2aa2c9a80dd7) Build: add node 12 (#11648) (薛定谔的猫) -* [`20364cc`](https://github.com/eslint/eslint/commit/20364cc4f7fe0423adce0dd44fb24fc48e1cae4b) Breaking: make no-redeclare stricter (fixes #11370, fixes #11405) (#11509) (Toru Nagashima) -* [`ed675a6`](https://github.com/eslint/eslint/commit/ed675a6e5ac42898555c51a7cf771b79695ba591) Sponsors: Sync README with website (ESLint Jenkins) -* [`8b4dba6`](https://github.com/eslint/eslint/commit/8b4dba606f8306f8ad0a37e2174a6e3236f7ebe7) Chore: Add linting to git commit (#11556) (Nicholas C. Zakas) -* [`8684f46`](https://github.com/eslint/eslint/commit/8684f4646da33bfe81e8f7f8c2d1af8b31065564) Sponsors: Sync README with website (ESLint Jenkins) -* [`1bdacc9`](https://github.com/eslint/eslint/commit/1bdacc9b703158d5ca3563e4a9b67bb8453ac316) Sponsors: Sync README with website (ESLint Jenkins) -* [`e62c8af`](https://github.com/eslint/eslint/commit/e62c8af6a86e35dc05f30713faf87a18cc77714d) Sponsors: Sync README with website (ESLint Jenkins) -* [`1dfe077`](https://github.com/eslint/eslint/commit/1dfe077b7e47c6090277eb984e08bd472bb5595e) Fix: autofix of no-unneeded-ternary made syntax error (fixes #11579) (#11616) (Toru Nagashima) -* [`bebd079`](https://github.com/eslint/eslint/commit/bebd0793eaf122b013cca501ff2c6b0fc05d5493) Docs: fix grammar mistake in no-caller docs (#11623) (Daniel Lemay) -* [`f570be1`](https://github.com/eslint/eslint/commit/f570be17b339cb7622c512331b1653013279855a) Sponsors: Sync README with website (ESLint Jenkins) -* [`7c13a1c`](https://github.com/eslint/eslint/commit/7c13a1c144a6a7c99cd9338a24166da9f7439cd0) Sponsors: Sync README with website (ESLint Jenkins) -* [`b7bd432`](https://github.com/eslint/eslint/commit/b7bd432e1161feba8dbb81f62cf03cafad42c3d4) Sponsors: Sync README with website (ESLint Jenkins) -* [`412a76b`](https://github.com/eslint/eslint/commit/412a76b316e05ca85334c1d6bc6372df536da2db) Sponsors: Sync README with website (ESLint Jenkins) - -v6.0.0-alpha.0 - April 12, 2019 - -* [`3d9e137`](https://github.com/eslint/eslint/commit/3d9e1372aad1e174b5438e3d6bd75fdefba06bad) Chore: fix test that fails when the CWD contains a space (#11612) (Teddy Katz) -* [`8bfd1d1`](https://github.com/eslint/eslint/commit/8bfd1d138001d4493180b2fcff3330b42d0bb7cb) Docs: add v6.0.0 migration guide (#11515) (Teddy Katz) -* [`9e49b56`](https://github.com/eslint/eslint/commit/9e49b56c08fd0e449fddab45dfeb0da8d918b460) Breaking: upgrade espree to 6.0.0-alpha.0 (fixes #9687) (#11610) (Teddy Katz) -* [`0127d10`](https://github.com/eslint/eslint/commit/0127d107590acabfdea4a68b56acbeee6a7b9daa) Fix: no-var fixed to incorrect code (fixes #11441) (#11443) (薛定谔的猫) -* [`5cfdc2d`](https://github.com/eslint/eslint/commit/5cfdc2d08307c63bec487e76d2f470ef84166867) Update: Improve no-loop-func rule description and message (#11046) (Pedro Lopes) -* [`608a02c`](https://github.com/eslint/eslint/commit/608a02c60656b96c3219d342eee7e98b55bdd580) Fix: object-shorthand ignoreConstructors option (fixes #11595) (#11596) (overlookmotel) -* [`eeea893`](https://github.com/eslint/eslint/commit/eeea89361d48494995446ddb6ee6f049457911ec) Upgrade: update js-yaml package to 3.13.1 version (#11607) (Pobegaylo Maksim) -* [`e70d5f7`](https://github.com/eslint/eslint/commit/e70d5f7573a9641d7b63394df53a3ef86183445c) Upgrade: compatible deps (#11608) (薛定谔的猫) -* [`a55913d`](https://github.com/eslint/eslint/commit/a55913d6c6fd1a7c684b8b4d7ab380cf7dc83eb8) Sponsors: Sync README with website (ESLint Jenkins) -* [`9a6e8fe`](https://github.com/eslint/eslint/commit/9a6e8fe4b025d52275f7ad2959361587f476cc58) Sponsors: Sync README with website (ESLint Jenkins) -* [`cbdee62`](https://github.com/eslint/eslint/commit/cbdee6230d22522c37259449467ace16f28ea8e8) Docs: README updates to reflect JSCS compat project is finished (#11568) (Kevin Partington) -* [`b92ca6e`](https://github.com/eslint/eslint/commit/b92ca6ea8ae46b92c258921e8b5b40f5035dbc43) Fix: getErrorResults function to not mutate passed parameter (#11592) (danielamaia) -* [`ef7801e`](https://github.com/eslint/eslint/commit/ef7801ea510e12a9ca4963bcc8ec7e3aacc75ff0) Breaking: disallow invalid rule defaults in RuleTester (fixes #11473) (#11599) (Teddy Katz) -* [`c021117`](https://github.com/eslint/eslint/commit/c021117915d5d23399233f761a237e138f1854af) Sponsors: Sync README with website (ESLint Jenkins) -* [`4e7cdca`](https://github.com/eslint/eslint/commit/4e7cdca571632a3f3c32b39eb03022fe88ca8b30) Breaking: comma-dangle enable functions: "never" (fixes #11502) (#11519) (薛定谔的猫) -* [`12f256f`](https://github.com/eslint/eslint/commit/12f256f22534c4a4e1ca0ba54c37c6db81441461) Breaking: no-confusing-arrow enable allowParens: true (fixes #11503) (#11520) (薛定谔的猫) -* [`25cc63d`](https://github.com/eslint/eslint/commit/25cc63d47e6c0aea8b88589a088c1f0de5f6f1cc) Breaking: simplify config/plugin/parser resolution (fixes #10125) (#11388) (Teddy Katz) -* [`63fead8`](https://github.com/eslint/eslint/commit/63fead86f8cf4e6b33d5424fb7db1e76a66d4cce) Sponsors: Sync README with website (ESLint Jenkins) -* [`595de40`](https://github.com/eslint/eslint/commit/595de4074fac1b5839f56b29fe0106a7fda7e3e0) Docs: edit arrow-parens as-needed explanation (fixes #11202) (#11569) (Logan Lowder) -* [`3396c3e`](https://github.com/eslint/eslint/commit/3396c3e2231b5b6e16da8751c22c86c256590f6b) Upgrade: karma@^4.0.1, drops Node 6 support, fixes vulnerability (#11570) (Kevin Partington) -* [`2f8ae13`](https://github.com/eslint/eslint/commit/2f8ae1397eef3625fe66636e95b0b312c6ff8a37) Update: support single argument on newline with function-paren-newline (#11406) (Vladlen Grachev) -* [`fd1c91b`](https://github.com/eslint/eslint/commit/fd1c91b00e8d8c3a83d21e60668d5f1fa61cb214) Breaking: throw an error for invalid global configs (refs #11338) (#11517) (Teddy Katz) -* [`be83322`](https://github.com/eslint/eslint/commit/be833229b355eafb90f3e0bbc29bb106e100bed0) Breaking: Remove extra rules from eslint:recommended (fixes #10873) (#11357) (Kevin Partington) -* [`2543f11`](https://github.com/eslint/eslint/commit/2543f11dfe8069ed5096073169cf6791d42454db) Breaking: remove deprecated experimentalObjectRestSpread option (#11420) (Teddy Katz) -* [`19248e0`](https://github.com/eslint/eslint/commit/19248e0838425748d75518fe9f0a985587793378) Fix: make `overrides[].files` matching dotfiles (fixes #11201) (#11225) (Toru Nagashima) -* [`0fb5fd4`](https://github.com/eslint/eslint/commit/0fb5fd402334098dc44cbfbb8ab25919da04843d) Breaking: interpret rule options as unicode regexes (fixes #11423) (#11516) (Teddy Katz) -* [`6e7da57`](https://github.com/eslint/eslint/commit/6e7da57dddc41830df4aee77e31c4320c1557350) Breaking: drop Node.js 6 support (fixes #11456) (#11557) (Toru Nagashima) -* [`a73b4b8`](https://github.com/eslint/eslint/commit/a73b4b8d6398b00bdaf90599d9e6d1c80f000f88) Docs: Update README team and sponsors (ESLint Jenkins) - -v5.16.0 - March 29, 2019 - -* [`dfef227`](https://github.com/eslint/eslint/commit/dfef227091955a2f8f3fa8c76ad79de8a77e7955) Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington) -* [`c06d38c`](https://github.com/eslint/eslint/commit/c06d38c81bd9203c904587396a65d3c8cc7f2944) Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin) -* [`87a5c03`](https://github.com/eslint/eslint/commit/87a5c034977cf4538ff3539d2f8776a987c5942a) Docs: `func-style`: clarify when `allowArrowFunctions` is used (#11548) (Oliver Joseph Ash) -* [`bc3e427`](https://github.com/eslint/eslint/commit/bc3e427ee8875c53eac6b6762884b50074f1adfc) Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer) -* [`b452f27`](https://github.com/eslint/eslint/commit/b452f270bc0b523d88d5d827c95be3096f82e99d) Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas) -* [`afe3d25`](https://github.com/eslint/eslint/commit/afe3d25f8afb88caee43f7202d0eb96f33a92a6b) Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede) -* [`4fe7eb7`](https://github.com/eslint/eslint/commit/4fe7eb7cecdc2395cf1eeaa20921bda8460b00c2) Chore: use nyc instead of istanbul (#11532) (Toru Nagashima) -* [`f16af43`](https://github.com/eslint/eslint/commit/f16af439694aab473c647d8fae47c402bd489447) Chore: fix formatters/table test (#11534) (Toru Nagashima) -* [`78358a8`](https://github.com/eslint/eslint/commit/78358a8f66e95c4fcc921f2497e8a5ec5f1537ec) Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz) - -v5.15.3 - March 18, 2019 - -* [`71adc66`](https://github.com/eslint/eslint/commit/71adc665b9649b173adc76f80723b8de20664ae1) Fix: avoid moving comments in implicit-arrow-linebreak (fixes #11521) (#11522) (Teddy Katz) -* [`1f715a2`](https://github.com/eslint/eslint/commit/1f715a20c145d8ccc38f3310afccd838495d09d4) Chore: make test-case-property-ordering reasonable (#11511) (Toru Nagashima) - -v5.15.2 - March 15, 2019 - -* [`29dbca7`](https://github.com/eslint/eslint/commit/29dbca73d762a809adb2f457b527e144426d54a7) Fix: implicit-arrow-linebreak adds extra characters (fixes #11268) (#11407) (Mark de Dios) -* [`5d2083f`](https://github.com/eslint/eslint/commit/5d2083fa3e14c024197f6c386ff72237a145e258) Upgrade: eslint-scope@4.0.3 (#11513) (Teddy Katz) -* [`a5dae7c`](https://github.com/eslint/eslint/commit/a5dae7c3d30231c2f5f075d98c2c8825899bab16) Fix: Empty glob pattern incorrectly expands to "/**" (#11476) (Ben Chauvette) -* [`448e8da`](https://github.com/eslint/eslint/commit/448e8da94d09b397e98ffcb6f22b55a578ef79c1) Chore: improve crash reporting (fixes #11304) (#11463) (Alex Zherdev) -* [`0f56dc6`](https://github.com/eslint/eslint/commit/0f56dc6d9eadad05dc3d5c9d1d9ddef94e10c5d3) Chore: make config validator params more consistent (#11435) (薛定谔的猫) -* [`d6c1122`](https://github.com/eslint/eslint/commit/d6c112289f0f16ade070865c8786831b7940ca79) Docs: Add working groups to maintainer guide (#11400) (Nicholas C. Zakas) -* [`5fdb4d3`](https://github.com/eslint/eslint/commit/5fdb4d3fb01b9d8a4c2dff71ed9cddb2f8feefb0) Build: compile deps to ES5 when generating browser file (fixes #11504) (#11505) (Teddy Katz) -* [`06fa165`](https://github.com/eslint/eslint/commit/06fa1655c3da8394ed9144d727115fc434b0416f) Build: update CI testing configuration (#11500) (Reece Dunham) -* [`956e883`](https://github.com/eslint/eslint/commit/956e883c21fd9f393bf6718d032a4e2e53b33f22) Docs: Fix example in no-restricted-modules docs (#11454) (Paul O’Shannessy) -* [`2c7431d`](https://github.com/eslint/eslint/commit/2c7431d6b32063f74e3837ee727f26af215eada7) Docs: fix json schema example dead link (#11498) (kazuya kawaguchi) -* [`e7266c2`](https://github.com/eslint/eslint/commit/e7266c2478aff5d66e7859313feb49e3a129f85e) Docs: Fix invalid JSON in "Specifying Parser Options" (#11492) (Mihira Jayasekera) -* [`6693161`](https://github.com/eslint/eslint/commit/6693161978a83e0730d5ea0fecdb627c5a2acdfd) Sponsors: Sync README with website (ESLint Jenkins) -* [`62fee4a`](https://github.com/eslint/eslint/commit/62fee4a976897d158c8c137339728cd280333286) Chore: eslint-config-eslint enable comma-dangle functions: "never" (#11434) (薛定谔的猫) -* [`34a5382`](https://github.com/eslint/eslint/commit/34a53829e7a63ff2f6b371d77ce283bbdd373b91) Build: copy bundled espree to website directory (#11478) (Pig Fang) -* [`f078f9a`](https://github.com/eslint/eslint/commit/f078f9a9e094ec00c61a6ef1c9550d017631e69a) Chore: use "file:" dependencies for internal rules/config (#11465) (Teddy Katz) -* [`0756128`](https://github.com/eslint/eslint/commit/075612871f85aa04cef8137bd32247e128ad600b) Docs: Add `visualstudio` to formatter list (#11480) (Patrick Eriksson) -* [`44de9d7`](https://github.com/eslint/eslint/commit/44de9d7e1aa2fcae475a97b8f597b7d8094566b2) Docs: Fix typo in func-name-matching rule docs (#11484) (Iulian Onofrei) - -v5.15.1 - March 4, 2019 - -* [`fe1a892`](https://github.com/eslint/eslint/commit/fe1a892f85b09c3d2fea05bef011530a678a6af5) Build: bundle espree (fixes eslint/eslint.github.io#546) (#11467) (薛定谔的猫) -* [`458053b`](https://github.com/eslint/eslint/commit/458053b0b541f857bf233dacbde5ba80681820f8) Fix: avoid creating invalid regex in no-warning-comments (fixes #11471) (#11472) (Teddy Katz) - -v5.15.0 - March 1, 2019 - -* [`4088c6c`](https://github.com/eslint/eslint/commit/4088c6c9d4578cd581ce8ff4385d90b58a75b755) Build: Remove path.resolve in webpack build (#11462) (Kevin Partington) -* [`ec59ec0`](https://github.com/eslint/eslint/commit/ec59ec09c8d001b8c04f9edc09994e2b0d0af0f9) New: add rule "prefer-named-capture-group" (fixes #11381) (#11392) (Pig Fang) -* [`a44f750`](https://github.com/eslint/eslint/commit/a44f75073306e5ea4e6722654009a99884fbca4f) Upgrade: eslint-scope@4.0.2 (#11461) (Teddy Katz) -* [`d3ce611`](https://github.com/eslint/eslint/commit/d3ce611e1c705440ccbcae357f2194134d026541) Sponsors: Sync README with website (ESLint Jenkins) -* [`ee88475`](https://github.com/eslint/eslint/commit/ee884754e4111e11994ff0df3f0c29e43e1dc3f2) Chore: add utils for rule tests (#11453) (薛定谔的猫) -* [`d4824e4`](https://github.com/eslint/eslint/commit/d4824e46d7a6ca1618454d3c6198403382108123) Sponsors: Sync README with website (ESLint Jenkins) -* [`6489518`](https://github.com/eslint/eslint/commit/64895185bde5233223648bcaf46f8deb72c9fb55) Fix: no-extra-parens crash when code is "((let))" (#11444) (Teddy Katz) -* [`9d20de2`](https://github.com/eslint/eslint/commit/9d20de2b0ac756bd62888119b8e08c7441d8a5aa) Sponsors: Sync README with website (ESLint Jenkins) -* [`3f14de4`](https://github.com/eslint/eslint/commit/3f14de458ba120e9c013f5fc7c6fe3e9b40c1460) Sponsors: Sync README with website (ESLint Jenkins) -* [`3d6c770`](https://github.com/eslint/eslint/commit/3d6c7709d47e047b25d91ca1a77d6dab92313061) Sponsors: Sync README with website (ESLint Jenkins) -* [`de5cbc5`](https://github.com/eslint/eslint/commit/de5cbc526b30405e742b35d85d04361529d49ed4) Update: remove invalid defaults from core rules (fixes #11415) (#11427) (Teddy Katz) -* [`eb0650b`](https://github.com/eslint/eslint/commit/eb0650ba20cf9f9ad78dbaccfeb7e0e7ab56e31d) Build: fix linting errors on master (#11428) (Teddy Katz) -* [`5018378`](https://github.com/eslint/eslint/commit/5018378131fd5190bbccca902c0cf4276ee1581a) Chore: enable require-unicode-regexp on ESLint codebase (#11422) (Teddy Katz) -* [`f6ba633`](https://github.com/eslint/eslint/commit/f6ba633f56eca6be20fc4b0d9496a78b9498d578) Chore: lint all files in the repo at the same time (#11425) (Teddy Katz) -* [`8f3d717`](https://github.com/eslint/eslint/commit/8f3d71754932669332ad7623bcc4c1aef3897125) Docs: Add non-attending TSC member info (#11411) (Nicholas C. Zakas) -* [`ce0777d`](https://github.com/eslint/eslint/commit/ce0777da5bc167fe0c529158fd8216d3eaf11565) Docs: use more common spelling (#11417) (薛定谔的猫) -* [`b9aabe3`](https://github.com/eslint/eslint/commit/b9aabe34311f6189b87c9d8a1aa40f3513fed773) Chore: run fuzzer along with unit tests (#11404) (Teddy Katz) -* [`db0c5e2`](https://github.com/eslint/eslint/commit/db0c5e2a7f894b7cda71007b0ba43d7814b3fb2e) Build: switch from browserify to webpack (fixes #11366) (#11398) (Pig Fang) - -v5.14.1 - February 18, 2019 - -* [`1d6e639`](https://github.com/eslint/eslint/commit/1d6e63930073e79e52890f552cc6e9a0646b7fb4) Fix: sort-keys throws Error at SpreadElement (fixes #11402) (#11403) (Krist Wongsuphasawat) - -v5.14.0 - February 15, 2019 - -* [`85a04b3`](https://github.com/eslint/eslint/commit/85a04b319e6dfde1458174cd1d8c9e7d33da0871) Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980) (Scott Stern) -* [`0c02932`](https://github.com/eslint/eslint/commit/0c02932f1b2e2a85809e84617efa1b8836c19cfb) Upgrade: espree@5.0.1 (#11401) (Ilya Volodin) -* [`104ae88`](https://github.com/eslint/eslint/commit/104ae881d0b21e9c64e006b2a2c21535cef0ad28) Docs: Update governance doc with reviewers status (#11399) (Nicholas C. Zakas) -* [`ab8ac6a`](https://github.com/eslint/eslint/commit/ab8ac6adaaf7a88e160899e7f438a4cfd655eb6e) Fix: Support boundary spread elements in sort-keys (#11158) (Jakub Rożek) -* [`a23d197`](https://github.com/eslint/eslint/commit/a23d1975d48841eafdead1a1357e2af842f688bc) New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243) (richie3366) -* [`e25e7aa`](https://github.com/eslint/eslint/commit/e25e7aa3ea1e8c9b3cd3242acda6d4a5572c2c6a) Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374) (Pig Fang) -* [`a1f7c44`](https://github.com/eslint/eslint/commit/a1f7c44ea9efbd9393889c1cc91b74260e0a8e02) Docs: fix space-before-blocks correct code for "classes": "never" (#11391) (PoziWorld) -* [`14f58a2`](https://github.com/eslint/eslint/commit/14f58a2bec4d6aade0de22771c378b86b1e51959) Docs: fix grammar in object-curly-spacing docs (#11389) (PoziWorld) -* [`d3e9a27`](https://github.com/eslint/eslint/commit/d3e9a27bbba30008a610df59e82b7192f0ecc3a3) Docs: fix grammar in “those who says” (#11390) (PoziWorld) -* [`ea8e804`](https://github.com/eslint/eslint/commit/ea8e8045ba0e6c1e1015104346af962f3e16fd81) Docs: Add note about support for object spread (fixes #11136) (#11395) (Steven Thomas) -* [`95aa3fd`](https://github.com/eslint/eslint/commit/95aa3fdb392d265e6c3d813d54076458e88e7ad8) Docs: Update README team and sponsors (ESLint Jenkins) -* [`51c4972`](https://github.com/eslint/eslint/commit/51c497298a15ad296a2b1f8fc397df687976b836) Update: Behavior of --init (fixes #11105) (#11332) (Nicholas C. Zakas) -* [`ad7a380`](https://github.com/eslint/eslint/commit/ad7a38097c32a91e5a831ef1bc8933601532576c) Docs: Update README team and sponsors (ESLint Jenkins) -* [`550de1e`](https://github.com/eslint/eslint/commit/550de1e611a1e9af873bcb18d74cf2056e8d2e1b) Update: use `default` keyword in JSON schema (fixes #9929) (#11288) (Pig Fang) -* [`983c520`](https://github.com/eslint/eslint/commit/983c5201210d7a4ffab0b3d05ab9919c0754e5ca) Update: Use 'readonly' and 'writable' for globals (fixes #11359) (#11384) (Nicholas C. Zakas) -* [`f1d3a7e`](https://github.com/eslint/eslint/commit/f1d3a7ee7c82365989e219b1dae379f08f6dd526) Upgrade: some deps (fixes #11372) (#11373) (薛定谔的猫) -* [`3e0c417`](https://github.com/eslint/eslint/commit/3e0c4176eff085498b813f8ba1732d7ed6ee44f8) Docs: Fix grammar in “there’s nothing prevent you” (#11385) (PoziWorld) -* [`de988bc`](https://github.com/eslint/eslint/commit/de988bc909b491366ad0cd9bc83f4d6de42d041a) Docs: Fix grammar: Spacing improve -> Spacing improves (#11386) (PoziWorld) -* [`1309dfd`](https://github.com/eslint/eslint/commit/1309dfdebb5595460b79dcac20df6a1f109e7566) Revert "Build: fix test failure on Node 11 (#11100)" (#11375) (薛定谔的猫) -* [`1e56897`](https://github.com/eslint/eslint/commit/1e56897db3e254e0aef6d2fe3274157fc379c79e) Docs: “the function actually use”: use -> uses (#11380) (PoziWorld) -* [`5a71bc9`](https://github.com/eslint/eslint/commit/5a71bc95a7e961b1b1b77022645e0bd9cdd08dc0) Docs: Update README team and sponsors (ESLint Jenkins) -* [`82a58ce`](https://github.com/eslint/eslint/commit/82a58ce26b282fd80335b3ac4fc88f21266c3ba1) Docs: Update README team and sponsors (ESLint Jenkins) -* [`546d355`](https://github.com/eslint/eslint/commit/546d355ace65631e27de859baea3ffcc50e0ad2c) Docs: Update README with latest sponsors/team data (#11378) (Nicholas C. Zakas) -* [`c0df9fe`](https://github.com/eslint/eslint/commit/c0df9febb7c7e045ababc10b88dbcbb3f28c724c) Docs: `...` is not an operator (#11232) (Felix Kling) -* [`7ecfdef`](https://github.com/eslint/eslint/commit/7ecfdefaeadb772f8b96ffe37c4a2c97fde0da16) Docs: update typescript parser (refs #11368) (#11369) (薛定谔的猫) -* [`3c90dd7`](https://github.com/eslint/eslint/commit/3c90dd7e25cf97833deddb11cfbc107a5663ac08) Update: remove prefer-spread autofix (fixes #11330) (#11365) (薛定谔的猫) -* [`5eb3121`](https://github.com/eslint/eslint/commit/5eb3121b82c1837da0c3021b7d9384bb30832e36) Update: add fixer for `prefer-destructuring` (fixes #11151) (#11301) (golopot) -* [`173eb38`](https://github.com/eslint/eslint/commit/173eb38cdb3e4673cba947521f27158828186d77) Docs: Clarify ecmaVersion doesn't imply globals (refs #9812) (#11364) (Keith Maxwell) -* [`84ce72f`](https://github.com/eslint/eslint/commit/84ce72fdeba082b7b132e4ac6b714fb1a93831b7) Fix: Remove extraneous linefeeds in `one-var` fixer (fixes #10741) (#10955) (st-sloth) -* [`389362a`](https://github.com/eslint/eslint/commit/389362a06ac6601512b872d3e843c7371f2a1bcc) Docs: clarify motivation for no-prototype-builtins (#11356) (Teddy Katz) -* [`533d240`](https://github.com/eslint/eslint/commit/533d240b0811f663494cb213b06cc9e51e1ff2d0) Update: no-shadow-restricted-names lets unassigned vars shadow undefined (#11341) (Teddy Katz) -* [`d0e823a`](https://github.com/eslint/eslint/commit/d0e823aef196a6564c87a78b72c1ef980ce67af9) Update: Make --init run js config files through linter (fixes #9947) (#11337) (Brian Kurek) -* [`92fc2f4`](https://github.com/eslint/eslint/commit/92fc2f4f3faf8aeaae8a8e71db0de405404fb6c3) Fix: CircularJSON dependency warning (fixes #11052) (#11314) (Terry) -* [`4dd19a3`](https://github.com/eslint/eslint/commit/4dd19a3c4c037adc860a65e96f2ba3eeccace1de) Docs: mention 'prefer-spread' in docs of 'no-useless-call' (#11348) (Klaus Meinhardt) -* [`4fd83d5`](https://github.com/eslint/eslint/commit/4fd83d5ec47a6a7b81cd8801c3bd63d27ea1c7c4) Docs: fix a misleading example in one-var (#11350) (薛定谔的猫) -* [`9441ce7`](https://github.com/eslint/eslint/commit/9441ce77b7228f2c4562e158a10905afe11f31f2) Chore: update incorrect tests to fix build failing (#11354) (薛定谔的猫) - -v5.13.0 - February 1, 2019 - -* [`91c8884`](https://github.com/eslint/eslint/commit/91c8884971f5e57f5f7490d8daf92c4a9a489836) Chore: use local function to append "s" instead of a package (#11293) (Timo Tijhof) -* [`b5143bf`](https://github.com/eslint/eslint/commit/b5143bfc09e53d8da8f63421ade093b7593f4f51) Update: for-direction detection false positives/negatives (#11254) (Ruben Bridgewater) -* [`9005e63`](https://github.com/eslint/eslint/commit/9005e632d13476880c55f7e3c8a6e450762a5171) Chore: increase camelcase test coverage (#11299) (Redmond Tran) -* [`5b14ad1`](https://github.com/eslint/eslint/commit/5b14ad1003c7df9a37621dea55c6d6d0484adc05) Fix: false positive in no-constant-condition (fixes #11306) (#11308) (Pig Fang) -* [`6567c4f`](https://github.com/eslint/eslint/commit/6567c4f6665df85c3347388b29d8193cc8208d63) Fix: only remove arrow before body in object-shorthand (fixes #11305) (#11307) (Pig Fang) -* [`fa2f370`](https://github.com/eslint/eslint/commit/fa2f370affa4814dbdda278f9859d0172d4b7aa2) Docs: update rule configuration values in examples (#11323) (Kai Cataldo) -* [`0a3c3ff`](https://github.com/eslint/eslint/commit/0a3c3ff1d91e8f39943efc4a7d2bf6927d68d37e) New: Allow globals to be disabled/configured with strings (fixes #9940) (#11338) (Teddy Katz) -* [`dccee63`](https://github.com/eslint/eslint/commit/dccee63cf41234180c71bf0fe01b165c9078fc69) Chore: avoid hard-coding the list of core rules in eslint:recommended (#11336) (Teddy Katz) -* [`c1fd6f5`](https://github.com/eslint/eslint/commit/c1fd6f54d92efe615bcae529006221e122dbe9e6) Chore: remove undocumented `Linter#rules` property (refs #9161) (#11335) (Teddy Katz) -* [`36e3356`](https://github.com/eslint/eslint/commit/36e335681d61cbe3c83b653b7cc5f95730f1d86e) Chore: remove dead code for loading rules (#11334) (Teddy Katz) -* [`c464e27`](https://github.com/eslint/eslint/commit/c464e2744ec76e7e9c6c5af0f6162c92187f1ece) Docs: Rename `result` -> `foo` (#11210) (Alexis Tyler) - -v5.12.1 - January 18, 2019 - -* [`eb5c401`](https://github.com/eslint/eslint/commit/eb5c4014f16be1c2003ed46ce9560d0d8a567d0f) Chore: use meta.messages in some rules (2/4) (refs #9870) (#10773) (薛定谔的猫) -* [`aa56247`](https://github.com/eslint/eslint/commit/aa56247746a0095996a41dd03bdbbf659f0f93b6) Fix: avoid loading core rules dynamically from FS in Linter (#11278) (Peter Metz) -* [`04450bb`](https://github.com/eslint/eslint/commit/04450bb7ed20f2412102538b238119d9764b4dc9) Docs: clarify process for adding committers (#11272) (Kai Cataldo) -* [`3ffcf26`](https://github.com/eslint/eslint/commit/3ffcf26c1c83efe7d7cf2d87f1063695ae653709) Docs: add @g-plane as committer (#11277) (Kai Cataldo) -* [`c403445`](https://github.com/eslint/eslint/commit/c40344566eff2e77a6ae2b2d2dbdbd4ad3e76b67) Fix: warn constant on RHS of || in no-constant-condition (fixes #11181) (#11253) (Merlin Mason) -* [`9194f45`](https://github.com/eslint/eslint/commit/9194f45ac7d521119a53773bf02b81670bad526e) Fix: Manage severity of 1 with TAP reporter (fixes #11110) (#11221) (Gabriel Cousin) -* [`000f495`](https://github.com/eslint/eslint/commit/000f4952ae6a4311fbbc3ed36c481235fcb0b64b) Docs: fix example for sort-imports ignoreDeclarationSort (#11242) (Remco Haszing) -* [`7c0bf2c`](https://github.com/eslint/eslint/commit/7c0bf2ca92d83125a1fa000c9c4250bae6b4fc21) Docs: Add `npx` usage to Getting Started guide (#11249) (eyal0803) -* [`da9174e`](https://github.com/eslint/eslint/commit/da9174e0798c1d785ddabb3ae405860fc5b89311) Docs: fixes typo peerDepencies (#11252) (Christian Kühl) -* [`9c31625`](https://github.com/eslint/eslint/commit/9c31625f19176664ef76dcf088ce50703c41c324) Docs: Improve custom formatter docs (#11258) (Nicholas C. Zakas) - -v5.12.0 - January 4, 2019 - -* [`0d91e7d`](https://github.com/eslint/eslint/commit/0d91e7d28e5eba79a6032165cdef5d4549d26462) Update: Add sort-imports ignoreDeclarationSort (fixes #11019) (#11040) (Remco Haszing) -* [`f92d6f0`](https://github.com/eslint/eslint/commit/f92d6f05c4dcd4a3a0616871e10b31edae9dfad5) Build: Add karma-chrome-launcher support (#11027) (薛定谔的猫) -* [`166853d`](https://github.com/eslint/eslint/commit/166853d9c59db493f0b1bb68a67ad868662a4205) Upgrade: eslint-plugin-eslint-plugin@2.0.1 (#11220) (薛定谔的猫) -* [`bfff77a`](https://github.com/eslint/eslint/commit/bfff77ad4eaa02e2e62481c986634df38d5db6e5) Fix: no-param-reassign parameter in ternary operator (fixes #11236) (#11239) (周昊宇) -* [`258b654`](https://github.com/eslint/eslint/commit/258b6541f61dc3a9ae64e200680766a11c3dd316) Upgrade: require-uncached renamed to import-fresh (#11066) (薛定谔的猫) - -v5.11.1 - December 26, 2018 - -* [`de79f10`](https://github.com/eslint/eslint/commit/de79f1026b7035f0296d7876f1db64f225cca1b8) Fix: handle optional catch bindings in no-useless-catch (#11205) (Colin Ihrig) - -v5.11.0 - December 22, 2018 - -* [`b4395f6`](https://github.com/eslint/eslint/commit/b4395f671442a7e0be956382c24cce38025a6df6) New: add option `first` for VariableDeclarator in indent (fixes #8976) (#11193) (Pig Fang) -* [`2b5a602`](https://github.com/eslint/eslint/commit/2b5a60284670a3ab1281b206941ed38faf2ea10c) New: no-useless-catch rule (fixes #11174) (#11198) (Alexander Grasley) -* [`06b3b5b`](https://github.com/eslint/eslint/commit/06b3b5bfcf0429c5078d4f4af3c03bb777e4f022) Fix: Account for comments in implicit-arrow-linebreak (#10545) (Mark de Dios) -* [`4242314`](https://github.com/eslint/eslint/commit/4242314215a6f35e432860433906f47af1a29724) Update: handle computed properties in camelcase (fixes #11084) (#11113) (Bence Dányi) -* [`1009304`](https://github.com/eslint/eslint/commit/100930493d9ab802a94dac5c761515b12241ddd2) Docs: add a note for no-unused-expressions (fixes #11169) (#11192) (Pig Fang) -* [`88f99d3`](https://github.com/eslint/eslint/commit/88f99d31b88a4cde4563bc4a6f4c41f0cc557885) Docs: clarify how to use configs in plugins (#11199) (Kai Cataldo) -* [`bcf558b`](https://github.com/eslint/eslint/commit/bcf558b2f7036f487af2bdb2b2d34b6cdf7fc174) Docs: Clarify the no-unused-vars docs (#11195) (Jed Fox) -* [`a470eb7`](https://github.com/eslint/eslint/commit/a470eb73d52fae0f0bc48de5a487e23cf78fcfa9) Docs: Fix no-irregular-whitespace description (#11196) (Jed Fox) -* [`8abc8af`](https://github.com/eslint/eslint/commit/8abc8afe71691b747cbd1819a13d896e8aa5b92a) Docs: Remove a misleading example (#11204) (Bogdan Gradinariu) -* [`733d936`](https://github.com/eslint/eslint/commit/733d93618a99758a05453ab94505a9f1330950e0) Docs: link to JSDoc EOL blogpost in valid-jsdoc and require-jsdoc (#11191) (Nathan Diddle) -* [`d5eb108`](https://github.com/eslint/eslint/commit/d5eb108e17f676d0e4fcddeb1211b4bdfac760c1) Docs: Ensure `triage` label is added to new issues (#11182) (Teddy Katz) -* [`617a287`](https://github.com/eslint/eslint/commit/617a2874ed085bca36ca289aac55e3b7f7ce937e) Docs: add missing deprecation notices for jsdoc rules (#11171) (Teddy Katz) - -v5.10.0 - December 8, 2018 - -* [`4b0f517`](https://github.com/eslint/eslint/commit/4b0f517cd317e5f1b99a1e8a0392332bd8a2e231) Upgrade: single- and multiline const, let, var statements (fixes #10721) (#10919) (Tom Panier) -* [`9666aba`](https://github.com/eslint/eslint/commit/9666abaf46c841fba7b5d4e53c6998cd25b9bc33) Update: space-infix-ops reports violating operator (#10934) (Bence Dányi) -* [`c14f717`](https://github.com/eslint/eslint/commit/c14f717f4c32860766185da47f64f8eb0c2d2998) Fix: Update all-files-ignored.txt message to be less confusing (#11075) (z.ky) -* [`9f3573d`](https://github.com/eslint/eslint/commit/9f3573dda3dc35bc220e945686cc835eaad0ac2c) Docs: Clarify the CLIEngine options (#10995) (Ed Morley) -* [`dd7b0cb`](https://github.com/eslint/eslint/commit/dd7b0cb019d94964930d30fec36f7b22ef072822) Chore: refactor template literal feature detection in 'quotes' rule (#11125) (Bryan) -* [`3bf0332`](https://github.com/eslint/eslint/commit/3bf0332508b921cb660c2e8a1ab7ddf46a2013b6) Fix: fix the fixer of lone comma with comments (fixes #10632) (#11154) (Pig Fang) -* [`f850726`](https://github.com/eslint/eslint/commit/f8507260c2091d18488fde20e466639d1a7f913c) Upgrade: Espree v5.0.0 (#11161) (Kai Cataldo) -* [`4490d7a`](https://github.com/eslint/eslint/commit/4490d7af529d4ecc18b6874f1d838869656da58a) Update: deprecate valid-jsdoc and require-jsdoc (#11145) (Teddy Katz) -* [`60dfb6c`](https://github.com/eslint/eslint/commit/60dfb6c623dfe829e5350dabe507e7850c1beacf) Docs: Update issue templates (#11163) (Teddy Katz) -* [`958987a`](https://github.com/eslint/eslint/commit/958987aa6f5630faa051d8f822f0200faff41924) Docs: Fix link to rule no-useless-rename (#11165) (Brian) -* [`62fd2b9`](https://github.com/eslint/eslint/commit/62fd2b93448966331db3eb2dfbe4e1273eb032b2) Update: Amend keyword-spacing to validate `default` keywords (#11097) (Bin Ury) -* [`4bcdfd0`](https://github.com/eslint/eslint/commit/4bcdfd07d514fd7a6b8672d33703d0b6c606f214) Chore: fix some jsdoc-related issues (#11148) (薛定谔的猫) -* [`c6471ed`](https://github.com/eslint/eslint/commit/c6471ed6feb3e71e239379a7042deb9b8ab3cf39) Docs: fix typo in issue-templates/new-rule (#11149) (薛定谔的猫) -* [`5d451c5`](https://github.com/eslint/eslint/commit/5d451c510c15abc41b5bb14b4955a7db96aeb100) Chore: Remove dependency on is-resolvable (#11128) (Matt Grande) -* [`bc50dc7`](https://github.com/eslint/eslint/commit/bc50dc7737496712463220e662946eb516e36ae1) Chore: Move ignored-paths, report-translator to lib/util (refs #10559) (#11116) (Kevin Partington) -* [`c0a80d0`](https://github.com/eslint/eslint/commit/c0a80d0ca3c80ca27694fc8aedcf84b72bfd9465) Fix: Do not strip underscores in camelcase allow (fixes #11000) (#11001) (Luke Page) -* [`a675c89`](https://github.com/eslint/eslint/commit/a675c89573836adaf108a932696b061946abf1e6) Docs: (Grammar) "the setup" -> "to set up" (#11117) (MarvinJWendt) -* [`54dfa60`](https://github.com/eslint/eslint/commit/54dfa602f62e6d183d57d60d5fdd417a263f479e) Fix: Typo in function comment parameters (#11111) (Pierre Maoui) -* [`cf296bd`](https://github.com/eslint/eslint/commit/cf296bdabf0dbbfbae491419e38aee4ecd63ec71) Docs: switch incorrect example with correct one (#11107) (Romain Le Quellec) -* [`d2d500c`](https://github.com/eslint/eslint/commit/d2d500ca5dff307189b9d4161a5e7b8282557dd6) Docs: no-console#When-Not-To-Use provides incorrect rule snippet (#11093) (Lawrence Chou) -* [`f394a1d`](https://github.com/eslint/eslint/commit/f394a1dfc5eb4874f899b7bc19685896893af7b8) Chore: Extract config comment parsing (#11091) (Nicholas C. Zakas) -* [`709190f`](https://github.com/eslint/eslint/commit/709190f8c5d7559b1e0915e25af60b50a94ba1c7) Build: fix test failure on Node 11 (#11100) (Teddy Katz) -* [`3025cdd`](https://github.com/eslint/eslint/commit/3025cddf0a2ea8461ce05575098a5714fcf6278d) Update: don't indent leading semi in line after import (fixes #11082) (#11085) (Pig Fang) -* [`e18c827`](https://github.com/eslint/eslint/commit/e18c827cc12cb1c52e5d0aa993f572cb56238704) Chore: refactor linter#parseBooleanConfig to improve readability (#11074) (薛定谔的猫) -* [`5da378a`](https://github.com/eslint/eslint/commit/5da378ac922d732ca1765f08edee0face1b1b924) Upgrade: eslint-release@1.2.0 (#11073) (Teddy Katz) - -v5.9.0 - November 9, 2018 - -* 9436712 Fix: Unused recursive function expressions (fixes #10982) (#11032) (Sergei Startsev) -* c832cd5 Update: add `ignoreDestructuring` option to `id-match` rule (#10554) (一名宅。) -* 54687a8 Fix: prefer-const autofix multiline assignment (fixes #10582) (#10987) (Scott Stern) -* ae2b61d Update: "off" options for "space-before-blocks" (refs #10906) (#10907) (Sophie Kirschner) -* 57f357e Docs: Update require-await docs with exception (fixes #9540) (#11063) (Nicholas C. Zakas) -* 79a2797 Update: no-restricted-imports to check re-export (fixes #9678) (#11064) (Nicholas C. Zakas) -* 3dd7493 Docs: update ecmaVersion to include 2019/10 values (#11059) (Vse Mozhet Byt) -* 607635d Upgrade: eslint-plugin-node & eslint-plugin (#11067) (薛定谔的猫) -* dcc6233 Fix: Ignore empty statements in no-unreachable (fixes #9081) (#11058) (Nicholas C. Zakas) -* 7ad86de New: Add --fix-type option to CLI (fixes #10855) (#10912) (Nicholas C. Zakas) -* 0800b20 Chore: fix invalid super() calls in tests (#11054) (Teddy Katz) -* 4fe3287 Docs: Cross-reference two rules (refs #11041) (#11042) (Paul Melnikow) -* 5525eb6 Fix: rule deprecation warnings did not consider all rules (#11044) (Teddy Katz) -* 44d37ca Docs: Update steps for adding new TSC member (#11038) (Nicholas C. Zakas) -* 802e926 Update: Warn for deprecation in Node output (fixes #7443) (#10953) (Colin Chang) - -v5.8.0 - October 26, 2018 - -* 9152417 Fix: deprecation warning in RuleTester using Node v11 (#11009) (Teddy Katz) -* e349a03 Docs: Update issue templates to ask for PRs (#11012) (Nicholas C. Zakas) -* 3d88b38 Chore: avoid using legacy report API in no-irregular-whitespace (#11013) (Teddy Katz) -* 5a31a92 Build: compile espree's deps to ES5 when generating site (fixes #11014) (#11015) (Teddy Katz) -* 3943635 Update: Create Linter.version API (fixes #9271) (#11010) (Nicholas C. Zakas) -* a940cf4 Docs: Mention version for config glob patterns (fixes #8793) (Nicholas C. Zakas) -* 6e1c530 Build: run tests on Node 11 (#11008) (Teddy Katz) -* 58ff359 Docs: add instructions for npm 2FA (refs #10631) (#10992) (Teddy Katz) -* 2f87bb3 Upgrade: eslint-release@1.0.0 (refs #10631) (#10991) (Teddy Katz) -* 57ef0fd Fix: prefer-const when using destructuring assign (fixes #8308) (#10924) (Nicholas C. Zakas) -* 577cbf1 Chore: Add typescript-specific edge case tests to space-infix-ops (#10986) (Bence Dányi) -* d45b184 Chore: Using deconstruction assignment for shelljs (#10974) (ZYSzys) - -v5.7.0 - October 12, 2018 - -* 6cb63fd Update: Add iife to padding-line-between-statements (fixes #10853) (#10916) (Kevin Partington) -* 5fd1bda Update: no-tabs allowIndentationTabs option (fixes #10256) (#10925) (Kevin Partington) -* d12be69 Fix: no-extra-bind No autofix if arg may have side effect (fixes #10846) (#10918) (Kevin Partington) -* 847372f Fix: no-unused-vars false pos. with markVariableAsUsed (fixes #10952) (#10954) (Roy Sutton) -* 4132de7 Chore: Simplify space-infix-ops (#10935) (Bence Dányi) -* 543edfa Fix: Fix error with one-var (fixes #10937) (#10938) (Justin Krup) -* 95c4cb1 Docs: Fix typo for no-unsafe-finally (#10945) (Sergio Santoro) -* 5fe0e1a Fix: no-invalid-regexp disallows \ at end of pattern (fixes #10861) (#10920) (Toru Nagashima) -* f85547a Docs: Add 'When Not To Use' section to space-infix-ops (#10931) (Bence Dányi) -* 3dccac4 Docs: Update working-with-parsers link (#10929) (Azeem Bande-Ali) -* 557a8bb Docs: Remove old note about caching, add a new one (fixes #10739) (#10913) (Zac) -* fe8111a Chore: Add more test cases to space-infix-ops (#10936) (Bence Dányi) -* 066f7e0 Update: camelcase rule ignoreList added (#10783) (Julien Martin) -* 70bde69 Upgrade: table to version 5 (#10903) (Rouven Weßling) -* 2e52bca Chore: Update issue templates (#10900) (Nicholas C. Zakas) - -v5.6.1 - September 28, 2018 - -* 9b26bdb Fix: avoid exponential require-atomic-updates traversal (fixes #10893) (#10894) (Teddy Katz) -* 9432b10 Fix: make separateRequires work in consecutive mode (fixes #10784) (#10886) (Pig Fang) -* e51868d Upgrade: debug@4 (fixes #10854) (#10887) (薛定谔的猫) -* d3f3994 Docs: add information about reporting security issues (#10889) (Teddy Katz) -* cc458f4 Build: fix failing tests on master (#10890) (Teddy Katz) -* a6ebfd3 Docs: clarify defaultAssignment option, fix no-unneeded-ternary examples (#10874) (CoffeeTableEspresso) -* 9d52541 Fix: Remove duplicate error message on crash (fixes #8964) (#10865) (Nicholas C. Zakas) -* 4eb9a49 Docs: Update quotes.md (#10862) (The Jared Wilcurt) -* 9159e9b Docs: Update complexity.md (#10867) (Szymon Przybylski) -* 14f4e46 Docs: Use Linter instead of linter in Nodejs API page (#10864) (Nicholas C. Zakas) -* b3e3cb1 Chore: Update debug log name to match filename (#10863) (Nicholas C. Zakas) - -v5.6.0 - September 14, 2018 - -* c5b688e Update: Added generators option to func-names (fixes #9511) (#10697) (Oscar Barrett) -* 7da36d5 Fix: respect generator function expressions in no-constant-condition (#10827) (Julian Rosse) -* 0a65844 Chore: quote enable avoidEscape option in eslint-config-eslint (#10626) (薛定谔的猫) -* 32f41bd Chore: Add configuration wrapper markdown for the bug report template (#10669) (Iulian Onofrei) - -v5.5.0 - August 31, 2018 - -* 6e110e6 Fix: camelcase duplicate warning bug (fixes #10801) (#10802) (Julian Rosse) -* 5103ee7 Docs: Add Brackets integration (#10813) (Jan Pilzer) -* b61d2cd Update: max-params to only highlight function header (#10815) (Ian Obermiller) -* 2b2f11d Upgrade: babel-code-frame to version 7 (#10808) (Rouven Weßling) -* 2824d43 Docs: fix comment placement in a code example (#10799) (Vse Mozhet Byt) -* 10690b7 Upgrade: devdeps and deps to latest (#10622) (薛定谔的猫) -* 80c8598 Docs: gitignore syntax updates (fixes #8139) (#10776) (Gustavo Santana) -* cb946af Chore: use meta.messages in some rules (1/4) (#10764) (薛定谔的猫) - -v5.4.0 - August 17, 2018 - -* a70909f Docs: Add jscs-dev.github.io links (#10771) (Gustavo Santana) -* 034690f Fix: no-invalid-meta crashes for non Object values (fixes #10750) (#10753) (Sandeep Kumar Ranka) -* 11a462d Docs: Broken jscs.info URLs (fixes #10732) (#10770) (Gustavo Santana) -* 985567d Chore: rm unused dep string.prototype.matchall (#10756) (薛定谔的猫) -* f3d8454 Update: Improve no-extra-parens error message (#10748) (Timo Tijhof) -* 562a03f Fix: consistent-docs-url crashes if meta.docs is empty (fixes #10722) (#10749) (Sandeep Kumar Ranka) -* 6492233 Chore: enable no-prototype-builtins in codebase (fixes #10660) (#10664) (薛定谔的猫) -* 137140f Chore: use eslintrc overrides (#10677) (薛定谔的猫) - -v5.3.0 - August 3, 2018 - -* dd6cb19 Docs: Updated no-return-await Rule Documentation (fixes #9695) (#10699) (Marla Foreman) -* 6009239 Chore: rename utils for consistency (#10727) (薛定谔的猫) -* 6eb972c New: require-unicode-regexp rule (fixes #9961) (#10698) (Toru Nagashima) -* 5c5d64d Fix: ignored-paths for Windows path (fixes #10687) (#10691) (Toru Nagashima) -* 5f6a765 Build: ensure URL fragments remain in documentation links (fixes #10717) (#10720) (Teddy Katz) -* 863aa78 Docs: add another example for when not to use no-await-in-loop (#10714) (Valeri Karpov) -* 6e78b7d Docs: remove links to terminated jscs.info domain (#10706) (Piotr Kuczynski) -* d56c39d Fix: ESLint cache no longer stops autofix (fixes #10679) (#10694) (Kevin Partington) -* 2cc3240 New: add no-misleading-character-class (fixes #10049) (#10511) (Toru Nagashima) -* 877f4b8 Fix: The "../.." folder is always ignored (fixes #10675) (#10682) (Sridhar) -* 5984820 Chore: Move lib/file-finder.js to lib/util/ (refs #10559) (#10695) (Kevin Partington) -* e37a593 Update: Fix incorrect default value for position (#10670) (Iulian Onofrei) -* 8084bfc Docs: change when not to use object spread (#10621) (Benny Powers) -* 7f496e2 Chore: Update require path for ast-utils (#10693) (Kevin Partington) -* 648a33a Chore: reorganize code structure of utilities (refs #10599) (#10680) (薛定谔的猫) -* f026fe1 Update: Fix 'function' in padding-line-between-statements (fixes #10487) (#10676) (Kevin Partington) -* c2bb8bb Docs: Remove superfluous object option sample code (#10652) (Iulian Onofrei) -* d34a13b Docs: add subheader in configuring/configuring-rules (#10686) (薛定谔的猫) -* d8aea28 Chore: rm unnecessary plugin in eslint-config-eslint (#10685) (薛定谔的猫) -* 9e76be7 Update: indent comments w/ nearby code if no blank lines (fixes #9733) (#10640) (Kevin Partington) -* 9e93d46 New: add no-async-promise-executor rule (fixes #10217) (#10661) (Teddy Katz) -* 5a2538c New: require-atomic-updates rule (fixes #10405) (#10655) (Teddy Katz) -* 8b83d2b Fix: always resolve default ignore patterns from CWD (fixes #9227) (#10638) (Teddy Katz) -* acb6658 Fix: ESLint crash with prefer-object-spread (fixes #10646) (#10649) (薛定谔的猫) -* 99fb7d3 Docs: fix misleading no-prototype-builtins description (#10666) (薛定谔的猫) -* 005b849 Docs: fix outdated description of `baseConfig` option (#10657) (Teddy Katz) -* 15a77c4 Docs: fix broken links (fixes eslint/eslint-jp#6) (#10658) (Toru Nagashima) -* 87cd344 Docs: Make marking a default option consistent with other rules (#10650) (Iulian Onofrei) -* 0cb5e3e Chore: Replace some function application with spread operators (#10645) (Kevin Partington) -* b6daf0e Docs: Remove superfluous section from no-unsafe-negation (#10648) (Iulian Onofrei) -* e1a3cac Chore: rm deprecated experimentalObjectRestSpread option in tests (#10647) (薛定谔的猫) - -v5.2.0 - July 20, 2018 - -* 81283d0 Update: Cache files that failed linting (fixes #9948) (#10571) (Kevin Partington) -* 13cc63e Upgrade: ignore@4.0.2 (#10619) (Rouven Weßling) -* ac77a80 Chore: Fixing a call to Object.assign.apply in Linter (#10629) (Kevin Partington) -* 761f802 Upgrade: eslint-plugin-node to 7.0.1 (#10612) (Toru Nagashima) -* c517b2a Build: fix npm run perf failing(fixes #10577) (#10607) (薛定谔的猫) -* e596939 Chore: fix redundant equality check (#10617) (Toru Nagashima) -* 9f93d5f Docs: Updated Working with Custom Formatters (fixes #9950) (#10592) (Marla Foreman) -* 9aaf195 Chore: Extract lint result cache logic (refs #9948) (#10562) (Kevin Partington) -* 80b296e Build: package.json update for eslint-config-eslint release (ESLint Jenkins) -* e4e7ff2 Chore: fix error message in eslint-config-eslint (#10588) (薛定谔的猫) -* 1e88170 Chore: Move lib/logging and lib/timing to lib/util/ (refs #10559) (#10579) (Kevin Partington) -* 64dfa21 Build: Fix prerelease logic in blog post generation (fixes #10578) (#10581) (Kevin Partington) -* 0faf633 Chore: Simplify helper method in Linter tests (#10580) (Kevin Partington) - -v5.1.0 - July 8, 2018 - -* 7328f99 Build: package.json update for eslint-config-eslint release (ESLint Jenkins) -* b161f6b Build: Include prerelease install info in release blog post (#10463) (Kevin Partington) -* b2df738 Fix: prefer-object-spread duplicated comma (fixes #10512, fixes #10532) (#10524) (Toru Nagashima) -* d8c3a25 Fix: wrap-regex doesn't work in some expression(fixes #10573) (#10576) (薛定谔的猫) -* 114f42e Docs: Clarify option defaults in max-lines-per-function docs (#10569) (Chris Harwood) -* 63f36f7 Fix: sort-keys in an object that contains spread (fixes #10261) (#10495) (katerberg) -* 601a5c4 Fix: Prefer-const rule crashing on array destructuring (fixes #10520) (#10527) (Michael Mason) -* 143890a Update: Adjust grammar of error/warnings fixable (#10546) (Matt Mischuk) -* 8ee39c5 Chore: small refactor config-validator (#10565) (薛定谔的猫) -* 100f1be Docs: add note about release issues to readme (#10572) (Teddy Katz) -* 02efeac Fix: do not fail on nested unknown operators (#10561) (Rubén Norte) -* 92b19ca Chore: use eslintrc overrides(dogfooding) (#10566) (薛定谔的猫) -* 076a6b6 Docs: add actionable fix to no-irregular-whitespace (#10558) (Matteo Collina) -* de663ec Docs: Only successfully linted files are cached (fixes #9802) (#10557) (Kevin Partington) -* f0e22fc Upgrade: globals@11.7.0 (#10497) (薛定谔的猫) -* 8a2ff2c Docs: adding a section about disable rules for some files (#10536) (Wellington Soares) -* f22a3f8 Docs: fix a word in no-implied-eval (#10539) (Dan Homola) -* 20d8bbd Docs: add missing paragraph about "custom parsers" (#10547) (Pig Fang) -* b7addf6 Update: deprecate no-catch-shadow (fixes #10466) (#10526) (Toru Nagashima) -* e862dc3 Fix: Remove autofixer for no-debugger (fixes #10242) (#10509) (Teddy Katz) - -v5.0.1 - June 25, 2018 - -* 196c102 Fix: valid-jsdoc should allow optional returns for async (fixes #10386) (#10480) (Mark Banner) -* 4c823bd Docs: Fix max-lines-per-function correct code's max value (#10513) (Rhys Bower) - -v5.0.0 - June 22, 2018 - -* 0feedfd New: Added max-lines-per-function rule (fixes #9842) (#10188) (peteward44) -* daefbdb Upgrade: eslint-scope and espree to 4.0.0 (refs #10458) (#10500) (Brandon Mills) -* 077358b Docs: no-process-exit: recommend process.exitCode (#10478) (Andres Kalle) -* f93d6ff Fix: do not fail on unknown operators from custom parsers (fixes #10475) (#10476) (Rubén Norte) -* 05343fd Fix: add parens for yield statement (fixes #10432) (#10468) (Pig Fang) -* d477c5e Fix: check destructuring for "no-shadow-restricted-names" (fixes #10467) (#10470) (Pig Fang) -* 7a7580b Update: Add considerPropertyDescriptor option to func-name-matching (#9078) (Dieter Luypaert) -* e0a0418 Fix: crash on optional catch binding (#10429) (Toru Nagashima) -* de4dba9 Docs: styling team members (#10460) (薛定谔的猫) -* 5e453a3 Docs: display team members in tables. (#10433) (薛定谔的猫) -* b1895eb Docs: Restore intentional spelling mistake (#10459) (Wilfred Hughes) - -v5.0.0-rc.0 - June 9, 2018 - -* abf400d Update: Add ignoreDestructing option to camelcase rule (fixes #9807) (#10373) (Andrew Lunny) -* e2b394d Upgrade: espree and eslint-scope to rc versions (#10457) (Kevin Partington) -* a370da2 Chore: small opt to improve readability (#10241) (薛定谔的猫) -* 640bf07 Update: Fixes multiline no-warning-comments rule. (fixes #9884) (#10381) (Scott Stern) -* 831c39a Build: Adding rc release script to package.json (#10456) (Kevin Partington) -* dc4075e Update: fix false negative in no-use-before-define (fixes #10227) (#10396) (Toru Nagashima) -* 3721841 Docs: Add new experimental syntax policy to README (fixes #9804) (#10408) (Kevin Partington) -* d0aae3c Docs: Create docs landing page (#10453) (Kevin Partington) -* fe8bec3 Fix: fix writing config file when `source` is `prompt` (#10422) (Pig Fang) -* 917108d Update: Add requireParamType option to valid-jsdoc (fixes #6753) (#10220) (Tomasz Sterna) -* 1984c21 Docs: move custom parsers docs into a page (fixes #9919) (#10431) (Pig Fang) -* 400d4b5 Docs: Add rest and spread operator changes to migration guide (#10416) (Yannick Croissant) -* e7bdd02 Upgrade: Consume espree@4.0.0-alpha.1 (#10410) (Kevin Partington) -* 3e9f33a Fix: prevent crashing from JSON parsing error (fixes #10364) (#10376) (Pig Fang) -* 636457d Fix: parse later ES files in `eslint --init` (fixes #10003) (#10378) (Pig Fang) - -v5.0.0-alpha.4 - May 28, 2018 - -* ce3e62a Docs: remove test coverage badge (#10407) (薛定谔的猫) -* 240c1a4 Fix: prefer-const object destructuring false positive (fixes #9108) (#10368) (Pig Fang) -* 93c9a52 Update: config-validator should validate overrides (#10357) (Toru Nagashima) -* c2e0398 Update: Improves the prefer-object-spread rule by removing extraneous visitors (#10351) (Sharmila Jesupaul) -* d848949 Update: Support JSXFragment node (fixes #9662) (#9664) (Clement Hoang) -* f268128 Build: add Node v10 to travis (#10262) (alberto) -* 9c922ce Update: Add "consistent" option to array-element-newline (fixes #9457) (#10355) (Pig Fang) -* 65bce3a Fix: ensure --stdin flag works when stdin is piped asynchronously (#10393) (Teddy Katz) -* b9b23a9 Chore: rm unused argument (#10400) (薛定谔的猫) -* 8b7a70c Fix: handle one-var with no semicolon (fixes #10330) (#10371) (Malcolm Groves) -* 465e615 New: prompt users before installing dependencies (#10353) (Pig Fang) -* e25fc22 Chore: remove assert.doesNotThrow in tests (#10199) (Ruben Bridgewater) -* fb148aa Fix: allow no tokens after `return` keyword (fixes #10372) (#10379) (Pig Fang) -* 074bc1c Docs: polish for max-classes-per-file rule (#10377) (Pig Fang) -* a812845 Fix: allow array spread for prefer-object-spread rule (fixes #10344) (#10347) (Pig Fang) -* 448fc52 Docs: Update link to Integrations / Build tools / Start (#10354) (Kir Belevich) -* 4e5e9be Chore: avoid unnecessary filesystem accesses during config search (#10359) (Teddy Katz) -* 363da01 Chore: avoid code duplication in rule severity checking (#10358) (Teddy Katz) - -v5.0.0-alpha.3 - May 11, 2018 - -* 1a6b399 New: Adds prefer-object-spread rule (refs: #7230) (#9955) (Sharmila Jesupaul) -* c4109b2 New: add max-classes-per-file rule (#10163) (James Garbutt) -* 41f0f6e Breaking: report multiline eslint-disable-line directives (fixes #10334) (#10335) (Teddy Katz) -* 4ccd25a Chore: add eslint-plugin-node to eslint-config-eslint(fixes #10319) (#10320) (薛定谔的猫) -* 82757b2 Docs: Adding a little guidance to rule documentation (#10301) (Justin) -* 09dde26 Breaking: new object-curly-newline/no-self-assign default (fixes #10215) (#10337) (Teddy Katz) -* d65f11d Fix: correct comma fix in spare array (fixes #10273) (#10329) (Malcolm Groves) -* c343d86 Fix: do not autofix octal escape sequence (fixes #10031) (#10240) (Malcolm Groves) -* 514013c New: Add `globInputPaths` CLIEngine option (fixes #9972) (#10191) (Pierre Vanduynslager) -* 02e7b28 Chore: upgrade deps (#10339) (薛定谔的猫) -* 1397179 Chore: unskip test for scope analysis (#10336) (Teddy Katz) -* e5b33be Update: Add --fix for one-var rule (refs #9072) (#10040) (Sebastian Malton) -* 99b842d Chore: upgrade mock-fs@4.5.0 (#10325) (Tim Schaub) -* fe91859 Chore: Update issue templates with new format (#10309) (Ilya Volodin) -* 2f30aa5 Docs: add a better vim linting engine (#10292) (Jon Smithers) -* df2c1fb Docs: improve formatter guide (refs #9550) (#10294) (Dominic Lee) -* f7330c1 Chore: Add ESLint path to plugin-missing message (#10283) (Kevin Partington) -* bb6090f Fix: Throw error when --ignore-path not a file (fixes #10076) (#10205) (Malcolm Groves) -* 1b6b2b2 Build: remove trailing spaces in blogpost template (#10280) (Teddy Katz) -* a960d69 Docs: remove outdated notes from migration guide (#10279) (Teddy Katz) - -v5.0.0-alpha.2 - April 27, 2018 - -* 510ca8b Docs: make grammatical tweaks in migration guide (#10278) (Teddy Katz) -* 02e44a5 Breaking: remove TDZ scopes (fixes #10245) (#10270) (Toru Nagashima) -* c74933b Breaking: remove extra check in getScope (fixes #10246, fixes #10247) (#10252) (Toru Nagashima) -* 7c2e83a Chore: improve tests and checking for equality (#10182) (Ruben Bridgewater) -* 8799972 Docs: make template link wording more clear (#10219) (David Luzar) -* 8b7c6ea Breaking: report fatal error for linting nonexistent files (fixes #7390) (#10143) (Teddy Katz) -* 9100819 Breaking: fix plugin resolver in extends (fixes #9904) (#10236) (Toru Nagashima) -* c45f1d0 Breaking: add rules to recommended (fixes #8865) (#10158) (薛定谔的猫) -* 1d443a0 Fix: valid-jsdoc does not know async function returns (fixes #9881) (#10161) (Rachael Sim) -* a82cbea Update: re-enable experimentalObjectRestSpread (fixes #9990) (#10230) (Toru Nagashima) -* f9c7371 Fix: do not autofix object-shorthand with comments (fixes #10038) (#10238) (Malcolm Groves) -* 4672b56 Docs: Correct wording in the `smart-tabs` docs page (#10277) (Jed Fox) -* b32d1f4 Chore: upgrade eslump@1.6.2 (#10258) (薛定谔的猫) -* 7938bf1 Chore: update eslint-fuzzer ecmaVersion to 2018 (#10255) (薛定谔的猫) -* a2953ec Chore: small opt to improve readability (#10225) (薛定谔的猫) -* 85a5191 Docs: Update JSCS FAQ (#10221) (alberto) -* 8e89d5c Docs: Fix typo (#10223) (alberto) -* c0c331e Docs: Add Prettier to FAQ (#10222) (alberto) -* 2443627 Docs: add backticks in getter-return (#10218) (薛定谔的猫) -* 74bb5b5 Docs: Fix misspelling in changelog (#10216) (Kevin Partington) - -v5.0.0-alpha.1 - April 13, 2018 - -* b2a48a9 Breaking: stop using fake `context._linter` property (fixes #10140) (#10209) (Teddy Katz) -* a039956 Breaking: remove deprecated browser/jest/node globals (fixes #10141) (#10210) (Teddy Katz) -* 98f1cad Docs: update migration guide with latest changes (#10212) (Teddy Katz) -* 2e60017 Chore: remove concat-stream dependency (#10173) (Teddy Katz) -* 7f69f11 Chore: rearrange init options. (#10131) (薛定谔的猫) -* f595fd8 Upgrade: upgrade deps (#10184) (alberto) -* 71167be Docs: fix wrong config in id-length (#10196) (薛定谔的猫) -* 81629d2 Chore: enable rest/spread rules on ESLint codebase (#10211) (Teddy Katz) -* 2324570 Breaking: no-unused-vars reports all after-used params (fixes #9909) (#10119) (Kevin Partington) -* 7765fc4 Upgrade: ajv@^6.0.1, still using json schema draft 04 (#9856) (Kevin Partington) -* b77846d Breaking: drop supporting Node.js 4 (fixes #10052) (#10074) (薛定谔的猫) -* cd34d44 Chore: avoid modifying global state when tests fail (#10201) (Teddy Katz) -* 731da1e Docs: fix code in correct example. (#10195) (薛定谔的猫) -* 3780915 Docs: fix some small errors in examples (#10194) (薛定谔的猫) -* 869c9f5 Upgrade: babelify (#10185) (alberto) -* 218ee57 Fix: report no-case-declarations from declarations (fixes #10048) (#10167) (Carlo Abelli) -* b7ee1ed Upgrade: upgrade devdeps (#10178) (alberto) -* db1a582 Chore: Add debug logging for CLI args as they came in (#10174) (Kevin Partington) -* f3a0291 Upgrade: Update dependencies. (#10168) (alberto) -* 7d6e052 Upgrade: esquery@^1.0.1 (fixes #8733) (#10170) (Kevin Partington) -* 1e7252f Docs: Add more related rules for object-curly-spacing (#10175) (Saugat Acharya) -* e5cf9cc Docs: Reorder README sections (#10172) (alberto) -* c85578f Chore: Remove `esprima-fb` dependency. (#10171) (alberto) -* d0dc2e3 Docs: Add Missing Quotes (#10162) (Samarth Verma) -* 7a63bfa Upgrade: eslint-release to v0.11.1 (#10156) (Teddy Katz) -* b7a1a7a Build: Gensite creates prerelease dirs if needed (#10154) (Brandon Mills) - -v5.0.0-alpha.0 - March 30, 2018 - -* f4b3af5 Breaking: Upgrade to Espree v4 alpha (refs #9990) (#10152) (Brandon Mills) -* 3351129 Docs: add v5.0.0 migration guide (fixes #10142) (#10147) (Teddy Katz) -* f2f98dd Build: make prerelease script publish to GitHub/website (#10151) (Teddy Katz) -* d440e84 Breaking: support @scope shorthand in plugins (fixes #9903) (#9905) (Toru Nagashima) -* 462b058 Update: Include debugging information when rule throws error (#9742) (Patrick Hayes) -* 9a020dc Chore: refactor --no-ignore flag logic (#10146) (Teddy Katz) -* 4f61a0d Chore: add noopener/noreferrer (薛定谔的猫) -* 65cc834 Docs: Ensure CLI doc sections match command line help order (#10144) (Kevin Partington) -* 9c79174 Docs: Update capitalized-comments with missing letters (fixes #10135) (#10134) (jasonfry) -* 9e66bfb Docs: remove eslint vs jshint from faq (#10108) (alberto) -* 692e383 Docs: Add modified variable examples for no-loop-func (fixes #9527) (#10098) (Rachael Sim) -* a9ee9ae Breaking: require rules to provide report messages (fixes #10011) (#10057) (Teddy Katz) -* 837edc7 Chore: Uncommented test for empty program for no-invalid-meta (#10046) (Kevin Partington) -* c383bc5 Breaking: Make require('eslint').linter non-enumerable (fixes #9270) (#9692) (Jed Fox) -* 4eaebe5 Breaking: set `parent` of AST nodes before rules run (fixes #9122) (#10014) (Teddy Katz) -* 91ece32 Breaking: remove special exception for linting empty files (fixes #9534) (#10013) (Teddy Katz) -* 27e3f24 Breaking: remove `source` property from linting messages (fixes #7358) (#10012) (Teddy Katz) -* e4c3b3c Breaking: use an exit code of 2 for fatal config problems (fixes #9384) (#10009) (Teddy Katz) -* 2a7ecaa Breaking: Use strict equality in RuleTester comparisons (fixes #9417) (#10008) (Teddy Katz) -* 0bc4a38 Fix: Make rule-tester strictly check messageId. (ref #9890) (#9908) (Jacques Favreau) -* ea6fb17 Update: Make no-cond-assign work for ternaries (fixes #10091) (#10109) (Aaron Harper) - -v4.19.1 - March 21, 2018 - -* 3ff5d11 Fix: no-invalid-regexp not understand variable for flags (fixes #10112) (#10113) (薛定谔的猫) -* abc765c Fix: object-curly-newline minProperties w/default export (fixes #10101) (#10103) (Kevin Partington) -* 6f9e155 Docs: Update ambiguous for...in example for guard-for-in (#10114) (CJ R) -* 0360cc2 Chore: Adding debug logs on successful plugin loads (#10100) (Kevin Partington) -* a717c5d Chore: Adding log at beginning of unit tests in Makefile.js (#10102) (Kevin Partington) - -v4.19.0 - March 16, 2018 - -* 55a1593 Update: consecutive option for one-var (fixes #4680) (#9994) (薛定谔的猫) -* 8d3814e Fix: false positive about ES2018 RegExp enhancements (fixes #9893) (#10062) (Toru Nagashima) -* 935f4e4 Docs: Clarify default ignoring of node_modules (#10092) (Matijs Brinkhuis) -* 72ed3db Docs: Wrap `Buffer()` in backticks in `no-buffer-constructor` rule description (#10084) (Stephen Edgar) -* 3aded2f Docs: Fix lodash typos, make spacing consistent (#10073) (Josh Smith) -* e33bb64 Chore: enable no-param-reassign on ESLint codebase (#10065) (Teddy Katz) -* 66a1e9a Docs: fix possible typo (#10060) (Vse Mozhet Byt) -* 2e68be6 Update: give a node at least the indentation of its parent (fixes #9995) (#10054) (Teddy Katz) -* 72ca5b3 Update: Correctly indent JSXText with trailing linebreaks (fixes #9878) (#10055) (Teddy Katz) -* 2a4c838 Docs: Update ECMAScript versions in FAQ (#10047) (alberto) - -v4.18.2 - March 2, 2018 - -* 6b71fd0 Fix: table@4.0.2, because 4.0.3 needs "ajv": "^6.0.1" (#10022) (Mathieu Seiler) -* 3c697de Chore: fix incorrect comment about linter.verify return value (#10030) (Teddy Katz) -* 9df8653 Chore: refactor parser-loading out of linter.verify (#10028) (Teddy Katz) -* f6901d0 Fix: remove catastrophic backtracking vulnerability (fixes #10002) (#10019) (Jamie Davis) -* e4f52ce Chore: Simplify dataflow in linter.verify (#10020) (Teddy Katz) -* 33177cd Chore: make library files non-executable (#10021) (Teddy Katz) -* 558ccba Chore: refactor directive comment processing (#10007) (Teddy Katz) -* 18e15d9 Chore: avoid useless catch clauses that just rethrow errors (#10010) (Teddy Katz) -* a1c3759 Chore: refactor populating configs with defaults in linter (#10006) (Teddy Katz) -* aea07dc Fix: Make max-len ignoreStrings ignore JSXText (fixes #9954) (#9985) (Rachael Sim) - -v4.18.1 - February 20, 2018 - -* f417506 Fix: ensure no-await-in-loop reports the correct node (fixes #9992) (#9993) (Teddy Katz) -* 3e99363 Docs: Fixed typo in key-spacing rule doc (#9987) (Jaid) -* 7c2cd70 Docs: deprecate experimentalObjectRestSpread (#9986) (Toru Nagashima) - -v4.18.0 - February 16, 2018 - -* 70f22f3 Chore: Apply memoization to config creation within glob utils (#9944) (Kenton Jacobsen) -* 0e4ae22 Update: fix indent bug with binary operators/ignoredNodes (fixes #9882) (#9951) (Teddy Katz) -* 47ac478 Update: add named imports and exports for object-curly-newline (#9876) (Nicholas Chua) -* e8efdd0 Fix: support Rest/Spread Properties (fixes #9885) (#9943) (Toru Nagashima) -* f012b8c Fix: support Async iteration (fixes #9891) (#9957) (Toru Nagashima) -* 74fa253 Docs: Clarify no-mixed-operators options (fixes #9962) (#9964) (Ivan Hayes) -* 426868f Docs: clean up key-spacing docs (fixes #9900) (#9963) (Abid Uzair) -* 4a6f22e Update: support eslint-disable-* block comments (fixes #8781) (#9745) (Erin) -* 777283b Docs: Propose fix typo for function (#9965) (John Eismeier) -* bf3d494 Docs: Fix typo in max-len ignorePattern example. (#9956) (Tim Martin) -* d64fbb4 Docs: fix typo in prefer-destructuring.md example (#9930) (Vse Mozhet Byt) -* f8d343f Chore: Fix default issue template (#9946) (Kai Cataldo) - -v4.17.0 - February 2, 2018 - -* 1da1ada Update: Add "multiline" type to padding-line-between-statements (#8668) (Matthew Bennett) -* bb213dc Chore: Use messageIds in some of the core rules (#9648) (Jed Fox) -* 1aa1970 Docs: remove outdated rule naming convention (#9925) (Teddy Katz) -* 3afaff6 Docs: Add prefer-destructuring variable reassignment example (#9873) (LePirlouit) -* d20f6b4 Fix: Typo in error message when running npm (#9866) (Maciej Kasprzyk) -* 51ec6a7 Docs: Use GitHub Multiple PR/Issue templates (#9911) (Kai Cataldo) -* dc80487 Update: space-unary-ops uses astUtils.canTokensBeAdjacent (fixes #9907) (#9906) (Kevin Partington) -* 084351b Docs: Fix the messageId example (fixes #9889) (#9892) (Jed Fox) -* 9cbb487 Docs: Mention the `globals` key in the no-undef docs (#9867) (Dan Dascalescu) - -v4.16.0 - January 19, 2018 - -* e26a25f Update: allow continue instead of if wrap in guard-for-in (fixes #7567) (#9796) (Michael Ficarra) -* af043eb Update: Add NewExpression support to comma-style (#9591) (Frazer McLean) -* 4f898c7 Build: Fix JSDoc syntax errors (#9813) (Matija Marohnić) -* 13bcf3c Fix: Removing curly quotes in no-eq-null report message (#9852) (Kevin Partington) -* b96fb31 Docs: configuration hierarchy for CLIEngine options (fixes #9526) (#9855) (PiIsFour) -* 8ccbdda Docs: Clarify that -c configs merge with `.eslintrc.*` (fixes #9535) (#9847) (Kevin Partington) -* 978574f Docs: Fix examples for no-useless-escape (#9853) (Toru Kobayashi) -* cd5681d Chore: Deactivate consistent-docs-url in internal rules folder (#9815) (Kevin Partington) -* 2e87ddd Docs: Sync messageId examples' style with other examples (#9816) (Kevin Partington) -* 1d61930 Update: use doctrine range information in valid-jsdoc (#9831) (Teddy Katz) -* 133336e Update: fix indent behavior on template literal arguments (fixes #9061) (#9820) (Teddy Katz) -* ea1b15d Fix: avoid crashing on malformed configuration comments (fixes #9373) (#9819) (Teddy Katz) -* add1e70 Update: fix indent bug on comments in ternary expressions (fixes #9729) (#9818) (Teddy Katz) -* 6a5cd32 Fix: prefer-destructuring error with computed properties (fixes #9784) (#9817) (Teddy Katz) -* 601f851 Docs: Minor modification to code comments for clarity (#9821) (rgovind92) -* b9da067 Docs: fix misleading info about RuleTester column numbers (#9830) (Teddy Katz) -* 2cf4522 Update: Rename and deprecate object-property-newline option (#9570) (Jonathan Pool) -* acde640 Docs: Add ES 2018 to Configuring ESLint (#9829) (Kai Cataldo) -* ccfce15 Docs: Minor tweaks to working with rules page (#9824) (Kevin Partington) -* 54b329a Docs: fix substitution of {{ name }} (#9822) (Andres Kalle) - -v4.15.0 - January 6, 2018 - -* 6ab04b5 New: Add context.report({ messageId }) (fixes #6740) (#9165) (Jed Fox) -* fc7f404 Docs: add url to each of the rules (refs #6582) (#9788) (Patrick McElhaney) -* fc44da9 Docs: fix sort-imports rule block language (#9805) (ferhat elmas) -* 65f0176 New: CLIEngine#getRules() (refs #6582) (#9782) (Patrick McElhaney) -* c64195f Update: More detailed assert message for rule-tester (#9769) (Weijia Wang) -* 9fcfabf Fix: no-extra-parens false positive (fixes: #9755) (#9795) (Erin) -* 61e5fa0 Docs: Add table of contents to Node.js API docs (#9785) (Patrick McElhaney) -* 4c87f42 Fix: incorrect error messages of no-unused-vars (fixes #9774) (#9791) (akouryy) -* bbabf34 Update: add `ignoreComments` option to `indent` rule (fixes #9018) (#9752) (Kevin Partington) -* db431cb Docs: HTTP -> HTTPS (fixes #9768) (#9768) (Ronald Eddy Jr) -* cbf0fb9 Docs: describe how to feature-detect scopeManager/visitorKeys support (#9764) (Teddy Katz) -* f7dcb70 Docs: Add note about "patch release pending" label to maintainer guide (#9763) (Teddy Katz) - -v4.14.0 - December 23, 2017 - -* be2f57e Update: support separate requires in one-var. (fixes #6175) (#9441) (薛定谔的猫) -* 370d614 Docs: Fix typos (#9751) (Jed Fox) -* 8196c45 Chore: Reorganize CLI options and associated docs (#9758) (Kevin Partington) -* 75c7419 Update: Logical-and is counted in `complexity` rule (fixes #8535) (#9754) (Kevin Partington) -* eb4b1e0 Docs: reintroduce misspelling in `valid-typeof` example (#9753) (Teddy Katz) -* ae51eb2 New: Add allowImplicit option to array-callback-return (fixes #8539) (#9344) (James C. Davis) -* e9d5dfd Docs: improve no-extra-parens formatting (#9747) (Rich Trott) -* 37d066c Chore: Add unit tests for overrides glob matching. (#9744) (Robert Jackson) -* 805a94e Chore: Fix typo in CLIEngine test name (#9741) (@scriptdaemon) -* 1c2aafd Update: Improve parser integrations (fixes #8392) (#8755) (Toru Nagashima) -* 4ddc131 Upgrade: debug@^3.1.0 (#9731) (Kevin Partington) -* f252c19 Docs: Make the lint message `source` property a little more subtle (#9735) (Jed Fox) -* 5a5c23c Docs: fix the link to contributing page (#9727) (Victor Hom) -* f44ce11 Docs: change beginner to good first issue label text (#9726) (Victor Hom) -* 14baa2e Chore: improve arrow-body-style error message (refs #5498) (#9718) (Teddy Katz) -* f819920 Docs: fix typos (#9723) (Thomas Broadley) -* 43d4ba8 Fix: false positive on rule`lines-between-class-members` (fixes #9665) (#9680) (sakabar) - -v4.13.1 - December 11, 2017 - -* b72dc83 Fix: eol-last allow empty-string to always pass (refs #9534) (#9696) (Kevin Partington) -* d80aa7c Fix: camelcase destructure leading/trailing underscore (fixes #9700) (#9701) (Kevin Partington) -* d49d9d0 Docs: Add missing period to the README (#9702) (Kevin Partington) -* 4564fe0 Chore: no-invalid-meta crash if no export assignment (refs #9534) (#9698) (Kevin Partington) - -v4.13.0 - December 8, 2017 - -* 256481b Update: update handling of destructuring in camelcase (fixes #8511) (#9468) (Erin) -* d067ae1 Docs: Don’t use undocumented array-style configuration for max-len (#9690) (Jed Fox) -* 1ad3091 Chore: fix test-suite to work with node master (#9688) (Myles Borins) -* cdb1488 Docs: Adds an example with try/catch. (#9672) (Jaap Taal) - -v4.12.1 - November 30, 2017 - -* 1e362a0 Revert "Fix: Use XML 1.1 on XML formatters (fixes #9607) (#9608)" (#9667) (Kevin Partington) - -v4.12.0 - November 25, 2017 - -* 76dab18 Upgrade: doctrine@^2.0.2 (#9656) (Kevin Partington) -* 28c9c8e New: add a Linter#defineParser function (#9321) (Ives van Hoorne) -* 5619910 Update: Add autofix for `sort-vars` (#9496) (Trevin Hofmann) -* 71eedbf Update: add `beforeStatementContinuationChars` to semi (fixes #9521) (#9594) (Toru Nagashima) -* 4118f14 New: Adds implicit-arrow-linebreak rule (refs #9510) (#9629) (Sharmila Jesupaul) -* 208fb0f Fix: Use XML 1.1 on XML formatters (fixes #9607) (#9608) (Daniel Reigada) -* 6e04f14 Upgrade: `globals` to 11.0.1 (fixes #9614) (#9632) (Toru Nagashima) -* e13d439 Fix: space-in-parens crash (#9655) (Toru Nagashima) -* 92171cc Docs: Updating migration guide for single-line disable (#9385) (Justin Helmer) -* f39ffe7 Docs: remove extra punctuation from readme (#9640) (Teddy Katz) -* a015234 Fix: prefer-destructuring false positive on "super" (fixes #9625) (#9626) (Kei Ito) -* 0cf081e Update: add importNames option to no-restricted-imports (#9506) (Benjamin R Gibson) -* 332c214 Docs: Add @platinumazure to TSC (#9618) (Ilya Volodin) - -v4.11.0 - November 10, 2017 - -* d4557a6 Docs: disallow use of the comma operator using no-restricted-syntax (#9585) (薛定谔的猫) -* d602f9e Upgrade: espree v3.5.2 (#9611) (Kai Cataldo) -* 4def876 Chore: avoid handling rules instances in config-validator (#9364) (Teddy Katz) -* fe5ac7e Chore: fix incorrect comment in safe-emitter.js (#9605) (Teddy Katz) -* 6672fae Docs: Fixed a typo on lines-between-class-members doc (#9603) (Moinul Hossain) -* 980ecd3 Chore: Update copyright and license info (#9599) (薛定谔的猫) -* cc2c7c9 Build: use Node 8 in appveyor (#9595) (薛定谔的猫) -* 2542f04 Docs: Add missing options for `lines-around-comment` (#9589) (Clément Fiorio) -* b6a7490 Build: ensure fuzzer tests get run with `npm test` (#9590) (Teddy Katz) -* 1073bc5 Build: remove shelljs-nodecli (refs #9533) (#9588) (Teddy Katz) -* 7e3bf6a Fix: edge-cases of semi-style (#9560) (Toru Nagashima) -* e5a37ce Fix: object-curly-newline for flow code (#9458) (Tiddo Langerak) -* 9064b9c Chore: add equalTokens in ast-utils. (#9500) (薛定谔的猫) -* b7c5b19 Fix: Correct [object Object] output of error.data. (#9561) (Jonathan Pool) -* 51c8cf0 Docs: Disambiguate definition of Update tag (#9584) (Jonathan Pool) -* afc3c75 Docs: clarify what eslint-config-eslint is (#9582) (Teddy Katz) -* aedae9d Docs: fix spelling in valid-typeof example (#9574) (Maksim Degtyarev) -* 4c5aaf3 Docs: Fix typo in no-underscore-dangle rule (#9567) (Fabien Lucas) -* 3623600 Chore: upgrade ajv@5.3.0 (#9557) (薛定谔的猫) -* 1b606cd Chore: Remove an indirect dependency on jsonify (#9444) (Rouven Weßling) -* 4d7d7ab Update: Resolve npm installed formatters (#5900) (#9464) (Tom Erik Støwer) -* accc490 Fix: Files with no failures get "passing" testcase (#9547) (Samuel Levy) -* ab0f66d Docs: Add examples to better show rule coverage. (#9548) (Jonathan Pool) -* 88d2303 Chore: Add object-property-newline tests to increase coverage. (#9553) (Jonathan Pool) -* 7f37b1c Build: test Node 9 on Travis (#9556) (Teddy Katz) -* acccfbd Docs: Minor rephrase in `no-invalid-this`. (#9542) (Francisc) -* 8f9c0fe Docs: improve id-match usage advice (#9544) (Teddy Katz) -* a9606a3 Fix: invalid tests with super (fixes #9539) (#9545) (Teddy Katz) -* 8e1a095 Chore: enable a modified version of multiline-comment-style on codebase (#9452) (Teddy Katz) -* cb60285 Chore: remove commented test for HTML formatter (#9532) (Teddy Katz) -* 06b491e Docs: fix duplicate entries in changelog (#9530) (Teddy Katz) -* 2224733 Chore: use eslint-plugin-rulesdir instead of --rulesdir for self-linting (#9164) (Teddy Katz) -* 9cf4ebe Docs: add .md to link(for github users) (#9529) (薛定谔的猫) - -v4.10.0 - October 27, 2017 - -* bb6e60a Fix: Improve the doc for no-restricted-modules rule (fixes #9437) (#9495) (vibss2397) -* c529de9 Docs: Amend rule document to correct and complete it (refs #6251). (#9498) (Jonathan Pool) -* f9c6673 Chore: Add tests to cover array and object values and leading commas. (#9502) (Jonathan Pool) -* 9169258 Chore: remove `npm run check-commit` script (#9513) (Teddy Katz) -* 7d390b2 Docs: Revise contributor documentation on issue labels. (#9469) (Jonathan Pool) -* d80b9d0 Fix: no-var don't fix globals (fixes #9520) (#9525) (Toru Nagashima) -* b8aa071 Fix: allow linting the empty string from stdin (fixes #9515) (#9517) (Teddy Katz) -* 350a72c Chore: regex.test => string.startsWith (#9518) (薛定谔的猫) -* de0bef4 Chore: remove obsolete eslintbot templates (#9512) (Teddy Katz) -* 720b6d5 Docs: Update ISSUE_TEMPLATE.md (#9504) (薛定谔的猫) -* 2fa64b7 Fix: should not convert non-consecutive line comments to a single blo… (#9475) (薛定谔的猫) -* 9725146 Fix: multiline-comment-style fix produces invalid code (fixes #9461). (#9463) (薛定谔的猫) -* b12cff8 Fix: Expected order of jsdoc tags (fixes #9412) (#9451) (Orlando Wenzinger) -* f054ab5 Docs: add `.md` to link (for github users) (#9501) (薛定谔的猫) -* 5ed9cfc Docs: Correct violations of “Variable Declarations” in Code Conventions (#9447) (Jonathan Pool) -* 3171097 Docs: Clears confusion on usage of global and local plugins.(#9492) (Vasili Sviridov) -* 3204773 Chore: enable max-len. (#9414) (薛定谔的猫) -* 0f71fef Docs: Unquote booleans in lines-between-class-members docs (#9497) (Brandon Mills) -* b3d7532 Docs: use consistent terminology & fix link etc. (#9490) (薛定谔的猫) -* 87db8ae Docs: Fix broken links (#9488) (gpiress) -* 51bdb2f Docs: Incorrect link to related rule (#9477) (Gavin King) -* 1a962e8 Docs: Add FAQ for when ESLint cannot find plugin (#9467) (Kevin Partington) -* 8768b2d Fix: multiline-comment-style autofixer added trailing space (#9454) (Teddy Katz) -* e830aa1 Fix: multiline-comment-style reports block comments followed by code (#9450) (Teddy Katz) -* b12e5fe Docs: Repair broken links and add migration links. (#9473) (Jonathan Pool) -* eca01ed Docs: Add missing info about special status of home-dir config files. (#9472) (Jonathan Pool) -* eb8cfb1 Fix: change err report in constant condition (fixes #9398) (#9436) (Victor Hom) -* da77eb4 Chore: Revise no-config-file test to prevent false failure. (#9443) (Jonathan Pool) -* 47e5f6f Docs: ensure "good commit message" examples actually follow guidelines (#9466) (Teddy Katz) -* ebb530d Update: Don't ignore comments (no-trailing-spaces) (#9416) (Chris van Marle) -* 5012661 Build: fix `npm run profile` script (fixes #9397) (#9455) (Teddy Katz) -* ecac0fd Docs: Remove blockBindings references (#9446) (Jan Pilzer) -* 0b89865 Chore: ensure tests for internal rules get run (#9453) (Teddy Katz) -* 052c504 Docs: suggest deleting branches after merging PRs (#9449) (Teddy Katz) -* b31e55a Chore: move internal rules out of lib/ (#9448) (Teddy Katz) -* a7521e3 Docs: improve examples for multiline-comment-style (#9440) (Teddy Katz) - -v4.9.0 - October 14, 2017 - -* 85388fb Fix: Correct error and test messages to fit config search path (#9428) (Jonathan Pool) -* 62a323c Fix: Add class options for `lines-around-comment` (fixes #8564) (#8565) (Ed Lee) -* 8eb4aae New: multiline-comment-style rule (fixes #8320) (#9389) (薛定谔的猫) -* db41408 Chore: avoid applying eslint-env comments twice (#9278) (Teddy Katz) -* febb897 Chore: avoid loose equality assertions (#9415) (Teddy Katz) -* 2247efa Update: Add FunctionExpression to require-jsdoc (fixes #5867) (#9395) (Kai Cataldo) -* 6791d18 Docs: Corrected noun to verb. (#9438) (Jonathan Pool) -* b02fbb6 Update: custom messages for no-restricted-* (refs #8400) (Maja Wichrowska) -* 02732bd Docs: Reorganized to avoid misunderstandings. (#9434) (Jonathan Pool) -* d9466b8 Docs: Correct time forecast for tests. (#9432) (Jonathan Pool) -* f7ed84f Docs: Add instruction re home-directory config files (refs #7729) (#9426) (Jonathan Pool) -* 30d018b Chore: Add Aladdin-ADD & VictorHom to README (#9424) (Kai Cataldo) -* 2d8a303 Docs: fix examples for prefer-numeric-literals (#9155) (Lutz Lengemann) -* d7610f5 Docs: Add jquery warning to prefer-destructuring (#9409) (Thomas Grainger) -* e835dd1 Docs: clarify no-mixed-operators (fixes #8051) (Ruxandra Fediuc) -* 51360c8 Docs: update block-spacing details (fixes #8743) (#9375) (Victor Hom) -* 6767857 Update: fix ignored nodes in indent rule when using tabs (fixes #9392) (#9393) (Robin Houston) -* 37dde77 Chore: Refactor SourceCode#getJSDocComment (#9403) (Kai Cataldo) -* 9fedd51 Chore: Add missing space in blog post template (#9407) (Kevin Partington) -* 7654c99 Docs: add installing prerequisites in readme. (#9401) (薛定谔的猫) -* 786cc73 Update: Add "consistent" option to array-bracket-newline (fixes #9136) (#9206) (Ethan Rutherford) -* e171f6b Docs: add installing prerequisites. (#9394) (薛定谔的猫) -* 74dfc87 Docs: update doc for class-methods-use-this (fixes #8910) (#9374) (Victor Hom) -* b4a9dbf Docs: show console call with no-restricted-syntax (fixes #7806) (#9376) (Victor Hom) -* 8da525f Fix: recognise multiline comments as multiline arrays (fixes #9211) (#9369) (Phil Quinn) -* c581b77 Chore: Error => TypeError (#9390) (薛定谔的猫) -* ee99876 New: lines-between-class-members rule (fixes #5949) (#9141) (薛定谔的猫) -* 9d3f5ad Chore: report unused eslint-disable directives in ESLint codebase (#9371) (Teddy Katz) -* 1167638 Update: add allowElseIf option to no-else-return (fixes #9228) (#9229) (Thomas Grainger) -* 4567ab1 New: Add the fix-dry-run flag (fixes #9076) (#9073) (Rafał Ruciński) - -v4.8.0 - September 29, 2017 - -* 3f2b908 New: add option to report unused eslint-disable directives (fixes #9249) (#9250) (Teddy Katz) -* ff2be59 Fix: dot notation rule failing to catch string template (fixes #9350) (#9357) (Phil Quinn) -* b1372da Chore: remove sourceCode property from Linter (refs #9161) (#9363) (Teddy Katz) -* cef6f8c Docs: remove line about removing rules from semver policy (#9367) (Teddy Katz) -* 06efe87 Fix: Add meta element with charset attribute. (#9365) (H1Gdev) -* 458ca67 Docs: update architecture page (fixes #9337) (#9345) (Victor Hom) -* 1c6bc67 Fix: special EventEmitter keys leak information about other rules (#9328) (Teddy Katz) -* d593e61 Docs: update eslint.org links to use https (#9358) (Teddy Katz) -* 38d0cb2 Fix: fix wrong code-path about try-for-in (fixes #8848) (#9348) (Toru Nagashima) -* 434d9e2 Fix: Invalid font-size property value issue. (#9341) (H1Gdev) -* a7668c2 Chore: Remove unnecessary slice from logging utility (#9343) (Gyandeep Singh) -* 2ff6fb6 Chore: remove unused arguments in codebase (#9340) (Teddy Katz) - -v4.7.2 - September 21, 2017 - -* 4f87732 Fix: Revert setting node.parent early (fixes #9331) (#9336) (Teddy Katz) - -v4.7.1 - September 18, 2017 - -* 08656db Fix: Handle nested disable directive correctly (fixes #9318) (#9322) (Gyandeep Singh) -* 9226495 Revert "Chore: rewrite parseListConfig for a small perf gain." (#9325) (薛定谔的猫) - -v4.7.0 - September 15, 2017 - -* 787b78b Upgrade: Espree v3.5.1 (fixes #9153) (#9314) (Brandon Mills) -* 1488b51 Update: run rules after `node.parent` is already set (fixes #9122) (#9283) (Teddy Katz) -* 4431d68 Docs: fix wrong config in max-len example. (#9309) (薛定谔的猫) -* 7d24dde Docs: Fix code snippet to refer to the correct option (#9313) (Ruben Tytgat) -* 12388d4 Chore: rewrite parseListConfig for a small perf gain. (#9300) (薛定谔的猫) -* ce1f084 Update: fix MemberExpression handling in no-extra-parens (fixes #9156) (jackyho112) -* 0c720a3 Update: allow autofixing when using processors (fixes #7510) (#9090) (Teddy Katz) -* 838df76 Chore: upgrade deps. (#9289) (薛定谔的猫) -* f12def6 Update: indent flatTernary option to handle `return` (fixes #9285) (#9296) (Teddy Katz) -* e220687 Fix: remove autofix for var undef inits (fixes #9231) (#9288) (Victor Hom) -* 002e199 Docs: fix no-restricted-globals wrong config. (#9305) (薛定谔的猫) -* fcfe91a Docs: fix wrong config in id-length example. (#9303) (薛定谔的猫) -* 2731f94 Update: make newline-per-chained-call fixable (#9149) (João Granado) -* 61f1093 Chore: avoid monkeypatching Linter instances in RuleTester (#9276) (Teddy Katz) -* 28929cb Chore: remove Linter#reset (refs #9161) (#9268) (Teddy Katz) -* abc8634 Build: re-run browserify when generating site (#9275) (Teddy Katz) -* 7685fed Fix: IIFE and arrow functions in no-invalid-this (fixes #9126) (#9258) (Toru Nagashima) -* 2b1eba2 Chore: enable eslint-plugin/no-deprecated-context-methods (#9279) (Teddy Katz) -* 981f933 Fix: reuse the AST of source code object in verify (#9256) (Toru Nagashima) -* cd698ba Docs: move RuleTester documentation to Node.js API page (#9273) (Teddy Katz) -* 4ae7ad3 Docs: fix inaccuracy in `npm run perf` description (#9274) (Teddy Katz) -* cad45bd Docs: improve documentation for rule contexts (#9272) (Teddy Katz) -* 3b0c6fd Chore: remove extraneous linter properties (refs #9161) (#9267) (Teddy Katz) -* c3231b3 Docs: Fix typo in array-bracket-newline.md (#9269) (宋文强) -* 51132d6 Fix: Formatters keep trailing '.' if preceded by a space (fixes #9154) (#9247) (i-ron-y) -* 88d5d4d Chore: remove undocumented Linter#markVariableAsUsed method (refs #9161) (#9266) (Teddy Katz) -* 09414cf Chore: remove internal Linter#getDeclaredVariables method (refs #9161) (#9264) (Teddy Katz) -* f31f59d Chore: prefer smaller scope for variables in codebase (#9265) (Teddy Katz) -* 3693e4e Chore: remove undocumented Linter#getScope method (#9253) (Teddy Katz) -* 5d7eb81 Chore: refactor config hash caching in CLIEngine (#9260) (Teddy Katz) -* 1a76c4d Chore: remove SourceCode passthroughs from Linter.prototype (refs #9161) (#9263) (Teddy Katz) -* 40ae27b Chore: avoid relying on Linter#getScope/markVariableAsUsed in tests (#9252) (Teddy Katz) -* b383d81 Chore: make executeOnFile a pure function in CLIEngine (#9262) (Teddy Katz) -* 5e0e579 Chore: avoid internal SourceCode methods in Linter tests (refs #9161) (#9223) (Teddy Katz) -* adab827 Chore: remove unused eslint-disable comment (#9251) (Teddy Katz) -* 31e4ec8 Chore: use consistent names for apply-disable-directives in tests (#9246) (Teddy Katz) -* 7ba46e6 Fix: shebang error in eslint-disable-new-line; add tests (fixes #9238) (#9240) (i-ron-y) -* 8f6546c Chore: remove undocumented defaults() method (refs #9161) (#9237) (Teddy Katz) -* 82d8b73 Docs: Fix error in example code for sort-imports (fixes #8734) (#9245) (i-ron-y) -* a32ec36 Update: refactor eslint-disable comment processing (#9216) (Teddy Katz) -* 583f0b8 Chore: avoid using globals in CLIEngine tests (#9242) (Teddy Katz) -* c8bf687 Chore: upgrade eslint-plugin-eslint-plugin@1.0.0 (#9234) (薛定谔的猫) -* 3c41a05 Chore: always normalize rules to new API in rules.js (#9236) (Teddy Katz) -* c5f4227 Chore: move logic for handling missing rules to rules.js (#9235) (Teddy Katz) -* bf1e344 Chore: create report translators lazily (#9221) (Teddy Katz) -* 2eedc1f Chore: remove currentFilename prop from Linter instances (refs #9161) (#9219) (Teddy Katz) -* 5566e94 Docs: Replace misleading CLA links (#9133) (#9232) (i-ron-y) -* c991630 Chore: remove ConfigOps.normalize in favor of ConfigOps.getRuleSeverity (#9224) (Teddy Katz) -* 171962a Chore: remove internal Linter#getAncestors helper (refs #9161) (#9222) (Teddy Katz) -* a567499 Chore: avoid storing list of problems on Linter instance (refs #9161) (#9214) (Teddy Katz) -* ed6d088 Chore: avoid relying on undocumented Linter#getFilename API in tests (#9218) (Teddy Katz) - -v4.6.1 - September 3, 2017 - -* bdec46d Build: avoid process leak when generating website (#9217) (Teddy Katz) -* cb74b87 Fix: avoid adding globals when an env is used with `false` (fixes #9202) (#9203) (Teddy Katz) -* f9b7544 Docs: Correct a typo in generator-star-spacing documentation (#9205) (Ethan Rutherford) -* e5c5e83 Build: Fixing issue with docs generation (Fixes #9199) (#9200) (Ilya Volodin) - -v4.6.0 - September 1, 2017 - -* 56dd769 Docs: fix link format in prefer-arrow-callback.md (#9198) (Vse Mozhet Byt) -* 6becf91 Update: add eslint version to error output. (fixes #9037) (#9071) (薛定谔的猫) -* 0e09973 New: function-paren-newline rule (fixes #6074) (#8102) (Teddy Katz) -* 88a64cc Chore: Make parseJsonConfig() a pure function in Linter (#9186) (Teddy Katz) -* 1bbac51 Fix: avoid breaking eslint-plugin-eslint-comments (fixes #9193) (#9196) (Teddy Katz) -* 3e8b70a Fix: off-by-one error in eslint-disable comment checking (#9195) (Teddy Katz) -* 73815f6 Docs: rewrite prefer-arrow-callback documentation (fixes #8950) (#9077) (Charles E. Morgan) -* 0d3a854 Chore: avoid mutating report descriptors in report-translator (#9189) (Teddy Katz) -* 2db356b Update: no-unused-vars Improve message to include the allowed patterns (#9176) (Eli White) -* 8fbaf0a Update: Add configurability to generator-star-spacing (#8985) (Ethan Rutherford) -* 8ed779c Chore: remove currentScopes property from Linter instances (refs #9161) (#9187) (Teddy Katz) -* af4ad60 Fix: Handle error when running init without npm (#9169) (Gabriel Aumala) -* 4b94c6c Chore: make parse() a pure function in Linter (refs #9161) (#9183) (Teddy Katz) -* 1be5634 Chore: don't make Linter a subclass of EventEmitter (refs #9161) (#9177) (Teddy Katz) -* e95af9b Chore: don't include internal test helpers in npm package (#9160) (Teddy Katz) -* 6fb32e1 Chore: avoid using private Linter APIs in astUtils tests (refs #9161) (#9173) (Teddy Katz) -* de6dccd Docs: add documentation for Linter methods (refs #6525) (#9151) (Teddy Katz) -* 2d90030 Chore: remove unused assignment. (#9182) (薛定谔的猫) -* d672aef Chore: refactor reporting logic (refs #9161) (#9168) (Teddy Katz) -* 5ab0434 Fix: indent crash on sparse arrays with "off" option (fixes #9157) (#9166) (Teddy Katz) -* c147b97 Chore: Make SourceCodeFixer accept text instead of a SourceCode instance (#9178) (Teddy Katz) -* f127423 Chore: avoid using private Linter APIs in Linter tests (refs #9161) (#9175) (Teddy Katz) -* 2334335 Chore: avoid using private Linter APIs in SourceCode tests (refs #9161) (#9174) (Teddy Katz) -* 2dc243a Chore: avoid using internal Linter APIs in RuleTester (refs #9161) (#9172) (Teddy Katz) -* d6e436f Fix: no-extra-parens reported some parenthesized IIFEs (fixes #9140) (#9158) (Teddy Katz) -* e6b115c Build: Add an edit link to the rule docs’ metadata (#9049) (Jed Fox) -* fcb7bb4 Chore: avoid unnecessarily complex forEach calls in no-extra-parens (#9159) (Teddy Katz) -* ffa021e Docs: quotes rule - when does \n require backticks (#9135) (avimar) -* 60c5148 Chore: improve coverage in lib/*.js (#9130) (Teddy Katz) - -v4.5.0 - August 18, 2017 - -* decdd2c Update: allow arbitrary nodes to be ignored in `indent` (fixes #8594) (#9105) (Teddy Katz) -* 79062f3 Update: fix indentation of multiline `new.target` expressions (#9116) (Teddy Katz) -* d00e24f Upgrade: `chalk` to 2.x release (#9115) (Stephen Edgar) -* 6ef734a Docs: add missing word in processor documentation (#9106) (Teddy Katz) -* a4f53ba Fix: Include files with no messages in junit results (#9093) (#9094) (Sean DuBois) -* 1d6a9c0 Chore: enable eslint-plugin/test-case-shorthand-strings (#9067) (薛定谔的猫) -* f8add8f Fix: don't autofix with linter.verifyAndFix when `fix: false` is used (#9098) (Teddy Katz) -* 77bcee4 Docs: update instructions for adding TSC members (#9086) (Teddy Katz) -* bd09cd5 Update: avoid requiring NaN spaces of indentation (fixes #9083) (#9085) (Teddy Katz) -* c93a853 Chore: Remove extra space in blogpost template (#9088) (Kai Cataldo) - -v4.4.1 - August 7, 2017 - -* ec93614 Fix: no-multi-spaces to avoid reporting consecutive tabs (fixes #9079) (#9087) (Teddy Katz) - -v4.4.0 - August 5, 2017 - -* 89196fd Upgrade: Espree to 3.5.0 (#9074) (Gyandeep Singh) -* b3e4598 Fix: clarify AST and don't use `node.start`/`node.end` (fixes #8956) (#8984) (Toru Nagashima) -* 62911e4 Update: Add ImportDeclaration option to indent rule (#8955) (David Irvine) -* de75f9b Chore: enable object-curly-newline & object-property-newline.(fixes #9042) (#9068) (薛定谔的猫) -* 5ae8458 Docs: fix typo in object-shorthand.md (#9066) (Jon Berry) -* c3d5b39 Docs: clarify options descriptions (fixes #8875) (#9060) (Brandon Mailhiot) -* 37158c5 Docs: clarified behavior of globalReturn option (fixes #8953) (#9058) (Brandon Mailhiot) -* c2f3553 Docs: Update example for MemberExpression option of indent (fixes #9056) (#9057) (Jeff) -* 78a85e0 Fix: no-extra-parens incorrectly reports async function expressions (#9035) (薛定谔的猫) -* c794f86 Fix: getter-return reporting method named 'get' (fixes #8919) (#9004) (薛定谔的猫) -* d0f78ec Docs: update rule deprecation policy (fixes #8635) (#9033) (Teddy Katz) -* 5ab282f Fix: Print error message in bin/eslint.js (fixes #9011) (#9041) (Victor Hom) -* 50e3cf3 Docs: Update sort-keys doc to define natural ordering (fixes #9043) (#9045) (Karan Sharma) -* 7ecfe6a Chore: enable eslint-plugin/test-case-property-ordering (#9040) (薛定谔的猫) -* ad32697 Upgrade: js-yaml to 3.9.1 (refs #9011) (#9044) (Teddy Katz) -* 66c1d43 Docs: Create SUPPORT.md (#9031) (Teddy Katz) -* 7247b6c Update: handle indentation of custom destructuring syntax (fixes #8990) (#9027) (Teddy Katz) -* cdb82f2 Fix: padding-line-between-statements crash on semicolons after blocks (#8748) (Alexander Madyankin) -* 3141872 Chore: remove unnecessary eslint-disable comments in codebase (#9032) (Teddy Katz) -* 0f97279 Fix: refactor no-multi-spaces to avoid regex backtracking (fixes #9001) (#9008) (Teddy Katz) -* b74514d Fix: refactor RuleContext to not modify report locations (fixes #8980) (#8997) (Teddy Katz) -* 31d7fd2 Fix: inconsistent `indent` behavior on computed properties (fixes #8989) (#8999) (Teddy Katz) -* 3393894 Fix: avoid reporting the entire AST for missing rules (#8998) (Teddy Katz) -* b3b95b8 Chore: enable additional rules on ESLint codebase (#9013) (Teddy Katz) -* 9b6c552 Upgrade: eslint-plugin-eslint-plugin@0.8.0 (#9012) (薛定谔的猫) -* acbe86a Chore: disallow .substr and .substring in favor of .slice (#9010) (Teddy Katz) -* d0536d6 Chore: Optimizes adding Linter methods (fixes #9000) (#9007) (Sean C Denison) -* 0a0401f Chore: fix spelling error. (#9003) (薛定谔的猫) -* 3d020b9 Update: emit a warning for ecmaFeatures rather than throwing an error (#8974) (Teddy Katz) -* d2f8f9f Fix: include name of invalid config in validation messages (fixes #8963) (#8973) (Teddy Katz) -* c3ee46b Chore: fix misleading comment in RuleTester (#8995) (Teddy Katz) - -v4.3.0 - July 21, 2017 - -* 91dccdf Update: support more options in prefer-destructuring (#8796) (Victor Hom) -* 3bebcfd Update: Support generator yields in no constant condition (#8762) (Victor Hom) -* 96df8c9 Fix: Handle fixing objects containing comments (fixes #8484) (#8944) (Brian Schemp) -* e39d41d Docs: Make `peerDependencies` package.json snippet valid JSON (#8971) (Sam Adams) -* a5fd101 Fix: duplicated error message if a crash occurs (fixes #8964) (#8965) (Teddy Katz) -* f8d122c Docs: trailing commas not allowed in json (#8969) (Scott Fletcher) -* d09288a Chore: Use `output: null` to assert that a test case is not autofixed. (#8960) (薛定谔的猫) -* e639358 Update: add question to confirm downgrade (fixes #8870) (#8911) (Toru Nagashima) -* 601039d Docs: fix badge in eslint-config-eslint readme (#8954) (Teddy Katz) -* 3c231fa Update: add enforceInMethodNames to no-underscore-dangle (fixes #7065) (#7234) (Gabriele Petronella) -* 128591f Update: prefer-numeric-literals warns Number.parseInt (fixes #8913) (#8929) (Kevin Partington) -* 846f8b1 Docs: Clarified that core PRs require issue in maintainer guide (#8927) (Kevin Partington) -* 55bc35d Fix: Avoid shell mangling during eslint --init (#8936) (Anders Kaseorg) -* 10c3d78 Chore: fix misleading `indent` test (#8925) (Teddy Katz) -* fb8005d Update: no-restricted-globals custom error messages (fixes #8315) (#8932) (Kevin Partington) -* a747b6f Chore: make minor improvements to `indent` internals (#8947) (Teddy Katz) -* 1ea3723 Update: fix indentation of parenthesized MemberExpressions (fixes #8924) (#8928) (Teddy Katz) -* 9abc6f7 Update: fix BinaryExpression indentation edge case (fixes #8914) (#8930) (Teddy Katz) -* 0e90453 Docs: Fixing broken cyclomatic complexity link (fixes #8396) (#8937) (Chris Bargren) -* a8a8350 Chore: improve performance of `indent` rule (#8905) (Teddy Katz) -* 764b2a9 Chore: update header info in `indent` (#8926) (Teddy Katz) -* 597c217 Fix: confusing error if plugins from config is not an array (#8888) (Calvin Freitas) -* 3c1dd6d Docs: add description of no-sync `allowAtRootLevel` option (fixes #8902) (#8906) (Teddy Katz) -* 933a9cf Chore: add a fuzzer to detect bugs in core rules (#8422) (Teddy Katz) -* 45f8cd9 Docs: fix verifyAndFix result property name (#8903) (Tino Vyatkin) -* 1a89e1c Docs: Fix always-multiline example in multiline-ternary docs (#8904) (Nathan Woltman) - -v4.2.0 - July 8, 2017 - -* e0f0101 Update: fix indentation of nested function parameters (fixes #8892) (#8900) (Teddy Katz) -* 9f95a3e Chore: remove unused helper method from `indent` (#8901) (Teddy Katz) -* 11ffe6b Fix: no-regex-spaces rule incorrectly fixes quantified spaces (#8773) (Keri Warr) -* 975dacf Update: fix indentation of EmptyStatements (fixes #8882) (#8885) (Teddy Katz) -* 88ed041 Build: Turnoff CI branch build (fixes #8804) (#8873) (Gyandeep Singh) -* 72f22eb Chore: replace is-my-json-valid with Ajv (#8852) (Gajus Kuizinas) -* 7c8de92 Docs: Clarified PR guidelines in maintainer guide (#8876) (Kevin Partington) -* d1fc408 Docs: Update CLA link in Contributing docs (#8883) (Calvin Freitas) -* 931a9f1 Fix: indent false positive with multi-line await expression (#8837) (薛定谔的猫) -* 3767cda Update: add no-sync option to allow at root level (fixes #7985) (#8859) (Victor Hom) -* 1ce553d Docs: Fix wording of minProperties in object-curly-newline (fixes #8874) (#8878) (solmsted) -* f00854e Fix: --quiet no longer fixes warnings (fixes #8675) (#8858) (Kevin Partington) -* b678535 Chore: Add collapsible block for config in ISSUE_TEMPLATE (#8872) (Gyandeep Singh) -* 1f5bfc2 Update: Add always-multiline option to multiline-ternary (fixes #8770) (#8841) (Nathan Woltman) -* 22116f2 Fix: correct comma-dangle JSON schema (#8864) (Evgeny Poberezkin) -* 676af9e Update: fix indentation of JSXExpressionContainer contents (fixes #8832) (#8850) (Teddy Katz) -* 330dd58 Chore: fix title of linter test suite (#8861) (Teddy Katz) -* 60099ed Chore: enable for-direction rule on ESLint codebase (#8853) (薛定谔的猫) -* e0d1a84 Chore: upgrade eslint-plugin-eslint-plugin & eslint-plugin-node (#8856) (薛定谔的猫) -* 0780d86 Chore: remove identical tests (#8851) (Teddy Katz) -* 5c3ac8e Fix: arrow-parens fixer gets tripped up with trailing comma in args (#8838) (薛定谔的猫) -* c4f2e29 Build: fix race condition in demo (#8827) (Teddy Katz) -* c693be5 New: Allow passing a function as `fix` option (fixes #8039) (#8730) (Ian VanSchooten) -* 8796d55 Docs: add missing item to 4.0 migration guide table of contents (#8835) (薛定谔的猫) -* 742998c doc md update: false -> `false` (#8825) (Erik Vold) -* ce969f9 Docs: add guidelines for patch release communication (fixes #7277) (#8823) (Teddy Katz) -* 5c83c99 Docs: Clarify arrow function parens in no-extra-parens (fixes #8741) (#8822) (Kevin Partington) -* 84d921d Docs: Added note about Node/CJS scoping to no-redeclare (fixes #8814) (#8820) (Kevin Partington) -* 85c9327 Update: fix parenthesized CallExpression indentation (fixes #8790) (#8802) (Teddy Katz) -* be8d354 Update: simplify variable declarator indent handling (fixes #8785) (#8801) (Teddy Katz) -* 9417818 Fix: no-debugger autofixer produced invalid syntax (#8806) (Teddy Katz) -* 8698a92 New: getter-return rule (fixes #8449) (#8460) (薛定谔的猫) -* eac06f2 Fix: no-extra-parens false positives for variables called "let" (#8808) (Teddy Katz) -* 616587f Fix: dot-notation autofix produces syntax errors for object called "let" (#8807) (Teddy Katz) -* a53ef7e Fix: don't require a third argument in linter.verifyAndFix (fixes #8805) (#8809) (Teddy Katz) -* 5ad8b70 Docs: add minor formatting improvement to paragraph about parsers (#8816) (Teddy Katz) - -v4.1.1 - June 25, 2017 - -* f307aa0 Fix: ensure configs from a plugin are cached separately (fixes #8792) (#8798) (Teddy Katz) -* 8b48ae8 Docs: Add doc on parser services (fixes #8390) (#8795) (Victor Hom) -* 0d041e7 Fix: avoid crashing when using baseConfig with extends (fixes #8791) (#8797) (Teddy Katz) -* 03213bb Chore: improve comment explanation of `indent` internal functions (#8800) (Teddy Katz) -* d2e88ed Chore: Fix misleading comment in ConfigCache.js (#8799) (Teddy Katz) - -v4.1.0 - June 23, 2017 - -* e8f1362 Docs: Remove wrong descriptions in `padded-block` rule (#8783) (Plusb Preco) -* 291a783 Update: `enforceForArrowConditionals` to `no-extra-parens` (fixes #6196) (#8439) (Evilebot Tnawi) -* a21dd32 New: Add `overrides`/`files` options for glob-based config (fixes #3611) (#8081) (Sylvan Mably) -* 879688c Update: Add ignoreComments option to no-trailing-spaces (#8061) (Jake Roussel) -* b58ae2e Chore: Only instantiate fileEntryCache when cache flage set (perf) (#8763) (Gyandeep Singh) -* 9851288 Update: fix indent errors on multiline destructure (fixes #8729) (#8756) (Victor Hom) -* 3608f06 Docs: Increase visibility of code of conduct (fixes #8758) (#8764) (Kai Cataldo) -* 673a58b Update: support multiple fixes in a report (fixes #7348) (#8101) (Toru Nagashima) -* 7a1bc38 Fix: don't pass default parserOptions to custom parsers (fixes #8744) (#8745) (Teddy Katz) -* c5b4052 Chore: enable computed-property-spacing on ESLint codebase (#8760) (Teddy Katz) -* 3419f64 Docs: describe how to use formatters on the formatter demo page (#8754) (Teddy Katz) -* a3ff8f2 Chore: combine tests in tests/lib/eslint.js and tests/lib/linter.js (#8746) (Teddy Katz) -* b7cc1e6 Fix: Space-infix-ops should ignore type annotations in TypeScript (#8341) (Reyad Attiyat) -* 46e73ee Fix: eslint --init installs wrong dependencies of popular styles (fixes #7338) (#8713) (Toru Nagashima) -* a82361b Chore: Prevent package-lock.json files from being created (fixes #8742) (#8747) (Teddy Katz) -* 5f81a68 New: Add eslintIgnore support to package.json (fixes #8458) (#8690) (Victor Hom) -* b5a70b4 Update: fix multiline binary operator/parentheses indentation (#8719) (Teddy Katz) -* ab8b016 Update: fix MemberExpression indentation with "off" option (fixes #8721) (#8724) (Teddy Katz) -* eb5d12c Update: Add Fixer method to Linter API (#8631) (Gyandeep Singh) -* 26a2daa Chore: Cache fs reads in ignored-paths (fixes #8363) (#8706) (Victor Hom) - -v4.0.0 - June 11, 2017 - -* 4aefb49 Chore: avoid using deprecated rules on ESLint codebase (#8708) (Teddy Katz) -* 389feba Chore: upgrade deps. (#8684) (薛定谔的猫) -* 3da7b5e Fix: Semi-Style only check for comments when tokens exist (fixes #8696) (#8697) (Reyad Attiyat) -* 3cfe9ee Fix: Add space between async and param on fix (fixes #8682) (#8693) (Reyad Attiyat) -* c702858 Chore: enable no-multiple-empty-lines on ESLint codebase (#8694) (Teddy Katz) -* 34c4020 Update: Add support for parens on left side for-loops (fixes: #8393) (#8679) (Victor Hom) -* 735cd09 Docs: Correct the comment in an example for `no-mixed-requires` (#8686) (Fangzhou Li) -* 026f048 Chore: remove dead code from prefer-const (#8683) (Teddy Katz) - -v4.0.0-rc.0 - June 2, 2017 - -* 0058b0f8 Update: add --fix to no-debugger (#8660) (薛定谔的猫) -* b4daa225 Docs: Note to --fix option for strict rule (#8680) (Vitaliy Potapov) -* 4df33e7c Chore: check for root:true in project sooner (fixes #8561) (#8638) (Victor Hom) -* c9b980ce Build: Add Node 8 on travis (#8669) (Gyandeep Singh) -* 95248336 Fix: Don't check object destructing in integer property (fixes #8654) (#8657) (flowmemo) -* c4ac969c Update: fix parenthesized ternary expression indentation (fixes #8637) (#8649) (Teddy Katz) -* 4f2f9fcb Build: update license checker to allow LGPL (fixes #8647) (#8652) (Teddy Katz) -* b0c83bd1 Docs: suggest pushing new commits to a PR instead of amending (#8632) (Teddy Katz) -* d0e9fd2d Fix: Config merge to correctly account for extends (fixes #8193) (#8636) (Gyandeep Singh) -* 705d88f7 Docs: Update CLA link on Pull Requests page (#8642) (Teddy Katz) -* 794d4d6c Docs: missing paren on readme (#8640) (Dan Beam) -* 7ebd9d6f New: array-element-newline rule (fixes #6075) (#8375) (Jan Peer Stöcklmair) -* f62cff66 Chore: Remove dependency to user-home (fixes #8604) (#8629) (Pavol Madar) -* 936bc174 Docs: Add missing documentation for scoped modules in sharable config developer-guide (#8610) (Jonathan Samines) - -v4.0.0-beta.0 - May 19, 2017 - -* 2f7015b6 New: semi-style rule (fixes #8169) (#8542) (Toru Nagashima) -* 1eaef580 Revert "Breaking: Traverse into type annotations (fixes #7129) (#8365)" (#8584) (Kai Cataldo) -* eb14584a Fix: no-unneeded-ternary change code behavior after fix (fixes #8507) (#8624) (Jan Peer Stöcklmair) -* 3ec436ee Breaking: New Linter API (fixes #8454) (#8465) (Gyandeep Singh) -* 3fc9653a Fix: Call expression consistency in variable declaration (fixes #8607) (#8619) (Reyad Attiyat) -* 5b6093ef Docs: Remove .eslintignore reference to transpiled file filtering (#8622) (Alex Summer) -* 729bbcdb Chore: Fix lgtm alerts. (#8611) (Max Schaefer) -* 3418479a Update: improve indent of `flatTernaryExpressions` (fixes #8481) (#8587) (Toru Nagashima) -* 268d52ef Update: Use sane defaults for JSX indentation (fixes #8425) (#8593) (Teddy Katz) -* d21f5283 Chore: make shelljs a devDependency instead of a dependency (#8608) (Teddy Katz) -* 11493781 Docs: Rephrase in about section (#8609) (Sudarsan G P) -* 23401626 Chore: remove strip-bom dependency (refs #8603) (#8606) (Teddy Katz) -* a93a2f95 New: padding-line-between-statements rule (fixes #7356) (#8099) (Toru Nagashima) -* 0ef09ea0 New: for-direction rule (fixes #8387) (#8519) (薛定谔的猫) -* a73e6c09 Fix: Fix failing uknown node test since #8569 indents class bodies (#8588) (Reyad Attiyat) -* c6c639d6 Fix: Ignore unknown nodes for Indent rule (fixes #8440) (#8504) (Reyad Attiyat) -* df17bc87 Fix: object-shorthand crash on some computed keys (fixes #8576) (#8577) (Teddy Katz) -* 482d5720 New: switch-colon-spacing rule (fixes #7981) (#8540) (Toru Nagashima) -* afa35c68 Update: check allman-style classes correctly in indent (fixes #8493) (#8569) (Teddy Katz) -* de0b4ad7 Fix: Indent Ignore Variable Declaration init operator (fixes #8546) (#8563) (Reyad Attiyat) -* 927ca0dc Fix: invalid syntax from prefer-arrow-callback autofixer (fixes #8541) (#8555) (Teddy Katz) -* 25db3d22 Chore: avoid skipping test for env overrides (refs #8291) (#8556) (Teddy Katz) -* 456f519b Update: make indent MemberExpression handling more robust (fixes #8552) (#8554) (Teddy Katz) -* 873310e5 Fix: run no-unexpected-multiline only if needed (fixes #8550) (#8551) (Ruben Bridgewater) -* 833a0cad Fix: confusing RuleTester error message when options is not an array (#8557) (Teddy Katz) - -v4.0.0-alpha.2 - May 5, 2017 - -* 74ab344 Update: check allman-style blocks correctly in indent rule (fixes #8493) (#8499) (Teddy Katz) -* f6256d4 Update: no-extend-native checks global scope refs only (fixes #8461) (#8528) (Kevin Partington) -* b463045 Docs: add typescript-eslint-parser (#8388) (#8534) (薛定谔的猫) -* 99c56d5 Update: handle multiline parents consistently in indent (fixes #8455) (#8498) (Teddy Katz) -* cf940c6 Update: indent `from` tokens in import statements (fixes #8438) (#8466) (Teddy Katz) -* 0a9a90f Fix: max-len doesn't allow comments longer than code (#8532) (Ken Gregory) -* 734846b Breaking: validate eslintrc properties (fixes #8213) (#8295) (alberto) -* 025e97a Chore: delete duplicated test. (#8527) (薛定谔的猫) -* 6a333ff Upgrade: espree@^3.4.2 (#8526) (Kevin Partington) -* e52d998 Docs: Configuring Cascading and Hierarchy example correction (#8512) (Cheong Yip) -* e135aa5 Docs: Correct code of conduct link on Readme.md (#8517) (Zander Mackie) -* 37e3ba1 Chore: Add license report and scan status (#8503) (Kevin Wang) -* afbea78 Chore: don't pull default options from eslint:recommended (fixes #8374) (#8381) (Teddy Katz) -* d49acc3 Update: fix no-self-compare false negative on non-literals (fixes #7677) (#8492) (Teddy Katz) -* aaa1a81 Fix: avoid creating extra whitespace in brace-style fixer (fixes #7621) (#8491) (Teddy Katz) -* 9c3da77 Docs: list another related rule in no-undefined (#8467) (Ethan) -* f987814 Docs: Update CHANGELOG.md for v4.0.0-alpha.1 release (#8488) (Kai Cataldo) - -v4.0.0-alpha.1 - April 21, 2017 - -* b0dadfe3 Docs: Update comments section of Migrating to v4.0.0 (#8486) (Kai Cataldo) -* b337738f Update: Add `consistent` option to `object-curly-newline` (fixes #6488) (#7720) (Evilebot Tnawi) -* 53fefb3b Update: add fix for no-confusing-arrow (#8347) (Mordy Tikotzky) -* 735d02d5 Update: Deprecate sourceCode.getComments() (fixes #8408) (#8434) (Kai Cataldo) -* ac39e3b0 Update: no-unexpected-multiline to flag confusing division (fixes #8469) (#8475) (Teddy Katz) -* e35107f0 Fix: indent crash on arrow functions without parens at start of line (#8477) (Teddy Katz) -* 973adeb6 Docs: State that functions option only applies in ES2017 (fixes #7809) (#8468) (Thenaesh Elango) -* 7bc6fe0a New: array-bracket-newline rule (#8314) (Jan Peer Stöcklmair) -* 10a1a2d7 Chore: Do not use cache when testing (#8464) (Kai Cataldo) -* 9f540fd2 Update: no-unused-vars false negative about destructuring (fixes #8442) (#8459) (Toru Nagashima) -* 741ed393 Docs: Clarify how to run local ESLint installation (#8463) (Kai Cataldo) -* fac53890 Breaking: Remove array-callback-return from recommended (fixes #8428) (#8433) (Kai Cataldo) -* 288c96c1 Upgrade: dependencies (#8304) (alberto) -* 48700fc8 Docs: Remove extra header line from LICENSE (#8448) (Teddy Katz) -* 161ee4ea Chore: avoid cloning comments array in TokenStore (#8436) (Teddy Katz) -* 0c2a386e Docs: clarify new indent behavior with MemberExpressions (#8432) (Teddy Katz) -* 446b8876 Docs: update space-before-function-paren docs for 4.0 (fixes #8430) (#8431) (Teddy Katz) - -v4.0.0-alpha.0 - April 7, 2017 - -* 950874f Docs: add 4.0.0 migration guide (fixes #8306) (#8313) (Teddy Katz) -* 2754141 Fix: more autofix token-combining bugs (#8394) (Teddy Katz) -* f5a7e42 Breaking: log number of fixable problems (fixes #7364) (#8324) (alberto) -* 769b121 Chore: Fix indentation errors in indent-legacy (#8424) (Kai Cataldo) -* 8394e48 Update: add deprecated indent-legacy rule as v3.x indent rule snapshot (#8286) (Teddy Katz) -* 3c87e85 Fix: no-multi-spaces false positive with irregular indent whitespace (#8412) (Teddy Katz) -* cc53481 Breaking: rewrite indent (fixes #1801, #3737, #3845, #6007, ...16 more) (#7618) (Teddy Katz) -* 867dd2e Breaking: Calculate leading/trailing comments in core (#7516) (Kai Cataldo) -* de9f1a0 Docs: ES6 syntax vs globals configuration (fixes #7984) (#8350) (Zander Mackie) -* 66af53e Breaking: Traverse into type annotations (fixes #7129) (#8365) (Kai Cataldo) -* 86cf3e4 New: no-buffer-constructor rule (fixes #5614) (#8413) (Teddy Katz) -* f560c06 Update: fix space-unary-ops behavior with postfix UpdateExpressions (#8391) (Teddy Katz) -* 936af66 Fix: no-multiple-empty-lines crash on space after last \n (fixes #8401) (#8402) (Teddy Katz) -* e395919 Breaking: Resolve patterns from .eslintignore directory (fixes #6759) (#7678) (Ian VanSchooten) -* c778676 Breaking: convert RuleTester to ES6 class (refs #8231) (#8263) (Teddy Katz) -* 6f7757e Breaking: convert SourceCode to ES6 class (refs #8231) (#8264) (Teddy Katz) -* 8842d7e Chore: fix comment spacing in tests (#8405) (Teddy Katz) -* 9a9d916 Breaking: update eslint:recommended for 4.0.0 (fixes #8236) (#8372) (Teddy Katz) -* b0c63f0 Breaking: infer endLine and endColumn from a reported node (fixes #8004) (#8234) (Teddy Katz) -* 40b8c69 Breaking: no-multi-spaces check around inline comments (fixes #7693) (#7696) (Kai Cataldo) -* 034a575 Breaking: convert CLIEngine to ES6 class (refs #8231) (#8262) (Teddy Katz) -* 7dd890d Breaking: tweak space-before-function-paren default option (fixes #8267) (#8285) (Teddy Katz) -* 0e0dd27 Breaking: Remove `ecmaFeatures` from `eslint:recommended` (#8239) (alberto) -* 2fa7502 Breaking: disallow scoped plugin references without scope (fixes #6362) (#8233) (Teddy Katz) -* 4673f6e Chore: Switch to eslint-scope from escope (#8280) (Corbin Uselton) -* e232464 Breaking: change defaults for padded-blocks (fixes #7879) (#8134) (alberto) - -v3.19.0 - March 31, 2017 - -* e09132f Fix: no-extra-parens false positive with exports and object literals (#8359) (Teddy Katz) -* 91baed4 Update: allow custom messages in no-restricted-syntax (fixes #8298) (#8357) (Vitor Balocco) -* 35c93e6 Fix: prevent space-before-function-paren from checking type annotations (#8349) (Teddy Katz) -* 3342e9f Fix: don't modify operator precedence in operator-assignment autofixer (#8358) (Teddy Katz) -* f88375f Docs: clarify that no-unsafe-negation is in eslint:recommended (#8371) (Teddy Katz) -* 02f0d27 Docs: Add soda0289 to Development Team (#8367) (Kai Cataldo) -* 155424c Fix: ignore empty path in patterns (fixes #8362) (#8364) (alberto) -* 27616a8 Fix: prefer-const false positive with object spread (fixes #8187) (#8297) (Vitor Balocco) -* 8569a90 Docs: add note about git's linebreak handling to linebreak-style docs (#8361) (Teddy Katz) -* 5878593 Chore: fix invalid syntax in no-param-reassign test (#8360) (Teddy Katz) -* 1b1046b Fix: don't classify plugins that throw errors as "missing" (fixes #6874) (#8323) (Teddy Katz) -* 29f4ba5 Fix: no-useless-computed-key invalid autofix for getters and setters (#8335) (Teddy Katz) -* 0541eaf Fix: no-implicit-coercion invalid autofix with consecutive identifiers (#8340) (Teddy Katz) -* 41b9786 Fix: no-extra-parens false positive with objects following arrows (#8339) (Teddy Katz) -* 3146167 Fix: `eslint.verify` should not mutate config argument (fixes #8329) (#8334) (alberto) -* 927de90 Fix: dot-notation autofix produces invalid syntax for integer properties (#8332) (Teddy Katz) -* a9d1bea Fix: comma-style autofix produces errors on parenthesized elements (#8331) (Teddy Katz) -* d52173f Fix: don't generate invalid options in config-rule (#8326) (Teddy Katz) -* 6eda3b5 Fix: no-extra-parens invalid autofix in for-of statements (#8337) (Teddy Katz) -* 6c819d8 Fix: dot-notation autofix produces errors on parenthesized computed keys (#8330) (Teddy Katz) -* 2d883d7 Fix: object-shorthand autofix produces errors on parenthesized functions (#8328) (Teddy Katz) -* cd9b774 Fix: quotes false positive with backtick option in method names (#8327) (Teddy Katz) -* d064ba2 Fix: no-else-return false positive for ifs in single-statement position (#8338) (Teddy Katz) -* 6a718ba Chore: enable max-statements-per-line on ESLint codebase (#8321) (Teddy Katz) -* 614b62e Chore: update sinon calls to deprecated API. (#8310) (alberto) -* 0491572 Chore: use precalculated counts in codeframe formatter (#8296) (Vitor Balocco) -* 8733e6a Chore: Fix incorrect error location properties in tests (#8307) (alberto) -* c4ffb49 Chore: Fix typos in test option assertions (#8305) (Teddy Katz) -* 79a97cb Upgrade: devDependencies (#8303) (alberto) -* e4da200 Upgrade: Mocha to 3.2.0 (#8299) (Ilya Volodin) -* 2f144ca Fix: operator-assignment autofix errors with parentheses (fixes #8293) (#8294) (Teddy Katz) -* 7521cd5 Chore: update token logic in rules to use ast-utils (#8288) (Teddy Katz) -* 9b509ce Chore: refactor space-before-function-paren rule (#8284) (Teddy Katz) -* ddc6350 Fix: no-param-reassign false positive on destructuring (fixes #8279) (#8281) (Teddy Katz) -* f8176b3 Chore: improve test coverage for node-event-generator (#8287) (Teddy Katz) -* 602e9c2 Docs: fix incorrect selector examples (#8278) (Teddy Katz) - -v3.18.0 - March 17, 2017 - -* 85f74ca Fix: broken code path of direct nested loops (fixes #8248) (#8274) (Toru Nagashima) -* a61c359 Fix: Ignore hidden folders when resolving globs (fixes #8259) (#8270) (Ian VanSchooten) -* 6f05546 Chore: convert StubModuleResolver in config tests to ES6 class (#8265) (Teddy Katz) -* 0c0fc31 Fix: false positive of no-extra-parens about spread and sequense (#8275) (Toru Nagashima) -* e104973 Docs: remove self-reference in no-restricted-syntax docs (#8277) (Vitor Balocco) -* 23eca51 Update: Add allowTaggedTemplates to no-unused-expressions (fixes #7632) (#8253) (Kevin Partington) -* f9ede3f Upgrade: doctrine to 2.0.0 (#8269) (alberto) -* 1b678a6 New: allow rules to listen for AST selectors (fixes #5407) (#7833) (Teddy Katz) -* 63ca0c5 Chore: use precalculated counts in stylish formatter (#8251) (alberto) -* 47c3171 Fix: typo in console.error (#8258) (Jan Peer Stöcklmair) -* e74ed6d Chore: convert Traverser to ES6 class (refs #7849) (#8232) (Teddy Katz) -* 13eead9 Fix: sort-vars crash on mixed destructuring declarations (#8245) (Teddy Katz) -* 133f489 Fix: func-name-matching crash on destructuring assignment to functions (#8247) (Teddy Katz) -* a34b9c4 Fix: func-name-matching crash on non-string literal computed keys (#8246) (Teddy Katz) -* 7276e6d Docs: remove unneeded semicolons in arrow-parens.md (#8249) (Dmitry Gershun) -* 8c40a25 concat-stream known to be vulnerable prior 1.5.2 (#8228) (Samuel) -* 149c055 Upgrade: mock-fs to v4.2.0 (fixes #8194) (#8243) (Teddy Katz) -* a83bff9 Build: remove unneeded json config in demo (fixes #8237) (#8242) (alberto) -* df12137 Docs: fix typos (#8235) (Gyandeep Singh) -* b5e9788 Chore: rename no-extra-parens methods (#8225) (Vitor Balocco) -* 7f8afe6 Update: no-extra-parens overlooked spread and superClass (fixes #8175) (#8209) (Toru Nagashima) -* ce6ff56 Docs: set recommended true for no-global-assign (fixes #8215) (#8218) (BinYi LIU) -* 5b5c236 Fix: wrong comment when module not found in config (fixes #8192) (#8196) (alberto) - -v3.17.1 - March 6, 2017 - -* f8c8e6e Build: change mock-fs path without SSH (fixes #8207) (#8208) (Toru Nagashima) -* f713f11 Fix: nonblock-statement-body-position multiline error (fixes #8202) (#8203) (Teddy Katz) -* 41e3d9c Fix: `operator-assignment` with parenthesized expression (fixes #8190) (#8197) (alberto) -* 5e3bca7 Chore: add eslint-plugin-eslint-plugin (#8198) (Teddy Katz) -* 580da36 Chore: add missing `output` property to tests (#8195) (alberto) - -v3.17.0 - March 3, 2017 - -* 4fdf6d7 Update: deprecate `applyDefaultPatterns` in `line-comment-position` (#8183) (alberto) -* 25e5817 Fix: Don't autofix `+ +a` to `++a` in space-unary-ops (#8176) (Alan Pierce) -* a6ce8f9 Build: Sort rules before dumping them to doc files (#8154) (Danny Andrews) -* 0af9057 Chore: Upgrade to a patched version of mock-fs (fixes #8177) (#8188) (Teddy Katz) -* bf4d8cf Update: ignore eslint comments in lines-arount-comment (fixes #4345) (#8155) (alberto) -* dad20ad New: add SourceCode#getLocFromIndex and #getIndexFromLoc (fixes #8073) (#8158) (Teddy Katz) -* 18a519f Update: let RuleTester cases assert that no autofix occurs (fixes #8157) (#8163) (Teddy Katz) -* a30eb8d Docs: improve documentation for RuleTester cases (#8162) (Teddy Katz) -* a78ec9f Chore: upgrade `coveralls` to ^2.11.16 (#8161) (alberto) -* d02bd11 Fix: padded-blocks autofix problems with comments (#8149) (alberto) -* 9994889 Docs: Add missing space to `create` in `no-use-before-define` (#8166) (Justin Anastos) -* 4d542ba Docs: Remove unneeded statement about autofix (#8164) (alberto) -* 20daea5 New: no-compare-neg-zero rule (#8091) (薛定谔的猫) -* 4d35a81 Fix: Add a utility to avoid autofix conflicts (fixes #7928, fixes #8026) (#8067) (Alan Pierce) -* 287e882 New: nonblock-statement-body-position rule (fixes #6067) (#8108) (Teddy Katz) -* 7f1f4e5 Chore: remove unneeded devDeps `linefix` and `gh-got` (#8160) (alberto) -* ca1694b Update: ignore negative ranges in fixes (#8133) (alberto) -* 163d751 Docs: `lines-around-comment` doesn't disallow empty lines (#8151) (alberto) -* 1c84922 Chore: upgrade eslint-plugin-node (#8156) (alberto) -* 1ee5c27 Fix: Make RuleTester handle empty-string cases gracefully (fixes #8142) (#8143) (Teddy Katz) -* 044bc10 Docs: Add details about "--fix" option for "sort-imports" rule (#8077) (Olivier Audard) -* 3fec54a Add option to ignore property in no-param-reassign (#8087) (Christian Bundy) -* 4e52cfc Fix: Improve keyword-spacing typescript support (fixes #8110) (#8111) (Reyad Attiyat) -* 7ff42e8 New: Allow regexes in RuleTester (fixes #7837) (#8115) (Daniel Lo Nigro) -* cbd7ded Build: display rules’ meta data in their docs (fixes #5774) (#8127) (Wilson Kurniawan) -* da8e8af Update: include function name in report message if possible (fixes #7260) (#8058) (Dieter Luypaert) -* 8f91e32 Fix: `ignoreRestSiblings` option didn't cover arguments (fixes #8119) (#8120) (Toru Nagashima) - -v3.16.1 - February 22, 2017 - -* ff8a80c Fix: duplicated autofix output for inverted fix ranges (fixes #8116) (#8117) (Teddy Katz) -* a421897 Docs: fix typo in arrow-parens.md (#8132) (Will Chen) -* 22d7fbf Chore: fix invalid redeclared variables in tests (#8130) (Teddy Katz) -* 8d95598 Chore: fix output assertion typos in rule tests (#8129) (Teddy Katz) -* 9fa2559 Docs: Add missing quotes in key-spacing rule (#8121) (Glenn Reyes) -* f3a6ced Build: package.json update for eslint-config-eslint release (ESLint Jenkins) - -v3.16.0 - February 20, 2017 - -* d89d0b4 Update: fix quotes false negative for string literals as template tags (#8107) (Teddy Katz) -* 21be366 Chore: Ensuring eslint:recommended rules are sorted. (#8106) (Kevin Partington) -* 360dbe4 Update: Improve error message when extend config missing (fixes #6115) (#8100) (alberto) -* f62a724 Chore: use updated token iterator methods (#8103) (Kai Cataldo) -* daf6f26 Fix: check output in RuleTester when errors is a number (fixes #7640) (#8097) (alberto) -* cfb65c5 Update: make no-lone-blocks report blocks in switch cases (fixes #8047) (#8062) (Teddy Katz) -* 290fb1f Update: Add includeComments to getTokenByRangeStart (fixes #8068) (#8069) (Kai Cataldo) -* ff066dc Chore: Incorrect source code test text (#8096) (Jack Ford) -* 14d146d Docs: Clarify --ext only works with directories (fixes #7939) (#8095) (alberto) -* 013a454 Docs: Add TSC meeting quorum requirement (#8086) (Kevin Partington) -* 7516303 Fix: `sourceCode.getTokenAfter` shouldn't skip tokens after comments (#8055) (Toru Nagashima) -* c53e034 Fix: unicode-bom fixer insert BOM in appropriate location (fixes #8083) (#8084) (pantosha) -* 55ac302 Chore: fix the timing to define rules for tests (#8082) (Toru Nagashima) -* c7e64f3 Upgrade: mock-fs (#8070) (Toru Nagashima) -* acc3301 Update: handle uncommon linebreaks consistently in rules (fixes #7949) (#8049) (Teddy Katz) -* 591b74a Chore: enable operator-linebreak on ESLint codebase (#8064) (Teddy Katz) -* 6445d2a Docs: Add documentation for /* exported */ (fixes #7998) (#8065) (Lee Yi Min) -* fcc38db Chore: simplify and improve performance for autofix (#8035) (Toru Nagashima) -* b04fde7 Chore: improve performance of SourceCode constructor (#8054) (Teddy Katz) -* 90fd555 Update: improve null detection in eqeqeq for ES6 regexes (fixes #8020) (#8042) (Teddy Katz) -* 16248e2 Fix: no-extra-boolean-cast incorrect Boolean() autofixing (fixes #7977) (#8037) (Jonathan Wilsson) -* 834f45d Update: rewrite TokenStore (fixes #7810) (#7936) (Toru Nagashima) -* 329dcdc Chore: unify checks for statement list parents (#8048) (Teddy Katz) -* c596690 Docs: Clarify generator-star-spacing config example (fixes #8027) (#8034) (Hòa Trần) -* a11d4a6 Docs: fix a typo in shareable configs documentation (#8036) (Dan Homola) -* 1e3d4c6 Update: add fixer for no-unused-labels (#7841) (Teddy Katz) -* f47fb98 Update: ensure semi-spacing checks import/export declarations (#8033) (Teddy Katz) -* e228d56 Update: no-undefined handles properties/classes/modules (fixes #7964) (#7966) (Kevin Partington) -* 7bc92d9 Chore: fix invalid test cases (#8030) (Toru Nagashima) - -v3.15.0 - February 3, 2017 - -* f2a3580 Fix: `no-extra-parens` incorrect precedence (fixes #7978) (#7999) (alberto) -* d6b6ba1 Fix: no-var should fix ForStatement.init (#7993) (Toru Nagashima) -* 99d386d Upgrade: Espree v3.4.0 (#8019) (Kai Cataldo) -* 42390fd Docs: update README.md for team (#8016) (Toru Nagashima) -* d7ffd88 Chore: enable template-tag-spacing on ESLint codebase (#8005) (Teddy Katz) -* f2be7e3 Docs: Fix typo in object-curly-newline.md (#8002) (Danny Andrews) -* df2351a Docs: Fix misleading section in brace-style documentation (#7996) (Teddy Katz) -* 5ae6e00 Chore: avoid unnecessary feature detection for Symbol (#7992) (Teddy Katz) -* 5d57c57 Chore: fix no-else-return lint error (refs #7986) (#7994) (Vitor Balocco) -* 62fb054 Chore: enable no-else-return on ESLint codebase (#7986) (Teddy Katz) -* c59a0ba Update: add ignoreRestSiblings option to no-unused-vars (#7968) (Zack Argyle) -* 5cdfa99 Chore: enable no-unneeded-ternary on ESLint codebase (#7987) (Teddy Katz) -* fbd7c13 Update: ensure operator-assignment handles exponentiation operators (#7970) (Teddy Katz) -* c5066ce Update: add "variables" option to no-use-before-define (fixes #7111) (#7948) (Teddy Katz) -* 09546a4 New: `template-tag-spacing` rule (fixes #7631) (#7913) (Jonathan Wilsson) - -v3.14.1 - January 25, 2017 - -* 791f32b Fix: brace-style false positive for keyword method names (fixes #7974) (#7980) (Teddy Katz) -* d7a0add Docs: Add ESLint tutorial embed to getting started (#7971) (Jamis Charles) -* 72d41f0 Fix: no-var autofix syntax error in single-line statements (fixes #7961) (#7962) (Teddy Katz) -* b9e5b68 Fix: indent rule crash on sparse array with object (fixes #7959) (#7960) (Gyandeep Singh) -* a7bd66a Chore: Adding assign/redeclare tests to no-undefined (refs #7964) (#7965) (Kevin Partington) -* 8bcbf5d Docs: typo in prefer-promise-reject-errors (#7958) (Patrick McElhaney) - -v3.14.0 - January 20, 2017 - -* 506324a Fix: `no-var` does not fix if causes ReferenceError (fixes #7950) (#7953) (Toru Nagashima) -* 05e7432 New: no-chained-assignments rule (fixes #6424) (#7904) (Stewart Rand) -* 243e47d Update: Add fixer for no-else-return (fixes #7863) (#7864) (Xander Dumaine) -* f091d95 New: `prefer-promise-reject-errors` rule (fixes #7685) (#7689) (Teddy Katz) -* ca01e00 Fix: recognize all line terminators in func-call-spacing (fixes #7923) (#7924) (Francesco Trotta) -* a664e8a Update: add ignoreJSX option to no-extra-parens (Fixes #7444) (#7926) (Robert Rossmann) -* 8ac3518 Fix: no-useless-computed-key false positive with `__proto__` (#7934) (Teddy Katz) -* c835e19 Docs: remove reference to deleted rule (#7942) (Alejandro Oviedo) -* 3c1e63b Docs: Improve examples for no-case-declarations (fixes #6716) (#7920) (Kevin Rangel) -* 7e04b33 Fix: Ignore inline plugin rule config in autoconfig (fixes #7860) (#7919) (Ian VanSchooten) -* 6448ba0 Fix: add parentheses in no-extra-boolean-cast autofixer (fixes #7912) (#7914) (Szymon Przybylski) -* b3f2094 Fix: brace-style crash with lone block statements (fixes #7908) (#7909) (Teddy Katz) -* 5eb2e88 Docs: Correct typos in configuring.md (#7916) (Gabriel Delépine) -* bd5e219 Update: ensure brace-style validates class bodies (fixes #7608) (#7871) (Teddy Katz) -* 427543a Fix: catastrophic backtracking in astUtils linebreak regex (fixes #7893) (#7898) (Teddy Katz) -* 995554c Fix: Correct typos in no-alert.md and lib/ast-utils.js (#7905) (Stewart Rand) -* d6150e3 Chore: Enable comma-dangle on ESLint codebase (fixes #7725) (#7906) (Teddy Katz) -* 075ec25 Chore: update to use ES6 classes (refs #7849) (#7891) (Claire Dranginis) -* 55f0cb6 Update: refactor brace-style and fix inconsistencies (fixes #7869) (#7870) (Teddy Katz) - -v3.13.1 - January 9, 2017 - -* 3fc4e3f Fix: prefer-destructuring reporting compound assignments (fixes #7881) (#7882) (Teddy Katz) -* f90462e Fix: no-extra-label autofix should not remove labels used elsewhere (#7885) (Teddy Katz) - -v3.13.0 - January 6, 2017 - -* cd4c025 Update: add fixer for no-extra-label (#7840) (Teddy Katz) -* aa75c92 Fix: Ensure prefer-const fixes destructuring assignments (fixes #7852) (#7859) (Teddy Katz) -* 4008022 Chore: Refactor to use ES6 Classes (Part 3)(refs #7849) (#7865) (Gyandeep Singh) -* c9ba40a Update: add fixer for `no-unneeded-ternary` (#7540) (Teddy Katz) -* dd56d87 Update: add object-shorthand option for arrow functions (fixes #7564) (#7746) (Teddy Katz) -* fbafdc0 Docs: `padded-blocks` `never` case (fixes #7868) (#7878) (alberto) -* ca1f841 Fix: no-useless-return stack overflow on loops after throw (fixes #7855) (#7856) (Teddy Katz) -* d80d994 Update: add fixer for object-property-newline (fixes #7740) (#7808) (Teddy Katz) -* bf3ea3a Fix: capitalized-comments: Ignore consec. comments if first is invalid (#7835) (Kevin Partington) -* 616611a Chore: Refactor to use ES6 Classes (Part 2)(refs #7849) (#7847) (Gyandeep Singh) -* 856084b Chore: Refactor to use ES6 Classes (Part 1)(refs #7849) (#7846) (Gyandeep Singh) -* bf45893 Docs: Clarify that we only support Stage 4 proposals (#7845) (Kevin Partington) -* 0fc24f7 Fix: adapt new-paren rule so it handles TypeScript (fixes #7817) (#7820) (Philipp A) -* df0b06b Fix: no-multiple-empty-lines perf issue on large files (fixes #7803) (#7843) (Teddy Katz) -* 18fa521 Chore: use ast-utils helper functions in no-multiple-empty-lines (#7842) (Teddy Katz) -* 7122205 Docs: Array destructuring example for no-unused-vars (fixes #7838) (#7839) (Remco Haszing) -* e21b36b Chore: add integration tests for cache files (refs #7748) (#7794) (Teddy Katz) -* 2322733 Fix: Throw error if ruletester is missing required test scenarios (#7388) (Teddy Katz) -* 1beecec Update: add fixer for `operator-linebreak` (#7702) (Teddy Katz) -* c5c3b21 Fix: no-implied-eval false positive on 'setTimeoutFoo' (fixes #7821) (#7836) (Teddy Katz) -* 00dd96c Chore: enable array-bracket-spacing on ESLint codebase (#7830) (Teddy Katz) -* ebcae1f Update: no-return-await with with complex `return` argument (fixes #7594) (#7595) (Dalton Santos) -* fd4cd3b Fix: Disable no-var autofixer in some incorrect cases in loops (#7811) (Alan Pierce) -* 1f25834 Docs: update outdated info in Architecture page (#7816) (Teddy Katz) -* f20b9e9 Fix: Relax no-useless-escape's handling of ']' in regexes (fixes #7789) (#7793) (Teddy Katz) -* 3004c1e Fix: consistent-return shouldn't report class constructors (fixes #7790) (#7797) (Teddy Katz) -* b938f1f Docs: Add an example for the spread operator to prefer-spread.md (#7802) (#7804) (butlermd) -* b8ce2dc Docs: Remove .html extensions from links in developer-guide (#7805) (Kevin Partington) -* aafebb2 Docs: Wrap placeholder sample in {% raw %} (#7798) (Daniel Lo Nigro) -* bb6b73b Chore: replace unnecessary function callbacks with arrow functions (#7795) (Teddy Katz) -* 428fbdf Fix: func-call-spacing "never" doesn't fix w/ line breaks (fixes #7787) (#7788) (Kevin Partington) -* 6e61070 Fix: `semi` false positive before regex/template literals (fixes #7782) (#7783) (Teddy Katz) -* ff0c050 Fix: remove internal property from config generation (fixes #7758) (#7761) (alberto) -* 27424cb New: `prefer-destructuring` rule (fixes #6053) (#7741) (Alex LaFroscia) -* bb648ce Docs: fix unclear example for no-useless-escape (#7781) (Teddy Katz) -* 8c3a962 Fix: syntax errors from object-shorthand autofix (fixes #7744) (#7745) (Teddy Katz) -* 8b296a2 Docs: fix in semi.md: correct instead of incorrect (#7779) (German Prostakov) -* 3493241 Upgrade: strip-json-comments ~v2.0.1 (Janus Troelsen) -* 75b7ba4 Chore: enable object-curly-spacing on ESLint codebase (refs #7725) (#7770) (Teddy Katz) -* 7d1dc7e Update: Make default-case comment case-insensitive (fixes #7673) (#7742) (Robert Rossmann) -* f1bf5ec Chore: convert remaining old-style context.report() calls to the new API (#7763) (Teddy Katz) - -v3.12.2 - December 14, 2016 - -* dec3ec6 Fix: indent bug with AssignmentExpressions (fixes #7747) (#7750) (Teddy Katz) -* 5344751 Build: Don't create blogpost links from rule names within other words (#7754) (Teddy Katz) -* 639b798 Docs: Use `Object.prototype` in examples (#7755) (Alex Reardon) - -v3.12.1 - December 12, 2016 - -* 0ad4d33 Fix: `indent` regression with function calls (fixes #7732, fixes #7733) (#7734) (Teddy Katz) -* ab246dd Docs: Rules restricting globals/properties/syntax are linked together (#7743) (Kevin Partington) -* df2f115 Docs: Add eslint-config-mdcs to JSCS Migration Guide (#7737) (Joshua Koo) -* 4b77333 Build: avoid creating broken rule links in the changelog (#7731) (Teddy Katz) - -v3.12.0 - December 9, 2016 - -* e569225 Update: fix false positive/negative of yoda rule (fixes #7676) (#7695) (Toru Nagashima) -* e95a230 Fix: indent "first" option false positive on nested arrays (fixes #7727) (#7728) (Teddy Katz) -* 81f9e7d Fix: Allow duplicated let declarations in `prefer-const` (fixes #7712) (#7717) (Teddy Katz) -* 1d0d61d New: Add no-await-in-loop rule (#7563) (Nat Mote) -* 2cdfb4e New: Additional APIs (fixes #6256) (#7669) (Ilya Volodin) -* 4278c42 Update: make no-obj-calls report errors for Reflect (fixes #7700) (#7710) (Tomas Echeverri Valencia) -* 4742d82 Docs: clarify the default behavior of `operator-linebreak` (fixes #7459) (#7726) (Teddy Katz) -* a8489e2 Chore: Avoid parserOptions boilerplate in tests for ES6 rules (#7724) (Teddy Katz) -* b921d1f Update: add `indent` options for array and object literals (fixes #7473) (#7681) (Teddy Katz) -* 7079c89 Update: Add airbnb-base to init styleguides (fixes #6986) (#7699) (alberto) -* 63bb3f8 Docs: improve the documentation for the autofix API (#7716) (Teddy Katz) -* f8786fb Update: add fixer for `capitalized-comments` (#7701) (Teddy Katz) -* abfd24f Fix: don't validate schemas for disabled rules (fixes #7690) (#7692) (Teddy Katz) -* 2ac07d8 Upgrade: Update globals dependency to 9.14.0 (#7683) (Aleksandr Oleynikov) -* 90a5d29 Docs: Remove incorrect info about issue requirements from PR guide (#7691) (Teddy Katz) -* f80c278 Docs: Add sails-hook-lint to integrations list (#7679) (Anthony M) -* e96da3f Docs: link first instance of `package.json` (#7684) (Kent C. Dodds) -* bf20e20 Build: include links to rule pages in release blogpost (#7671) (Teddy Katz) -* b30116c Docs: Fix code-blocks in spaced-comment docs (#7524) (Michał Gołębiowski) -* 0a2a7fd Fix: Allow \u2028 and \u2029 as string escapes in no-useless-escape (#7672) (Teddy Katz) -* 76c33a9 Docs: Change Sails.js integration to active npm package (#7675) (Anthony M) - -v3.11.1 - November 28, 2016 - -* be739d0 Fix: capitalized-comments fatal error fixed (fixes #7663) (#7664) (Rich Trott) -* cc4cedc Docs: Fix a typo in array-bracket-spacing documentation (#7667) (Alex Guerrero) -* f8adadc Docs: fix a typo in capitalized-comments documentation (#7666) (Teddy Katz) - -v3.11.0 - November 25, 2016 - -* ad56694 New: capitalized-comments rule (fixes #6055) (#7415) (Kevin Partington) -* 7185567 Update: add fixer for `operator-assignment` (#7517) (Teddy Katz) -* faf5f56 Update: fix false negative of `quotes` with \n in template (fixes #7646) (#7647) (Teddy Katz) -* 474e444 Update: add fixer for `sort-imports` (#7535) (Teddy Katz) -* f9b70b3 Docs: Enable example highlighting in rules examples (ref #6444) (#7644) (Alex Guerrero) -* d50f6c1 Fix: incorrect location for `no-useless-escape` errors (fixes #7643) (#7645) (Teddy Katz) -* 54a993c Docs: Fix a typo in the require-yield.md (#7652) (Vse Mozhet Byt) -* eadd808 Chore: Fix prefer-arrow-callback lint errors (#7651) (Kevin Partington) -* 89bd8de New: `require-await` rule (fixes #6820) (#7435) (Toru Nagashima) -* b7432bd Chore: Ensure JS files are checked out with LF (#7624) (Kevin Partington) -* 32a3547 Docs: Add absent quotes in rules documentation (#7625) (Denis Sikuler) -* 5c9a4ad Fix: Prevent `quotes` from fixing templates to directives (fixes #7610) (#7617) (Teddy Katz) -* d90ca46 Upgrade: Update markdownlint dependency to 0.3.1 (fixes #7589) (#7592) (David Anson) -* 07124d1 Docs: add missing quote mark (+=" → "+=") (#7613) (Sean Juarez) -* 8998043 Docs: fix wording in docs for no-extra-parens config (Michael Ficarra) - -v3.10.2 - November 15, 2016 - -* 0643bfe Fix: correctly handle commented code in `indent` autofixer (fixes #7604) (#7606) (Teddy Katz) -* bd0514c Fix: syntax error after `key-spacing` autofix with comment (fixes #7603) (#7607) (Teddy Katz) -* f56c1ef Fix: `indent` crash on parenthesized global return values (fixes #7573) (#7596) (Teddy Katz) -* 100c6e1 Docs: Fix example for curly "multi-or-nest" option (#7597) (Will Chen) -* 6abb534 Docs: Update code of conduct link (#7599) (Nicholas C. Zakas) -* 8302cdb Docs: Update no-tabs to match existing standards & improve readbility (#7590) (Matt Stow) - -v3.10.1 - November 14, 2016 - -* 8a0e92a Fix: handle try/catch correctly in `no-return-await` (fixes #7581) (#7582) (Teddy Katz) -* c4dd015 Fix: no-useless-return stack overflow on unreachable loops (fixes #7583) (#7584) (Teddy Katz) - -v3.10.0 - November 11, 2016 - -* 7ee039b Update: Add comma-style options for calls, fns, imports (fixes #7470) (Max Englander) -* 670e060 Chore: make the `object-shorthand` tests more readable (#7580) (Teddy Katz) -* c3f4809 Update: Allow `func-names` to recognize inferred ES6 names (fixes #7235) (#7244) (Logan Smyth) -* b8d6e48 Fix: syntax errors created by `object-shorthand` autofix (fixes #7574) (#7575) (Teddy Katz) -* 1b3b65c Chore: ensure that files in tests/conf are linted (#7579) (Teddy Katz) -* 2bd1dd7 Update: avoid creating extra whitespace in `arrow-body-style` fixer (#7504) (Teddy Katz) -* 66fe9ff New: `no-return-await` rule. (fixes #7537) (#7547) (Jordan Harband) -* 759525e Chore: Use process.exitCode instead of process.exit() in bin/eslint.js (#7569) (Teddy Katz) -* 0d60db7 Fix: Curly rule doesn't account for leading comment (fixes #7538) (#7539) (Will Chen) -* 5003b1c Update: fix in/instanceof handling with `space-infix-ops` (fixes #7525) (#7552) (Teddy Katz) -* 3e6131e Docs: explain config option merging (#7499) (Danny Andrews) -* 1766524 Update: "Error type should be" assertion in rule-tester (fixes 6106) (#7550) (Frans Jaspers) -* 44eb274 Docs: Missing semicolon report was missing a comma (#7553) (James) -* 6dbda15 Docs: Document the optional defaults argument for RuleTester (#7548) (Teddy Katz) -* e117b80 Docs: typo fix (#7546) (oprogramador) -* 25e5613 Chore: Remove incorrect test from indent.js. (#7531) (Scott Stern) -* c0f4937 Fix: `arrow-parens` supports type annotations (fixes #7406) (#7436) (Toru Nagashima) -* a838b8e Docs: `func-name-matching`: update with “always”/“never” option (#7536) (Jordan Harband) -* 3c379ff Update: `no-restricted-{imports,modules}`: add “patterns” (fixes #6963) (#7433) (Jordan Harband) -* f5764ee Docs: Update example of results returned from `executeOnFiles` (#7362) (Simen Bekkhus) -* 4613ba0 Fix: Add support for escape char in JSX. (#7461) (Scott Stern) -* ea0970d Fix: `curly` false positive with no-semicolon style (#7509) (Teddy Katz) -* af1fde1 Update: fix `brace-style` false negative on multiline node (fixes #7493) (#7496) (Teddy Katz) -* 3798aea Update: max-statements to report function name (refs #7260) (#7399) (Nicholas C. Zakas) -* 0c215fa Update: Add `ArrowFunctionExpression` support to `require-jsdoc` rule (#7518) (Gyandeep Singh) -* 578c373 Build: handle deprecated rules with no 'replacedBy' (refs #7471) (#7494) (Vitor Balocco) -* a7f3976 Docs: Specify min ESLint version for new rule format (#7501) (cowchimp) -* 8a3e717 Update: Fix `lines-around-directive` semicolon handling (fixes #7450) (#7483) (Teddy Katz) -* e58cead Update: add a fixer for certain statically-verifiable `eqeqeq` cases (#7389) (Teddy Katz) -* 0dea0ac Chore: Add Node 7 to travis ci build (#7506) (Gyandeep Singh) -* 36338f0 Update: add fixer for `no-extra-boolean-cast` (#7387) (Teddy Katz) -* 183def6 Chore: enable `prefer-arrow-callback` on ESLint codebase (fixes #6407) (#7503) (Teddy Katz) -* 4f1fa67 Docs: Update copyright (#7497) (Nicholas C. Zakas) - -v3.9.1 - October 31, 2016 - -* 2012258 Fix: incorrect `indent` check for array property access (fixes #7484) (#7485) (Teddy Katz) -* 8a71d4a Fix: `no-useless-return` false positive on conditionals (fixes #7477) (#7482) (Teddy Katz) -* 56a662b Fix: allow escaped backreferences in `no-useless-escape` (fixes #7472) (#7474) (Teddy Katz) -* fffdf13 Build: Fix prefer-reflect rule to not crash site gen build (#7471) (Ilya Volodin) -* 8ba68a3 Docs: Update broken link (#7490) (Devinsuit) -* 65231d8 Docs: add the "fixable" icon for `no-useless-return` (#7480) (Teddy Katz) - -v3.9.0 - October 28, 2016 - -* d933516 New: `no-useless-return` rule (fixes #7309) (#7441) (Toru Nagashima) -* 5e7af30 Update: Add `CallExpression` option for `indent` (fixes #5946) (#7189) (Teddy Katz) -* b200086 Fix: Support type annotations in array-bracket-spacing (#7445) (Jimmy Jia) -* 5ed8b9b Update: Deprecate prefer-reflect (fixes #7226) (#7464) (Kai Cataldo) -* 92ad43b Chore: Update deprecated rules in conf/eslint.json (#7467) (Kai Cataldo) -* e46666b New: Codeframe formatter (fixes #5860) (#7437) (Vitor Balocco) -* fe0d903 Upgrade: Shelljs to ^0.7.5 (fixes #7316) (#7465) (Gyandeep Singh) -* 1d5146f Update: fix wrong indentation about `catch`,`finally` (#7371) (Toru Nagashima) -* 77e3a34 Chore: Pin mock-fs dev dependency (#7466) (Gyandeep Singh) -* c675d7d Update: Fix `no-useless-escape` false negative in regexes (fixes #7424) (#7425) (Teddy Katz) -* ee3bcea Update: add fixer for `newline-after-var` (fixes #5959) (#7375) (Teddy Katz) -* 6e9ff08 Fix: indent.js to support multiline array statements. (#7237) (Scott Stern) -* f8153ad Build: Ensure absolute links in docs retain .md extensions (fixes #7419) (#7438) (Teddy Katz) -* 16367a8 Fix: Return statement spacing. Fix for indent rule. (fixes #7164) (#7197) (Imad Elyafi) -* 3813988 Update: fix false negative of `no-extra-parens` (fixes #7122) (#7432) (Toru Nagashima) -* 23062e2 Docs: Fix typo in no-unexpected-multiline (fixes #7442) (#7447) (Denis Sikuler) -* d257428 Update: `func-name-matching`: add “always”/“never” option (fixes #7391) (#7428) (Jordan Harband) -* c710584 Fix: support for MemberExpression with function body. (#7400) (Scott Stern) -* 2c8ed2d Build: ensure that all files are linted on bash (fixes #7426) (#7427) (Teddy Katz) -* 18ff70f Chore: Enable `no-useless-escape` (#7403) (Vitor Balocco) -* 8dfd802 Fix: avoid `camelcase` false positive with NewExpressions (fixes #7363) (#7409) (Teddy Katz) -* e8159b4 Docs: Fix typo and explain static func calls for class-methods-use-this (#7421) (Scott O'Hara) -* 85d7e24 Docs: add additional examples for MemberExpressions in Indent rule. (#7408) (Scott Stern) -* 2aa1107 Docs: Include note on fatal: true in the node.js api section (#7376) (Simen Bekkhus) -* e064a25 Update: add fixer for `arrow-body-style` (#7240) (Teddy Katz) -* e0fe727 Update: add fixer for `brace-style` (fixes #7074) (#7347) (Teddy Katz) -* cbbe420 New: Support enhanced parsers (fixes #6974) (#6975) (Nicholas C. Zakas) -* 644d25b Update: Add an ignoreRegExpLiterals option to max-len (fixes #3229) (#7346) (Wilfred Hughes) -* 6875576 Docs: Remove broken links to jslinterrors.com (fixes #7368) (#7369) (Dannii Willis) - -v3.8.1 - October 17, 2016 - -* 681c78a Fix: `comma-dangle` was confused by type annotations (fixes #7370) (#7372) (Toru Nagashima) -* 7525042 Fix: Allow useless escapes in tagged template literals (fixes #7383) (#7384) (Teddy Katz) -* 9106964 Docs: Fix broken link for stylish formatter (#7386) (Vitor Balocco) -* 49d3c1b Docs: Document the deprecated meta property (#7367) (Randy Coulman) -* 19d2996 Docs: Relax permission for merging PRs (refs eslint/tsc-meetings#20) (#7360) (Brandon Mills) - -v3.8.0 - October 14, 2016 - -* ee60acf Chore: add integration tests for autofixing (fixes #5909) (#7349) (Teddy Katz) -* c8796e9 Update: `comma-dangle` supports trailing function commas (refs #7101) (#7181) (Toru Nagashima) -* c4abaf0 Update: `space-before-function-paren` supports async/await (refs #7101) (#7180) (Toru Nagashima) -* d0d3b28 Fix: id-length rule incorrectly firing on member access (fixes #6475) (#7365) (Burak Yiğit Kaya) -* 2729d94 Fix: Don't report setter params in class bodies as unused (fixes #7351) (#7352) (Teddy Katz) -* 0b85004 Chore: Enable prefer-template (fixes #6407) (#7357) (Kai Cataldo) -* ca1947b Chore: Update pull request template (refs eslint/tsc-meetings#20) (#7359) (Brandon Mills) -* d840afe Docs: remove broken link from no-loop-func doc (#7342) (Michael McDermott) -* 5266793 Update: no-useless-escape checks template literals (fixes #7331) (#7332) (Kai Cataldo) -* b08fb91 Update: add source property to LintResult object (fixes #7098) (#7304) (Vitor Balocco) -* 0db4164 Chore: run prefer-template autofixer on test files (refs #6407) (#7354) (Kai Cataldo) -* c1470b5 Update: Make the `prefer-template` fixer unescape quotes (fixes #7330) (#7334) (Teddy Katz) -* 5d08c33 Fix: Handle parentheses correctly in `yoda` fixer (fixes #7326) (#7327) (Teddy Katz) -* cd72bba New: `func-name-matching` rule (fixes #6065) (#7063) (Annie Zhang) -* 55b5146 Fix: `RuleTester` didn't support `mocha --watch` (#7287) (Toru Nagashima) -* f8387c1 Update: add fixer for `prefer-spread` (#7283) (Teddy Katz) -* 52da71e Fix: Don't require commas after rest properties (fixes #7297) (#7298) (Teddy Katz) -* 3b11d3f Chore: refactor `no-multiple-empty-lines` (#7314) (Teddy Katz) -* 16d495d Docs: Updating CLI overview with latest changes (#7335) (Kevin Partington) -* 52dfce5 Update: add fixer for `one-var-declaration-per-line` (#7295) (Teddy Katz) -* 0e994ae Update: Improve the error messages for `no-unused-vars` (fixes #7282) (#7315) (Teddy Katz) -* 93214aa Chore: Convert non-lib/test files to template literals (refs #6407) (#7329) (Kai Cataldo) -* 72f394d Update: Fix false negative of `no-multiple-empty-lines` (fixes #7312) (#7313) (Teddy Katz) -* 756bc5a Update: Use characters instead of code units for `max-len` (#7299) (Teddy Katz) -* c9a7ec5 Fix: Improving optionator configuration for --print-config (#7206) (Kevin Partington) -* 51bfade Fix: avoid `object-shorthand` crash with spread properties (fixes #7305) (#7306) (Teddy Katz) -* a12d1a9 Update: add fixer for `no-lonely-if` (#7202) (Teddy Katz) -* 1418384 Fix: Don't require semicolons before `++`/`--` (#7252) (Adrian Heine né Lang) -* 2ffe516 Update: add fixer for `curly` (#7105) (Teddy Katz) -* ac3504d Update: add functionPrototypeMethods to wrap-iife (fixes #7212) (#7284) (Eli White) -* 5e16fb4 Update: add fixer for `no-extra-bind` (#7236) (Teddy Katz) - -v3.7.1 - October 3, 2016 - -* 3dcae13 Fix: Use the correct location for `comma-dangle` errors (fixes #7291) (#7292) (Teddy Katz) -* cb7ba6d Fix: no-implicit-coercion should not fix ~. (fixes #7272) (#7289) (Eli White) -* ce590e2 Chore: Add additional tests for bin/eslint.js (#7290) (Teddy Katz) -* 8ec82ee Docs: change links of templates to raw data (#7288) (Toru Nagashima) - -v3.7.0 - September 30, 2016 - -* 2fee8ad Fix: object-shorthand's consistent-as-needed option (issue #7214) (#7215) (Naomi Jacobs) -* c05a19c Update: add fixer for `prefer-numeric-literals` (#7205) (Teddy Katz) -* 2f171f3 Update: add fixer for `no-undef-init` (#7210) (Teddy Katz) -* 876d747 Docs: Steps for adding new committers/TSCers (#7221) (Nicholas C. Zakas) -* dffb4fa Fix: `no-unused-vars` false positive (fixes #7250) (#7258) (Toru Nagashima) -* 4448cec Docs: Adding missing ES8 reference to configuring (#7271) (Kevin Partington) -* 332d213 Update: Ensure `indent` handles nested functions correctly (fixes #7249) (#7265) (Teddy Katz) -* c36d842 Update: add fixer for `no-useless-computed-key` (#7207) (Teddy Katz) -* 18376cf Update: add fixer for `lines-around-directive` (#7217) (Teddy Katz) -* f8e8fab Update: add fixer for `wrap-iife` (#7196) (Teddy Katz) -* 558b444 Docs: Add @not-an-aardvark to development team (#7279) (Ilya Volodin) -* cd1dc57 Update: Add a fixer for `dot-location` (#7186) (Teddy Katz) -* 89787b2 Update: for `yoda`, add a fixer (#7199) (Teddy Katz) -* 742ae67 Fix: avoid indent and no-mixed-spaces-and-tabs conflicts (fixes #7248) (#7266) (Teddy Katz) -* 85b8714 Fix: Use error templates even when reading from stdin (fixes #7213) (#7223) (Teddy Katz) -* 66adac1 Docs: correction in prefer-reflect docs (fixes #7069) (#7150) (Scott Stern) -* e3f95de Update: Fix `no-extra-parens` false negative (fixes #7229) (#7231) (Teddy Katz) -* 2909c19 Docs: Fix typo in object-shorthand docs (#7267) (Brian Donovan) -* 7bb800d Chore: add internal rule to enforce meta.docs conventions (fixes #6954) (#7155) (Vitor Balocco) -* 722c68c Docs: add code fences to the issue template (#7254) (Teddy Katz) - -v3.6.1 - September 26, 2016 - -* b467436 Upgrade: Upgrade Espree to 3.3.1 (#7253) (Ilya Volodin) -* 299a563 Build: Do not strip .md extension from absolute URLs (#7222) (Kai Cataldo) -* 27042d2 Chore: removed unused code related to scopeMap (#7218) (Yang Su) -* d154204 Chore: Lint bin/eslint.js (#7243) (Kevin Partington) -* 87625fa Docs: Improve eol-last examples in docs (#7227) (Chainarong Tangsurakit) -* de8eaa4 Docs: `class-methods-use-this`: fix option name (#7224) (Jordan Harband) -* 2355f8d Docs: Add Brunch plugin to integrations (#7225) (Aleksey Shvayka) -* a5817ae Docs: Default option from `operator-linebreak` is `after`and not always (#7228) (Konstantin Pschera) - -v3.6.0 - September 23, 2016 - -* 1b05d9c Update: add fixer for `strict` (fixes #6668) (#7198) (Teddy Katz) -* 0a36138 Docs: Update ecmaVersion instructions (#7195) (Nicholas C. Zakas) -* aaa3779 Update: Allow `space-unary-ops` to handle await expressions (#7174) (Teddy Katz) -* 91bf477 Update: add fixer for `prefer-template` (fixes #6978) (#7165) (Teddy Katz) -* 745343f Update: `no-extra-parens` supports async/await (refs #7101) (#7178) (Toru Nagashima) -* 8e1fee1 Fix: Handle number literals correctly in `no-whitespace-before-property` (#7185) (Teddy Katz) -* 462a3f7 Update: `keyword-spacing` supports async/await (refs #7101) (#7179) (Toru Nagashima) -* 709a734 Update: Allow template string in `valid-typeof` comparison (fixes #7166) (#7168) (Teddy Katz) -* f71937a Fix: Don't report async/generator callbacks in `array-callback-return` (#7172) (Teddy Katz) -* 461b015 Fix: Handle async functions correctly in `prefer-arrow-callback` fixer (#7173) (Teddy Katz) -* 7ea3e4b Fix: Handle await expressions correctly in `no-unused-expressions` (#7175) (Teddy Katz) -* 16bb802 Update: Ensure `arrow-parens` handles async arrow functions correctly (#7176) (Teddy Katz) -* 2d10657 Chore: add tests for `generator-star-spacing` and async (refs #7101) (#7182) (Toru Nagashima) -* c118d21 Update: Let `no-restricted-properties` check destructuring (fixes #7147) (#7151) (Teddy Katz) -* 9e0b068 Fix: valid-jsdoc does not throw on FieldType without value (fixes #7184) (#7187) (Kai Cataldo) -* 4b5d9b7 Docs: Update process for evaluating proposals (fixes #7156) (#7183) (Kai Cataldo) -* 95c777a Update: Make `no-restricted-properties` more flexible (fixes #7137) (#7139) (Teddy Katz) -* 0fdf23c Update: fix `quotes` rule's false negative (fixes #7084) (#7141) (Toru Nagashima) -* f2a789d Update: fix `no-unused-vars` false negative (fixes #7124) (#7143) (Toru Nagashima) -* 6148d85 Fix: Report columns for `eol-last` correctly (fixes #7136) (#7149) (kdex) -* e016384 Update: add fixer for quote-props (fixes #6996) (#7095) (Teddy Katz) -* 35f7be9 Upgrade: espree to 3.2.0, remove tests with SyntaxErrors (fixes #7169) (#7170) (Teddy Katz) -* 28ddcf8 Fix: `max-len`: `ignoreTemplateLiterals`: handle 3+ lines (fixes #7125) (#7138) (Jordan Harband) -* 660e091 Docs: Update rule descriptions (fixes #5912) (#7152) (Kenneth Williams) -* 8b3fc32 Update: Make `indent` report lines with mixed spaces/tabs (fixes #4274) (#7076) (Teddy Katz) -* b39ac2c Update: add fixer for `no-regex-spaces` (#7113) (Teddy Katz) -* cc80467 Docs: Update PR templates for formatting (#7128) (Nicholas C. Zakas) -* 76acbb5 Fix: include LogicalExpression in indent length calc (fixes #6731) (#7087) (Alec) -* a876673 Update: no-implicit-coercion checks TemplateLiterals (fixes #7062) (#7121) (Kai Cataldo) -* 8db4f0c Chore: Enable `typeof` check for `no-undef` rule in eslint-config-eslint (#7103) (Teddy Katz) -* 7e8316f Docs: Update release process (#7127) (Nicholas C. Zakas) -* 22edd8a Update: `class-methods-use-this`: `exceptMethods` option (fixes #7085) (#7120) (Jordan Harband) -* afd132a Fix: line-comment-position "above" string option now works (fixes #7100) (#7102) (Kevin Partington) -* 1738b2e Chore: fix name of internal-no-invalid-meta test file (#7142) (Vitor Balocco) -* ac0bb62 Docs: Fixes examples for allowTemplateLiterals (fixes #7115) (#7135) (Zoe Ingram) -* bcfa3e5 Update: Add `always`/`never` option to `eol-last` (fixes #6938) (#6952) (kdex) -* 0ca26d9 Docs: Distinguish examples for space-before-blocks (#7132) (Timo Tijhof) -* 9a2aefb Chore: Don't require an issue reference in check-commit npm script (#7104) (Teddy Katz) -* c85fd84 Fix: max-statements-per-line rule to force minimum to be 1 (fixes #7051) (#7092) (Scott Stern) -* e462e47 Docs: updates category of no-restricted-properties (fixes #7112) (#7118) (Alec) -* 6ae660b Fix: Don't report comparisons of two typeof expressions (fixes #7078) (#7082) (Teddy Katz) -* 710f205 Docs: Fix typos in Issues section of Maintainer's Guide (#7114) (Kai Cataldo) -* 546a3ca Docs: Clarify that linter does not process configuration (fixes #7108) (#7110) (Kevin Partington) -* 0d50943 Docs: Elaborate on `guard-for-in` best practice (fixes #7071) (#7094) (Dallon Feldner) -* 58e6d76 Docs: Fix examples for no-restricted-properties (#7099) (not-an-aardvark) -* 6cfe519 Docs: Corrected typo in line-comment-position rule doc (#7097) (Alex Mercier) -* f02e52a Docs: Add fixable note to no-implicit-coercion docs (#7096) (Brandon Mills) - -v3.5.0 - September 9, 2016 - -* 08fa538 Update: fix false negative of `arrow-spacing` (fixes #7079) (#7080) (Toru Nagashima) -* cec65e3 Update: add fixer for no-floating-decimal (fixes #7070) (#7081) (not-an-aardvark) -* 2a3f699 Fix: Column number for no-multiple-empty-lines (fixes #7086) (#7088) (Ian VanSchooten) -* 6947299 Docs: Add info about closing accepted issues to docs (fixes #6979) (#7089) (Kai Cataldo) -* d30157a Docs: Add link to awesome-eslint in integrations page (#7090) (Vitor Balocco) -* 457be1b Docs: Update so issues are not required (fixes #7015) (#7072) (Nicholas C. Zakas) -* d9513b7 Fix: Allow linting of .hidden files/folders (fixes #4828) (#6844) (Ian VanSchooten) -* 6d97c18 New: `max-len`: `ignoreStrings`+`ignoreTemplateLiterals` (fixes #5805) (#7049) (Jordan Harband) -* 538d258 Update: make no-implicit-coercion support autofixing. (fixes #7056) (#7061) (Eli White) -* 883316d Update: add fixer for prefer-arrow-callback (fixes #7002) (#7004) (not-an-aardvark) -* 7502eed Update: auto-fix for `comma-style` (fixes #6941) (#6957) (Gyandeep Singh) -* 645dda5 Update: add fixer for dot-notation (fixes #7014) (#7054) (not-an-aardvark) -* 2657846 Fix: `no-console` ignores user-defined console (fixes #7010) (#7058) (Toru Nagashima) -* 656bb6e Update: add fixer for newline-before-return (fixes #5958) (#7050) (Vitor Balocco) -* 1f995c3 Fix: no-implicit-coercion string concat false positive (fixes #7057) (#7060) (Kai Cataldo) -* 6718749 Docs: Clarify that `es6` env also sets `ecmaVersion` to 6 (#7067) (Jérémie Astori) -* e118728 Update: add fixer for wrap-regex (fixes #7013) (#7048) (not-an-aardvark) -* f4fcd1e Update: add more `indent` options for functions (fixes #6052) (#7043) (not-an-aardvark) -* 657eee5 Update: add fixer for new-parens (fixes #6994) (#7047) (not-an-aardvark) -* ff19aa9 Update: improve `max-statements-per-line` message (fixes #6287) (#7044) (Jordan Harband) -* 3960617 New: `prefer-numeric-literals` rule (fixes #6068) (#7029) (Annie Zhang) -* fa760f9 Chore: no-regex-spaces uses internal rule message format (fixes #7052) (#7053) (Kevin Partington) -* 22c7e09 Update: no-magic-numbers false negative on reassigned vars (fixes #4616) (#7028) (not-an-aardvark) -* be29599 Update: Throw error if whitespace found in plugin name (fixes #6854) (#6960) (Jesse Ostrander) -* 4063a79 Fix: Rule message placeholders can be inside braces (fixes #6988) (#7041) (Kevin Partington) -* 52e8d9c Docs: Clean up sort-vars (#7045) (Matthew Dunsdon) -* 4126f12 Chore: Rule messages use internal rule message format (fixes #6977) (#6989) (Kevin Partington) -* 46cb690 New: `no-restricted-properties` rule (fixes #3218) (#7017) (Eli White) -* 00b3042 Update: Pass file path to parse function (fixes #5344) (#7024) (Annie Zhang) -* 3f13325 Docs: Add kaicataldo and JamesHenry to our teams (#7039) (alberto) -* 8e77f16 Update: `new-parens` false negative (fixes #6997) (#6999) (Toru Nagashima) -* 326f457 Docs: Add missing 'to' in no-restricted-modules (#7022) (Oskar Risberg) -* 8277357 New: `line-comment-position` rule (fixes #6077) (#6953) (alberto) -* c1f0d76 New: `lines-around-directive` rule (fixes #6069) (#6998) (Kai Cataldo) -* 61f1de0 Docs: Fix typo in no-debugger (#7019) (Denis Ciccale) -* 256c4a2 Fix: Allow separate mode option for multiline and align (fixes #6691) (#6991) (Annie Zhang) -* a989a7c Docs: Declaring dependency on eslint in shared config (fixes #6617) (#6985) (alberto) -* 6869c60 Docs: Fix minor typo in no-extra-parens doc (#6992) (Jérémie Astori) -* 28f1619 Docs: Update the example of SwitchCase (#6981) (fish) - -v3.4.0 - August 26, 2016 - -* c210510 Update: add fixer for no-extra-parens (fixes #6944) (#6950) (not-an-aardvark) -* ca3d448 Fix: `prefer-const` false negative about `eslintUsed` (fixes #5837) (#6971) (Toru Nagashima) -* 1153955 Docs: Draft of JSCS migration guide (refs #5859) (#6942) (Nicholas C. Zakas) -* 3e522be Fix: false negative of `indent` with `else if` statements (fixes #6956) (#6965) (not-an-aardvark) -* 2dfb290 Docs: Distinguish examples in rules under Stylistic Issues part 7 (#6760) (Kenneth Williams) -* 3c710c9 Fix: rename "AirBnB" => "Airbnb" init choice (fixes #6969) (Harrison Shoff) -* 7660b39 Fix: `object-curly-spacing` for type annotations (fixes #6940) (#6945) (Toru Nagashima) -* 21ab784 New: do not remove non visited files from cache. (fixes #6780) (#6921) (Roy Riojas) -* 3a1763c Fix: enable `@scope/plugin/ruleId`-style specifier (refs #6362) (#6939) (Toru Nagashima) -* d6fd064 Update: Add never option to multiline-ternary (fixes #6751) (#6905) (Kai Cataldo) -* 0d268f1 New: `symbol-description` rule (fixes #6778) (#6825) (Jarek Rencz) -* a063d4e Fix: no-cond-assign within a function expression (fixes #6908) (#6909) (Patrick McElhaney) -* 16db93a Build: Tag docs, publish release notes (fixes #6892) (#6934) (Nicholas C. Zakas) -* 0cf1d55 Chore: Fix object-shorthand errors (fixes #6958) (#6959) (Kai Cataldo) -* 8851ddd Fix: Improve pref of globbing by inheriting glob.GlobSync (fixes #6710) (#6783) (Kael Zhang) -* cf2242c Update: `requireStringLiterals` option for `valid-typeof` (fixes #6698) (#6923) (not-an-aardvark) -* 8561389 Fix: `no-trailing-spaces` wrong fixing (fixes #6933) (#6937) (Toru Nagashima) -* 6a92be5 Docs: Update semantic versioning policy (#6935) (alberto) -* a5189a6 New: `class-methods-use-this` rule (fixes #5139) (#6881) (Gyandeep Singh) -* 1563808 Update: add support for ecmaVersion 20xx (fixes #6750) (#6907) (Kai Cataldo) -* d8b770c Docs: Change rule descriptions for consistent casing (#6915) (Brandon Mills) -* c676322 Chore: Use object-shorthand batch 3 (refs #6407) (#6914) (Kai Cataldo) - -v3.3.1 - August 15, 2016 - -* a2f06be Build: optimize rule page title for small browser tabs (fixes #6888) (#6904) (Vitor Balocco) -* 02a00d6 Docs: clarify rule details for no-template-curly-in-string (#6900) (not-an-aardvark) -* b9b3446 Fix: sort-keys ignores destructuring patterns (fixes #6896) (#6899) (Kai Cataldo) -* 3fe3a4f Docs: Update options in `object-shorthand` (#6898) (Grant Snodgrass) -* cd09c96 Chore: Use object-shorthand batch 2 (refs #6407) (#6897) (Kai Cataldo) -* 2841008 Chore: Use object-shorthand batch 1 (refs #6407) (#6893) (Kai Cataldo) - -v3.3.0 - August 12, 2016 - -* 683ac56 Build: Add CI release scripts (fixes #6884) (#6885) (Nicholas C. Zakas) -* ebf8441 Update: `prefer-rest-params` relax for member accesses (fixes #5990) (#6871) (Toru Nagashima) -* df01c4f Update: Add regex support for exceptions (fixes #5187) (#6883) (Annie Zhang) -* 055742c Fix: `no-dupe-keys` type errors (fixes #6886) (#6889) (Toru Nagashima) -* e456fd3 New: `sort-keys` rule (fixes #6076) (#6800) (Toru Nagashima) -* 3e879fc Update: Rule "eqeqeq" to have more specific null handling (fixes #6543) (#6849) (Simon Sturmer) -* e8cb7f9 Chore: use eslint-plugin-node (refs #6407) (#6862) (Toru Nagashima) -* e37bbd8 Docs: Remove duplicate statement (#6878) (Richard Käll) -* 11395ca Fix: `no-dupe-keys` false negative (fixes #6801) (#6863) (Toru Nagashima) -* 1ecd2a3 Update: improve error message in `no-control-regex` (#6839) (Jordan Harband) -* d610d6c Update: make `max-lines` report the actual number of lines (fixes #6766) (#6764) (Jarek Rencz) -* b256c50 Chore: Fix glob for core js files for lint (fixes #6870) (#6872) (Gyandeep Singh) -* f8ab8f1 New: func-call-spacing rule (fixes #6080) (#6749) (Brandon Mills) -* be68f0b New: no-template-curly-in-string rule (fixes #6186) (#6767) (Jeroen Engels) -* 80789ab Chore: don't throw if rule is in old format (fixes #6848) (#6850) (Vitor Balocco) -* d47c505 Fix: `newline-after-var` false positive (fixes #6834) (#6847) (Toru Nagashima) -* bf0afcb Update: validate void operator in no-constant-condition (fixes #5726) (#6837) (Vitor Balocco) -* 5ef839e New: Add consistent and ..-as-needed to object-shorthand (fixes #5438) (#5439) (Martijn de Haan) -* 7e1bf01 Fix: update peerDependencies of airbnb option for `--init` (fixes #6843) (#6846) (Vitor Balocco) -* 8581f4f Fix: `no-invalid-this` false positive (fixes #6824) (#6827) (Toru Nagashima) -* 90f78f4 Update: add `props` option to `no-self-assign` rule (fixes #6718) (#6721) (Toru Nagashima) -* 30d71d6 Update: 'requireForBlockBody' modifier for 'arrow-parens' (fixes #6557) (#6558) (Nicolas Froidure) -* cdded07 Chore: use native `Object.assign` (refs #6407) (#6832) (Gyandeep Singh) -* 579ec49 Chore: Add link to rule change guidelines in "needs info" template (fixes #6829) (#6831) (Kevin Partington) -* 117e7aa Docs: Remove incorrect "constructor" statement from `no-new-symbol` docs (#6830) (Jarek Rencz) -* aef18b4 New: `no-unsafe-negation` rule (fixes #2716) (#6789) (Toru Nagashima) -* d94e945 Docs: Update Getting Started w/ Readme installation instructions (#6823) (Kai Cataldo) -* dfbc112 Upgrade: proxyquire to 1.7.10 (fixes #6821) (#6822) (alberto) -* 4c5e911 Chore: enable `prefer-const` and apply it to our codebase (refs #6407) (#6805) (Toru Nagashima) -* e524d16 Update: camelcase rule fix for import declarations (fixes #6755) (#6784) (Lorenzo Zottar) -* 8f3509d Update: make `eslint:all` excluding deprecated rules (fixes #6734) (#6756) (Toru Nagashima) -* 2b17459 New: `no-global-assign` rule (fixes #6586) (#6746) (alberto) - -v3.2.2 - August 1, 2016 - -* 510ce4b Upgrade: file-entry-cache@^1.3.1 (fixes #6816, refs #6780) (#6819) (alberto) -* 46b14cd Fix: ignore MemberExpression in VariableDeclarators (fixes #6795) (#6815) (Nicholas C. Zakas) - -v3.2.1 - August 1, 2016 - -* 584577a Build: Pin file-entry-cache to avoid licence issue (refs #6816) (#6818) (alberto) -* 38d0d23 Docs: clarify minor releases and suggest using `~ to version (#6804) (Henry Zhu) -* 4ca809e Fix: Normalizes messages so all end with a period (fixes #6762) (#6807) (Patrick McElhaney) -* c7488ac Fix: Make MemberExpression option opt-in (fixes #6797) (#6798) (Rich Trott) -* 715e8fa Docs: Update issue closing policy (fixes #6765) (#6808) (Nicholas C. Zakas) -* 288f7bf Build: Fix site generation (fixes #6791) (#6793) (Nicholas C. Zakas) -* 261a9f3 Docs: Update JSCS status in README (#6802) (alberto) -* 5ae0887 Docs: Update no-void.md (#6799) (Daniel Hritzkiv) - -v3.2.0 - July 29, 2016 - -* 2438ee2 Upgrade: Update markdownlint dependency to 0.2.0 (fixes #6781) (#6782) (David Anson) -* 4fc0018 Chore: dogfooding `no-var` rule and remove `var`s (refs #6407) (#6757) (Toru Nagashima) -* b22eb5c New: `no-tabs` rule (fixes #6079) (#6772) (Gyandeep Singh) -* ddea63a Chore: Updated no-control-regex tests to cover all cases (fixes #6438) (#6752) (Efe Gürkan YALAMAN) -* 1025772 Docs: Add plugin example to disabling with comments guide (fixes #6742) (#6747) (Brandon Mills) -* 628aae4 Docs: fix inconsistent spacing inside block comment (#6768) (Brian Jacobel) -* 2983c32 Docs: Add options to func-names config comments (#6748) (Brandon Mills) -* 2f94443 Docs: fix wrong path (#6763) (molee1905) -* 6f3faa4 Revert "Build: Remove support for Node v5 (fixes #6743)" (#6758) (Nicholas C. Zakas) -* 99dfd1c Docs: fix grammar issue in rule-changes page (#6761) (Vitor Balocco) -* e825458 Fix: Rule no-unused-vars had missing period (fixes #6738) (#6739) (Brian Mock) -* 71ae64c Docs: Clarify cache file deletion (fixes #4943) (#6712) (Nicholas C. Zakas) -* 26c85dd Update: merge warnings of consecutive unreachable nodes (fixes #6583) (#6729) (Toru Nagashima) -* 106e40b Fix: Correct grammar in object-curly-newline reports (fixes #6725) (#6728) (Vitor Balocco) -* e00754c Chore: Dogfooding ES6 rules (refs #6407) (#6735) (alberto) -* 181b26a Build: Remove support for Node v5 (fixes #6743) (#6744) (alberto) -* 5320a6c Update: `no-use-before-define` false negative on for-in/of (fixes #6699) (#6719) (Toru Nagashima) -* a2090cb Fix: space-infix-ops doesn't fail for type annotations(fixes #5211) (#6723) (Nicholas C. Zakas) -* 9c36ecf Docs: Add @vitorbal and @platinumazure to development team (Ilya Volodin) -* e09d1b8 Docs: describe all RuleTester options (fixes #4810, fixes #6709) (#6711) (Nicholas C. Zakas) -* a157f47 Chore: Update CLIEngine option desc (fixes #5179) (#6713) (Nicholas C. Zakas) -* a0727f9 Chore: fix `.gitignore` for vscode (refs #6383) (#6720) (Toru Nagashima) -* 75d2d43 Docs: Clarify Closure type hint expectation (fixes #5231) (#6714) (Nicholas C. Zakas) -* 95ea25a Update: Check indentation of multi-line chained properties (refs #1801) (#5940) (Rich Trott) -* e7b1e1c Docs: Edit issue/PR waiting period docs (fixes #6009) (#6715) (Nicholas C. Zakas) -* 053aa0c Update: Added 'allowSuper' option to `no-underscore-dangle` (fixes #6355) (#6662) (peteward44) -* 8929045 Build: Automatically generate rule index (refs #2860) (#6658) (Ilya Volodin) -* f916ae5 Docs: Fix multiline-ternary typos (#6704) (Cédric Malard) -* c64b0c2 Chore: First ES6 refactoring (refs #6407) (#6570) (Nicholas C. Zakas) - -v3.1.1 - July 18, 2016 - -* 565e584 Fix: `eslint:all` causes regression in 3.1.0 (fixes #6687) (#6696) (alberto) -* cb90359 Fix: Allow named recursive functions (fixes #6616) (#6667) (alberto) -* 3f206dd Fix: `balanced` false positive in `spaced-comment` (fixes #6689) (#6692) (Grant Snodgrass) -* 57f1676 Docs: Add missing brackets from code examples (#6700) (Plusb Preco) -* 124f066 Chore: Remove fixable key from multiline-ternary metadata (fixes #6683) (#6688) (Kai Cataldo) -* 9f96086 Fix: Escape control characters in XML. (fixes #6673) (#6672) (George Chung) - -v3.1.0 - July 15, 2016 - -* e8f8c6c Fix: incorrect exitCode when eslint is called with --stdin (fixes #6677) (#6682) (Steven Humphrey) -* 38639bf Update: make `no-var` fixable (fixes #6639) (#6644) (Toru Nagashima) -* dfc20e9 Fix: `no-unused-vars` false positive in loop (fixes #6646) (#6649) (Toru Nagashima) -* 2ba75d5 Update: relax outerIIFEBody definition (fixes #6613) (#6653) (Stephen E. Baker) -* 421e4bf Chore: combine multiple RegEx replaces with one (fixes #6669) (#6661) (Sakthipriyan Vairamani) -* 089ee2c Docs: fix typos,wrong path,backticks (#6663) (molee1905) -* ef827d2 Docs: Add another pre-commit hook to integrations (#6666) (David Alan Hjelle) -* a343b3c Docs: Fix option typo in no-underscore-dangle (Fixes #6674) (#6675) (Luke Page) -* 5985eb2 Chore: add internal rule that validates meta property (fixes #6383) (#6608) (Vitor Balocco) -* 4adb15f Update: Add `balanced` option to `spaced-comment` (fixes #4133) (#6575) (Annie Zhang) -* 1b13c25 Docs: fix incorrect example being mark as correct (#6660) (David Björklund) -* a8b4e40 Fix: Install required eslint plugin for "standard" guide (fixes #6656) (#6657) (Feross Aboukhadijeh) -* 720686b New: `endLine` and `endColumn` of the lint result. (refs #3307) (#6640) (Toru Nagashima) -* 54faa46 Docs: Small tweaks to CLI documentation (fixes #6627) (#6642) (Kevin Partington) -* e108850 Docs: Added examples and structure to `padded-blocks` (fixes #6628) (#6643) (alberto) -* 350e1c0 Docs: Typo (#6650) (Peter Rood) -* b837c92 Docs: Correct a term in max-len.md (fixes #6637) (#6641) (Vse Mozhet Byt) -* baeb313 Fix: Warning behavior for executeOnText (fixes #6611) (#6632) (Nicholas C. Zakas) -* e6004be Chore: Enable preferType in valid-jsdoc (refs #5188) (#6634) (Nicholas C. Zakas) -* ca323cf Fix: Use default assertion messages (fixes #6532) (#6615) (Dmitrii Abramov) -* 2bdf22c Fix: Do not throw exception if baseConfig is provided (fixes #6605) (#6625) (Kevin Partington) -* e42cacb Upgrade: mock-fs to 3.10, fixes for Node 6.3 (fixes #6621) (#6624) (Tim Schaub) -* 8a263ae New: multiline-ternary rule (fixes #6066) (#6590) (Kai Cataldo) -* e951303 Update: Adding new `key-spacing` option (fixes #5613) (#5907) (Kyle Mendes) -* 10c3e91 Docs: Remove reference from 3.0.0 migration guide (refs #6605) (#6618) (Kevin Partington) -* 5010694 Docs: Removed non-existing resource (#6609) (Moritz Kröger) -* 6d40d85 Docs: Note that PR requires ACCEPTED issue (refs #6568) (#6604) (Patrick McElhaney) - -v3.0.1 - July 5, 2016 - -* 27700cf Fix: `no-unused-vars` false positive around callback (fixes #6576) (#6579) (Toru Nagashima) -* 124d8a3 Docs: Pull request template (#6568) (Nicholas C. Zakas) -* e9a2ed9 Docs: Fix rules\id-length exceptions typos (fixes #6397) (#6593) (GramParallelo) -* a2cfa1b Fix: Make outerIIFEBody work correctly (fixes #6585) (#6596) (Nicholas C. Zakas) -* 9c451a2 Docs: Use string severity in example (#6601) (Kenneth Williams) -* 8308c0b Chore: remove path-is-absolute in favor of the built-in (fixes #6598) (#6600) (shinnn) -* 7a63717 Docs: Add missing pull request step (fixes #6595) (#6597) (Nicholas C. Zakas) -* de3ed84 Fix: make `no-unused-vars` ignore for-in (fixes #2342) (#6126) (Oleg Gaidarenko) -* 6ef2cbe Fix: strip Unicode BOM of config files (fixes #6556) (#6580) (Toru Nagashima) -* ee7fcfa Docs: Correct type of `outerIIFEBody` in `indent` (fixes #6581) (#6584) (alberto) -* 25fc7b7 Fix: false negative of `max-len` (fixes #6564) (#6565) (not-an-aardvark) -* f6b8452 Docs: Distinguish examples in rules under Stylistic Issues part 6 (#6567) (Kenneth Williams) - -v3.0.0 - July 1, 2016 - -* 66de9d8 Docs: Update installation instructions on README (#6569) (Nicholas C. Zakas) -* dc5b78b Breaking: Add `require-yield` rule to `eslint:recommended` (fixes #6550) (#6554) (Gyandeep Singh) -* 7988427 Fix: lib/config.js tests pass if personal config exists (fixes #6559) (#6566) (Kevin Partington) -* 4c05967 Docs: Update rule docs for new format (fixes #5417) (#6551) (Nicholas C. Zakas) -* 70da5a8 Docs: Correct link to rules page (#fixes 6553) (#6561) (alberto) -* e2b2030 Update: Check RegExp strings for `no-regex-spaces` (fixes #3586) (#6379) (Jackson Ray Hamilton) -* 397e51b Update: Implement outerIIFEBody for indent rule (fixes #6259) (#6382) (David Shepherd) -* 666da7c Docs: 3.0.0 migration guide (#6521) (Nicholas C. Zakas) -* b9bf8fb Docs: Update Governance Policy (fixes #6452) (#6522) (Nicholas C. Zakas) -* 1290657 Update: `no-unused-vars` ignores read it modifies itself (fixes #6348) (#6535) (Toru Nagashima) -* d601f6b Fix: Delete cache only when executing on files (fixes #6459) (#6540) (Kai Cataldo) -* e0d4b19 Breaking: Error thrown/printed if no config found (fixes #5987) (#6538) (Kevin Partington) -* 18663d4 Fix: false negative of `no-useless-rename` (fixes #6502) (#6506) (Toru Nagashima) -* 0a7936d Update: Add fixer for prefer-const (fixes #6448) (#6486) (Nick Heiner) -* c60341f Chore: Update index and `meta` for `"eslint:recommended"` (refs #6403) (#6539) (Mark Pedrotti) -* 73da28d Better wording for the error reported by the rule "no-else-return" #6411 (#6413) (Olivier Thomann) -* e06a5b5 Update: Add fixer for arrow-parens (fixes #4766) (#6501) (madmed88) -* 5f8f3e8 Docs: Remove Box as a sponsor (#6529) (Nicholas C. Zakas) -* 7dfe0ad Docs: fix max-lines samples (fixes #6516) (#6515) (Dmitriy Shekhovtsov) -* fa05119 Breaking: Update eslint:recommended (fixes #6403) (#6509) (Nicholas C. Zakas) -* e96177b Docs: Add "Proposing a Rule Change" link to CONTRIBUTING.md (#6511) (Kevin Partington) -* bea9096 Docs: Update pull request steps (fixes #6474) (#6510) (Nicholas C. Zakas) -* 7bcf6e0 Docs: Consistent example headings & text pt3 (refs #5446) (#6492) (Guy Fraser) -* 1a328d9 Docs: Consistent example headings & text pt4 (refs #5446) (#6493) (Guy Fraser) -* ff5765e Docs: Consistent example headings & text pt2 (refs #5446)(#6491) (Guy Fraser) -* 01384fa Docs: Fixing typos (refs #5446)(#6494) (Guy Fraser) -* 4343ae8 Fix: false negative of `object-shorthand` (fixes #6429) (#6434) (Toru Nagashima) -* b7d8c7d Docs: more accurate yoda-speak (#6497) (Tony Lukasavage) -* 3b0ab0d Fix: add warnIgnored flag to CLIEngine.executeOnText (fixes #6302) (#6305) (Robert Levy) -* c2c6cec Docs: Mark object-shorthand as fixable. (#6485) (Nick Heiner) -* 5668236 Fix: Allow objectsInObjects exception when destructuring (fixes #6469) (#6470) (Adam Renklint) -* 17ac0ae Fix: `strict` rule reports a syntax error for ES2016 (fixes #6405) (#6464) (Toru Nagashima) -* 4545123 Docs: Rephrase documentation for `no-duplicate-imports` (#6463) (Simen Bekkhus) -* 1b133e3 Docs: improve `no-native-reassign` and specifying globals (fixes #5358) (#6462) (Toru Nagashima) -* b179373 Chore: Remove dead code in excuteOnFiles (fixes #6467) (#6466) (Andrew Hutchings) -* 18fbc4b Chore: Simplify eslint process exit code (fixes #6368) (#6371) (alberto) -* 58542e4 Breaking: Drop support for node < 4 (fixes #4483) (#6401) (alberto) -* f50657e Breaking: use default for complexity in eslint:recommended (fixes #6021) (#6410) (alberto) -* 3e690fb Fix: Exit init early if guide is chosen w/ no package.json (fixes #6476) (#6478) (Kai Cataldo) - -v2.13.1 - June 20, 2016 - -* 434de7f Fix: wrong baseDir (fixes #6450) (#6457) (Toru Nagashima) -* 3c9ce09 Fix: Keep indentation when fixing `padded-blocks` "never" (fixes #6454) (#6456) (Ed Lee) -* a9d4cb2 Docs: Fix typo in max-params examples (#6471) (J. William Ashton) -* 1e185b9 Fix: no-multiple-empty-lines errors when no line breaks (fixes #6449) (#6451) (strawbrary) - -v2.13.0 - June 17, 2016 - -* cf223dd Fix: add test for a syntax error (fixes #6013) (#6378) (Toru Nagashima) -* da30cf9 Update: Add fixer for object-shorthand (fixes #6412) (#6418) (Nick Heiner) -* 2cd90eb Chore: Fix rule meta description inconsistencies (refs #5417) (#6422) (Mark Pedrotti) -* d798b2c Added quotes around "classes" option key (#6441) (Guy Fraser) -* 852b6df Docs: Delete empty table of links from Code Path Analysis (#6423) (Mark Pedrotti) -* 5e9117e Chore: sort rules in eslint.json (fixes #6425) (#6426) (alberto) -* c2b5277 Docs: Add gitter chat link to Reporting Bugs (#6430) (Mark Pedrotti) -* 1316db0 Update: Add `never` option for `func-names` (fixes #6059) (#6392) (alberto) -* 1c123e2 Update: Add autofix for `padded-blocks` (fixes #6320) (#6393) (alberto) -* 8ec89c8 Fix: `--print-config` return config inside subdir (fixes #6329) (#6385) (alberto) -* 4f73240 Fix: `object-curly-newline` multiline with comments (fixes #6381) (#6396) (Toru Nagashima) -* 77697a7 Chore: Fake config hierarchy fixtures (fixes #6206) (#6402) (Gyandeep Singh) -* 73a9a6d Docs: Fix links in Configuring ESLint (#6421) (Mark Pedrotti) -* ed84c4c Fix: improve `newline-per-chained-call` message (fixes #6340) (#6360) (Toru Nagashima) -* 9ea4e44 Docs: Update parser reference to `espree` instead of `esprima` (#6404) (alberto) -* 7f57467 Docs: Make `fix` param clearer (fixes #6366) (#6367) (Nick Heiner) -* fb49c7f Fix: nested `extends` with relative path (fixes #6358) (#6359) (Toru Nagashima) -* 5122f73 Update: no-multiple-empty-lines fixer (fixes #6225) (#6226) (Ruurd Moelker) -* 0e7ce72 Docs: Fix rest-spread-spacing's name (#6365) (cody) -* cfdd524 Fix: allow semi as braceless body of statements (fixes #6386) (#6391) (alberto) -* 6b08cfc Docs: key-spacing fixable documenation notes (fixes #6375) (#6376) (Ruurd Moelker) -* 4b4be3b Docs: `max-lines` option: fix `skipComments` typo (#6374) (Jordan Harband) -* 20ab4f6 Docs: Fix wrong link in object-curly-newline (#6373) (Grant Snodgrass) -* 412ce8d Docs: Fix broken links in no-mixed-operators (#6372) (Grant Snodgrass) - -v2.12.0 - June 10, 2016 - -* 54c30fb Update: Add explicit default option `always` for `eqeqeq` (refs #6144) (#6342) (alberto) -* 2d63370 Update: max-len will warn indented comment lines (fixes #6322) (#6324) (Kai Cataldo) -* dcd4ad7 Docs: clarify usage of inline disable comments (fixes #6335) (#6347) (Kai Cataldo) -* c03300b Docs: Clarified how plugin rules look in plugin configs (fixes #6346) (#6351) (Kevin Partington) -* 9c87709 Docs: Add semantic versioning policy (fixes #6244) (#6343) (Nicholas C. Zakas) -* 5affab1 Docs: Describe values under Extending Configuration Files (refs #6240) (#6336) (Mark Pedrotti) -* 2520f5a New: `max-lines` rule (fixes #6078) (#6321) (alberto) -* 9bfbc64 Update: Option for object literals in `arrow-body-style` (fixes #5936) (#6216) (alberto) -* 977cdd5 Chore: remove unused method from FileFinder (fixes #6344) (#6345) (alberto) -* 477fbc1 Docs: Add section about customizing RuleTester (fixes #6227) (#6331) (Jeroen Engels) -* 0e14016 New: `no-mixed-operators` rule (fixes #6023) (#6241) (Toru Nagashima) -* 6e03c4b Update: Add never option to arrow-body-style (fixes #6317) (#6318) (Andrew Hyndman) -* f804397 New: Add `eslint:all` option (fixes #6240) (#6248) (Robert Fletcher) -* dfe05bf Docs: Link JSCS rules to their corresponding page. (#6334) (alberto) -* 1cc4356 Docs: Remove reference to numeric config (fixes #6309) (#6327) (Kevin Partington) -* 2d4efbe Docs: Describe options in rule under Strict Mode (#6312) (Mark Pedrotti) -* c1953fa Docs: Typo fix 'and' -> 'any' (#6326) (Stephen Edgar) -* d49ab4b Docs: Code conventions improvements (#6313) (Kevin Partington) -* 316a507 Fix: one-var allows uninitialized vars in ForIn/ForOf (fixes #5744) (#6272) (Kai Cataldo) -* 6cbee31 Docs: Typo fix 'colum' -> 'column' (#6306) (Andrew Cobby) -* 2663569 New: `object-curly-newline` (fixes #6072) (#6223) (Toru Nagashima) -* 72c2ea5 Update: callback-return allows for object methods (fixes #4711) (#6277) (Kai Cataldo) -* 89580a4 Docs: Distinguish examples in rules under Stylistic Issues part 5 (#6291) (Kenneth Williams) -* 1313804 New: rest-spread-spacing rule (fixes #5391) (#6278) (Kai Cataldo) -* 61dfe68 Fix: `no-useless-rename` false positive in babel-eslint (fixes #6266) (#6290) (alberto) -* c78c8cb Build: Remove commit check from appveyor (fixes #6292) (#6294) (alberto) -* 3e38fc1 Chore: more tests for comments at the end of blocks (refs #6090) (#6273) (Kai Cataldo) -* 38dccdd Docs: `--no-ignore` disables all forms of ignore (fixes #6260) (#6304) (alberto) -* bb69380 Fix: no-useless-rename handles ExperimentalRestProperty (fixes #6284) (#6288) (Kevin Partington) -* fca0679 Update: Improve perf not traversing default ignored dirs (fixes #5679) (#6276) (alberto) -* 320e8b0 Docs: Describe options in rules under Possible Errors part 4 (#6270) (Mark Pedrotti) -* 3e052c1 Docs: Mark no-useless-rename as fixable in rules index (#6297) (Dalton Santos) - -v2.11.1 - May 30, 2016 - -* 64b0d0c Fix: failed to parse `/*eslint` comments by colon (fixes #6224) (#6258) (Toru Nagashima) -* c8936eb Build: Don't check commit count (fixes #5935) (#6263) (Nicholas C. Zakas) -* 113c1a8 Fix: `max-statements-per-line` false positive at exports (fixes #6264) (#6268) (Toru Nagashima) -* 03beb27 Fix: `no-useless-rename` false positives (fixes #6266) (#6267) (alberto) -* fe89037 Docs: Fix rule name in example (#6279) (Kenneth Williams) - -v2.11.0 - May 27, 2016 - -* 77dd2b4 Fix: On --init, print message when package.json is invalid (fixes #6257) (#6261) (Kai Cataldo) -* 7f60186 Fix: `--ignore-pattern` can't uningnore files (fixes #6127) (#6253) (alberto) -* fea8fe6 New: no-useless-rename (fixes #6058) (#6249) (Kai Cataldo) -* b4cff9d Fix: Incorrect object-property-newline behavior (fixes #6207) (#6213) (Rafał Ruciński) -* 35b4656 Docs: Edit arrow-parens.md to show correct output value (#6245) (Adam Terlson) -* ee0cd58 Fix: `newline-before-return` shouldn't disallow newlines (fixes #6176) (#6217) (alberto) -* d4f5526 Fix: `vars-on-top` crashs at export declarations (fixes #6210) (#6220) (Toru Nagashima) -* 088bda9 New: `unicode-bom` rule to allow or disallow BOM (fixes #5502) (#6230) (Andrew Johnston) -* 14bfc03 Fix: `comma-dangle` wrong autofix (fixes #6233) (#6235) (Toru Nagashima) -* cdd65d7 Docs: added examples for arrow-body-style (refs #5498) (#6242) (Tieme van Veen) -* c10c07f Fix: lost code in autofixing (refs #6233) (#6234) (Toru Nagashima) -* e6d5b1f Docs: Add rule deprecation section to user guide (fixes #5845) (#6201) (Kai Cataldo) -* 777941e Upgrade: doctrine to 1.2.2 (fixes #6121) (#6231) (alberto) -* 74c458d Update: key-spacing rule whitespace fixer (fixes #6167) (#6169) (Ruurd Moelker) -* 04bd586 New: Disallow use of Object.prototype methods on objects (fixes #2693) (#6107) (Andrew Levine) -* 53754ec Update: max in `max-statements-per-line` should be >=0 (fixes #6171) (#6172) (alberto) -* 54d1201 Update: Add treatUndefinedAsUnspecified option (fixes #6026) (#6194) (Kenneth Williams) -* 18152dd Update: Add checkLoops option to no-constant-condition (fixes #5477) (#6202) (Kai Cataldo) -* 7644908 Fix: no-multiple-empty-lines BOF and EOF defaults (fixes #6179) (#6180) (Ruurd Moelker) -* 72335eb Fix: `max-statements-per-line` false positive (fixes #6173, fixes #6153) (#6192) (Toru Nagashima) -* 9fce04e Fix: `generator-star-spacing` false positive (fixes #6135) (#6168) (Toru Nagashima) - -v2.10.2 - May 16, 2016 - -* bda5de5 Fix: Remove default parser from CLIEngine options (fixes #6182) (#6183) (alberto) -* e59e5a0 Docs: Describe options in rules under Possible Errors part 3 (#6105) (Mark Pedrotti) -* 842ab2e Build: Run phantomjs tests using karma (fixes #6128) (#6178) (alberto) - -v2.10.1 - May 14, 2016 - -* 9397135 Fix: `valid-jsdoc` false positive at default parameters (fixes #6097) (#6170) (Toru Nagashima) -* 2166ad4 Fix: warning & error count in `CLIEngine.getErrorResults` (fixes #6155) (#6157) (alberto) -* 1e0a652 Fix: ignore empty statements in max-statements-per-line (fixes #6153) (#6156) (alberto) -* f9ca0d6 Fix: `no-extra-parens` to check for nulls (fixes #6161) (#6164) (Gyandeep Singh) -* d095ee3 Fix: Parser merge sequence in config (fixes #6158) (#6160) (Gyandeep Singh) -* f33e49f Fix: `no-return-assign` to check for null tokens (fixes #6159) (#6162) (Gyandeep Singh) - -v2.10.0 - May 13, 2016 - -* 098cd9c Docs: Distinguish examples in rules under Stylistic Issues part 4 (#6136) (Kenneth Williams) -* 805742c Docs: Clarify JSX option usage (#6132) (Richard Collins) -* 10b0933 Fix: Optimize no-irregular-whitespace for the common case (fixes #6116) (#6117) (Andres Suarez) -* 36bec90 Docs: linkify URLs in development-environment.md (#6150) (chrisjshull) -* 29c401a Docs: Convert rules in index under Removed from list to table (#6091) (Mark Pedrotti) -* e13e696 Fix: `_` and `$` in isES5Constructor (fixes #6085) (#6094) (Kevin Locke) -* 67916b9 Fix: `no-loop-func` crashed (fixes #6130) (#6138) (Toru Nagashima) -* d311a62 Fix: Sort fixes consistently even if they overlap (fixes #6124) (#6133) (alberto) -* 6294459 Docs: Correct syntax for default ignores and `.eslintignore` example (#6118) (alberto) -* 067db14 Fix: Replace `assert.deepEqual` by `lodash.isEqual` (fixes #6111) (#6112) (alberto) -* 52fdf04 Fix: `no-multiple-empty-lines` duplicate errors at BOF (fixes #6113) (#6114) (alberto) -* e6f56da Docs: Document `--ignore-pattern` (#6120) (alberto) -* ef739cd Fix: Merge various command line configs at the same time (fixes #6104) (#6108) (Ed Lee) -* 767da6f Update: add returnAssign option to no-extra-parens (fixes #6036) (#6095) (Kai Cataldo) -* 06f6252 Build: Use split instead of slice/indexOf for commit check (fixes #6109) (#6110) (Ed Lee) -* c4fc39b Docs: Update headings of rules under Removed (refs #5774) (#6102) (Mark Pedrotti) -* 716345f Build: Match rule id at beginning of heading (refs #5774) (#6089) (Mark Pedrotti) -* 0734967 Update: Add an option to `prefer-const` (fixes #5692) (#6040) (Toru Nagashima) -* 7941d5e Update: Add autofix for `lines-around-comment` (fixes #5956) (#6062) (alberto) -* dc538aa Build: Pin proxyquire to ">=1.0.0 <1.7.5" (fixes #6096) (#6100) (alberto) -* 04563ca Docs: Describe options in rules under Possible Errors part 2 (#6063) (Mark Pedrotti) -* 5d390b2 Chore: Replace deprecated calls to context - batch 4 (fixes #6029) (#6087) (alberto) -* 6df4b23 Fix: `no-return-assign` warning nested expressions (fixes #5913) (#6041) (Toru Nagashima) -* 16fad58 Merge pull request #6088 from eslint/docs-one-var-per-line (alberto) -* 0b67170 Docs: Correct default for `one-var-declaration-per-line` (fixes #6017) (#6022) (Ed Lee) -* d40017f Fix: comma-style accounts for parens in array (fixes #6006) (#6038) (Kai Cataldo) -* 992d9cf Docs: Fix typography/teriminology in indent doc (fixes #6045) (#6044) (Rich Trott) -* 4ae39d2 Chore: Replace deprecated calls to context - batch 3 (refs #6029) (#6056) (alberto) -* 8633e4d Update: multipass should not exit prematurely (fixes #5995) (#6048) (alberto) -* 3c44c2c Update: Adds an avoidQuotes option for object-shorthand (fixes #3366) (#5870) (Chris Sauvé) -* a9a4652 Fix: throw when rule uses `fix` but `meta.fixable` not set (fixes #5970) (#6043) (Vitor Balocco) -* ad10106 Docs: Update comma-style docs (#6039) (Kai Cataldo) -* 388d6f8 Fix: `no-sequences` false negative at arrow expressions (fixes #6082) (#6083) (Toru Nagashima) -* 8e96064 Docs: Clarify rule example in README since we allow string error levels (#6061) (Kevin Partington) -* a66bf19 Fix: `lines-around-comment` multiple errors on same line (fixes #5965) (#5994) (alberto) -* a2cc54e Docs: Organize meta and describe visitor in Working with Rules (#5967) (Mark Pedrotti) -* ef8cbff Fix: object-shorthand should only lint computed methods (fixes #6015) (#6024) (Kai Cataldo) -* cd1b057 Chore: Replace deprecated calls to context - batch 2 (refs #6029) (#6049) (alberto) -* a3a6e06 Update: no-irregal-whitespace in a regular expression (fixes #5840) (#6018) (Linda_pp) -* 9b9d76c Chore: Replace deprecated calls to context - batch 1 (refs #6029) (#6034) (alberto) -* dd8bf93 Fix: blockless else in max-statements-per-line (fixes #5926) (#5993) (Glen Mailer) -* f84eb80 New: Add new rule `object-property-newline` (fixes #5667) (#5933) (Vitor Balocco) -* d5f4104 Docs: mention parsing errors in strict mode (fixes #5485) (#5991) (Mark Pedrotti) -* 249732e Docs: Move docs from eslint.github.io (fixes #5964) (#6012) (Nicholas C. Zakas) -* 4c2de6c Docs: Add example of diff clarity to comma-dangle rule docs (#6035) (Vitor Balocco) -* 3db2e89 Fix: Do not swallow exceptions in CLIEngine.getFormatter (fixes #5977) (#5978) (Gustav Nikolaj) -* eb2fb44 Fix: Always ignore defaults unless explicitly passed (fixes #5547) (#5820) (Ian VanSchooten) -* ab57e94 Docs: Add example of diff clarity to newline-per-chained-call (#5986) (Vitor Balocco) -* 88bc014 Docs: Update readme info about jshint (#6027) (alberto) -* a2c15cc Docs: put config example in code block (#6005) (Amos Wenger) -* a5011cb Docs: Fix a wrong examples' header of `prefer-arrow-callback`. (#6020) (Toru Nagashima) -* 1484ede Docs: Typo in nodejs-api (#6025) (alberto) -* ade6a9b Docs: typo: "eslint-disable-line" not "eslint disable-line" (#6019) (Will Day) -* 2f15354 Fix: Removed false positives of break and continue (fixes #5972) (#6000) (Onur Temizkan) - -v2.9.0 - April 29, 2016 - -* a8a2cd8 Fix: Avoid autoconfig crashes from inline comments (fixes #5992) (#5999) (Ian VanSchooten) -* 23b00e0 Upgrade: npm-license to 0.3.2 (fixes #5996) (#5998) (alberto) -* 377167d Upgrade: ignore to 3.1.2 (fixes #5979) (#5988) (alberto) -* 141b778 Fix: no-control-regex literal handling fixed. (fixes #5737) (#5943) (Efe Gürkan YALAMAN) -* 577757d Fix: Clarify color option (fixes #5928) (#5974) (Grant Snodgrass) -* e7e6581 Docs: Update CLA link (#5980) (Gustav Nikolaj) -* 0be26bc Build: Add nodejs 6 to travis (fixes #5971) (#5973) (Gyandeep Singh) -* e606523 New: Rule `no-unsafe-finally` (fixes #5808) (#5932) (Onur Temizkan) -* 42d1ecc Chore: Add metadata to existing rules - Batch 7 (refs #5417) (#5969) (Vitor Balocco) -* e2ad1ec Update: object-shorthand lints computed methods (fixes #5871) (#5963) (Chris Sauvé) -* d24516a Chore: Add metadata to existing rules - Batch 6 (refs #5417) (#5966) (Vitor Balocco) -* 1e7a3ef Fix: `id-match` false positive in property values (fixes #5885) (#5960) (Mike Sherov) -* 51ddd4b Update: Use process @abstract when processing @return (fixes #5941) (#5945) (Simon Schick) -* 52a4bea Update: Add autofix for `no-whitespace-before-property` (fixes #5927) (#5951) (alberto) -* 46e058d Docs: Correct typo in configuring.md (#5957) (Nick S. Plekhanov) -* 5f8abab Chore: Add metadata to existing rules - Batch 5 (refs #5417) (#5944) (Vitor Balocco) -* 0562f77 Chore: Add missing newlines to test cases (fixes #5947) (Rich Trott) -* fc78e78 Chore: Enable quote-props rule in eslint-config-eslint (refs #5188) (#5938) (Gyandeep Singh) -* 43f6d05 Docs: Update docs to refer to column (#5937) (Sashko Stubailo) -* 586478e Update: Add autofix for `comma-dangle` (fixes #3805) (#5925) (alberto) -* a4f9c5a Docs: Distinguish examples in rules under Stylistic Issues part 3 (Kenneth Williams) -* e7c0737 Chore: Enable no-console rule in eslint-config-eslint (refs #5188) (Kevin Partington) -* 0023fe6 Build: Add “chore” to commit tags (fixes #5880) (#5929) (Mike Sherov) -* 25d626a Upgrade: espree 3.1.4 (fixes #5923, fixes #5756) (Kai Cataldo) -* a01b412 New: Add `no-useless-computed-key` rule (fixes #5402) (Burak Yigit Kaya) -* 9afb9cb Chore: Remove workaround for espree and escope bugs (fixes #5852) (alberto) -* 3ffc582 Chore: Update copyright and license info (alberto) -* 249eb40 Docs: Clarify init sets up local installation (fixes #5874) (Kai Cataldo) -* 6cd8c86 Docs: Describe options in rules under Possible Errors part 1 (Mark Pedrotti) -* f842d18 Fix: `no-this-before-super` crash on unreachable paths (fixes #5894) (Toru Nagashima) -* a02960b Docs: Fix missing delimiter in README links (Kevin Partington) -* 3a9e72c Docs: Update developer guide with new standards (Nicholas C. Zakas) -* cb78585 Update: Add `allowUnboundThis` to `prefer-arrow-callback` (fixes #4668) (Burak Yigit Kaya) -* 02be29f Chore: Remove CLA check from bot (Nicholas C. Zakas) -* 220713e Chore: Add metadata to existing rules - Batch 4 (refs #5417) (Vitor Balocco) -* df53414 Chore: Include jQuery Foundation info (Nicholas C. Zakas) -* f1b2992 Fix: `no-useless-escape` false positive in JSXAttribute (fixes #5882) (Toru Nagashima) -* 74674ad Docs: Move `sort-imports` to 'ECMAScript 6' (Kenneth Williams) -* ae69ddb Docs: Fix severity type in example (Kenneth Williams) -* 19f6fff Update: Autofixing does multiple passes (refs #5329) (Nicholas C. Zakas) -* 1e4b0ca Docs: Reduce length of paragraphs in rules index (Mark Pedrotti) -* 8cfe1eb Docs: Fix a wrong option (Zach Orlovsky) -* 8f6739f Docs: Add alberto as reviewer (alberto) -* 2ae4938 Docs: Fix message for `inline-config` option (alberto) -* 089900b Docs: Fix a wrong rule name in an example (Toru Nagashima) -* c032b41 Docs: Fix emphasis (Toru Nagashima) -* ae606f0 Docs: Update JSCS info in README (alberto) -* a9c5323 Fix: Install ESLint on init if not installed (fixes #5833) (Kai Cataldo) -* ed38358 Docs: Removed incorrect example (James M. Greene) -* af3113c Docs: Fix config comments in indent docs (Brandon Mills) -* 2b39461 Update: `commentPattern` option for `default-case` rule (fixes #5803) (Artyom Lvov) - -v2.8.0 - April 15, 2016 - -* a8821a5 Docs: Distinguish examples in rules under Stylistic Issues part 2 (Kenneth Williams) -* 76913b6 Update: Add metadata to existing rules - Batch 3 (refs #5417) (Vitor Balocco) -* 34ad8d2 Fix: Check that module.paths exists (fixes #5791) (Nicholas C. Zakas) -* 37239b1 Docs: Add new members of the team (Ilya Volodin) -* fb3c2eb Update: allow template literals (fixes #5234) (Jonathan Haines) -* 5a4a935 Update: Add metadata to existing rules - Batch 2 (refs #5417) (Vitor Balocco) -* ea2e625 Fix: newline-before-return handles return as first token (fixes #5816) (Kevin Partington) -* f8db9c9 Update: add nestedBinaryExpressions to no-extra-parens (fixes #3065) (Ilya Volodin) -* 0045d57 Update: `allowNamedFunctions` in `prefer-arrow-callback` (fixes #5675) (alberto) -* 19da72a Update: Add metadata to existing rules - Batch 1 (refs #5417) (Vitor Balocco) -* cc14e43 Fix: `no-fallthrough` empty case with comment (fixes #5799) (alberto) -* 13c8b14 Fix: LogicalExpression checks for short circuit (fixes #5693) (Vamshi krishna) -* 73b225e Fix: Document and fix metadata (refs #5417) (Ilya Volodin) -* 882d199 Docs: Improve options description in `no-redeclare` (alberto) -* 6a71ceb Docs: Improve options description in `no-params-reassign` (alberto) -* 24b6215 Update: Include 'typeof' in rule 'no-constant-condition' (fixes #5228) (Vamshi krishna) -* a959063 Docs: Remove link to deprecated ESLintTester project (refs #3110) (Trey Thomas) -* 6fd7d82 Update: Change order in `eslint --init` env options (fixes #5742) (alberto) -* c59d909 Fix: Extra paren check around object arrow bodies (fixes #5789) (Brandon Mills) -* 6f88546 Docs: Use double quotes for better Win compatibility (fixes #5796) (alberto) -* 02743d5 Fix: catch self-assignment operators in `no-magic-number` (fixes #4400) (alberto) -* c94e74e Docs: Make rule descriptions more consistent (Kenneth Williams) -* 6028252 Docs: Distinguish examples in rules under Stylistic Issues part 1 (Mark Pedrotti) -* ccd8ca9 Fix: Added property onlyDeclaration to id-match rule (fixes #3488) (Gajus Kuizinas) -* 6703c02 Update: no-useless-escape / exact locations of errors (fixes #5751) (Onur Temizkan) -* 3d84b91 Fix: ignore trailing whitespace in template literal (fixes #5786) (Kai Cataldo) -* b0e6bc4 Update: add allowEmptyCatch option to no-empty (fixes #5800) (Kai Cataldo) -* f1f1dd7 Docs: Add @pedrottimark as a committer (Brandon Mills) -* 228f201 Update: `commentPattern` option for `no-fallthrough` rule (fixes #5757) (Artyom Lvov) -* 41db670 Docs: Clarify disable inline comments (Kai Cataldo) -* 9c9a295 Docs: Add note about shell vs node glob parameters in cli (alberto) -* 5308ff9 Docs: Add code backticks to sentence in fixable rules (Mark Pedrotti) -* 965ec06 Docs: fix the examples for space-before-function-paren. (Craig Silverstein) -* 2b202fc Update: Add ignore option to space-before-function-parens (fixes #4127) (Craig Silverstein) -* 24c12ba Fix: improve `constructor-super` errors for literals (fixes #5449) (Toru Nagashima) - -v2.7.0 - April 4, 2016 - -* 134cb1f Revert "Update: adds nestedBinaryExpressions for no-extra-parens rule (fixes #3065)" (Ilya Volodin) -* 7e80867 Docs: Update sentence in fixable rules (Mark Pedrotti) -* 1b6d5a3 Update: adds nestedBinaryExpressions for no-extra-parens (fixes #3065) (Nick Fisher) -* 4f93c32 Docs: Clarify `array-bracket-spacing` with newlines (fixes #5768) (alberto) -* 161ddac Fix: remove `console.dir` (fixes #5770) (Toru Nagashima) -* 0c33f6a Fix: indent rule uses wrong node for class indent level (fixes #5764) (Paul O’Shannessy) - -v2.6.0 - April 1, 2016 - -* ce2accd Fix: vars-on-top now accepts exported variables (fixes #5711) (Olmo Kramer) -* 7aacba7 Update: Deprecate option `maximum` in favor of `max` (fixes #5685) (Vitor Balocco) -* 5fe6fca Fix: no-useless-escape \B regex escape (fixes #5750) (Onur Temizkan) -* 9b73ffd Update: `destructuring` option of `prefer-const` rule (fixes #5594) (Toru Nagashima) -* 8ac9206 Docs: Typo in `sort-imports` (alberto) -* 12902c5 Fix: valid-jsdoc crash w/ Field & Array Type (fixes #5745) (fixes #5746) (Burak Yigit Kaya) -* 2c8b65a Docs: Edit examples for a few rules (Mark Pedrotti) -* d736bc2 Fix: Treat SwitchCase like a block in lines-around-comment (fixes #5718) (Scott O'Hara) -* 24a61a4 Update: make `no-useless-escape` allowing line breaks (fixes #5689) (Toru Nagashima) -* 4ecd45e Fix: Ensure proper lookup of config files (fixes #5175, fixes #5468) (Nicholas C. Zakas) -* 088e26b Fix: Update doctrine to allow hyphens in JSDoc names (fixes #5612) (Kai Cataldo) -* 692fd5d Upgrade: Old Chalk.JS deprecated method (fixes #5716) (Morris Singer) -* f59d91d Update: no-param-reassign error msgs (fixes #5705) (Isaac Levy) -* c1b16cd Fix: Object spread throws error in key-spacing rule. (fixes #5724) (Ziad El Khoury Hanna) -* 3091613 Docs: Correct explanation about properties (James Monger) -* cb0f0be Fix: Lint issue with `valid-jsdoc` rule (refs #5188) (Gyandeep Singh) -* aba1954 Build: Ignore jsdoc folder internally (fixes #5714) (alberto) -* a35f127 Fix: Lint for eslint project in regards to vars (refs #5188) (Gyandeep Singh) -* d9ab4f0 Fix: Windows scoped package configs (fixes #5644) (Nicholas C. Zakas) -* 8d0cd0d Update: Basic valid-jsdoc default parameter support (fixes #5658) (Tom Andrews) - -v2.5.3 - March 28, 2016 - -* 8749ac5 Build: Disable bundling dependencies (fixes #5687) (Nicholas C. Zakas) - -v2.5.2 - March 28, 2016 - -* 1cc7f8e Docs: Remove mention of minimatch for .eslintignore (Ian VanSchooten) -* 5bd69a9 Docs: Reorder FAQ in README (alberto) -* 98e6bd9 Fix: Correct default for indentation in `eslint --init` (fixes #5698) (alberto) -* 679095e Fix: make the default of `options.cwd` in runtime (fixes #5694) (Toru Nagashima) -* 4f06f2f Docs: Distinguish examples in rules under Best Practices part 2 (Mark Pedrotti) -* 013a18e Build: Fix bundling script (fixes #5680) (Nicholas C. Zakas) -* 8c5d954 Docs: Typo fix (István Donkó) -* 09659d6 Docs: Use string severity (Kenneth Williams) -* a4ae769 Docs: Manual changelog update for v2.5.1 (Nicholas C. Zakas) -* c41fab9 Fix: don't use path.extname with undefined value (fixes #5678) (Myles Borins) - -v2.5.1 - March 25, 2016 - -* Build: No functional changes, just republished with a working package. - -v2.5.0 - March 25, 2016 - -* 7021aa9 Fix: lines-around-comment in ESLint repo, part 2 (refs #5188) (Kevin Partington) -* 095c435 Docs: Remove ES2016 from experimental section of README (Kevin Partington) -* 646f863 Build: Bundle dependencies in package.json (fixes #5013) (Nicholas C. Zakas) -* ea06868 Docs: Clarify --ext does not apply to globs (fixes #5452) (Ian VanSchooten) -* 569c478 Build: Fix phantomjs CI problems (fixes #5666) (alberto) -* 6022426 Docs: Add link to chat room in README primary links (alberto) -* 2fbb530 Docs: Add link to "Proposing a Rule Change" in README (alberto) -* 25bf491 Upgrade: globals 9.x (fixes #5668) (Toru Nagashima) -* d6f8409 New: Rule - No useless escape (fixes #5460) (Onur Temizkan) -* 12a43f1 Docs: remove brace expansion from configuring.md (refs #5314) (Jonathan Haines) -* 92d1749 New: max-statements-per-line (fixes #5424) (Kenneth Williams) -* aaf324a Fix: missing support for json sub configs (fixes #5413) (Noam Okman) -* 48ad5fe Update: Add 'caughtErrors' to rule no-unused-vars (fixes #3837) (vamshi) -* ad90c2b Fix: incorrect config message (fixes #5653) (s0ph1e) -* a551831 Docs: Distinguish examples in rules under Node.js and CommonJS (Mark Pedrotti) -* 83cd651 Upgrade: chai to 3.5.0 (fixes #5647) (alberto) -* 32748dc Fix: `radix` rule false positive at shadowed variables (fixes #5639) (Toru Nagashima) -* 66db38d Fix: `--no-ignore` should not un-ignore default ignores (fixes #5547) (alberto) -* e3e06f3 Docs: Distinguish examples in rules under Best Practices part 4 (Mark Pedrotti) -* a9f0865 Docs: Update no-sequences rule docs for clarity (fixes #5536) (Kai Cataldo) -* bae7b30 Docs: Add michaelficarra as committer (alberto) -* e2990e7 Docs: Consistent wording in rules README (alberto) -* 49b4d2a Docs: Update team list with new members (Ilya Volodin) -* d0ae66c Update: Allow autoconfiguration for JSX code (fixes #5511) (Ian VanSchooten) -* 38a0a64 Docs: Clarify `linebreak-style` docs (fixes #5628) (alberto) -* 4b7305e Fix: Allow default ignored files to be unignored (fixes #5410) (Ian VanSchooten) -* 4b05ce6 Update: Enforce repo coding conventions via ESLint (refs #5188) (Kevin Partington) -* 051b255 Docs: Remove or rewrite references to former ecmaFeatures (Mark Pedrotti) -* 9a22625 Fix: `prefer-const` false positive at non-blocked if (fixes #5610) (Toru Nagashima) -* b1fd482 Fix: leading comments added from previous node (fixes #5531) (Kai Cataldo) -* c335650 Docs: correct the no-confusing-arrow docs (Daniel Norman) -* e94b77d Fix: Respect 'ignoreTrailingComments' in max-len rule (fixes #5563) (Vamshi Krishna) -* 9289ef8 Fix: handle personal package.json without config (fixes #5496) (Denny Christochowitz) -* 87d74b2 Fix: `prefer-const` got to not change scopes (refs #5284) (Toru Nagashima) -* 5a881e7 Docs: Fix typo in code snippet for no-unmodified-loop-condition rule (Chris Rebert) -* 03037c2 Update: Overrides for space-unary-ops (fixes #5060) (Afnan Fahim) -* 24d986a Update: replace MD5 hashing of cache files with MurmurHash (fixes #5522) (Michael Ficarra) -* f405030 Fix: Ensure allowing `await` as a property name (fixes #5564) (Toru Nagashima) -* aefc90c Fix: `no-useless-constructor` clash (fixes #5573) (Toru Nagashima) -* 9eaa20d Docs: Fix typo in CLI help message (ryym) -* a7c3e67 Docs: Invalid json in `configuring.md` (alberto) -* 4e50332 Docs: Make `prefer-template` examples consistent. (alberto) -* cfc14a9 Fix: valid-jsdoc correctly checks type union (fixes #5260) (Kai Cataldo) -* 689cb7d Fix: `quote-props` false positive on certain keys (fixes #5532) (Burak Yigit Kaya) -* 167a03a Fix: `brace-style` erroneously ignoring certain errors (fixes #5197) (Burak Yigit Kaya) -* 3133f28 Fix: object-curly-spacing doesn't know types (fixes #5537) (fixes #5538) (Burak Yigit Kaya) -* d0ca171 Docs: Separate parser and config questions in issue template (Kevin Partington) -* bc769ca Fix: Improve file path resolution (fixes #5314) (Ian VanSchooten) -* 9ca8567 Docs: Distinguish examples in rules under Best Practices part 3 (Mark Pedrotti) -* b9c69f1 Docs: Distinguish examples in rules under Variables part 2 (Mark Pedrotti) -* c289414 New: `no-duplicate-imports` rule (fixes #3478) (Simen Bekkhus) - -v2.4.0 - March 11, 2016 - -* 97b2466 Fix: estraverse/escope to work with unknowns (fixes #5476) (Nicholas C. Zakas) -* 641b3f7 Fix: validate the type of severity level (fixes #5499) (Shinnosuke Watanabe) -* 9ee8869 Docs: no-unused-expressions - add more edge unusable and usable examples (Brett Zamir) -* 56bf864 Docs: Create parity between no-sequences examples (Brett Zamir) -* 13ef1c7 New: add `--parser-options` to CLI (fixes #5495) (Jordan Harband) -* ae1ee54 Docs: fix func-style arrow exception option (Craig Martin) -* 91852fd Docs: no-lone-blocks - show non-problematic (and problematic) label (Brett Zamir) -* b34458f Docs: Rearrange rules for better categories (and improve rule summaries) (Brett Zamir) -* 1198b26 Docs: Minor README clarifications (Brett Zamir) -* 03e6869 Fix: newline-before-return: bug with comment (fixes #5480) (mustafa) -* ad100fd Fix: overindent in VariableDeclarator parens or brackets (fixes #5492) (David Greenspan) -* 9b8e04b Docs: Replace all node references to Node.js which is the official name (Brett Zamir) -* cc1f2f0 Docs: Minor fixes in no-new-func (Brett Zamir) -* 6ab81d4 Docs: Distinguish examples in rules under Best Practices part 1 (Mark Pedrotti) -* 9c6c70c Update: add `allowParens` option to `no-confusing-arrow` (fixes #5332) (Burak Yigit Kaya) -* 979c096 Docs: Document linebreak-style as fixable. (Afnan Fahim) -* 9f18a81 Fix: Ignore destructuring assignment in `object-shorthand` (fixes #5488) (alberto) -* 5d9a798 Docs: README.md, prefer-const; change modified to reassigned (Michiel de Bruijne) -* 38eb7f1 Fix: key-spacing checks ObjectExpression is multiline (fixes #5479) (Kevin Partington) -* 9592c45 Fix: `no-unmodified-loop-condition` false positive (fixes #5445) (Toru Nagashima) - -v2.3.0 - March 4, 2016 - -* 1b2c6e0 Update: Proposed no-magic-numbers option: ignoreJSXNumbers (fixes #5348) (Brandon Beeks) -* 63c0b7d Docs: Fix incorrect environment ref. in Rules in Plugins. (fixes #5421) (Jesse McCarthy) -* 124c447 Build: Add additional linebreak to docs (fixes #5464) (Ilya Volodin) -* 0d3831b Docs: Add RuleTester parserOptions migration steps (Kevin Partington) -* 50f4d5a Fix: extends chain (fixes #5411) (Toru Nagashima) -* 0547072 Update: Replace getLast() with lodash.last() (fixes #5456) (Jordan Eldredge) -* 8c29946 Docs: Distinguish examples in rules under Possible Errors part 1 (Mark Pedrotti) -* 5319b4a Docs: Distinguish examples in rules under Possible Errors part 2 (Mark Pedrotti) -* 1da2420 Fix: crash when SourceCode object was reused (fixes #5007) (Toru Nagashima) -* 9e9daab New: newline-before-return rule (fixes #5009) (Kai Cataldo) -* e1bbe45 Fix: Check space after anonymous generator star (fixes #5435) (alberto) -* 119e0ed Docs: Distinguish examples in rules under Variables (Mark Pedrotti) -* 905c049 Fix: `no-undef` false positive at new.target (fixes #5420) (Toru Nagashima) -* 4a67b9a Update: Add ES7 support (fixes #5401) (Brandon Mills) -* 89c757d Docs: Replace ecmaFeatures with parserOptions in working-with-rules (Kevin Partington) -* 804c08e Docs: Add parserOptions to RuleTester section of working-with-rules (Kevin Partington) -* 1982c50 Docs: Document string option for `no-unused-vars`. (alberto) -* 4f82b2b Update: Support classes in `padded-blocks` (fixes #5092) (alberto) -* ed5564f Docs: Specify results of `no-unused-var` with `args` (fixes #5334) (chinesedfan) -* de0a4ef Fix: `getFormatter` throws an error when called as static (fixes #5378) (cowchimp) -* 78f7ca9 Fix: Prevent crash from swallowing console.log (fixes #5381) (Ian VanSchooten) -* 34b648d Fix: remove tests which have invalid syntax (fixes #5405) (Toru Nagashima) -* 7de5ae4 Docs: Missing allow option in docs (Scott O'Hara) -* cf14c71 Fix: `no-useless-constructor` rule crashes sometimes (fixes #5290) (Burak Yigit Kaya) -* 70e3a02 Update: Allow string severity in config (fixes #3626) (Nicholas C. Zakas) -* 13c7c19 Update: Exclude ES5 constructors from consistent-return (fixes #5379) (Kevin Locke) -* 784d3bf Fix: Location info in `dot-notation` rule (fixes #5397) (Gyandeep Singh) -* 6280b2d Update: Support switch statements in padded-blocks (fixes #5056) (alberto) -* 25a5b2c Fix: Allow irregular whitespace in comments (fixes #5368) (Christophe Porteneuve) -* 560c0d9 New: no-restricted-globals rule implementation (fixes #3966) (Benoît Zugmeyer) -* c5bb478 Fix: `constructor-super` false positive after a loop (fixes #5394) (Toru Nagashima) -* 6c0c4aa Docs: Add Issue template (fixes #5313) (Kai Cataldo) -* 1170e67 Fix: indent rule doesn't handle constructor instantiation (fixes #5384) (Nate Cavanaugh) -* 6bc9932 Fix: Avoid magic numbers in rule options (fixes #4182) (Brandon Beeks) -* 694e1c1 Fix: Add tests to cover default magic number tests (fixes #5385) (Brandon Beeks) -* 0b5349d Fix: .eslintignore paths should be absolute (fixes #5362) (alberto) -* 8f6c2e7 Update: Better error message for plugins (refs #5221) (Nicholas C. Zakas) -* 972d41b Update: Improve error message for rule-tester (fixes #5369) (Jeroen Engels) -* fe3f6bd Fix: `no-self-assign` false positive at shorthand (fixes #5371) (Toru Nagashima) -* 2376291 Docs: Missing space in `no-fallthrough` doc. (alberto) -* 5aedb87 Docs: Add mysticatea as reviewer (Nicholas C. Zakas) -* 1f9fd10 Update: no-invalid-regexp allows custom flags (fixes #5249) (Afnan Fahim) -* f1eab9b Fix: Support for dash and slash in `valid-jsdoc` (fixes #1598) (Gyandeep Singh) -* cd12a4b Fix:`newline-per-chained-call` should only warn on methods (fixes #5289) (Burak Yigit Kaya) -* 0d1377d Docs: Add missing `symbol` type into valid list (Plusb Preco) -* 6aa2380 Update: prefer-const; change modified to reassigned (fixes #5350) (Michiel de Bruijne) -* d1d62c6 Fix: indent check for else keyword with Stroustrup style (fixes #5218) (Gyandeep Singh) -* 7932f78 Build: Fix commit message validation (fixes #5340) (Nicholas C. Zakas) -* 1c347f5 Fix: Cleanup temp files from tests (fixes #5338) (Nick) -* 2f3e1ae Build: Change rules to warnings in perf test (fixes #5330) (Brandon Mills) -* 36f40c2 Docs: Achieve consistent order of h2 in rule pages (Mark Pedrotti) - -v2.2.0 - February 19, 2016 - -* 45a22b5 Docs: remove esprima-fb from suggested parsers (Henry Zhu) -* a4d9cd3 Docs: Fix semi rule typo (Brandon Mills) -* 9d005c0 Docs: Correct option name in `no-implicit-coercion` rule (Neil Kistner) -* 2977248 Fix: Do not cache `.eslintrc.js` (fixes #5067) (Nick) -* 211eb8f Fix: no-multi-spaces conflicts with smart tabs (fixes #2077) (Afnan Fahim) -* 6dc9483 Fix: Crash in `constructor-super` (fixes #5319) (Burak Yigit Kaya) -* 3f48875 Docs: Fix yield star spacing examples (Dmitriy Lazarev) -* 4dab76e Docs: Update `preferType` heading to keep code format (fixes #5307) (chinesedfan) -* 7020b82 Fix: `sort-imports` warned between default and members (fixes #5305) (Toru Nagashima) -* 2f4cd1c Fix: `constructor-super` and `no-this-before-super` false (fixes #5261) (Toru Nagashima) -* 59e9c5b New: eslint-disable-next-line (fixes #5206) (Kai Cataldo) -* afb6708 Fix: `indent` rule forgot about some CallExpressions (fixes #5295) (Burak Yigit Kaya) -* d18d406 Docs: Update PR creation bot message (fixes #5268) (Nicholas C. Zakas) -* 0b1cd19 Fix: Ignore parser option if set to default parser (fixes #5241) (Kai Cataldo) - -v2.1.0 - February 15, 2016 - -* 7981ef5 Build: Fix release script (Nicholas C. Zakas) -* c9c34ea Fix: Skip computed members in `newline-per-chained-call` (fixes #5245) (Burak Yigit Kaya) -* b32ddad Build: `npm run perf` command should check the exit code (fixes #5279) (Burak Yigit Kaya) -* 6580d1c Docs: Fix incorrect `api.verify` JSDoc for `config` param (refs #5104) (Burak Yigit Kaya) -* 1f47868 Docs: Update yield-star-spacing documentation for 2.0.0 (fixes #5272) (Burak Yigit Kaya) -* 29da8aa Fix: `newline-after-var` crash on a switch statement (fixes #5277) (Toru Nagashima) -* 86c5a20 Fix: `func-style` should ignore ExportDefaultDeclarations (fixes #5183) (Burak Yigit Kaya) -* ba287aa Fix: Consolidate try/catches to top levels (fixes #5243) (Ian VanSchooten) -* 3ef5da1 Docs: Update no-magic-numbers#ignorearrayindexes. (KazuakiM) -* 0d6850e Update: Allow var declaration at end of block (fixes #5246) (alberto) -* c1e3a73 Fix: Popular style init handles missing package.json keys (refs #5243) (Brandon Mills) -* 68c6e22 Docs: fix default value of `keyword-spacing`'s overrides option. (Toru Nagashima) -* 00fe46f Upgrade: inquirer (fixes #5265) (Bogdan Chadkin) -* ef729d7 Docs: Remove option that is not being used in max-len rule (Thanos Lefteris) -* 4a5ddd5 Docs: Fix rule config above examples for require-jsdoc (Thanos Lefteris) -* c5cbc1b Docs: Add rule config above each example in jsx-quotes (Thanos Lefteris) -* f0aceba Docs: Correct alphabetical ordering in rule list (Randy Coulman) -* 1651ffa Docs: update migrating to 2.0.0 (fixes #5232) (Toru Nagashima) -* 9078537 Fix: `indent` on variable declaration with separate array (fixes #5237) (Burak Yigit Kaya) -* f8868b2 Docs: Typo fix in consistent-this rule doc fixes #5240 (Nicolas Froidure) -* 44f6915 Fix: ESLint Bot mentions the wrong person for extra info (fixes #5229) (Burak Yigit Kaya) -* c612a8e Fix: `no-empty-function` crash (fixes #5227) (Toru Nagashima) -* ae663b6 Docs: Add links for issue documentation (Nicholas C. Zakas) -* 717bede Build: Switch to using eslint-release (fixes #5223) (Nicholas C. Zakas) -* 980e139 Fix: Combine all answers for processAnswers (fixes #5220) (Ian VanSchooten) -* 1f2a1d5 Docs: Remove inline errors from doc examples (fixes #4104) (Burak Yigit Kaya) - -v2.0.0 - February 12, 2016 - -* cc3a66b Docs: Issue message when more info is needed (Nicholas C. Zakas) -* 2bc40fa Docs: Simplify hierarchy of headings in rule pages (Mark Pedrotti) -* 1666254 Docs: Add note about only-whitespace rule for `--fix` (fixes #4774) (Burak Yigit Kaya) -* 2fa09d2 Docs: Add `quotes` to related section of `prefer-template` (fixes #5192) (Burak Yigit Kaya) -* 7b12995 Fix: `key-spacing` not enforcing no-space in minimum mode (fixes #5008) (Burak Yigit Kaya) -* c1c4f4d Breaking: new `no-empty-function` rule (fixes #5161) (Toru Nagashima) - -v2.0.0-rc.1 - February 9, 2016 - -* 4dad82a Update: Adding shared environment for node and browser (refs #5196) (Eli White) -* b46c893 Fix: Config file relative paths (fixes #5164, fixes #5160) (Nicholas C. Zakas) -* aa5b2ac Fix: no-whitespace-before-property fixes (fixes #5167) (Kai Cataldo) -* 4e99924 Update: Replace several dependencies with lodash (fixes #5012) (Gajus Kuizinas) -* 718dc68 Docs: Remove periods in rules' README for consistency. (alberto) -* 7a47085 Docs: Correct `arrow-spacing` overview. (alberto) -* a4cde1b Docs: Clarify global-require inside try/catch (fixes #3834) (Brandon Mills) -* fd07925 Docs: Clarify docs for api.verify (fixes #5101, fixes #5104) (Burak Yigit Kaya) -* 413247f New: Add a --print-config flag (fixes #5099) (Christopher Crouzet) -* efeef42 Update: Implement auto fix for space-in-parens (fixes #5050) (alberto) -* e07fdd4 Fix: code path analysis and labels (fixes #5171) (Toru Nagashima) -* 2417bb2 Fix: `no-unmodified-loop-condition` false positive (fixes #5166) (Toru Nagashima) -* fae1884 Fix: Allow same-line comments in padded-blocks (fixes #5055) (Brandon Mills) -* a24d8ad Fix: Improve autoconfig logging (fixes #5119) (Ian VanSchooten) -* e525923 Docs: Correct obvious inconsistencies in rules h2 elements (Mark Pedrotti) -* 9675b5e Docs: `avoid-escape` does not allow backticks (fixes #5147) (alberto) -* a03919a Fix: `no-unexpected-multiline` false positive (fixes #5148) (Feross Aboukhadijeh) -* 74360d6 Docs: Note no-empty applies to empty block statements (fixes #5105) (alberto) -* 6eeaa3f Build: Remove pending tests (fixes #5126) (Ian VanSchooten) -* 02c83df Docs: Update docs/rules/no-plusplus.md (Sheldon Griffin) -* 0c4de5c New: Added "table" formatter (fixes #4037) (Gajus Kuizinas) -* 0a59926 Update: 'implied strict mode' ecmaFeature (fixes #4832) (Nick Evans) -* 53a6eb3 Fix: Handle singular case in rule-tester error message (fixes #5141) (Bryan Smith) -* 97ac91c Build: Increment eslint-config-eslint (Nicholas C. Zakas) - -v2.0.0-rc.0 - February 2, 2016 - -* 973c499 Fix: `sort-imports` crash (fixes #5130) (Toru Nagashima) -* e64b2c2 Breaking: remove `no-empty-label` (fixes #5042) (Toru Nagashima) -* 79ebbc9 Breaking: update `eslint:recommended` (fixes #5103) (Toru Nagashima) -* e1d7368 New: `no-extra-label` rule (fixes #5059) (Toru Nagashima) -* c83b48c Fix: find ignore file only in cwd (fixes #5087) (Nicholas C. Zakas) -* 3a24240 Docs: Fix jsdoc param names to match function param names (Thanos Lefteris) -* 1d79746 Docs: Replace ecmaFeatures setting with link to config page (Thanos Lefteris) -* e96ffd2 New: `template-curly-spacing` rule (fixes #5049) (Toru Nagashima) -* 4b02902 Update: Extended no-console rule (fixes #5095) (EricHenry) -* 757651e Docs: Remove reference to rules enabled by default (fixes #5100) (Brandon Mills) -* 0d87f5d Docs: Clarify eslint-disable comments only affect rules (fixes #5005) (Brandon Mills) -* 1e791a2 New: `no-self-assign` rule (fixes #4729) (Toru Nagashima) -* c706eb9 Fix: reduced `no-loop-func` false positive (fixes #5044) (Toru Nagashima) -* 3275e86 Update: Add extra aliases to consistent-this rule (fixes #4492) (Zachary Alexander Belford) -* a227360 Docs: Replace joyent org with nodejs (Thanos Lefteris) -* b2aedfe New: Rule to enforce newline after each call in the chain (fixes #4538) (Rajendra Patil) -* d67bfdd New: `no-unused-labels` rule (fixes #5052) (Toru Nagashima) - -v2.0.0-beta.3 - January 29, 2016 - -* 86a3e3d Update: Remove blank lines at beginning of files (fixes #5045) (Jared Sohn) -* 4fea752 New: Autoconfiguration from source inspection (fixes #3567) (Ian VanSchooten) -* 519f39f Breaking: Remove deprecated rules (fixes #5032) (Gyandeep Singh) -* c75ee4a New: Add support for configs in plugins (fixes #3659) (Ilya Volodin) -* 361377f Fix: `prefer-const` false positive reading before writing (fixes #5074) (Toru Nagashima) -* ff2551d Build: Improve `npm run perf` command (fixes #5028) (Toru Nagashima) -* bcca69b Update: add int32Hint option to `no-bitwise` rule (fixes #4873) (Maga D. Zandaqo) -* e3f2683 Update: config extends dependency lookup (fixes #5023) (Nicholas C. Zakas) -* a327a06 Fix: Indent rule for allman brace style scenario (fixes #5064) (Gyandeep Singh) -* afdff6d Fix: `no-extra-bind` false positive (fixes #5058) (Toru Nagashima) -* c1fad4f Update: add autofix support for spaced-comment (fixes #4969, fixes #5030) (Maga D. Zandaqo) -* 889b942 Revert "Docs: Update readme for legend describing rules icons (refs #4355)" (Nicholas C. Zakas) -* b0f21a0 Fix: `keyword-spacing` false positive in template strings (fixes #5043) (Toru Nagashima) -* 53fa5d1 Fix: `prefer-const` false positive in a loop condition (fixes #5024) (Toru Nagashima) -* 385d399 Docs: Update readme for legend describing rules icons (Kai Cataldo) -* 505f1a6 Update: Allow parser to be relative to config (fixes #4985) (Nicholas C. Zakas) -* 79e8a0b New: `one-var-declaration-per-line` rule (fixes #1622) (alberto) -* 654e6e1 Update: Check extra Boolean calls in no-extra-boolean-cast (fixes #3650) (Andrew Sutton) - -v2.0.0-beta.2 - January 22, 2016 - -* 3fa834f Docs: Fix formatter links (fixes #5006) (Gyandeep Singh) -* 54b1bc8 Docs: Fix link in strict.md (fixes #5026) (Nick Evans) -* e0c5cf7 Upgrade: Espree to 3.0.0 (fixes #5018) (Ilya Volodin) -* 69f149d Docs: language tweaks (Andres Kalle) -* 2b33c74 Update: valid-jsdoc to not require @return in constructors (fixes #4976) (Maga D. Zandaqo) -* 6ac2e01 Docs: Fix description of exported comment (Mickael Jeanroy) -* 29392f8 New: allow-multiline option on comma-dangle (fixes #4967) (Alberto Gimeno) -* 05b8cb3 Update: Module overrides all 'strict' rule options (fixes #4936) (Nick Evans) -* 8470474 New: Add metadata to few test rules (fixes #4494) (Ilya Volodin) -* ba11c1b Docs: Add Algolia as sponsor to README (Nicholas C. Zakas) -* b28a19d Breaking: Plugins envs and config removal (fixes #4782, fixes #4952) (Nicholas C. Zakas) -* a456077 Docs: newline-after-var doesn't allow invalid options. (alberto) -* 3e6a24e Breaking: Change `strict` default mode to "safe" (fixes #4961) (alberto) -* 5b96265 Breaking: Update eslint:recommended (fixes #4953) (alberto) -* 7457a4e Upgrade: glob to 6.x (fixes #4991) (Gyandeep Singh) -* d3f4bdd Build: Cleanup for code coverage (fixes #4983) (Gyandeep Singh) -* b8fbaa0 Fix: multiple message in TAP formatter (fixes #4975) (Simon Degraeve) -* 990f8da Fix: `getNodeByRangeIndex` performance issue (fixes #4989) (Toru Nagashima) -* 8ac1dac Build: Update markdownlint dependency to 0.1.0 (fixes #4988) (David Anson) -* 5cd5429 Fix: function expression doc in call expression (fixes #4964) (Tim Schaub) -* 4173baa Fix: `no-dupe-class-members` false positive (fixes #4981) (Toru Nagashima) -* 12fe803 Breaking: Supports Unicode BOM (fixes #4878) (Toru Nagashima) -* 1fc80e9 Build: Increment eslint-config-eslint (Nicholas C. Zakas) -* e0a9024 Update: Report newline between template tag and literal (fixes #4210) (Rajendra Patil) -* da3336c Update: Rules should get `sourceType` from Program node (fixes #4960) (Nick Evans) -* a2ac359 Update: Make jsx-quotes fixable (refs #4377) (Gabriele Petronella) -* ee1014d Fix: Incorrect error location for object-curly-spacing (fixes #4957) (alberto) -* b52ed17 Fix: Incorrect error location for space-in-parens (fixes #4956) (alberto) -* 9c1bafb Fix: Columns of parse errors are off by 1 (fixes #4896) (alberto) -* 5e4841e New: 'id-blacklist' rule (fixes #3358) (Keith Cirkel) -* 700b8bc Update: Add "allow" option to allow specific operators (fixes #3308) (Rajendra Patil) -* d82eeb1 Update: Add describe around rule tester blocks (fixes #4907) (Ilya Volodin) -* 2967402 Update: Add minimum value to integer values in schema (fixes #4941) (Ilya Volodin) -* 7b632f8 Upgrade: Globals to ^8.18.0 (fixes #4728) (Gyandeep Singh) -* 86e6e57 Fix: Incorrect error at EOF for no-multiple-empty-lines (fixes #4917) (alberto) -* 7f058f3 Fix: Incorrect location for padded-blocks (fixes #4913) (alberto) -* b3de8f7 Fix: Do not show ignore messages for default ignored files (fixes #4931) (Gyandeep Singh) -* b1360da Update: Support multiLine and singleLine options (fixes #4697) (Rajendra Patil) -* 82fbe09 Docs: Small semantic issue in documentation example (fixes #4937) (Marcelo Zarate) -* 13a4e30 Docs: Formatting inconsistencies (fixes #4912) (alberto) -* d487013 Update: Option to allow extra parens for cond assign (fixes #3317) (alberto) -* 0f469b4 Fix: JSDoc for function expression on object property (fixes #4900) (Tim Schaub) -* c2dee27 Update: Add module tests to no-extra-semi (fixes #4915) (Nicholas C. Zakas) -* 5a633bf Update: Add `preferType` option to `valid-jsdoc` rule (fixes #3056) (Gyandeep Singh) -* ebd01b7 Build: Fix version number on release (fixes #4921) (Nicholas C. Zakas) -* 2d626a3 Docs: Fix typo in changelog (Nicholas C. Zakas) -* c4c4139 Fix: global-require no longer warns if require is shadowed (fixes #4812) (Kevin Partington) -* bbf7f27 New: provide config.parser via `parserName` on RuleContext (fixes #3670) (Ben Mosher) - -v2.0.0-beta.1 - January 11, 2016 - -* 6c70d84 Build: Fix prerelease script (fixes #4919) (Nicholas C. Zakas) -* d5c9435 New: 'sort-imports' rule (refs #3143) (Christian Schuller) -* a8cfd56 Fix: remove duplicate of eslint-config-eslint (fixes #4909) (Toru Nagashima) -* 19a9fbb Breaking: `space-before-blocks` ignores after keywords (fixes #1338) (Toru Nagashima) -* c275b41 Fix: no-extra-parens ExpressionStatement restricted prods (fixes #4902) (Michael Ficarra) -* b795850 Breaking: don't load ~/.eslintrc when using --config flag (fixes #4881) (alberto) -* 3906481 Build: Add AppVeyor CI (fixes #4894) (Gyandeep Singh) -* 6390862 Docs: Fix missing footnote (Yoshiya Hinosawa) -* e5e06f8 Fix: Jsdoc comment for multi-line function expressions (fixes #4889) (Gyandeep Singh) -* 7c9be60 Fix: Fix path errors in windows (fixes #4888) (Gyandeep Singh) -* a1840e7 Fix: gray text was invisible on Solarized Dark theme (fixes #4886) (Jack Leigh) -* fc9f528 Docs: Modify unnecessary flag docs in quote-props (Matija Marohnić) -* 186e8f0 Update: Ignore camelcase in object destructuring (fixes #3185) (alberto) -* 7c97201 Upgrade: doctrine version to 1.1.0 (fixes #4854) (Tim Schaub) -* ceaf324 New: Add no-new-symbol rule (fixes #4862) (alberto) -* e2f2b66 Breaking: Remove defaults from `eslint:recommended` (fixes #4809) (Ian VanSchooten) -* 0b3c01e Docs: Specify default for func-style (fixes #4834) (Ian VanSchooten) -* 008ea39 Docs: Document default for operator assignment (fixes #4835) (alberto) -* b566f56 Docs: no-new-func typo (alberto) -* 1569695 Update: Adds default 'that' for consistent-this (fixes #4833) (alberto) -* f7b28b7 Docs: clarify `requireReturn` option for valid-jsdoc rule (fixes #4859) (Tim Schaub) -* 407f329 Build: Fix prerelease script (Nicholas C. Zakas) -* 688f277 Fix: Set proper exit code for Node > 0.10 (fixes #4691) (Nicholas C. Zakas) -* 58715e9 Fix: Use single quotes in context.report messages (fixes #4845) (Joe Lencioni) -* 5b7586b Fix: do not require a @return tag for @interface (fixes #4860) (Tim Schaub) -* d43f26c Breaking: migrate from minimatch to node-ignore (fixes #2365) (Stefan Grönke) -* c07ca39 Breaking: merges keyword spacing rules (fixes #3869) (Toru Nagashima) -* 871f534 Upgrade: Optionator version to 0.8.1 (fixes #4851) (Eric Johnson) -* 82d4cd9 Update: Add atomtest env (fixes #4848) (Andres Suarez) -* 9c9beb5 Update: Add "ignore" override for operator-linebreak (fixes #4294) (Rajendra Patil) -* 9c03abc Update: Add "allowCall" option (fixes #4011) (Rajendra Patil) -* 29516f1 Docs: fix migration guide for no-arrow-condition rule (Peter Newnham) -* 2ef7549 Docs: clarify remedy to some prefer-const errors (Turadg Aleahmad) -* 1288ba4 Update: Add default limit to `complexity` (fixes #4808) (Ian VanSchooten) -* d3e8179 Fix: env is rewritten by modules (fixes #4814) (Toru Nagashima) -* fd72aba Docs: Example fix for `no-extra-parens` rule (fixes #3527) (Gyandeep Singh) -* 315f272 Fix: Change max-warnings type to Int (fixes #4660) (George Zahariev) -* 5050768 Update: Ask for `commonjs` under config init (fixes #3553) (Gyandeep Singh) -* 4665256 New: Add no-whitespace-before-property rule (fixes #1086) (Kai Cataldo) -* f500d7d Fix: allow extending @scope/eslint/file (fixes #4800) (André Cruz) -* 5ab564e New: 'ignoreArrayIndexes' option for 'no-magic-numbers' (fixes #4370) (Christian Schuller) -* 97cdb95 New: Add no-useless-constructor rule (fixes #4785) (alberto) -* b9bcbaf Fix: Bug in no-extra-bind (fixes #4806) (Andres Kalle) -* 246a6d2 Docs: Documentation fix (Andres Kalle) -* 9ea6b36 Update: Ignore case in jsdoc tags (fixes #4576) (alberto) -* acdda24 Fix: ignore argument parens in no-unexpected-multiline (fixes #4658) (alberto) -* 4931f56 Update: optionally allow bitwise operators (fixes #4742) (Swaagie) - -v2.0.0-alpha-2 - December 23, 2015 - -* Build: Add prerelease script (Nicholas C. Zakas) -* Update: Allow to omit semi for one-line blocks (fixes #4385) (alberto) -* Fix: Handle getters and setters in key-spacing (fixes #4792) (Brandon Mills) -* Fix: ObjectRestSpread throws error in key-spacing rule (fixes #4763) (Ziad El Khoury Hanna) -* Docs: Typo in generator-star (alberto) -* Fix: Backtick behavior in quotes rule (fixes #3090) (Nicholas C. Zakas) -* Fix: Empty schemas forbid any options (fixes #4789) (Brandon Mills) -* Fix: Remove `isMarkedAsUsed` function name (fixes #4783) (Gyandeep Singh) -* Fix: support arrow functions in no-return-assign (fixes #4743) (alberto) -* Docs: Add license header to Working with Rules guide (Brandon Mills) -* Fix: RuleTester to show parsing errors (fixes #4779) (Nicholas C. Zakas) -* Docs: Escape underscores in no-path-concat (alberto) -* Update: configuration for classes in space-before-blocks (fixes #4089) (alberto) -* Docs: Typo in no-useless-concat (alberto) -* Docs: fix typos, suggests (molee1905) -* Docs: Typos in space-before-keywords and space-unary-ops (fixes #4771) (alberto) -* Upgrade: beefy to ^2.0.0, fixes installation errors (fixes #4760) (Kai Cataldo) -* Docs: Typo in no-unexpected-multiline (fixes #4756) (alberto) -* Update: option to ignore top-level max statements (fixes #4309) (alberto) -* Update: Implement auto fix for semi-spacing rule (fixes #3829) (alberto) -* Fix: small typos in code examples (Plusb Preco) -* Docs: Add section on file extensions to user-guide/configuring (adam) -* Fix: Comma first issue in `indent` (fixes #4739, fixes #3456) (Gyandeep Singh) -* Fix: no-constant-condition false positive (fixes #4737) (alberto) -* Fix: Add source property for fatal errors (fixes #3325) (Gyandeep Singh) -* New: Add a comment length option to the max-len rule (fixes #4665) (Ian) -* Docs: RuleTester doesn't require any tests (fixes #4681) (alberto) -* Fix: Remove path analysis from debug log (fixes #4631) (Ilya Volodin) -* Fix: Set null to property ruleId when fatal is true (fixes #4722) (Sébastien Règne) -* New: Visual Studio compatible formatter (fixes #4708) (rhpijnacker) -* New: Add greasemonkey environment (fixes #4715) (silverwind) -* Fix: always-multiline for comma-dangle import (fixes #4704) (Nicholas C. Zakas) -* Fix: Check 1tbs non-block else (fixes #4692) (Nicholas C. Zakas) -* Fix: Apply environment configs last (fixes #3915) (Nicholas C. Zakas) -* New: `no-unmodified-loop-condition` rule (fixes #4523) (Toru Nagashima) -* Breaking: deprecate `no-arrow-condition` rule (fixes #4417) (Luke Karrys) -* Update: Add cwd option for cli-engine (fixes #4472) (Ilya Volodin) -* New: Add no-confusing-arrow rule (refs #4417) (Luke Karrys) -* Fix: ensure `ConfigOps.merge` do a deep copy (fixes #4682) (Toru Nagashima) -* Fix: `no-invalid-this` allows this in static method (fixes #4669) (Toru Nagashima) -* Fix: Export class syntax for `require-jsdoc` rule (fixes #4667) (Gyandeep Singh) -* Update: Add "safe" mode to strict (fixes #3306) (Brandon Mills) - -v2.0.0-alpha-1 - December 11, 2015 - -* Breaking: Correct links between variables and references (fixes #4615) (Toru Nagashima) -* Fix: Update rule tests for parser options (fixes #4673) (Nicholas C. Zakas) -* Breaking: Implement parserOptions (fixes #4641) (Nicholas C. Zakas) -* Fix: max-len rule overestimates the width of some tabs (fixes #4661) (Nick Evans) -* New: Add no-implicit-globals rule (fixes #4542) (Joshua Peek) -* Update: `no-use-before-define` checks invalid initializer (fixes #4280) (Toru Nagashima) -* Fix: Use oneValuePerFlag for --ignore-pattern option (fixes #4507) (George Zahariev) -* New: `array-callback-return` rule (fixes #1128) (Toru Nagashima) -* Upgrade: Handlebars to >= 4.0.5 for security reasons (fixes #4642) (Jacques Favreau) -* Update: Add class body support to `indent` rule (fixes #4372) (Gyandeep Singh) -* Breaking: Remove space-after-keyword newline check (fixes #4149) (Nicholas C. Zakas) -* Breaking: Treat package.json like the rest of configs (fixes #4451) (Ilya Volodin) -* Docs: writing mistake (molee1905) -* Update: Add 'method' option to no-empty (fixes #4605) (Kai Cataldo) -* Breaking: Remove autofix from eqeqeq (fixes #4578) (Ilya Volodin) -* Breaking: Remove ES6 global variables from builtins (fixes #4085) (Brandon Mills) -* Fix: Handle forbidden LineTerminators in no-extra-parens (fixes #4229) (Brandon Mills) -* Update: Option to ignore constructor Fns object-shorthand (fixes #4487) (Kai Cataldo) -* Fix: Check YieldExpression argument in no-extra-parens (fixes #4608) (Brandon Mills) -* Fix: Do not cache `package.json` (fixes #4611) (Spain) -* Build: Consume no-underscore-dangle allowAfterThis option (fixes #4599) (Kevin Partington) -* New: Add no-restricted-imports rule (fixes #3196) (Guy Ellis) -* Docs: no-extra-semi no longer refers to deprecated rule (fixes #4598) (Kevin Partington) -* Fix: `consistent-return` checks the last (refs #3530, fixes #3373) (Toru Nagashima) -* Update: add class option to `no-use-before-define` (fixes #3944) (Toru Nagashima) -* Breaking: Simplify rule schemas (fixes #3625) (Nicholas C. Zakas) -* Docs: Update docs/rules/no-plusplus.md (Xiangyun Chi) -* Breaking: added bower_components to default ignore (fixes #3550) (Julian Laval) -* Fix: `no-unreachable` with the code path (refs #3530, fixes #3939) (Toru Nagashima) -* Fix: `no-this-before-super` with the code path analysis (refs #3530) (Toru Nagashima) -* Fix: `no-fallthrough` with the code path analysis (refs #3530) (Toru Nagashima) -* Fix: `constructor-super` with the code path analysis (refs #3530) (Toru Nagashima) -* Breaking: Switch to Espree 3.0.0 (fixes #4334) (Nicholas C. Zakas) -* Breaking: Freeze context object (fixes #4495) (Nicholas C. Zakas) -* Docs: Add Code of Conduct (fixes #3095) (Nicholas C. Zakas) -* Breaking: Remove warnings of readonly from `no-undef` (fixes #4504) (Toru Nagashima) -* Update: allowAfterThis option in no-underscore-dangle (fixes #3435) (just-boris) -* Fix: Adding options unit tests for --ignore-pattern (refs #4507) (Kevin Partington) -* Breaking: Implement yield-star-spacing rule (fixes #4115) (Bryan Smith) -* New: `prefer-rest-params` rule (fixes #4108) (Toru Nagashima) -* Update: `prefer-const` begins to cover separating init (fixes #4474) (Toru Nagashima) -* Fix: `no-eval` come to catch indirect eval (fixes #4399, fixes #4441) (Toru Nagashima) -* Breaking: Default no-magic-numbers to none. (fixes #4193) (alberto) -* Breaking: Allow empty arrow body (fixes #4411) (alberto) -* New: Code Path Analysis (fixes #3530) (Toru Nagashima) - -v1.10.3 - December 1, 2015 - -* Docs: Update strict rule docs (fixes #4583) (Nicholas C. Zakas) -* Docs: Reference .eslintrc.* in contributing docs (fixes #4532) (Kai Cataldo) -* Fix: Add for-of to `curly` rule (fixes #4571) (Kai Cataldo) -* Fix: Ignore space before function in array start (fixes #4569) (alberto) - -v1.10.2 - November 27, 2015 - -* Upgrade: escope@3.3.0 (refs #4485) (Nicholas C. Zakas) -* Upgrade: Pinned down js-yaml to avoid breaking dep (fixes #4553) (alberto) -* Fix: lines-around-comment with multiple comments (fixes #3509) (alberto) -* Upgrade: doctrine@0.7.1 (fixes #4545) (Kevin Partington) -* Fix: Bugfix for eqeqeq autofix (fixes #4540) (Kevin Partington) -* Fix: Add for-in to `curly` rule (fixes #4436) (Kai Cataldo) -* Fix: `valid-jsdoc` unneeded require check fix (fixes #4527) (Gyandeep Singh) -* Fix: `brace-style` ASI fix for if-else condition (fixes #4520) (Gyandeep Singh) -* Build: Add branch update during release process (fixes #4491) (Gyandeep Singh) -* Build: Allow revert commits in commit messages (fixes #4452) (alberto) -* Fix: Incorrect location in no-fallthrough (fixes #4516) (alberto) -* Fix: `no-spaced-func` had been crashed (fixes #4508) (Toru Nagashima) -* Fix: Add a RestProperty test of `no-undef` (fixes #3271) (Toru Nagashima) -* Docs: Load badge from HTTPS (Brian J Brennan) -* Build: Update eslint bot messages (fixes #4497) (Nicholas C. Zakas) - -v1.10.1 - November 20, 2015 - -* Fix: Revert freezing context object (refs #4495) (Nicholas C. Zakas) -* 1.10.0 (Nicholas C. Zakas) - -v1.10.0 - November 20, 2015 - -* Docs: Remove dupes from changelog (Nicholas C. Zakas) -* Update: --init to create extensioned files (fixes #4476) (Nicholas C. Zakas) -* Docs: Update description of exported comment (fixes #3916) (Nicholas C. Zakas) -* Docs: Move legacy rules to stylistic (files #4111) (Nicholas C. Zakas) -* Docs: Clean up description of recommended rules (fixes #4365) (Nicholas C. Zakas) -* Docs: Fix home directory config description (fixes #4398) (Nicholas C. Zakas) -* Update: Add class support to `require-jsdoc` rule (fixes #4268) (Gyandeep Singh) -* Update: return type error in `valid-jsdoc` rule (fixes #4443) (Gyandeep Singh) -* Update: Display errors at the place where fix should go (fixes #4470) (nightwing) -* Docs: Fix typo in default `cacheLocation` value (Andrew Hutchings) -* Fix: Handle comments in block-spacing (fixes #4387) (alberto) -* Update: Accept array for `ignorePattern` (fixes #3982) (Jesse McCarthy) -* Update: replace label and break with IIFE and return (fixes #4459) (Ilya Panasenko) -* Fix: space-before-keywords false positive (fixes #4449) (alberto) -* Fix: Improves performance (refs #3530) (Toru Nagashima) -* Fix: Autofix quotes produces invalid javascript (fixes #4380) (nightwing) -* Docs: Update indent.md (Nathan Brown) -* New: Disable comment config option (fixes #3901) (Matthew Riley MacPherson) -* New: Config files with extensions (fixes #4045, fixes #4263) (Nicholas C. Zakas) -* Revert "Update: Add JSX exceptions to no-extra-parens (fixes #4229)" (Brandon Mills) -* Update: Add JSX exceptions to no-extra-parens (fixes #4229) (Brandon Mills) -* Docs: Replace link to deprecated rule with newer rule (Andrew Marshall) -* Fix: `no-extend-native` crashed at empty defineProperty (fixes #4438) (Toru Nagashima) -* Fix: Support empty if blocks in lines-around-comment (fixes #4339) (alberto) -* Fix: `curly` warns wrong location for `else` (fixes #4362) (Toru Nagashima) -* Fix: `id-length` properties never option (fixes #4347) (Toru Nagashima) -* Docs: missing close rbracket in example (@storkme) -* Revert "Update: Allow empty arrow body (fixes #4411)" (Nicholas C. Zakas) -* Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423) (Kevin Partington) -* Docs: Document semi-spacing behaviour (fixes #4404) (alberto) -* Update: Allow empty arrow body (fixes #4411) (alberto) -* Fix: Handle comments in comma-spacing (fixes #4389) (alberto) -* Update: Refactor eslint.verify args (fixes #4395) (Nicholas C. Zakas) -* Fix: no-undef-init should ignore const (fixes #4284) (Nicholas C. Zakas) -* Fix: Add the missing "as-needed" docs to the radix rule (fixes #4364) (Michał Gołębiowski) -* Fix: Display singular/plural version of "line" in message (fixes #4359) (Marius Schulz) -* Update: Add Popular Style Guides (fixes #4320) (Jamund Ferguson) -* Fix: eslint.report can be called w/o node if loc provided (fixes #4220) (Kevin Partington) -* Update: no-implicit-coercion validate AssignmentExpression (fixes #4348) (Ilya Panasenko) - -v1.9.0 - November 6, 2015 - -* Update: Make radix accept a "as-needed" option (fixes #4048) (Michał Gołębiowski) -* Fix: Update the message to include number of lines (fixes #4342) (Brian Delahunty) -* Docs: ASI causes problem whether semicolons are used or not (Thai Pangsakulyanont) -* Fix: Fixer to not overlap ranges among fix objects (fixes #4321) (Gyandeep Singh) -* Update: Add default to `max-nested-callbacks` (fixes #4297) (alberto) -* Fix: Check comments in space-in-parens (fixes #4302) (alberto) -* Update: Add quotes to error messages to improve clarity (fixes #4313) (alberto) -* Fix: tests failing due to differences in temporary paths (fixes #4324) (alberto) -* Fix: Make tests compatible with Windows (fixes #4315) (Ian VanSchooten) -* Update: Extract glob and filesystem logic from cli-engine (fixes #4305) (Ian VanSchooten) -* Build: Clarify commit-check messages (fixes #4256) (Ian VanSchooten) -* Upgrade: Upgrade various dependencies (fixes #4303) (Gyandeep Singh) -* Build: Add node 5 to travis build (fixes #4310) (Gyandeep Singh) -* Fix: ensure using correct estraverse (fixes #3951) (Toru Nagashima) -* Docs: update docs about using gitignore (Mateusz Derks) -* Update: Detect and fix wrong linebreaks (fixes #3981) (alberto) -* New: Add no-case-declarations rule (fixes #4278) (Erik Arvidsson) - -v1.8.0 - October 30, 2015 - -* Fix: Check for node property before testing type (fixes #4298) (Ian VanSchooten) -* Docs: Specify 'double' as default for quotes (fixes #4270) (Ian VanSchooten) -* Fix: Missing errors in space-in-parens (fixes #4257, fixes #3996) (alberto) -* Docs: fixed typo (Mathieu M-Gosselin) -* Fix: `cacheLocation` handles paths in windows style. (fixes #4285) (royriojas) -* Docs: fixed typo (mpal9000) -* Update: Add support for class in `valid-jsdoc` rule (fixes #4279) (Gyandeep Singh) -* Update: cache-file accepts a directory. (fixes #4241) (royriojas) -* Update: Add `maxEOF` to no-multiple-empty-lines (fixes #4235) (Adrien Vergé) -* Update: fix option for comma-spacing (fixes #4232) (HIPP Edgar (PRESTA EXT)) -* Docs: Fix use of wrong word in configuration doc (Jérémie Astori) -* Fix: Prepare config before verifying SourceCode (fixes #4230) (Ian VanSchooten) -* Update: RuleTester come to check AST was not modified (fixes #4156) (Toru Nagashima) -* Fix: wrong count for 'no-multiple-empty-lines' on last line (fixes #4228) (alberto) -* Update: Add `allow` option to `no-shadow` rule (fixes #3035) (Gyandeep Singh) -* Doc: Correct the spelling of Alberto's surname (alberto) -* Docs: Add alberto as a committer (Gyandeep Singh) -* Build: Do not stub console in testing (fixes #1328) (Gyandeep Singh) -* Fix: Check node exists before checking type (fixes #4231) (Ian VanSchooten) -* Update: Option to exclude afterthoughts from no-plusplus (fixes #4093) (Brody McKee) -* New: Add rule no-arrow-condition (fixes #3280) (Luke Karrys) -* Update: Add linebreak style option to eol-last (fixes #4148) (alberto) -* New: arrow-body-style rule (fixes #4109) (alberto) - -v1.7.3 - October 21, 2015 - -* Fix: Support comma-first style in key-spacing (fixes #3877) (Brandon Mills) -* Fix: no-magic-numbers: variable declarations (fixes #4192) (Ilya Panasenko) -* Fix: Support ES6 shorthand in key-spacing (fixes #3678) (Brandon Mills) -* Fix: `indent` array with memberExpression (fixes #4203) (Gyandeep Singh) -* Fix: `indent` param function on sameline (fixes #4174) (Gyandeep Singh) -* Fix: no-multiple-empty-lines fails when empty line at EOF (fixes #4214) (alberto) -* Fix: `comma-dangle` false positive (fixes #4200) (Nicholas C. Zakas) -* Fix: `valid-jsdoc` prefer problem (fixes #4205) (Nicholas C. Zakas) -* Docs: Add missing single-quote (Kevin Lamping) -* Fix: correct no-multiple-empty-lines at EOF (fixes #4140) (alberto) - -v1.7.2 - October 19, 2015 - -* Fix: comma-dangle confused by parens (fixes #4195) (Nicholas C. Zakas) -* Fix: no-mixed-spaces-and-tabs (fixes #4189, fixes #4190) (alberto) -* Fix: no-extend-native disallow using Object.properties (fixes #4180) (Nathan Woltman) -* Fix: no-magic-numbers should ignore Number.parseInt (fixes #4167) (Henry Zhu) - -v1.7.1 - October 16, 2015 - -* Fix: id-match schema (fixes #4155) (Nicholas C. Zakas) -* Fix: no-magic-numbers should ignore parseInt (fixes #4167) (Nicholas C. Zakas) -* Fix: `indent` param function fix (fixes #4165, fixes #4164) (Gyandeep Singh) - -v1.7.0 - October 16, 2015 - -* Fix: array-bracket-spacing for empty array (fixes #4141) (alberto) -* Fix: `indent` arrow function check fix (fixes #4142) (Gyandeep Singh) -* Update: Support .js files for config (fixes #3102) (Gyandeep Singh) -* Fix: Make eslint-config-eslint work (fixes #4145) (Nicholas C. Zakas) -* Fix: `prefer-arrow-callback` had been wrong at arguments (fixes #4095) (Toru Nagashima) -* Docs: Update various rules docs (Nicholas C. Zakas) -* New: Create eslint-config-eslint (fixes #3525) (Nicholas C. Zakas) -* Update: RuleTester allows string errors in invalid cases (fixes #4117) (Kevin Partington) -* Docs: Reference no-unexpected-multiline in semi (fixes #4114) (alberto) -* Update: added exceptions to `lines-around-comment` rule. (fixes #2965) (Mathieu M-Gosselin) -* Update: Add `matchDescription` option to `valid-jsdoc` (fixes #2449) (Gyandeep Singh) -* Fix: check for objects or arrays in array-bracket-spacing (fixes #4083) (alberto) -* Docs: Alphabetize Rules lists (Kenneth Chung) -* Fix: message templates fail when no parameters are passed (fixes #4080) (Ilya Volodin) -* Fix: `indent` multi-line function call (fixes #4073, fixes #4075) (Gyandeep Singh) -* Docs: Improve comma-dangle documentation (Gilad Peleg) -* Fix: no-mixed-tabs-and-spaces fails with some comments (fixes #4086) (alberto) -* Fix: `semi` to check for do-while loops (fixes #4090) (Gyandeep Singh) -* Build: Fix path related failures on Windows in tests (fixes #4061) (Burak Yigit Kaya) -* Fix: `no-unused-vars` had been missing some parameters (fixes #4047) (Toru Nagashima) -* Fix: no-mixed-spaces-and-tabs with comments and templates (fixes #4077) (alberto) -* Update: Add `allow` option for `no-underscore-dangle` rule (fixes #2135) (Gyandeep Singh) -* Update: `allowArrowFunctions` option for `func-style` rule (fixes #1897) (Gyandeep Singh) -* Fix: Ignore template literals in no-mixed-tabs-and-spaces (fixes #4054) (Nicholas C. Zakas) -* Build: Enable CodeClimate (fixes #4068) (Nicholas C. Zakas) -* Fix: `no-cond-assign` had needed double parens in `for` (fixes #4023) (Toru Nagashima) -* Update: Ignore end of function in newline-after-var (fixes #3682) (alberto) -* Build: Performance perf to not ignore jshint file (refs #3765) (Gyandeep Singh) -* Fix: id-match bug incorrectly errors on `NewExpression` (fixes #4042) (Burak Yigit Kaya) -* Fix: `no-trailing-spaces` autofix to handle linebreaks (fixes #4050) (Gyandeep Singh) -* Fix: renamed no-magic-number to no-magic-numbers (fixes #4053) (Vincent Lemeunier) -* New: add "consistent" option to the "curly" rule (fixes #2390) (Benoît Zugmeyer) -* Update: Option to ignore for loops in init-declarations (fixes #3641) (alberto) -* Update: Add webextensions environment (fixes #4051) (Blake Winton) -* Fix: no-cond-assign should report assignment location (fixes #4040) (alberto) -* New: no-empty-pattern rule (fixes #3668) (alberto) -* Upgrade: Upgrade globals to 8.11.0 (fixes #3599) (Burak Yigit Kaya) -* Docs: Re-tag JSX code fences (fixes #4020) (Brandon Mills) -* New: no-magic-number rule (fixes #4027) (Vincent Lemeunier) -* Docs: Remove list of users from README (fixes #3881) (Brandon Mills) -* Fix: `no-redeclare` and `no-sahadow` for builtin globals (fixes #3971) (Toru Nagashima) -* Build: Add `.eslintignore` file for the project (fixes #3765) (Gyandeep Singh) - -v1.6.0 - October 2, 2015 - -* Fix: cache is basically not working (fixes #4008) (Richard Hansen) -* Fix: a test failure on Windows (fixes #3968) (Toru Nagashima) -* Fix: `no-invalid-this` had been missing globals in node (fixes #3961) (Toru Nagashima) -* Fix: `curly` with `multi` had false positive (fixes #3856) (Toru Nagashima) -* Build: Add load performance check inside perf function (fixes #3994) (Gyandeep Singh) -* Fix: space-before-keywords fails with super keyword (fixes #3946) (alberto) -* Fix: CLI should not fail on account of ignored files (fixes #3978) (Dominic Barnes) -* Fix: brace-style rule incorrectly flagging switch (fixes #4002) (Aparajita Fishman) -* Update: Implement auto fix for space-unary-ops rule (fixes #3976) (alberto) -* Update: Implement auto fix for computed-property-spacing (fixes #3975) (alberto) -* Update: Implement auto fix for no-multi-spaces rule (fixes #3979) (alberto) -* Fix: Report shorthand method names in complexity rule (fixes #3955) (Tijn Kersjes) -* Docs: Add note about typeof check for isNaN (fixes #3985) (Daniel Lo Nigro) -* Update: ESLint reports parsing errors with clear prefix. (fixes #3555) (Kevin Partington) -* Build: Update markdownlint dependency (fixes #3954) (David Anson) -* Update: `no-mixed-require` to have non boolean option (fixes #3922) (Gyandeep Singh) -* Fix: trailing spaces auto fix to check for line breaks (fixes #3940) (Gyandeep Singh) -* Update: Add `typeof` option to `no-undef` rule (fixes #3684) (Gyandeep Singh) -* Docs: Fix explanation and typos for accessor-pairs (alberto) -* Docs: Fix typos for camelcase (alberto) -* Docs: Fix typos for max-statements (Danny Guo) -* Update: Implement auto fix for object-curly-spacing (fixes #3857) (alberto) -* Update: Implement auto fix for array-bracket-spacing rule (fixes #3858) (alberto) -* Fix: Add schema to `global-require` rule (fixes #3923) (Gyandeep Singh) -* Update: Apply lazy loading for rules (fixes #3930) (Gyandeep Singh) -* Docs: Fix typo for arrow-spacing (Danny Guo) -* Docs: Fix typos for wrap-regex (Danny Guo) -* Docs: Fix explanation for space-before-keywords (Danny Guo) -* Docs: Fix typos for operator-linebreak (Danny Guo) -* Docs: Fix typos for callback-return (Danny Guo) -* Fix: no-trailing-spaces autofix to account for blank lines (fixes #3912) (Gyandeep Singh) -* Docs: Fix example in no-negated-condition.md (fixes #3908) (alberto) -* Update:warn message use @return when prefer.returns=return (fixes #3889) (闲耘™) -* Update: Implement auto fix for generator-star-spacing rule (fixes #3873) (alberto) -* Update: Implement auto fix for arrow-spacing rule (fixes #3860) (alberto) -* Update: Implement auto fix for block-spacing rule (fixes #3859) (alberto) -* Fix: Support allman style for switch statement (fixes #3903) (Gyandeep Singh) -* New: no-negated-condition rule (fixes #3740) (alberto) -* Docs: Fix typo in blog post template (Nicholas C. Zakas) -* Update: Add env 'nashorn' to support Java 8 Nashorn Engine (fixes #3874) (Benjamin Winterberg) -* Docs: Prepare for rule doc linting (refs #2271) (Ian VanSchooten) - -v1.5.1 - September 22, 2015 - -* Fix: valid-jsdoc fix for param with properties (fixes #3476) (Gyandeep Singh) -* Fix: valid-jsdoc error with square braces (fixes #2270) (Gyandeep Singh) -* Upgrade: `doctrine` to 0.7.0 (fixes #3891) (Gyandeep Singh) -* Fix: `space-before-keywords` had been wrong on getters (fixes #3854) (Toru Nagashima) -* Fix: `no-dupe-args` had been wrong for nested destructure (fixes #3867) (Toru Nagashima) -* Docs: io.js is the new Node.js (thefourtheye) -* Docs: Fix method signature on working-with-rules docs (fixes #3862) (alberto) -* Docs: Add related ternary links (refs #3835) (Ian VanSchooten) -* Fix: don’t ignore config if cwd is the home dir (fixes #3846) (Mathias Schreck) -* Fix: `func-style` had been warning arrows with `this` (fixes #3819) (Toru Nagashima) -* Fix: `space-before-keywords`; allow opening curly braces (fixes #3789) (Marko Raatikka) -* Build: Fix broken .gitattributes generation (fixes #3566) (Nicholas C. Zakas) -* Build: Fix formatter docs generation (fixes #3847) (Nicholas C. Zakas) - -v1.5.0 - September 18, 2015 - -* Fix: invalidate cache when config changes. (fixes #3770) (royriojas) -* Fix: function body indent issues (fixes #3614, fixes #3799) (Gyandeep Singh) -* Update: Add configuration option to `space-before-blocks` (fixes #3758) (Phil Vargas) -* Fix: space checking between tokens (fixes #2211) (Nicholas C. Zakas) -* Fix: env-specified ecmaFeatures had been wrong (fixes #3735) (Toru Nagashima) -* Docs: Change example wording from warnings to problems (fixes #3676) (Ian VanSchooten) -* Build: Generate formatter example docs (fixes #3560) (Ian VanSchooten) -* New: Add --debug flag to CLI (fixes #2692) (Nicholas C. Zakas) -* Docs: Update no-undef-init docs (fixes #3170) (Nicholas C. Zakas) -* Docs: Update no-unused-expressions docs (fixes #3685) (Nicholas C. Zakas) -* Docs: Clarify node types in no-multi-spaces (fixes #3781) (Nicholas C. Zakas) -* Docs: Update new-cap docs (fixes #3798) (Nicholas C. Zakas) -* Fix: `space-before-blocks` had conflicted `arrow-spacing` (fixes #3769) (Toru Nagashima) -* Fix: `comma-dangle` had not been checking imports/exports (fixes #3794) (Toru Nagashima) -* Fix: tests fail due to differences in temporary paths. (fixes #3778) (royriojas) -* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) -* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) -* Update: Implement auto fix for `space-infix-ops` rule (fixes #3801) (Gyandeep Singh) -* Fix: `no-warning-comments` can't be set via config comment (fixes #3619) (Burak Yigit Kaya) -* Update: `key-spacing` should allow 1+ around colon (fixes #3363) (Burak Yigit Kaya) -* Fix: false alarm of semi-spacing with semi set to never (fixes #1983) (Chen Yicai) -* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) -* Docs: add more examples + tests for block-scoped-var (fixes #3791) (JT) -* Update: Implement auto fix for `indent` rule (fixes #3734) (Gyandeep Singh) -* Fix: `space-before-keywords` fails to handle some cases (fixes #3756) (Marko Raatikka) -* Docs: Add if-else example (fixes #3722) (Ian VanSchooten) -* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) -* Docs: Fix closing code fence on cli docs (Ian VanSchooten) -* Update: Implement auto fix for `space-before-blocks` rule (fixes #3776) (Gyandeep Singh) -* Update: Implement auto fix for `space-after-keywords` rule (fixes #3773) (Gyandeep Singh) -* Fix: `semi-spacing` had conflicted with `block-spacing` (fixes #3721) (Toru Nagashima) -* Update: Implement auto fix for `space-before-keywords` rule (fixes #3771) (Gyandeep Singh) -* Update: auto fix for space-before-function-paren rule (fixes #3766) (alberto) -* Update: Implement auto fix for `no-extra-semi` rule (fixes #3745) (Gyandeep Singh) -* Update: Refactors the traversing logic (refs #3530) (Toru Nagashima) -* Update: Implement auto fix for `space-return-throw-case` (fixes #3732) (Gyandeep Singh) -* Update: Implement auto fix for `no-spaced-func` rule (fixes #3728) (Gyandeep Singh) -* Update: Implement auto fix for `eol-last` rule (fixes #3725) (Gyandeep Singh) -* Update: Implement auto fix for `no-trailing-spaces` rule (fixes #3723) (Gyandeep Singh) - -v1.4.3 - September 15, 2015 - -* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) -* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) - -v1.4.2 - September 15, 2015 - -* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) -* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) - -v1.4.1 - September 11, 2015 - -* Fix: CLIEngine default cache parameter name (fixes #3755) (Daniel G. Taylor) -* Fix: Glob pattern from .eslintignore not applied (fixes #3750) (Burak Yigit Kaya) -* Fix: Skip JSDoc from NewExpression (fixes #3744) (Nicholas C. Zakas) -* Docs: Shorten and simplify autocomment for new issues (Nicholas C. Zakas) - -v1.4.0 - September 11, 2015 - -* Docs: Add new formatters to API docs (Ian VanSchooten) -* New: Implement autofixing (fixes #3134) (Nicholas C. Zakas) -* Fix: Remove temporary `"allow-null"` (fixes #3705) (Toru Nagashima) -* Fix: `no-unused-vars` had been crashed at `/*global $foo*/` (fixes #3714) (Toru Nagashima) -* Build: check-commit now checks commit message length. (fixes #3706) (Kevin Partington) -* Fix: make getScope acquire innermost scope (fixes #3700) (voideanvalue) -* Docs: Fix spelling mistake (domharrington) -* Fix: Allow whitespace in rule message parameters. (fixes #3690) (Kevin Partington) -* Fix: Eqeqeq rule with no option does not warn on 'a == null' (fixes #3699) (fediev) -* Fix: `no-unused-expressions` with `allowShortCircuit` false positive if left has no effect (fixes #3675) (Toru Nagashima) -* Update: Add Node 4 to travis builds (fixes #3697) (Ian VanSchooten) -* Fix: Not check for punctuator if on same line as last var (fixes #3694) (Gyandeep Singh) -* Docs: Make `quotes` docs clearer (fixes #3646) (Nicholas C. Zakas) -* Build: Increase mocha timeout (fixes #3692) (Nicholas C. Zakas) -* Fix: `no-extra-bind` to flag all arrow funcs (fixes #3672) (Nicholas C. Zakas) -* Docs: Update README with release and sponsor info (Nicholas C. Zakas) -* Fix: `object-curly-spacing` had been crashing on an empty object pattern (fixes #3658) (Toru Nagashima) -* Fix: `no-extra-parens` false positive at IIFE with member accessing (fixes #3653) (Toru Nagashima) -* Fix: `comma-dangle` with `"always"`/`"always-multiline"` false positive after a rest element (fixes #3627) (Toru Nagashima) -* New: `jsx-quotes` rule (fixes #2011) (Mathias Schreck) -* Docs: Add linting for second half of rule docs (refs #2271) (Ian VanSchooten) -* Fix: `no-unused-vars` had not shown correct locations for `/*global` (fixes #3617) (Toru Nagashima) -* Fix: `space-after-keywords` not working for `catch` (fixes #3654) (Burak Yigit Kaya) -* Fix: Incorrectly warning about ignored files (fixes #3649) (Burak Yigit Kaya) -* Fix: Indent rule VariableDeclarator doesn't apply to arrow functions (fixes #3661) (Burak Yigit Kaya) -* Upgrade: Consuming handlebars@^4.0.0 (fixes #3632) (Kevin Partington) -* Docs: Fixing typos in plugin processor section. (fixes #3648) (Kevin Partington) -* Fix: Invalid env keys would cause an unhandled exception.(fixes #3265) (Ray Booysen) -* Docs: Fixing broken link in documentation (Ilya Volodin) -* Update: Check for default assignment in no-unneeded-ternary (fixes #3232) (cjihrig) -* Fix: `consistent-as-needed` mode with `keyword: true` (fixes #3636) (Alex Guerrero) -* New: Implement cache in order to only operate on changed files since previous run. (fixes #2998) (Roy Riojas) -* Update: Grouping related CLI options. (fixes #3612) (Kevin Partington) -* Update: Using @override does not require @param or @returns (fixes #3629) (Whitney Young) -* Docs: Use eslint-env in no-undef (fixes #3616) (Ian VanSchooten) -* New: `require-jsdoc` rule (fixes #1842) (Gyandeep Singh) -* New: Support glob path on command line (fixes #3402) (Burak Yigit Kaya) -* Update: Short circuit and ternary support in no-unused-expressions (fixes #2733) (David Warkentin) -* Docs: Replace to npmjs.com (Ryuichi Okumura) -* Fix: `indent` should only indent chain calls if the first call is single line (fixes #3591) (Burak Yigit Kaya) -* Fix: `quote-props` should not crash for object rest spread syntax (fixes #3595) (Joakim Carlstein) -* Update: Use `globals` module for the `commonjs` globals (fixes #3606) (Sindre Sorhus) -* New: `no-restricted-syntax` rule to forbid certain syntax (fixes #2422) (Burak Yigit Kaya) -* Fix: `no-useless-concat` false positive at numbers (fixes #3575, fixes #3589) (Toru Nagashima) -* New: Add --max-warnings flag to CLI (fixes #2769) (Kevin Partington) -* New: Add `parser` as an option (fixes #3127) (Gyandeep Singh) -* New: `space-before-keywords` rule (fixes #1631) (Marko Raatikka) -* Update: Allowing inline comments to disable eslint rules (fixes #3472) (Whitney Young) -* Docs: Including for(;;) as valid case in no-constant-condition (Kevin Partington) -* Update: Add quotes around the label in `no-redeclare` error messages (fixes #3583) (Ian VanSchooten) -* Docs: correct contributing URL (Dieter Luypaert) -* Fix: line number for duplicate object keys error (fixes #3573) (Elliot Lynde) -* New: global-require rule (fixes #2318) (Jamund Ferguson) - -v1.3.1 - August 29, 2015 - -* Fix: `indent` to not crash on empty files (fixes #3570) (Gyandeep Singh) -* Fix: Remove unused config file (fixes #2227) (Gyandeep Singh) - -v1.3.0 - August 28, 2015 - -* Build: Autogenerate release blog post (fixes #3562) (Nicholas C. Zakas) -* New: `no-useless-concat` rule (fixes #3506) (Henry Zhu) -* Update: Add `keywords` flag to `consistent-as-needed` mode in `quote-props` (fixes #3532) (Burak Yigit Kaya) -* Update: adds `numbers` option to quote-props (fixes #2914) (Jose Roberto Vidal) -* Fix: `quote-props` rule should ignore computed and shorthand properties (fixes #3557) (fixes #3544) (Burak Yigit Kaya) -* Docs: Add config comments for rule examples 'accessor-pairs' to 'no-extra-semi' (refs #2271) (Ian VanSchooten) -* Update: Return to accept `undefined` type (fixes #3382) (Gyandeep Singh) -* New: Added HTML formatter (fixes #3505) (Julian Laval) -* Fix: check space after yield keyword in space-unary-ops (fixes #2707) (Mathias Schreck) -* Docs: (curly) Fix broken code in example (Kent C. Dodds) -* Update: Quote var name in `no-unused-vars` error messages (refs #3526) (Burak Yigit Kaya) -* Update: Move methods to SourceCode (fixes #3516) (Nicholas C. Zakas) -* Fix: Don't try too hard to find fault in `no-implicit-coercion` (refs #3402) (Burak Yigit Kaya) -* Fix: Detect ternary operator in operator-linebreak rule (fixes #3274) (Burak Yigit Kaya) -* Docs: Clearer plugin rule configuration (fixes #2022) (Nicholas C. Zakas) -* Update: Add quotes around the label in `no-empty-label` error reports (fixes #3526) (Burak Yigit Kaya) -* Docs: Turn off Liquid in example (Nicholas C. Zakas) -* Docs: Mention CommonJS along with Node.js (fixes #3388) (Nicholas C. Zakas) -* Docs: Make it clear which rules are recommended (fixes #3398) (Nicholas C. Zakas) -* Docs: Add links to JSON Schema resources (fixes #3411) (Nicholas C. Zakas) -* Docs: Add more info to migration guide (fixes #3439) (Nicholas C. Zakas) -* Fix: ASI indentation issue (fixes #3514) (Burak Yigit Kaya) -* Fix: Make `no-implicit-coercion` smarter about numerical expressions (fixes #3510) (Burak Yigit Kaya) -* Fix: `prefer-template` had not been handling TemplateLiteral as literal node (fixes #3507) (Toru Nagashima) -* Update: `newline-after-var` Allow comment + blank after var (fixes #2852) (Ian VanSchooten) -* Update: Add `unnecessary` option to `quote-props` (fixes #3381) (Burak Yigit Kaya) -* Fix: `indent` shouldn't check the last line unless it is a punctuator (fixes #3498) (Burak Yigit Kaya) -* Fix: `indent` rule does not indent when doing multi-line chain calls (fixes #3279) (Burak Yigit Kaya) -* Fix: sort-vars rule fails when memo is undefined (fixes #3474) (Burak Yigit Kaya) -* Fix: `brace-style` doesn't report some closing brace errors (fixes #3486) (Burak Yigit Kaya) -* Update: separate options for block and line comments in `spaced-comment` rule (fixes #2897) (Burak Yigit Kaya) -* Fix: `indent` does not check FunctionDeclaration nodes properly (fixes #3173) (Burak Yigit Kaya) -* Update: Added "properties" option to `id-length` rule to ignore property names. (fixes #3450) (Mathieu M-Gosselin) -* Update: add new ignore pattern options to no-unused-vars (fixes #2321) (Mathias Schreck) -* New: Protractor environment (fixes #3457) (James Whitney) -* Docs: Added section to shareable config (Gregory Waxman) -* Update: Allow pre-parsed code (fixes #1025, fixes #948) (Nicholas C. Zakas) - -v1.2.1 - August 20, 2015 - -* Fix: "key-spacing" crashes eslint on object literal shorthand properties (fixes #3463) (Burak Yigit Kaya) -* Fix: ignore leading space check for `null` elements in comma-spacing (fixes #3392) (Mathias Schreck) -* Fix: `prefer-arrow-callback` false positive at recursive functions (fixes #3454) (Toru Nagashima) -* Fix: one-var rule doesn’t have default options (fixes #3449) (Burak Yigit Kaya) -* Fix: Refactor `no-duplicate-case` to be simpler and more efficient (fixes #3440) (Burak Yigit Kaya) -* Docs: Fix trailing spaces in README (Nicholas C. Zakas) -* Docs: Update gyandeeps and add byk (Nicholas C. Zakas) -* Docs: Update plugins documentation for 1.0.0 (Nicholas C. Zakas) -* Docs: `object-curly-spacing` doc is inaccurate about exceptions (Burak Yigit Kaya) -* Fix: `object-curly-spacing` shows the incorrect column for opening brace (fixes #3438) (Burak Yigit Kaya) - -v1.2.0 - August 18, 2015 - -* Update: add support for semicolon in comma-first setup in indent rule (fixes #3423) (Burak Yigit Kaya) -* Docs: better JSDoc for indent rule (Burak Yigit Kaya) -* Docs: Document the second argument of `CLIEngine.executeOnText()` (Sindre Sorhus) -* New: `no-dupe-class-members` rule (fixes #3294) (Toru Nagashima) -* Fix: exclude `AssignmentExpression` and `Property` nodes from extra indentation on first line (fixes #3391) (Burak Yigit Kaya) -* Update: Separate indent options for var, let and const (fixes #3339) (Burak Yigit Kaya) -* Fix: Add AssignmentPattern to space-infix-ops (fixes #3380) (Burak Yigit Kaya) -* Docs: Fix typo: exception label (tienslebien) -* Update: Clean up tests for CLI config support (refs #2543) (Gyandeep Singh) -* New: `block-spacing` rule (fixes #3303) (Toru Nagashima) -* Docs: Update docs for no-iterator (fixes #3405) (Nicholas C. Zakas) -* Upgrade: bump `espree` dependency to `2.2.4` (fixes #3403) (Burak Yigit Kaya) -* Fix: false positive on switch 'no duplicate case', (fixes #3408) (Cristian Carlesso) -* Fix: `valid-jsdoc` test does not recognize aliases for `@param` (fixes #3399) (Burak Yigit Kaya) -* New: enable `-c` flag to accept a shareable config (fixes #2543) (Shinnosuke Watanabe) -* Fix: Apply plugin given in CLI (fixes #3383) (Ian VanSchooten) -* New: Add commonjs environment (fixes #3377) (Nicholas C. Zakas) -* Docs: Update no-unused-var docs (Nicholas C. Zakas) -* Fix: trailing commas in object-curly-spacing for import/export (fixes #3324) (Henry Zhu) -* Update: Make `baseConfig` to behave as other config options (fixes #3371) (Gyandeep Singh) -* Docs: Add "Compatibility" section to linebreak-style (Vitor Balocco) -* New: `prefer-arrow-callback` rule (fixes #3140) (Toru Nagashima) -* Docs: Clarify what an unused var is (fixes #2342) (Nicholas C. Zakas) -* Docs: Mention double-byte character limitation in max-len (fixes #2370) (Nicholas C. Zakas) -* Fix: object curly spacing incorrectly warning for import with default and multiple named specifiers (fixes #3370) (Luke Karrys) -* Fix: Indent rule errors with array of objects (fixes #3329) (Burak Yigit Kaya) -* Update: Make it clear that `space-infix-ops` support `const` (fixes #3299) (Burak Yigit Kaya) -* New: `prefer-template` rule (fixes #3014) (Toru Nagashima) -* Docs: Clarify `no-process-env` docs (fixes #3318) (Nicholas C. Zakas) -* Docs: Fix arrow name typo (fixes #3309) (Nicholas C. Zakas) -* Update: Improve error message for `indent` rule violation (fixes #3340) (Burak Yigit Kaya) -* Fix: radix rule does not apply for Number.parseInt (ES6) (fixes #3364) (Burak Yigit Kaya) -* Fix: `key-spacing.align` doesn't pay attention to non-whitespace before key (fixes #3267) (Burak Yigit Kaya) -* Fix: arrow-parens & destructuring/default params (fixes #3353) (Jamund Ferguson) -* Update: Add support for Allman to brace-style rule, brackets on newline (fixes #3347) (Burak Yigit Kaya) -* Fix: Regression no-catch-shadow (1.1.0) (fixes #3322) (Burak Yigit Kaya) -* Docs: remove note outdated in 1.0.0 (Denis Sokolov) -* Build: automatically convert line endings in release script (fixes #2642) (Burak Yigit Kaya) -* Update: allow disabling new-cap on object methods (fixes #3172) (Burak Yigit Kaya) -* Update: Improve checkstyle format (fixes #3183) (Burak Yigit Kaya) -* Fix: Indent rule errors if an array literal starts a new statement (fixes #3328) (Burak Yigit Kaya) -* Update: Improve validation error messages (fixes #3193) (Burak Yigit Kaya) -* Docs: fix syntax error in space-before-function-paren (Fabrício Matté) -* Fix: `indent` rule to check for last line correctly (fixes #3327) (Gyandeep Singh) -* Fix: Inconsistent off-by-one errors with column numbers (fixes #3231) (Burak Yigit Kaya) -* Fix: Keyword "else" must not be followed by a newline (fixes #3226) (Burak Yigit Kaya) -* Fix: `id-length` does not work for most of the new ES6 patterns (fixes #3286) (Burak Yigit Kaya) -* Fix: Spaced Comment Exceptions Not Working (fixes #3276) (Jamund Ferguson) - -v1.1.0 - August 7, 2015 - -* Update: Added as-needed option to arrow-parens (fixes #3277) (Jamund Ferguson) -* Fix: curly-spacing missing import case (fixes #3302) (Jamund Ferguson) -* Fix: `eslint-env` in comments had not been setting `ecmaFeatures` (fixes #2134) (Toru Nagashima) -* Fix: `es6` env had been missing `spread` and `newTarget` (fixes #3281) (Toru Nagashima) -* Fix: Report no-spaced-func on last token before paren (fixes #3289) (Benjamin Woodruff) -* Fix: Check for null elements in indent rule (fixes #3272) (Gyandeep Singh) -* Docs: Use backticks for option heading (Gyandeep Singh) -* Fix: `no-invalid-this` had been missing jsdoc comment (fixes #3287) (Toru Nagashima) -* Fix: `indent` rule for multi-line objects and arrays (fixes #3236) (Gyandeep Singh) -* Update: add new `multi-or-nest` option for the `curly` rule (fixes #1806) (Ivan Nikulin) -* Fix: `no-cond-assign` had been missing simplest pattern (fixes #3249) (Toru Nagashima) -* Fix: id-length rule doesn't catch violations in arrow function parameters (fixes #3275) (Burak Yigit Kaya) -* New: Added grep-style formatter (fixes #2991) (Nobody Really) -* Update: Split out generic AST methods into utility (fixes #962) (Gyandeep Singh) -* Fix: `accessor-pairs` false positive (fixes #3262) (Toru Nagashima) -* Fix: `context.getScope()` returns correct scope in blockBindings (fixes #3254) (Toru Nagashima) -* Update: Expose `getErrorResults` as a static method on `CLIEngine` (fixes #3242) (Gyandeep Singh) -* Update: Expose `getFormatter` as a static method on `CLIEngine` (fixes #3239) (Gyandeep Singh) -* Docs: use correct encoding for id-match.md (fixes #3246) (Matthieu Larcher) -* Docs: place id-match rule at correct place in README.md (fixes #3245) (Matthieu Larcher) -* Docs: Update no-proto.md (Joe Zimmerman) -* Docs: Fix typo in object-shorthand docs (Gunnar Lium) -* Upgrade: inquirer dependency (fixes #3241) (Gyandeep Singh) -* Fix: `indent` rule for objects and nested one line blocks (fixes #3238, fixes #3237) (Gyandeep Singh) -* Docs: Fix wrong options in examples of key-spacing (keik) -* Docs: Adds missing "not" to semi.md (Marius Schulz) -* Docs: Update no-multi-spaces.md (Kenneth Powers) -* Fix: `indent` to not error on same line nodes (fixes #3228) (Gyandeep Singh) -* New: Jest environment (fixes #3212) (Darshak Parikh) - -v1.0.0 - July 31, 2015 - -* Update: merge `no-reserved-keys` into `quote-props` (fixes #1539) (Jose Roberto Vidal) -* Fix: `indent` error message (fixes #3220) (Gyandeep Singh) -* Update: Add embertest env (fixes #3205) (ismay) -* Docs: Correct documentation errors for `id-length` rule. (Jess Telford) -* Breaking: `indent` rule to have node specific options (fixes #3210) (Gyandeep Singh) -* Fix: space-after-keyword shouldn't allow newlines (fixes #3198) (Brandon Mills) -* New: Add JSON formatter (fixes #3036) (Burak Yigit Kaya) -* Breaking: Switch to RuleTester (fixes #3186) (Nicholas C. Zakas) -* Breaking: remove duplicate warnings of `no-undef` from `block-scoped-var` (fixes #3201) (Toru Nagashima) -* Fix: `init-declarations` ignores in for-in/of (fixes #3202) (Toru Nagashima) -* Fix: `quotes` with `"backtick"` ignores ModuleSpecifier and LiteralPropertyName (fixes #3181) (Toru Nagashima) -* Fix: space-in-parens in Template Strings (fixes #3182) (Ian VanSchooten) -* Fix: Check for concatenation in no-throw-literal (fixes #3099, fixes #3101) (Ian VanSchooten) -* Build: Remove `eslint-tester` from devDependencies (fixes #3189) (Gyandeep Singh) -* Fix: Use new ESLintTester (fixes #3187) (Nicholas C. Zakas) -* Update: `new-cap` supports fullnames (fixes #2584) (Toru Nagashima) -* Fix: Non object rule options merge (fixes #3179) (Gyandeep Singh) -* New: add id-match rule (fixes #2829) (Matthieu Larcher) -* Fix: Rule options merge (fixes #3175) (Gyandeep Singh) -* Fix: `spaced-comment` allows a mix of markers and exceptions (fixes #2895) (Toru Nagashima) -* Fix: `block-scoped-var` issues (fixes #2253, fixes #2747, fixes #2967) (Toru Nagashima) -* New: Add id-length rule (fixes #2784) (Burak Yigit Kaya) -* Update: New parameters for quote-props rule (fixes #1283, fixes #1658) (Tomasz Olędzki) - -v1.0.0-rc-3 - July 24, 2015 - -* Fix: Make Chai and Mocha as a dependency (fixes #3156) (Gyandeep Singh) -* Fix: traverse `ExperimentalSpread/RestProperty.argument` (fixes #3157) (Toru Nagashima) -* Fix: Check shareable config package prefix correctly (fixes #3146) (Gyandeep Singh) -* Update: move redeclaration checking for builtins (fixes #3070) (Toru Nagashima) -* Fix: `quotes` with `"backtick"` allows directive prologues (fixes #3132) (Toru Nagashima) -* Fix: `ESLintTester` path in exposed API (fixes #3149) (Gyandeep Singh) -* Docs: Remove AppVeyor badge (Gyandeep Singh) -* Fix: Check no-new-func on CallExpressions (fixes #3145) (Benjamin Woodruff) - -v1.0.0-rc-2 - July 23, 2015 - -* Docs: Mention eslint-tester in migration guide (Nicholas C. Zakas) -* Docs: Mention variables defined in a global comment (fixes #3137) (William Becker) -* Docs: add documentation about custom-formatters. (fixes #1260) (royriojas) -* Fix: Multi-line variable declarations indent (fixes #3139) (Gyandeep Singh) -* Fix: handles blocks in no-use-before-define (fixes #2960) (Jose Roberto Vidal) -* Update: `props` option of `no-param-reassign` (fixes #1600) (Toru Nagashima) -* New: Support shared configs named `@scope/eslint-config`, with shortcuts of `@scope` and `@scope/` (fixes #3123) (Jordan Harband) -* New: Add ignorePattern, ignoreComments, and ignoreUrls options to max-len (fixes #2934, fixes #2221, fixes #1661) (Benjamin Woodruff) -* Build: Increase Windows Mocha timeout (fixes #3133) (Ian VanSchooten) -* Docs: incorrect syntax in the example for rule «one-var» (Alexander Burtsev) -* Build: Check commit message format at end of tests (fixes #3058) (Ian VanSchooten) -* Update: Move eslint-tester into repo (fixes #3110) (Nicholas C. Zakas) -* Fix: Not load configs outside config with `root: true` (fixes #3109) (Gyandeep Singh) -* Docs: Add config information to README (fixes #3074) (Nicholas C. Zakas) -* Docs: Add mysticatea as committer (Nicholas C. Zakas) -* Docs: Grammar fixes in rule descriptions (refs #3038) (Greg Cochard) -* Fix: Update sort-vars to ignore Array and ObjectPattern (fixes #2954) (Harry Ho) -* Fix: block-scoped-var rule incorrectly flagging break/continue with label (fixes #3082) (Aparajita Fishman) -* Fix: spaces trigger wrong in `no-useless-call` and `prefer-spread` (fixes #3054) (Toru Nagashima) -* Fix: `arrow-spacing` allow multi-spaces and line-endings (fixes #3079) (Toru Nagashima) -* Fix: add missing loop scopes to one-var (fixes #3073) (Jose Roberto Vidal) -* New: the `no-invalid-this` rule (fixes #2815) (Toru Nagashima) -* Fix: allow empty loop body in no-extra-semi (fixes #3075) (Mathias Schreck) -* Update: Add qunit to environments (fixes #2870) (Nicholas C. Zakas) -* Fix: `space-before-blocks` to consider classes (fixes #3062) (Gyandeep Singh) -* Fix: Include phantomjs globals (fixes #3064) (Linus Unnebäck) -* Fix: no-else-return handles multiple else-if blocks (fixes #3015) (Jose Roberto Vidal) -* Fix: `no-*-assgin` rules support destructuring (fixes #3029) (Toru Nagashima) -* New: the `no-implicit-coercion` rule (fixes #1621) (Toru Nagashima) -* Fix: Make no-implied-eval match more types of strings (fixes #2898) (Benjamin Woodruff) -* Docs: Clarify that bot message is automatic (Ian VanSchooten) -* Fix: Skip rest properties in no-dupe-keys (fixes 3042) (Nicholas C. Zakas) -* Docs: New issue template (fixes #3048) (Nicholas C. Zakas) -* Fix: strict rule supports classes (fixes #2977) (Toru Nagashima) -* New: the `prefer-reflect` rule (fixes #2939) (Keith Cirkel) -* Docs: make grammar consistent in rules index (Greg Cochard) -* Docs: Fix unmatched paren in rule description (Greg Cochard) -* Docs: Small typo fix in no-useless-call documentation (Paul O’Shannessy) -* Build: readd phantomjs dependency with locked down version (fixes #3026) (Mathias Schreck) -* Docs: Add IanVS as committer (Nicholas C. Zakas) -* docs: additional computed-property-spacing documentation (fixes #2941) (Jamund Ferguson) -* Docs: Add let and const examples for newline-after-var (fixes #3020) (James Whitney) -* Build: Remove unnecessary phantomjs devDependency (fixes #3021) (Gyandeep Singh) -* Update: added shared builtins list (fixes #2972) (Jose Roberto Vidal) - -v1.0.0-rc-1 - July 15, 2015 - -* Upgrade: Espree to 2.2.0 (fixes #3011) (Nicholas C. Zakas) -* Docs: fix a typo (bartmichu) -* Fix: indent rule should recognize single line statements with ASI (fixes #3001, fixes #3000) (Mathias Schreck) -* Update: Handle CRLF line endings in spaced-comment rule - 2 (fixes #3005) (Burak Yigit Kaya) -* Fix: Indent rule error on empty block body (fixes #2999) (Gyandeep Singh) -* New: the `no-class-assign` rule (fixes #2718) (Toru Nagashima) -* New: the `no-const-assign` rule (fixes #2719) (Toru Nagashima) -* Docs: Add 1.0.0 migration guide (fixes #2994) (Nicholas C. Zakas) -* Docs: Update changelog for 0.24.1 (fixes #2976) (Nicholas C. Zakas) -* Breaking: Remove deprecated rules (fixes #1898) (Ian VanSchooten) -* Fix: multi-line + fat arrow indent (fixes #2239) (Gyandeep Singh) -* Breaking: Create eslint:recommended and add to --init (fixes #2713) (Greg Cochard) -* Fix: Indent rule (fixes #1797, fixes #1799, fixes #2248, fixes #2343, fixes #2278, fixes #1800) (Gyandeep Singh) -* New: `context.getDeclaredVariables(node)` (fixes #2801) (Toru Nagashima) -* New: the `no-useless-call` rule (fixes #1925) (Toru Nagashima) -* New: the `prefer-spread` rule (fixes #2946) (Toru Nagashima) -* Fix: `valid-jsdoc` counts `return` for arrow expressions (fixes #2952) (Toru Nagashima) -* New: Add exported comment option (fixes #1200) (Jamund Ferguson) -* Breaking: Default to --reset behavior (fixes #2100) (Brandon Mills) -* New: Add arrow-parens and arrow-spacing rule (fixes #2628) (Jxck) -* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) -* Add: Warn on missing rule definition or deprecation (fixes #1549) (Ian VanSchooten) -* Update: adding some tests for no-redeclare to test named functions (fixes #2953) (Dominic Barnes) -* New: Add support for root: true in config files (fixes #2736) (Ian VanSchooten) -* Fix: workaround for leading and trailing comments in padded-block (fixes #2336 and fixes #2788) (Mathias Schreck) -* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) -* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) -* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) -* Update: `no-loop-func` allows block-scoped variables (fixes #2517) (Toru Nagashima) -* Docs: remove mistaken "off by default" (Jan Schär) -* Build: Add appveyor CI system (fixes #2923) (Gyandeep Singh) -* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) -* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) -* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) -* Docs: clarification in no-unused-vars (Jan Schär) -* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) -* Docs: missing quotes in JSON (Jan Schär) -* Breaking: Switch to 1-based columns (fixes #2284) (Nicholas C. Zakas) -* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) -* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) -* Docs: Add space-in-brackets deprecation notice (Brandon Mills) -* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) -* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) -* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) -* New: Add init-declarations rule (fixes #2606) (cjihrig) -* Docs: Fix typo in array-bracket-spacing rule (zallek) -* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) -* Build: gensite target supports rule removal (refs #1898) (Brandon Mills) -* Update: Handle CRLF line endings in spaced-comment rule (fixes #2884) (David Anson) -* Update: Attach parent in getNodeByRangeIndex (fixes #2863) (Brandon Mills) -* Docs: Fix typo (Bryan Smith) -* New: Add serviceworker environment (fixes #2557) (Gyandeep Singh) -* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) -* Update: Loosens regex rules around intentional fall through comments (Fixes #2811) (greg5green) -* Update: Add missing schema to rules (fixes #2858) (Ilya Volodin) -* New: `require-yield` rule (fixes #2822) (Toru Nagashima) -* New: add callback-return rule (fixes #994) (Jamund Ferguson) - -v0.24.1 - July 10, 2015 - -* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) -* Docs: remove mistaken "off by default" (Jan Schär) -* Docs: remove mistaken "off by default" (Jan Schär) -* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) -* Docs: clarification in no-unused-vars (Jan Schär) -* Docs: missing quotes in JSON (Jan Schär) -* Fix: Revert 1-based column changes in tests for patch (refs #2284) (Nicholas C. Zakas) -* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) -* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) -* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) -* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) -* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) -* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) -* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) -* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) -* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) -* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) -* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) -* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) -* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) -* Docs: Add space-in-brackets deprecation notice (Brandon Mills) - -v0.24.0 - June 26, 2015 - -* Upgrade: eslint-tester to 0.8.1 (Nicholas C. Zakas) -* Fix: no-dupe-args sparse array crash (fixes #2848) (Chris Walker) -* Fix: space-after-keywords should ignore extra parens (fixes #2847) (Mathias Schreck) -* New: add no-unexpected-multiline rule (fixes #746) (Glen Mailer) -* Update: refactor handle-callback-err to improve performance (fixes #2841) (Mathias Schreck) -* Fix: Add --init to the CLI options (fixes #2817) (Gyandeep Singh) -* Update: Add `except-parens` option to `no-return-assign` rule (fixes #2809) (Toru Nagashima) -* Fix: handle-callback-err missing arrow functions (fixes #2823) (Jamund Ferguson) -* Fix: `no-extra-semi` in class bodies (fixes #2794) (Toru Nagashima) -* Fix: Check type to be file when looking for config files (fixes #2790) (Gyandeep Singh) -* Fix: valid-jsdoc to work for object getters (fixes #2407) (Gyandeep Singh) -* Update: Add an option as an object to `generator-star-spacing` rule (fixes #2787) (Toru Nagashima) -* Build: Update markdownlint dependency (David Anson) -* Fix: context report message to handle more scenarios (fixes #2746) (Gyandeep Singh) -* Update: Ignore JsDoc comments by default for `spaced-comment` (fixes #2766) (Gyandeep Singh) -* Fix: one-var 'never' option for mixed initialization (Fixes #2786) (Ian VanSchooten) -* Docs: Fix a minor typo in a prefer-const example (jviide) -* Fix: comma-dangle always-multiline: no comma right before the last brace (fixes #2091) (Benoît Zugmeyer) -* Fix: Allow blocked comments with markers and new-line (fixes #2777) (Gyandeep Singh) -* Docs: small fix in quote-props examples (Jose Roberto Vidal) -* Fix: object-shorthand rule should not warn for NFEs (fixes #2748) (Michael Ficarra) -* Fix: arraysInObjects for object-curly-spacing (fixes #2752) (Jamund Ferguson) -* Docs: Clarify --rule description (fixes #2773) (Nicholas C. Zakas) -* Fix: object literals in arrow function bodies (fixes #2702) (Jose Roberto Vidal) -* New: `constructor-super` rule (fixes #2720) (Toru Nagashima) -* New: `no-this-before-super` rule (fixes #2721) (Toru Nagashima) -* Fix: space-unary-ops flags expressions starting w/ keyword (fixes #2764) (Michael Ficarra) -* Update: Add block options to `lines-around-comment` rule (fixes #2667) (Gyandeep Singh) -* New: array-bracket-spacing (fixes #2226) (Jamund Ferguson) -* Fix: No-shadow rule duplicating error messages (fixes #2706) (Aliaksei Shytkin) - -v0.23.0 - June 14, 2015 - -* Build: Comment out auto publishing of release notes (refs #2640) (Ilya Volodin) -* Fix: "extends" within package.json (fixes #2754) (Gyandeep Singh) -* Upgrade: globals@8.0.0 (fixes #2759) (silverwind) -* Docs: eol-last docs fix (fixes #2755) (Gyandeep Singh) -* Docs: btmills is a reviewer (Nicholas C. Zakas) -* Build: Revert lock io.js to v2.1.0 (refs #2745) (Brandon Mills) -* New: computed-property-spacing (refs #2226) (Jamund Ferguson) -* Build: Pin Sinon version (fixes #2742) (Ilya Volodin) -* Fix: `prefer-const` treats `for-in`/`for-of` with the same way (Fixes #2739) (Toru Nagashima) -* Docs: Add links to team members profile (Gyandeep Singh) -* Docs: add team and ES7 info to readme (Nicholas C. Zakas) -* Fix: don't try to strip "line:" prefix from parser errors with no such prefix (fixes #2698) (Tim Cuthbertson) -* Fix: never ignore config comment options (fixes #2725) (Brandon Mills) -* Update: Add clarification to spaced-comment (refs #2588) (Greg Cochard) -* Update: Add markers to spaced-comment (fixes #2588) (Greg Cochard) -* Fix: no-trailing-spaces now handles skipBlankLines (fixes #2575) (Greg Cochard) -* Docs: Mark global-strict on by default (fixes #2629) (Ilya Volodin) -* New: Allow extends to be an array (fixes #2699) (Justin Morris) -* New: globals@7.1.0 (fixes #2682) (silverwind) -* New: `prefer-const` rule (fixes #2333) (Toru Nagashima) -* Fix: remove hard-coded list of unary keywords in space-unary-ops rule (fixes #2696) (Tim Cuthbertson) -* Breaking: Automatically validate rule options (fixes #2595) (Brandon Mills) -* Update: no-lone-blocks does not report block-level scopes (fixes #2119) (Jose Roberto Vidal) -* Update: yoda onlyEquality option (fixes #2638) (Denis Sokolov) -* Docs: update comment to align with source code it's referencing (Michael Ficarra) -* Fix: Misconfigured default option for lines-around-comment rule (fixes #2677) (Gyandeep Singh) -* Fix: `no-shadow` allows shadowing in the TDZ (fixes #2568) (Toru Nagashima) -* New: spaced-comment rule (fixes #1088) (Gyandeep Singh) -* Fix: Check unused vars in exported functions (fixes #2678) (Gyandeep Singh) -* Build: Stringify payload of release notes (fixes #2640) (Greg Cochard) -* Fix: Allowing u flag in regex to properly lint no-empty-character-class (fixes #2679) (Dominic Barnes) -* Docs: deprecate no-wrap-func (fixes #2644) (Jose Roberto Vidal) -* Docs: Fixing grammar: then -> than (E) -* Fix: trailing commas in object-curly-spacing (fixes #2647) (Jamund Ferguson) -* Docs: be consistent about deprecation status (Matthew Dapena-Tretter) -* Docs: Fix mistakes in object-curly-spacing docs (Matthew Dapena-Tretter) -* New: run processors when calling executeOnText (fixes #2331) (Mordy Tikotzky) -* Update: move executeOnText() tests to the correct describe block (fixes #2648) (Mordy Tikotzky) -* Update: add tests to assert that the preprocessor is running (fixes #2651) (Mordy Tikotzky) -* Build: Lock io.js to v2.1.0 (fixes #2653) (Ilya Volodin) - -v0.22.1 - May 30, 2015 - -* Build: Remove release notes auto-publish (refs #2640) (Ilya Volodin) - -v0.22.0 - May 30, 2015 - -* Upgrade: escope 3.1.0 (fixes #2310, #2405) (Toru Nagashima) -* Fix: “consistent-this” incorrectly flagging destructuring of `this` (fixes #2633) (David Aurelio) -* Upgrade: eslint-tester to 0.7.0 (Ilya Volodin) -* Update: allow shadowed references in no-alert (fixes #1105) (Mathias Schreck) -* Fix: no-multiple-empty-lines and template strings (fixes #2605) (Jamund Ferguson) -* New: object-curly-spacing (fixes #2225) (Jamund Ferguson) -* Docs: minor fix for one-var rule (Jamund Ferguson) -* Fix: Shared config being clobbered by other config (fixes #2592) (Dominic Barnes) -* Update: adds "functions" option to no-extra-parens (fixes #2477) (Jose Roberto Vidal) -* Docs: Fix json formatting for lines-around-comments rule (Gyandeep Singh) -* Fix: Improve around function/class names of `no-shadow` (fixes #2556, #2552) (Toru Nagashima) -* Fix: Improve code coverage (fixes #2590) (Ilya Volodin) -* Fix: Allow scoped configs to have sub-configs (fixes #2594) (Greg Cochard) -* Build: Add auto-update of release tag on github (fixes #2566) (Greg Cochard) -* New: lines-around-comment (fixes #1344) (Jamund Ferguson) -* Build: Unblock build by increasing code coverage (Ilya Volodin) -* New: accessor-pairs rule to object initializations (fixes #1638) (Gyandeep Singh) -* Fix: counting of variables statements in one-var (fixes #2570) (Mathias Schreck) -* Build: Add sudo:false for Travis (fixes #2582) (Ilya Volodin) -* New: Add rule schemas (refs #2179) (Brandon Mills) -* Docs: Fix typo in shareable-configs example (fixes #2571) (Ted Piotrowski) -* Build: Relax markdownlint rules by disabling style-only items (David Anson) -* Fix: Object shorthand rule incorrectly flagging getters/setters (fixes #2563) (Brad Dougherty) -* New: Add config validator (refs #2179) (Brandon Mills) -* New: Add worker environment (fixes #2442) (Ilya Volodin) -* New no-empty-character class (fixes #2508) (Jamund Ferguson) -* New: Adds --ignore-pattern option. (fixes #1742) (Patrick McElhaney) - -v0.21.2 - May 18, 2015 - -* 0.21.2 (Nicholas C. Zakas) -* Fix: one-var exception for ForStatement.init (fixes #2505) (Brandon Mills) -* Fix: Don't throw spurious shadow errors for classes (fixes #2545) (Jimmy Jia) -* Fix: valid-jsdoc rule to support exported functions (fixes #2522) (Gyandeep Singh) -* Fix: Allow scoped packages in configuration extends (fixes #2544) (Eric Isakson) -* Docs: Add chatroom to FAQ (Nicholas C. Zakas) -* Docs: Move Gitter badge (Nicholas C. Zakas) - -v0.21.1 - May 15, 2015 - -* 0.21.1 (Nicholas C. Zakas) -* Fix: loc obj in report fn expects column (fixes #2481) (Varun Verma) -* Build: Make sure that all md files end with empty line (fixes #2520) (Ilya Volodin) -* Added Gitter badge (The Gitter Badger) -* Fix: forced no-shadow to check all scopes (fixes #2294) (Jose Roberto Vidal) -* Fix: --init indent setting (fixes #2493) (Nicholas C. Zakas) -* Docs: Mention bundling multiple shareable configs (Nicholas C. Zakas) -* Fix: Not to override the required extended config object directly (fixes #2487) (Gyandeep Singh) -* Build: Update markdownlint dependency (David Anson) -* Docs: added recursive function example to no-unused-vars (Jose Roberto Vidal) -* Docs: Fix typo (then -> than) (Vladimir Agafonkin) -* Revert "Fix: sanitise Jekyll interpolation during site generation (fixes #2297)" (Nicholas C. Zakas) -* Fix: dot-location should use correct dot token (fixes #2504) (Mathias Schreck) -* Fix: Stop linebreak-style from crashing (fixes #2490) (James Whitney) -* Fix: rule no-duplicate-case problem with CallExpressions. (fixes #2499) (Matthias Osswald) -* Fix: Enable full support for eslint-env comments (refs #2134) (Ilya Volodin) -* Build: Speed up site generation (fixes #2475) (Ilya Volodin) -* Docs: Fixing trailing spaces (Fixes #2478) (Ilya Volodin) -* Docs: Update README FAQs (Nicholas C. Zakas) -* Fix: Allow comment before comma for comma-spacing rule (fixes #2408) (Gyandeep Singh) - -v0.21.0 - May 9, 2015 - -* 0.21.0 (Nicholas C. Zakas) -* New: Shareable configs (fixes #2415) (Nicholas C. Zakas) -* Fix: Edge cases for no-wrap-func (fixes #2466) (Nicholas C. Zakas) -* Docs: Update ecmaFeatures description (Nicholas C. Zakas) -* New: Add dot-location rule. (fixes #1884) (Greg Cochard) -* New: Add addPlugin method to CLI-engine (Fixes #1971) (Ilya Volodin) -* Breaking: Do not check unset declaration types (Fixes #2448) (Ilya Volodin) -* Fix: no-redeclare switch scoping (fixes #2337) (Nicholas C. Zakas) -* Fix: Check extra scope in no-use-before-define (fixes #2372) (Nicholas C. Zakas) -* Fix: Ensure baseConfig isn't changed (fixes #2380) (Nicholas C. Zakas) -* Fix: Don't warn for member expression functions (fixes #2402) (Nicholas C. Zakas) -* New: Adds skipBlankLines option to the no-trailing-spaces rule (fixes #2303) (Andrew Vaughan) -* Fix: Adding exception for last line (Refs #2423) (Greg Cochard) -* Fix: crash on 0 max (fixes #2423) (gcochard) -* Fix object-shorthand arrow functions (fixes #2414) (Jamund Ferguson) -* Fix: Improves detection of self-referential functions (fixes #2363) (Jose Roberto Vidal) -* Update: key-spacing groups must be consecutive lines (fixes #1728) (Brandon Mills) -* Docs: grammar fix in no-sync (Tony Lukasavage) -* Docs: Update configuring.md to fix incorrect link. (Ans) -* New: Check --stdin-filename by ignore settings (fixes #2432) (Aliaksei Shytkin) -* Fix: `no-loop-func` rule allows functions at init part (fixes #2427) (Toru Nagashima) -* New: Add init command (fixes #2302) (Ilya Volodin) -* Fix: no-irregular-whitespace should work with irregular line breaks (fixes #2316) (Mathias Schreck) -* Fix: generator-star-spacing with class methods (fixes #2351) (Brandon Mills) -* New: no-unneeded-ternary rule to disallow boolean literals in conditional expressions (fixes #2391) (Gyandeep Singh) -* Docs: Add `restParams` to `ecmaFeatures` options list (refs: #2346) (Bogdan Savluk) -* Fix: space-in-brackets Cannot read property 'range' (fixes #2392) (Gyandeep Singh) -* Docs: Sort the rules (Lukas Böcker) -* Add: Exception option for `no-extend-native` and `no-native-reassign` (fixes #2355) (Gyandeep Singh) -* Fix: space-in-brackets import declaration (fixes #2378) (Gyandeep Singh) -* Update: Add uninitialized and initialized options (fixes #2206) (Ian VanSchooten) -* Fix: brace-style to not warn about curly mix ifStatements (fixes #1739) (Gyandeep Singh) -* Fix: npm run profile script should use espree (fixes #2150) (Mathias Schreck) -* New: Add support for extending configurations (fixes #1637) (Espen Hovlandsdal) -* Fix: Include string literal keys in object-shorthand (Fixes #2374) (Jamund Ferguson) -* Docs: Specify language for all code fences, enable corresponding markdownlint rule. (David Anson) -* New: linebreak-style rule (fixes #1255) (Erik Müller) -* Update: Add "none" option to operator-linebreak rule (fixes #2295) (Casey Visco) -* Fix: sanitise Jekyll interpolation during site generation (fixes #2297) (Michael Ficarra) - -v0.20.0 - April 24, 2015 - -* 0.20.0 (Nicholas C. Zakas) -* Fix: support arrow functions in no-extra-parens (fixes #2367) (Michael Ficarra) -* Fix: Column position in space-infix-ops rule (fixes #2354) (Gyandeep Singh) -* Fix: allow plugins to be namespaced (fixes #2360) (Seth Pollack) -* Update: one-var: enable let & const (fixes #2301) (Joey Baker) -* Docs: Add meteor to avaiable environments list (bartmichu) -* Update: Use `Object.assign()` polyfill for all object merging (fixes #2348) (Sindre Sorhus) -* Docs: Update markdownlint dependency, resolve/suppress new issues. (David Anson) -* Fix: newline-after-var declare and export (fixes #2325) (Gyandeep Singh) -* Docs: Some typos and grammar. (AlexKVal) -* Fix: newline-after-var to ignore declare in for specifiers (fixes #2317) (Gyandeep Singh) -* New: add --stdin-filename option (fixes #1950) (Mordy Tikotzky) -* Fix: Load .eslintrc in $HOME only if no other .eslintrc is found (fixes #2279) (Jasper Woudenberg) -* Fix: Add `v8` module to no-mixed-requires rule (fixes #2320) (Gyandeep Singh) -* Fix: key-spacing with single properties (fixes #2311) (Brandon Mills) -* Docs: `no-invalid-regexp`: add `ecmaFeatures` flags for `u`/`y` (Jordan Harband) -* New: object-shorthand rule (refs: #1617) (Jamund Ferguson) -* Update: backticks support for quotes rule (fixes #2153) (borislavjivkov) -* Fix: space-in-brackets to work with modules (fixes #2216) (Nicholas C. Zakas) - -v0.19.0 - April 11, 2015 - -* 0.19.0 (Nicholas C. Zakas) -* Upgrade: Espree to 2.0.1 (Nicholas C. Zakas) -* Docs: Update one-var documentation (fixes #2210) (Nicholas C. Zakas) -* Update: Add test for no-undef (fixes #2214) (Nicholas C. Zakas) -* Fix: Report better location for padded-blocks error (fixes #2224) (Nicholas C. Zakas) -* Fix: Don't check concise methods in quote-props (fixes #2251) (Nicholas C. Zakas) -* Fix: Consider tabs for space-in-parens rule (fixes #2191) (Josh Quintana) -* Fix: block-scoped-var to work with classes (fixes #2280) (Nicholas C. Zakas) -* Docs: Remove trailing spaces, enable corresponding markdownlint rule. (David Anson) -* Fix: padded-blocks with ASI (fixes #2273) (Brandon Mills) -* Fix: Handle comment lines in newline-after-var (fixed #2237) (Casey Visco) -* Docs: Standardize on '*' for unordered lists, enable corresponding markdownlint rule. (David Anson) -* Fix: no-undef and no-underscore-dangle to use double quotes (fixes #2258) (Gyandeep Singh) -* Docs: Improve grammar and style in comma-dangle.md (Nate Eagleson) -* Docs: Improve grammar and style in padded-blocks.md (Nate Eagleson) -* Docs: Update URL in no-wrap-func.md to resolve 404 (Nate Eagleson) -* Docs: Fix typo in command-line-interface.md (Nate Eagleson) -* Docs: Fix typo in working-with-rules.md (Nate Eagleson) -* Docs: Remove hard tabs from *.md, enable corresponding markdownlint rule. (David Anson) -* Fix: Function id missing in parent scope when using ecmaFeature `modules` for rule block-scoped-var (fixes #2242) (Michael Ferris) -* Fix: Ignore single lines for vertical alignment (fixes #2018) (Ian VanSchooten) -* Fix: Allow inline comments in newline-after-var rule (fixes #2229) (Casey Visco) -* Upgrade: Espree 2.0.0 and escope 3.0.0 (fixes #2234, fixes #2201, fixes (Nicholas C. Zakas) -* Docs: Update --no-ignore warning (Brandon Mills) -* Build: Remove jshint files (fixes #2222) (Jeff Tan) -* Docs: no-empty fix comment change (refs #2188) (Gyandeep Singh) -* Fix: duplicate semi and no-extra-semi errors (fixes #2207) (Brandon Mills) -* Docs: Update processors description (Nicholas C. Zakas) -* Fix: semi error on export declaration (fixes #2194) (Brandon Mills) -* New: operator-linebreak rule (fixes #1405) (Benoît Zugmeyer) -* Docs: Fixing broken links in documentation (Ilya Volodin) -* Upgrade: Espree to 0.12.3 (fixes #2195) (Gyandeep Singh) -* Fix: camelcase rule with {properties: never} shouldn't check assignment (fixes #2189) (Gyandeep Singh) -* New: Allow modifying base config (fixes #2143) (Meo) -* New: no-continue rule (fixes #1945) (borislavjivkov) -* Fix: `no-empty` rule should allow any comments (fixes #2188) (Gyandeep Singh) -* Docs: Fix spell in camelcase doc (fixes #2190) (Gyandeep Singh) -* Fix: Require semicolon after import/export statements (fixes #2174) (Gyandeep Singh) -* Build: Add linting of Markdown files to "npm test" script (fixes #2182) (David Anson) -* Build: Fixing site generation (Ilya Volodin) -* Build: Fix gensite task to work even if files are missing (Nicholas C. Zakas) - -v0.18.0 - March 28, 2015 - -* 0.18.0 (Nicholas C. Zakas) -* Fix: Mark variables as used in module scope (fixes #2137) (Nicholas C. Zakas) -* Fix: arrow functions need wrapping (fixes #2113) (Nicholas C. Zakas) -* Fix: Don't crash on empty array pattern item (fixes #2111) (Nicholas C. Zakas) -* Fix: Don't error on destructured params (fixes #2051) (Nicholas C. Zakas) -* Docs: Fixing broken links (Ilya Volodin) -* Fix: no-constant-condition should not flag += (fixes #2155) (Nicholas C. Zakas) -* Fix: Ensure piped in code will trigger correct errors (fixes #2154) (Nicholas C. Zakas) -* Fix: block-scoped-var to handle imports (fixes #2087) (Nicholas C. Zakas) -* Fix: no-dupe-args to work with destructuring (fixes #2148) (Nicholas C. Zakas) -* Fix: key-spacing crash on computed properties (fixes #2120) (Brandon Mills) -* Fix: indent crash on caseless switch (fixes #2144) (Brandon Mills) -* Fix: Don't warn about destructured catch params (fixes #2125) (Nicholas C. Zakas) -* Update: Omit setter param from no-unused-vars (fixes #2133) (Nicholas C. Zakas) -* Docs: Cleaning dead links (Ilya Volodin) -* Docs: Moving documentation out of the repository and modifying build scripts (Ilya Volodin) -* Docs: Update link to Documentation (Kate Lizogubova) -* Docs: Adding back deprecated space-unary-word-ops documentation (Ilya Volodin) -* Fix: Unused recursive functions should be flagged (issue2095) (Nicholas C. Zakas) -* Breaking: Remove JSX support from no-undef (fixes #2093) (Nicholas C. Zakas) -* Fix: markVariableAsUsed() should work in Node.js env (fixes #2089) (Nicholas C. Zakas) -* New: Add "always" and "never" options to "one-var" rule. (fixes #1619) (Danny Fritz) -* New: newline-after-var rule (fixes #2057) (Gopal Venkatesan) -* Fix: func-names with ES6 classes (fixes #2103) (Marsup) -* Fix: Add "Error" to the "new-cap" rule exceptions (fixes #2098) (Mickaël Tricot) -* Fix: vars-on-top conflict with ES6 import (fixes #2099) (Gyandeep Singh) -* Docs: Fixed JSON syntax (Sajin) -* New: space-before-function-paren rule (fixes #2028) (Brandon Mills) -* Breaking: rule no-empty also checking for empty catch blocks. (fixes #1841) (Dieter Oberkofler) -* Update: rule camelcase to allow snake_case in object literals. (fixes #1919) (Dieter Oberkofler) -* New: Added option int32Hint for space-infix-ops (fixes #1295) (Kirill Efimov) -* New: no-param-reassign rule (fixes #1599) (Nat Burns) - -v0.17.1 - March 17, 2015 - -* 0.17.1 (Nicholas C. Zakas) -* Fix: no-func-assign should not fail on import declarations (fixes #2060) (Igor Zalutsky) -* Fix: block-scoped-var to work with destructuring (fixes #2059) (Nicholas C. Zakas) -* Fix: no-redeclare should check Node.js scope (fixes #2064) (Nicholas C. Zakas) -* Fix: space-before-function-parentheses generator methods (fixes #2082) (Brandon Mills) -* Fix: Method name resolution in complexity rule (fixes #2049) (Nicholas C. Zakas) -* Fix: no-unused-vars crash from escope workaround (fixes #2042) (Brandon Mills) -* Fix: restrict dot-notation keywords to actual ES3 keywords (fixes #2075) (Michael Ficarra) -* Fix: block-scoped-var to work with classes (fixes #2048) (Nicholas C. Zakas) -* Docs: Update no-new documentation (fixes #2044) (Nicholas C. Zakas) -* Fix: yoda range exceptions with this (fixes #2063) (Brandon Mills) -* Docs: Fix documentation on configuring eslint with comments (Miguel Ping) -* Fix: rule no-duplicate-case problem with MemberExpressions. (fixes #2038) (Dieter Oberkofler) -* Fix: Exempt \0 from no-octal-escape (fixes #1923) (Michael Ficarra) - -v0.17.0 - March 14, 2015 - -* 0.17.0 (Nicholas C. Zakas) -* Fix: module import specifiers should be defined (refs #1978) (Nicholas C. Zakas) -* Fix: Ignore super in no-undef (refs #1968) (Nicholas C. Zakas) -* Upgrade: Espree to v0.12.0 (refs #1968) (Nicholas C. Zakas) -* Fix: destructured arguments should work in block-scoped-var (fixes #1996) (Nicholas C. Zakas) -* Fix: Line breaking with just carriage return (fixes #2005) (Nicholas C. Zakas) -* Fix: location of new-cap error messages (fixes #2025) (Mathias Schreck) -* Breaking: Stop checking JSX variable use, expose API instead (fixes #1911) (Glen Mailer) -* Fix: Check spacing of class methods (fixes #1989) (Nicholas C. Zakas) -* New: no-duplicate-case rule to disallow a duplicate case label (fixes #2015) (Dieter Oberkofler) -* Clarify issue requirement for doc pull requests (Ian) -* Add quotes around object key (Ian) -* Fix: Add comma-dangle allow-multiline (fixes #1984) (Keith Cirkel) -* Fix: Don't explode on default export function (fixes #1985) (Nicholas C. Zakas) -* Update: Add AST node exceptions to comma-style. (fixes #1932) (Evan Simmons) -* Docs: Add spread operator to available language options (Nicholas C. Zakas) -* New: generator-star-spacing rule (fixes #1680, fixes #1949) (Brandon Mills) - -v0.16.2 - March 10, 2015 - -* 0.16.2 (Nicholas C. Zakas) -* Fix: Ensure globalReturn isn't on when node:false (fixes #1995) (Nicholas C. Zakas) -* Downgrade: escope pegged to 2.0.6 (refs #2001) (Nicholas C. Zakas) -* Upgrade: escope to 2.0.7 (fixes #1978) (Nicholas C. Zakas) -* Docs: Update descriptive text for --no-ignore option. (David Anson) -* Upgrade: estraverse to latest for ESTree support (fixes #1986) (Nicholas C. Zakas) -* Fix: Global block-scope-var check should work (fixes #1980) (Nicholas C. Zakas) -* Fix: Don't warn about parens around yield (fixes #1981) (Nicholas C. Zakas) - -v0.16.1 - March 8, 2015 - -* 0.16.1 (Nicholas C. Zakas) -* Fix: Node.js scoping in block-scoped-var (fixes #1969) (Nicholas C. Zakas) -* Update: Enable ES6 scoping for more options (Nicholas C. Zakas) -* Fix: Ensure all export nodes are traversable (fixes #1965) (Nicholas C. Zakas) -* Fix: Ensure class names are marked as used (fixes #1967) (Nicholas C. Zakas) -* Fix: remove typo that caused a crash (fixes #1963) (Fabricio C Zuardi) -* Docs: Added missing "are" (Sean Wilkinson) - -v0.16.0 - March 7, 2015 - -* 0.16.0 (Nicholas C. Zakas) -* Fix: Pass correct sourceType to escope (fixes #1959) (Nicholas C. Zakas) -* Fix: Scoping for Node.js (fixes #892) (Nicholas C. Zakas) -* Fix: strict rule should honor module code (fixes #1956) (Nicholas C. Zakas) -* New: Add es6 environment (fixes #1864, fixes #1944) (Nicholas C. Zakas) -* Docs: Update ecmaFeatures list (fixes #1942) (Nicholas C. Zakas) -* Fix: Make no-unused-vars ignore exports (fixes #1903) (Nicholas C. Zakas) -* Upgrade: Espree to v1.11.0 (Nicholas C. Zakas) -* Fix: Comment configuration of rule doesn't work (fixes #1792) (Jary) -* Fix: Rest args should work in no-undef and block-scoped-var (fixes #1543) (Nicholas C. Zakas) -* Breaking: change no-comma-dangle to comma-dangle (fixes #1350) (Mathias Schreck) -* Update: space-before-function-parentheses to support generators (fixes #1929) (Brandon Mills) -* New: Adding support for "// eslint-disable-line rule" style comments (Billy Matthews) -* Fix: Use unversioned sinon file in browser test (fixes #1947) (Nicholas C. Zakas) -* Docs: Add mention of compatible parsers (Nicholas C. Zakas) -* Fix: Better error when given null as rule config (fixes #1760) (Glen Mailer) -* Update: no-empty to check TryStatement.handler (fixes #1930) (Brandon Mills) -* Fix: space-before-function-parentheses and object methods (fixes #1920) (Brandon Mills) -* New: no-dupe-args rule (fixes #1880) (Jamund Ferguson) -* Fix: comma-spacing should ignore JSX text (fixes #1916) (Brandon Mills) -* Breaking: made eol-last less strict (fixes #1460) (Glen Mailer) -* New: generator-star middle option (fixes #1808) (Jamund Ferguson) -* Upgrade: Espree to 1.10.0 for classes support (Nicholas C. Zakas) -* Docs: no-plusplus.md - auto semicolon insertion (Miroslav Obradović) -* Docs: Use union types in TokenStore JSDoc (refs #1878) (Brandon Mills) -* Fix: block-scoped-var to work with destructuring (fixes #1863) (Nicholas C. Zakas) -* Docs: Update docs for token-related methods (fixes #1878) (Nicholas C. Zakas) -* Update: Remove preferGlobal from package.json (fixes #1877) (Nicholas C. Zakas) -* Fix: allow block bindings in no-inner-declarations (fixes #1893) (Roberto Vidal) -* Fix: getScope and no-use-before-define for arrow functions (fixes #1895) (Brandon Mills) -* Fix: Make no-inner-declarations look for arrow functions (fixes #1892) (Brandon Mills) -* Breaking: Change no-space-before-semi to semi-spacing and add "after" option (fixes #1671) (Mathias Schreck) -* Update: Add support for custom preprocessors (fixes #1817) (Ilya Volodin) - -v0.15.1 - February 26, 2015 - -* 0.15.1 (Nicholas C. Zakas) -* Build: Fix release task (Nicholas C. Zakas) -* Fix: check all semicolons in no-space-before-semi (fixes #1885) (Mathias Schreck) -* Fix: Refactor comma-spacing (fixes #1587, fixes #1845) (Roberto Vidal) -* Fix: Allow globalReturn in consistent-return (fixes #1868) (Brandon Mills) -* Fix: semi rule should check throw statements (fixes #1873) (Mathias Schreck) -* Docs: Added HolidayCheck AG as user (0xPIT) -* Upgrade: `chalk` to 1.0.0 (Sindre Sorhus) -* Docs: Add CustomInk to the list of companies (Derek Lindahl) -* Docs: Alphabetize project & company usage list (Derek Lindahl) -* Docs: fix typo (Henry Zhu) -* Docs: Fix typo (Brenard Cubacub) - -v0.15.0 - February 21, 2015 - -* 0.15.0 (Nicholas C. Zakas) -* Upgrade: Espree to 1.9.1 (fixes #1816, fixes #1805) (Nicholas C. Zakas) -* Fix: make rules work with for-of statements (fixes #1859) (Mathias Schreck) -* Fix: Enable globalReturn for Node.js environment (fixes #1158) (Nicholas C. Zakas) -* Fix: Location of extra paren message (fixes #1814) (Nicholas C. Zakas) -* Fix: Remove unnecessary file exists check (fixes #1831) (Nicholas C. Zakas) -* Fix: Don't count else-if in max-depth (fixes #1835) (Nicholas C. Zakas) -* Fix: Don't flag for-of statement (fixes #1852) (Nicholas C. Zakas) -* Build: Test using io.js as well (Nicholas C. Zakas) -* Change customformat value to path (suisho) -* Docs: Add a missing word in the Contributing doc (Ben Linskey) -* Docs: Fix typo in wrap-iife rule doc title (Ben Linskey) -* Docs: Update pages to fix rendering of lists (David Anson) -* Fix: new-cap should allow defining exceptions (fixes #1424) (Brian Di Palma) -* Update: Add requireReturnDescription for valid-jsdoc (fixes #1833) (Brian Di Palma) -* New: rule no-throw-literal added (fixes #1791) (Dieter Oberkofler) -* New: multi-line option for the curly rule (fixes #1812) (Hugo Wood) -* Docs: fix typo in configuring docs (mendenhallmagic) -* Update: Backslashes in path (fixes #1818) (Jan Schär) -* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) -* Docs: add webpack loader to the docs/integrations page (Maxime Thirouin) -* Breaking: space-before-function-parentheses replaces space-after-function-name and checkFunctionKeyword (fixes #1618) (Mathias Schreck) - -v0.14.1 - February 8, 2015 - -* 0.14.1 (Nicholas C. Zakas) -* Fix: Exit code should be 1 for any number of errors (fixes #1795) (Nicholas C. Zakas) -* Fix: Check indentation of first line (fixes #1796) (Nicholas C. Zakas) -* Fix: strict rules shouldn't throw on arrow functions (fixes #1789) (Nicholas C. Zakas) - -v0.14.0 - February 7, 2015 - -* 0.14.0 (Nicholas C. Zakas) -* Update: Fix indentation of comment (Nicholas C. Zakas) -* Fix: comma-spacing for template literals (fixes #1736) (Nicholas C. Zakas) -* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) -* Breaking: Remove node from results (fixes #957) (Nicholas C. Zakas) -* Breaking: Exit code is now error count (Nicholas C. Zakas) -* Docs: Correct getFormatter() documentation (refs #1723) (Nicholas C. Zakas) -* Update: Make rules work with arrow functions (fixes #1508, fixes #1509, fixes #1493) (Nicholas C. Zakas) -* Fix: Ensure template string references count (fixes #1542) (Nicholas C. Zakas) -* Fix: no-undef to work with arrow functions (fixes #1604) (Nicholas C. Zakas) -* Upgrade: Espree to version 1.8.0 (Nicholas C. Zakas) -* Fix: Don't throw error for arguments (fixes #1759) (Nicholas C. Zakas) -* Fix: Don't warn on computed nonliteral properties (fixes #1762) (Nicholas C. Zakas) -* New: Allow parser to be configured (fixes #1624) (Nicholas C. Zakas) -* Docs: Added double quotes for JSON keys for comma-spacing and key-spacing rule (Dmitry Polovka) -* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) -* Revert "New: Rule indent (fixes #1022)" (Nicholas C. Zakas) -* Update: fix eslint indentations (fixes #1770) (Dmitriy Shekhovtsov) -* Fix: Scoping issues for no-unused-vars (fixes #1741) (Nicholas C. Zakas) -* Docs: Added `eslint-enable` inline (Ivan Fraixedes) -* New: Add predefined Meteor globals (fixes #1763) (Johan Brook) -* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) -* Update: Check all assignments for consistent-this (fixes #1513) (Timothy Jones) -* Fix: Support exceptions in no-multi-spaces (fixes #1755) (Brandon Mills) -* Docs: Forgotten parentheses in code snippet (Ivan Fraixedes) -* Update: CLIEngine results include warning and error count (fixes #1732) (gyandeeps) -* Fix: Scoping issues for no-unused-vars (fixes #1733) (Nicholas C. Zakas) -* Update: Add getNodeByRangeIndex method (refs #1755) (Brandon Mills) -* Update: Replace getTokenByRange(Index->Start) (refs #1721) (Brandon Mills) -* Update: Fast-path for empty input (fixes #546) (Nicholas C. Zakas) -* Fix: Allow single line else-if (fixes #1739) (Nicholas C. Zakas) -* Fix: Don't crash when $HOME isn't set (fixes #1465) (Nicholas C. Zakas) -* Fix: Make no-multi-spaces work for every case (fixes #1603, fixes #1659) (Nicholas C. Zakas) -* Breaking: Show error and warning counts in stylish summary (fixes #1746) (Brandon Mills) -* Docs: fixed typo in no-lone-blocks docs (Vitor Balocco) -* Docs: fixed typo in consistent-return docs (Vitor Balocco) -* Breaking: remove implied eval check from no-eval (fixes #1202) (Mathias Schreck) -* Update: Improve CLIEngine.getFormatter() (refs #1723) (Nicholas C. Zakas) -* Docs: Add Backbone plugin link (Ilya Volodin) -* Docs: use npm's keyword route (Tom Vincent) -* Build: Update sitegen script (Closes #1725) (Ilya Volodin) - -v0.13.0 - January 24, 2015 - -* 0.13.0 (Nicholas C. Zakas) -* Update: The rule spaced-line-comment now also allows tabs and not only spaces as whitespace. (fixes #1713) (Dieter Oberkofler) -* Docs: add Jasmine rules and eslintplugin npm links (Tom Vincent) -* Fix: Make no-redeclare work with let (fixes #917) (Nicholas C. Zakas) -* Update: Add CLIEngine.getFormatter() (fixes #1653) (Nicholas C. Zakas) -* Breaking: Update escope (fixes #1642) (Nicholas C. Zakas) -* Update: Switch to using estraverse-fb (fixes #1712) (Nicholas C. Zakas) -* Docs: Update README FAQ (Nicholas C. Zakas) -* Update: no-warning-comments matches on whole word only (fixes #1709) (Nick Fisher) -* Build: Add JSDoc generation (fixes #1363) (Nicholas C. Zakas) -* Docs: Add more info about context (fixes #1330) (Nicholas C. Zakas) -* Upgrade: Espree to 1.7.1 (fixes #1706) (Nicholas C. Zakas) -* Docs: Make CLA notice more prominent (Nicholas C. Zakas) -* Update: Added globals for: phantom,jquery, prototypejs, shelljs (fixes #1704) (Dmitriy Shekhovtsov) -* Docs: Fixed example for the space-return-throw-case rule (mpal9000) -* Fix: Except object literal methods from func-names (fixes #1699) (Brandon Mills) -* Update: use global strict mode everywhere (fixes #1691) (Brandon Mills) -* Update: Add allowPattern option for dot-notation rule (fixes #1679) (Tim Schaub) -* Fix: Missing undeclared variables in JSX (fixes #1676) (Yannick Croissant) -* Fix: no-unused-expressions rule incorrectly flagging yield (fixes #1672) (Rémi Gérard-Marchant) -* Update: Combine strict mode rules (fixes #1246) (Brandon Mills) -* Fix: disregards leading './' in ignore pattern or file name (fixes #1685) (Chris Montrois) -* Upgrade: globals module to latest (fixes #1670) (Nicholas C. Zakas) -* Fix: generator-star should allow params (fixes #1677) (Brandon Mills) -* Fix: no-unused-vars for JSX (fixes #1673 and fixes #1534) (Yannick Croissant) -* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) - -v0.12.0 - January 17, 2015 - -* 0.12.0 (Nicholas C. Zakas) -* Fix: Track JSX global variable correctly (fixes #1534) (Nicholas C. Zakas) -* Fix: Property regex flag checking (fixes #1537) (Nicholas C. Zakas) -* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) -* Update: Expose ecmaFeatures on context (fixes #1648) (Nicholas C. Zakas) -* Docs: Added Fitbit to the list of companies (Igor Zalutsky) -* New: gen-star rule (refs #1617) (Jamund Ferguson) -* New: no-var rule (refs #1617) (Jamund Ferguson) -* Fix: Support JSX spread operator (fixes #1634) (Nicholas C. Zakas) -* Docs: Document ecmaFeatures (Nicholas C. Zakas) -* Upgrade: several dependencies (fixes #1377) (Nicholas C. Zakas) -* Fix: Broken JSX test (Nicholas C. Zakas) -* Fix: no-bitwise reports on bitwise assignment expressions (fixes #1643) (Mathias Schreck) -* Fix: Find JSXIdentifier refs in no-unused-vars (fixes #1534) (Nicholas C. Zakas) -* Update: Add a couple JSX tests (Nicholas C. Zakas) -* Fix: quotes rule ignores JSX literals (fixes #1477) (Nicholas C. Zakas) -* Fix: Don't warn on JSX literals with newlines (fixes #1533) (Nicholas C. Zakas) -* Update: Fully enable JSX support (fixes #1640) (Nicholas C. Zakas) -* Breaking: Allow parser feature flips (fixes #1602) (Nicholas C. Zakas) -* Fix: Allow comments in key-spacing groups (fixes #1632) (Brandon Mills) -* Fix: block-scoped-var reports labels (fixes #1630) (Michael Ficarra) -* Docs: add newline to no-process-env (fixes #1627) (Tom Vincent) -* Fix: Update optionator, --no in help (fixes #1134) (George Zahariev) -* Fix: Allow individual newlines in space-in-brackets (fixes #1614) (Brandon Mills) -* Docs: Correct alignment in example project tree (Tim Schaub) -* Docs: Remove references to Esprima (Nicholas C. Zakas) -* Docs: Remove illegal code fence (Nicholas C. Zakas) - -v0.11.0 - December 30, 2014 - -* 0.11.0 (Nicholas C. Zakas) -* Fix: Adding regexp literal exception (fixes #1589) (Greg Cochard) -* Fix: padded-blocks incorrectly complained on comments (fixes #1416) (Mathias Schreck) -* Fix: column location of key-spacing with additional tokens (fixes #1458) (Mathias Schreck) -* Build: tag correct commit (refs #1606) (Mathias Schreck) -* Upgrade: Updat Espree to 1.3.1 (Nicholas C. Zakas) -* Fix: add es3 config option to dot-notation rule (fixes #1484) (Michael Ficarra) -* Fix: valid-jsdoc should recognize @class (fixes #1585) (Nicholas C. Zakas) -* Update: Switch to use Espree (fixes #1595) (Nicholas C. Zakas) -* Fix: brace-style stroustrup should report on cuddled elseif (fixes #1583) (Ian Christian Myers) -* New: Configuration via package.json (fixes #698) (Michael Mclaughlin) -* Update: Set environments w/ globals (fixes #1577) (Elan Shanker) -* Fix: yoda treats negative numbers as literals (fixes #1571) (Brandon Mills) -* Fix: function arguments now count towards no-shadow check (fixes #1584) (Glen Mailer) -* Fix: check if next statement is on newline when warning against extra semicolons. (fixes #1580) (Evan You) -* Update: add yoda exception for range tests (fixes #1561) (Brandon Mills) -* New: space-after-function-name (fixes #1340) (Roberto Vidal) - -v0.10.2 - December 12, 2014 - -* 0.10.2 (Nicholas C. Zakas) -* Fix: detect for...in in no-loop-func (fixes #1573) (Greg Cochard) -* Update: simplify comma-spacing logic (fixes #1562) (Brandon Mills) -* Fix: operator-assignment addition is non-commutative (fixes#1556) (Brandon Mills) -* 0.10.1 (Nicholas C. Zakas) -* Update: Add new-cap exception configurations. (Fixes #1487) - `newCapsAllowed` - `nonNewCapsAllowed` (Jordan Harband) - -v0.10.1 - December 6, 2014 - -* 0.10.1 (Nicholas C. Zakas) -* Docs: Fix v0.10.0 changelog (Nicholas C. Zakas) -* Build: Ensure changelog works with large semver versions (Nicholas C. Zakas) -* Fix: comma-spacing and comma-style to work with array literals (fixes #1492) (Nicholas C. Zakas) -* Update: better operator regex in use-isnan rule (fixes #1551) (Michael Ficarra) -* Fix: wrong op index in no-multi-spaces (fixes #1547) (Brandon Mills) -* Fix: Restrict use-isnan violations to comparison operators. (Fixes #1535) (Jordan Harband) -* Fix: comma-spacing has false positives when parenthesis are used (fixes #1457) (Jamund Ferguson) -* Docs: alphabetize the "Stylistic Issues" section (Jeff Williams) -* Build: make the "gensite" target work when DOCS_DIR does not exist (fixes #1530) (Jeff Williams) -* Docs: badges should only refer to master branch (Mathias Schreck) -* Fix: prevent crash on empty blocks in no-else-return (fixes #1527) (Mathias Schreck) -* Build: Fix md to html conversion regex (fixes #1525) (Brandon Mills) -* 0.10.0 (Nicholas C. Zakas) - -v0.10.0 - November 27, 2014 - -* 0.10.0 (Nicholas C. Zakas) -* Fix: Add Object and Function as exceptions in new-cap (refs #1487) (Nicholas C. Zakas) -* Breaking: Allow extensionless files to be passed on CLI (fixes #1131) (Nicholas C. Zakas) -* Fix: typo: iffe to iife, none to non (Michael Ficarra) -* Update: refactor tokens API (refs #1212) (Brandon Mills) -* New: Allow other file extensions (fixes #801) (Nicholas C. Zakas) -* Update: Add Event to browser globals (fixes #1474) (Nicholas C. Zakas) -* Fix: check function call arguments in comma-spacing (fixes #1515) (Mathias Schreck) -* Update: Add no-cond-assign option to disallow nested assignments in conditionals (fixes #1444) (Jeff Williams) -* Fix: crash in no-multi-spaces on empty array elements (fixes #1418) (Brandon Mills) -* Fix: Don't explode on directory traversal (fixes #1452) (Nicholas C. Zakas) -* Fix: no-fallthrough should work when semis are missing (fixes #1447) (Nicholas C. Zakas) -* Fix: JSDoc parsing by updating doctrine (fixes #1442) (Nicholas C. Zakas) -* Update: restore the "runs" global present in Jasmine 1.3 (fixes #1498) (Michał Gołębiowski) -* Fix: ignore undefined identifiers in typeof (fixes #1482) (Mathias Schreck) -* Fix: Ignoring empty comments. (fixes #1488) (Greg Cochard) -* New: Add space-unary-ops rules (#1346) (Marcin Kumorek) -* Update: Remove shebang workaround in spaced-line-comment (fixes #1433) (Michael Ficarra) -* Docs: change 'and' to 'an' in docs/rules/valid-jsdoc.md (fixes #1441) (Michael Ficarra) -* Update: Add `beforeAll` and `afterAll` to the Jasmine globals (fixes #1478) (Gyandeep Singh) -* Update: Add exception options to space-in-parens (fixes #1368) (David Clark) -* Build: Add check for license issues (fixes #782) (Brandon Mills) -* Docs: update badges (Yoshua Wuyts) -* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) -* Fix: env rules merging for command line config (fixes #1271) (Roberto Vidal) -* Fix: Collect variables declare in switch-case.(fixes #1453) (chris) -* Fix: remove extra capture group (Nate-Wilkins) -* Update: allow distinct alignment groups in key-spacing (fixes #1439) (Brandon Mills) -* Fix: message for numeric property names in quote-props (fixes #1459) (Brandon Mills) -* Docs: Remove assumption about the rule config (Alexander Schmidt) -* New: Add ability to time individual rules (fixes #1437) (Brandon Mills) -* Fix: single quotes (Nate-Wilkins) -* Docs: Fix broken code fences in key-spacing docs (Brandon Mills) -* Docs: Explain .eslintignore features (fixes #1094) (Brandon Mills) -* Breaking: ignore node_modules by default (fixes #1163) (Brandon Mills) -* Fix: Adds clamping to getSource beforeCount (fixes #1427) (Greg Gianforcaro) -* New: add no-inline-comment rule (fixes #1366) (Greg Cochard) -* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) -* Build: Filter and sort versions in gensite (fixes #1430) (Brandon Mills) -* Build: Escape period in regex (fixes #1428) (Brandon Mills) -* Revert "Fix: '.md' to '.html' with anchors (fixes #1415)" (Nicholas C. Zakas) -* 0.9.2 (Nicholas C. Zakas) -* New: Add operator-assignment rule (fixes #1420) (Brandon Mills) - -v0.9.2 - November 1, 2014 - -* 0.9.2 (Nicholas C. Zakas) -* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) -* Fix: Allow line breaks in key-spacing rule (fixes #1407) (Brandon Mills) -* Build: add coveralls integration (fixes #1411) (Mathias Schreck) -* Fix: add severity flag for ignored file warning (fixes #1401) (Mathias Schreck) -* Fix: Keep sinon at ~1.10.3 (fixes #1406) (Brandon Mills) -* Fix: ! negates .eslintignore patterns (fixes #1093) (Brandon Mills) -* Fix: let fs.stat throw if a file does not exist (fixes #1296) (Mathias Schreck) -* Fix: check switch statements in space-before-blocks (fixes #1397) (Mathias Schreck) -* Docs: fix rule name in example configuration (Mathias Schreck) -* Fix: disable colors during test run (fixes #1395) (Mathias Schreck) -* New: add isPathIgnored method to CLIEngine (fixes #1392) (Mathias Schreck) -* Docs: changing eslint to ESLint and add missing backtick (Mathias Schreck) -* Docs: Documents the functionality to load a custom formatter from a file (Adam Baldwin) -* 0.9.1 (Nicholas C. Zakas) -* Update: Option type for mixed tabs and spaces (fixes #1374) (Max Nordlund) -* Fix: Nested occurrences of no-else-return now show multiple reports (fixes #1369) (Jordan Hawker) - -v0.9.1 - October 25, 2014 - -* 0.9.1 (Nicholas C. Zakas) -* Docs: fix link on governance model (azu) -* Fix: plugins without rulesConfig causes crash (fixes #1388) (Mathias Schreck) -* 0.9.0 (Nicholas C. Zakas) - -v0.9.0 - October 24, 2014 - -* 0.9.0 (Nicholas C. Zakas) -* New: Allow reading from STDIN (fixes #368) (Nicholas C. Zakas) -* New: add --quiet option (fixes #905) (Mathias Schreck) -* Update: Add support for plugin default configuration (fixes #1358) (Ilya Volodin) -* Fix: Make sure shebang comment node is removed (fixes #1352) (Nicholas C. Zakas) -* New: Adding in rule for irregular whitespace checking. (fixes #1024) (Jonathan Kingston) -* Fix: space-in-parens should not throw for multiline statements (fixes #1351) (Jary) -* Docs: Explain global vs. local plugins (fixes #1238) (Nicholas C. Zakas) -* Docs: Add docs on Node.js API (fixes #1247) (Nicholas C. Zakas) -* Docs: Add recommended keywords for plugins (fixes #1248) (Nicholas C. Zakas) -* Update: Add CLIEngine#getConfigForFile (fixes #1309) (Nicholas C. Zakas) -* Update: turn on comma-style for project (fixes #1316) (Nicholas C. Zakas) -* Fix: Ensure messages are sorted by line (fixes #1343) (Nicholas C. Zakas) -* Update: Added arraysInObjects and objectsInObjects options to space-in-brackets rule (fixes #1265, fixes #1302) (vegetableman) -* Breaking: Removed comma spacing check from space-infix-ops (fixes #1361) (vegetableman) -* Fix: addressed linting errors (Nicholas C. Zakas) -* Docs: Add Contributor Model (fixes #1341) (Nicholas C. Zakas) -* Docs: Add reference to CLA (Nicholas C. Zakas) -* Build: add version numbers to docs (fixes #1170) (Mathias Schreck) -* Fix: no-fallthrough incorrectly flagged falls through annotations (fixes #1353) (Mathias Schreck) -* Build: separate site publishing form generation (fixes #1356) (Mathias Schreck) -* New: Add key-spacing rule (fixes #1280) (Brandon Mills) -* New: add spaced-line-comment rule (fixes #1345) (Greg Cochard) -* Docs: added more Related Rules sections (fixes #1347) (Delapouite) -* Fix: resolve linting issue in (fixes #1339) (Nicholas C. Zakas) -* New: add space-before-blocks rule (fixes #1277) (Mathias Schreck) -* Docs: Remove moot integration plugins (Sindre Sorhus) -* New: add rule for multiple empty lines (fixes #1254) (Greg Cochard) -* Fix: no-shadow rule should consider function expressions (fixes #1322) (Mathias Schreck) -* Update: remove globals present only in Jasmine plugins (fixes #1326) (Michał Gołębiowski) -* New: added no-multi-spaces rule (fixes #630) (vegetableman) -* New: Added comma-spacing rule (Fixes #628, Fixes #1319) (vegetableman) -* New: add rule for padded blocks (fixes #1278) (Mathias Schreck) -* Docs: fix eqeqeq isNullCheck comment (Denis Sokolov) -* Fix: no-comma-dangle violation in unit test and Makefile.js/lint not checking return codes (fixes #1306) (David Anson) -* Fix: allow comma-last with object properties having line breaks (fixes #1314) (vegetableman) -* New: Added comma-style rule (fixes #1282) (vegetableman) -* Update: add space after function keyword check (fixes #1276) (Mathias Schreck) -* Update: Add missing environments and fix sorting/grouping of rules (fixes #1307, fixes #1308) (David Anson) -* Docs: Fix sorting of rules within each section (David Anson) -* Docs: Correct a few misspelled words (David Anson) -* Docs: Update multiple pages to fix rendering of fenced code blocks (David Anson) -* New: Added no-process-env rule (fixes #657) (vegetableman) -* Fix: add rule ensuring #1258 is fixed by recent rewrite (fixes #1258) (Michael Ficarra) -* Update: split propertyName from singleValue in space-in-brackets (fixes #1253) (Michael Ficarra) -* Update: add "as-needed" option to quote-props rule (fixes #1279) (Michael Ficarra) -* Docs: fixed broken link and changed warning level to error level (vegetableman) -* Docs: Added "the native web" to the list of companies that use ESLint. (Golo Roden) -* Docs: Add BountySource badge to README (Nicholas C. Zakas) -* 0.8.2 (Nicholas C. Zakas) - -v0.8.2 - September 20, 2014 - -* 0.8.2 (Nicholas C. Zakas) -* Docs: Updated contribution guidelines to add accepted/bounty issues descriptions (Nicholas C. Zakas) -* Docs: Update README with links and FAQs (Nicholas C. Zakas) -* Docs: add finally to space-after-keywords documentation (Mathias Schreck) -* New: add ignoreCase option to sort-vars (fixes #1272) (Mathias Schreck) -* Docs: fix typo (Barry Handelman) -* Docs: Fix broken Markdown on configuration page (Nicholas C. Zakas) -* Docs: Fix reference to wrong rule name (Harry Wolff) -* Upgrade: Most dev dependencies (Nicholas C. Zakas) -* Upgrade: shelljs to 0.3.0 (Nicholas C. Zakas) -* Upgrade: doctrine to 0.5.2 (Nicholas C. Zakas) -* Upgrade: esprima to 1.2.2 (Nicholas C. Zakas) -* Upgrade: eslint-tester to latest (Nicholas C. Zakas) -* Fix: Load .eslintrc in directory with $HOME as an ancestor (fixes #1266) (Beau Gunderson) -* Fix: load .eslintrc from HOME (fixes #1262) (Beau Gunderson) -* New: Add sharable rule settings (fixes #1233) (Ilya Volodin) -* Upgrade: upgrade outdated dependencies (fixes #1251) (Mathias Schreck) -* Docs: fix typo in no-ex-assign documentation (Michael Ficarra) -* Docs: add intellij plugin to integrations (ido) -* Docs: Changing NPM to npm (Peter deHaan) -* Fix: strict should check function expressions (fixes #1244) (Brandon Mills) -* Docs: fix vars-on-top documentation (fixes #1234) (Mathias Schreck) -* 0.8.1 (Nicholas C. Zakas) -* Docs: Fixed a typo in brace-style.md (Anton Antonov) - -v0.8.1 - September 9, 2014 - -* 0.8.1 (Nicholas C. Zakas) -* Fix: Ensure exit code is 1 when there's a syntax error (fixes #1239) (Nicholas C. Zakas) -* Docs: fix up vars-on-top documentation (fixes #1234) (Michael Ficarra) -* Fix: vars-on-top directive support (fixes #1235) (Michael Ficarra) -* Fix: Avoid mutating node.range in max-len (fixes #1224) (Brandon Mills) -* Docs: Typo, add missing quotation mark (Ádám Lippai) -* Update: space-in-brackets to allow exceptions (fixes #1142) (Brandyn Bennett) -* 0.8.0 (Nicholas C. Zakas) - -v0.8.0 - September 5, 2014 - -* 0.8.0 (Nicholas C. Zakas) -* Perf-related revert "Fix: Speed up tokens API (refs #1212)" (Nicholas C. Zakas) -* Fix: no-fallthrough: continue affects control flow, too (fixes #1220) (Michael Ficarra) -* Fix: rewrite no-unused-vars rule (refs #1212) (Michael Ficarra) -* Fix: Error when there's a \r in .eslintrc (#1172) (Gyandeep Singh) -* Added rule disallowing reserved words being used as keys (fixes #1144) (Emil Bay) -* Fix: rewrite no-spaced-func rule (refs #1212) (Michael Ficarra) -* Fix: Speed up getScope() (refs #1212) (Brandon Mills) -* Fix: no-extra-strict behavior for named function expressions (fixes #1209) (Mathias Schreck) -* Add Date.UTC to allowed capitalized functions (David Brockman Smoliansky) -* New: Adding 'vars-on-top' rule (fixes #1148) (Gyandeep Singh) -* Fix: Speed up tokens API (refs #1212) (Brandon Mills) -* Docs: document plugin usage (fixes #1117) (Mathias Schreck) -* New: accept plugins from cli (fixes #1113) (Mathias Schreck) -* Docs: fix some typos. (Mathias Schreck) -* New: Load plugins from configs (fixes #1115). (Mathias Schreck) -* Fix: no-unused-expressions better directive detection (fixes #1195) (Michael Ficarra) -* Fix: no-unused-expressions directive support (fixes #1185) (Michael Ficarra) -* Update: Add 'allowSingleLine' option to brace-style (fixes #1089) (John Gozde) -* Docs: Spell checking and one extra closing curly in code example (Juga Paazmaya) -* Fix: mergeConfigs ensures the plugins property exists (fixes #1191). (Mathias Schreck) -* Update: Declare ES6 collections (Map, Set, WeakMap, WeakSet) as built-in globals (fixes #1189) (Michał Gołębiowski) -* New: Adding 'plugin' CLI option (fixes #1112) (Greg) -* Fix: Correct a typo in the error message in tests (Michał Gołębiowski) -* New: Add no-extra-bind rule to flag unnecessary bind calls (fixes #982) (Bence Dányi) -* Fix: Useless bind call in cli-engine (fixes #1181) (Bence Dányi) -* Docs: Updates `amd` description (fixes #1175) (James Whitney) -* New: Adds support for the `jasmine` env (fixes #1176) (James Whitney) -* Fix: for-in support to no-empty-label rule (fixes #1161) (Marc Harter) -* docs: Update link (Mathias Bynens) -* Fix: crash when loading empty eslintrc file (fixes #1164) (Michael Ficarra) -* Fix: no-unused-var should respect compound assignments (fixes #1166) (Michael Ficarra) -* Update: ES3 `ReservedWord`s (fixes #1151) Adds ES3 `ReservedWord`s to the list of keywords in the `dot-notation` rule (fixes #1151) (Emil Bay) -* Update: Update comment parser to read rule slashes (fixes #1116) (Jary) -* New: add no-void rule (fixes #1017). (Mike Sidorov) -* New: Add rules.import() (fixes #1114) (Mathias Schreck) -* New: Make mergeConfigs() merge plugin entries (fixes #1111) (Mathias Schreck) -* Breaking: Change no-global-strict to global-strict and add "always" option (fixes #989) (Brandon Mills) -* Fix: no-unreachable should check top-level statements (fixes #1138) (Brandon Mills) -* Fix: Speed up no-unreachable (fixes #1135) (Brandon Mills) -* New: advanced handle-callback-err configuration (fixes #1124) (Mathias Schreck) -* New: Expose CLIEngine (fixes #1083) (Gyandeep Singh) -* Docs: Add link to new Atom linter (fixes #1125) (Gil Pedersen) -* Fix: space-after-keywords checks finally of TryStatement (fixes #1122) (Michael Ficarra) -* Fix: space-after-keywords checks while of DoWhileStatement (fixes #1120) (Michael Ficarra) -* Fix: space-after-keywords w/ "never" should allow else-if (fixes #1118) (Michael Ficarra) -* Fix: dot-notation rule flags non-keyword reserved words (fixes #1102) (Michael Ficarra) -* Update: Use xml-escape instead of inline helper (Ref #848) (jrajav) -* Update: Added comments support to .eslintignore (fixes #1084) (Vitaly Puzrin) -* Update: enabled 'no-trailing-spaces' rule by default (fixes #1051) (Vitaly Puzrin) -* Breaking: Ignore children of all patterns by adding "/**" (Fixes #1069) (jrajav) -* Fix: skip dot files and ignored dirs on traverse (fixes #1077, related to #814) (Vitaly Puzrin) -* Docs: Added Gruntjs plugin on integrations page (Gyandeep Singh) -* Fix: don't break node offsets if hasbang present (fixes #1078) (Vitaly Puzrin) -* Build: Exclude readme/index from rules Resources generation (Fixes #1072) (jrajav) -* Docs: Change eol-last examples to `
` (Fixes #1068) (jrajav)
-* 0.7.4 (Nicholas C. Zakas)
-* New: space-in-parens rule (Closes #627) (jrajav)
-
-v0.7.4 - July 10, 2014
-
-* 0.7.4 (Nicholas C. Zakas)
-* Docs: Fix 'lintinging' typo and ref links (Tom Vincent)
-* Fix: Transform envs option to object in Config (Fixes #1064) (jrajav)
-* 0.7.3 (Nicholas C. Zakas)
-
-v0.7.3 - July 9, 2014
-
-* 0.7.3 (Nicholas C. Zakas)
-* Update: Address code review comment for strict rule (refs #1011) (Nicholas C. Zakas)
-* Docs: Update copyright policy (Nicholas C. Zakas)
-* Docs: Update documentation for max-len to include description of second option (fixes #1006) (Nicholas C. Zakas)
-* Fix: Avoid double warnings for strict rule (fixes #1011) (Nicholas C. Zakas)
-* Fix: Check envs for true/false (Fixes #1059) (jrajav)
-* 0.7.2 (Nicholas C. Zakas)
-
-v0.7.2 - July 8, 2014
-
-* 0.7.2 (Nicholas C. Zakas)
-* Fix: no-mixed-spaces-and-tabs incorrectly flagging multiline comments (fixes #1055) (Nicholas C. Zakas)
-* Fix: new-cap error that throws on non-string member (fixes #1056) (Nicholas C. Zakas)
-* Fix: Always make globals an object (Fixes #1049) (jrajav)
-* 0.7.1 (Nicholas C. Zakas)
-
-v0.7.1 - July 7, 2014
-
-* 0.7.1 (Nicholas C. Zakas)
-* Docs: Add Related Rules sections (Fixes #990) (jrajav)
-* Fix: Check output file isn't dir, fix tests (Fixes #1034) (jrajav)
-* Docs: Updated documentation for several rules (Nicholas C. Zakas)
-* Docs: Updated contributor guide and dev env setup guide (Nicholas C. Zakas)
-* Breaking: Implement configuration hierarchy (fixes #963) (Nicholas C. Zakas)
-* Update: greatly simplify eqeqeq's operator finding logic (fixes #1037) (Michael Ficarra)
-* New: Add getSourceLines() to core and rule context (fixed #1005) (Jary)
-* Build + Docs: Adding generated resource links to rule docs (Fixes #1021) (jrajav)
-* Fix: Ignore unused params for args: 'none' (Fixes #1026) (jrajav)
-* Fix: Point eqeqeq error at operator (Fixes #1029) (jrajav)
-* New: report output to a file (fixes #1027) (Gyandeep Singh)
-* Breaking: CLIEngine abstraction for CLI operations; formatters no longer are passed configs (fixes #935) (Nicholas C. Zakas)
-* Fix: Allow stdout to drain before exiting (fixes #317) (Nicholas C. Zakas)
-* New: add no-undefined rule (fixes #1020) (Michael Ficarra)
-* New: Added no-mixed-spaces-and-tabs rule (fixes #1003) (Jary)
-* New: Added no-trailing-spaces rule (fixes #995) (Vitaly Puzrin)
-* Update: Factor ignores out of Config (fixes #958) (jrajav)
-* Fix: rewrite eol-last rule (fixes #1007) (fixes #1008) (Michael Ficarra)
-* Fix: add additional IIFE exception in no-extra-parens (fixes #1004) (Michael Ficarra)
-* Docs: Removed reference to brace-style Stroustrup default (fixes #1000) (Caleb Troughton)
-* New: Added eol-last rule (Fixes #996) (Vitaly Puzrin)
-* Fix: Put rule severity in messages (Fixes #984); deprecates passing full config to Formatters (jrajav)
-* Fix: no-unused-vars to check only file globals (fixes #975) (Aliaksei Shytkin)
-* Build: Makefile - Check for rule ids in docs titles (Fixes #969) (Delapouite)
-* Docs: guard-for-in - added missing id in title (Fixes #969) (Delapouite)
-* Breaking: Change 'no-yoda' rule to 'yoda' and add "always" option (Fixes #959) (jrajav)
-* Fix: Fixes no-unused-vars to check /*globals*/ (Fixes #955) (jrajav)
-* Update: no-eval to also warn on setTimeout and setInterval (fixes #721) (Nicholas C. Zakas)
-* Remove: experimental match() method (Nicholas C. Zakas)
-* Update: space-in-brackets now always allows empty object and array literals to have no spaces (fixes #797) (Nicholas C. Zakas)
-* New: Allow the cli parameter "color" and "no-color" (fixes #954) (Tom Gallacher)
-* Fix: valid-jsdoc no more warning for multi-level params (Fixes #925) (Delapouite)
-* Update: Search parent directories for .eslintignore (Fixes #933) (jrajav)
-* Fix: Correct order of arguments passed to assert.equal (fixes #945) (Michał Gołębiowski)
-* Update: Write the summary in stylish formatter in yellow if no errors (fixes #906); test coloring of messages (Michał Gołębiowski)
-* Fix: Corrects configs merging into base config (Fixes #838) (jrajav)
-* Fix: Adding check if char is non-alphabetic to new-cap (Fixes #940) (jrajav)
-* Docs: Update about page description (fixes #936) (Nicholas C. Zakas)
-* Docs: Add '/', forgotten in first commit (Fixes #931) (jrajav)
-* Update: Rule `new-cap` checks capitalized functions (fixes #904) (Aliaksei Shytkin)
-* Docs: Mention allowed semicolons in "never" mode for 'semi' rule (fixes #931) (jrajav)
-* Docs: Mention Yeoman generator in dev setup (fixes #914) (Nicholas C. Zakas)
-* Build: Remove flaky perf test from Travis (Nicholas C. Zakas)
-* Breaking: Refactor .eslintignore functionality (refs #928, fixes #901, fixes #837, fixes #853) (Nicholas C. Zakas)
-* 0.6.2 (Nicholas C. Zakas)
-* Breaking: Remove JSON support for .eslintignore (fixes #883) (icebox)
-
-v0.6.2 - May 23, 2014
-
-* 0.6.2 (Nicholas C. Zakas)
-* Fix: Adding per-environment rule configs to docs and doc validation (Fixes #918) (jrajav)
-* Docs: Updated contribution guidelines (Nicholas C. Zakas)
-* Docs: Update description of eqeqeq to mention special cases (fixes #924) (Nicholas C. Zakas)
-* Fix: block-scoped-var CatchClause handling (fixes #922) (Michael Ficarra)
-* Fix: block-scoped-var respects decls in for and for-in (fixes #919) (Michael Ficarra)
-* Update: Implement eqeqeq option "allow-null" (fixes #910) (Michał Gołębiowski)
-* Fix: new-cap should allow non-alpha characters (fixes #897) (Michael Ficarra)
-* Update: Refactor ESLintTester to fix dependency hell (fixes #602) (Nicholas C. Zakas)
-* Fix: Merge configs with ancestors (Fixes #820) (jrajav)
-* Fix: no-fallthrough should respect block statements in case statements (fixes #893) (Nicholas C. Zakas)
-* Docs: Fix layout issue in configuration docs (fixes #889) (Nicholas C. Zakas)
-* Build: Enable default-case rule (fixes #881) (icebox)
-* Build: Enable space-after-keywords (fixes #884) (icebox)
-* Fix api double emit on comment nodes (fixes #876) (Aliaksei Shytkin)
-* 0.6.1 (Nicholas C. Zakas)
-
-v0.6.1 - May 17, 2014
-
-* 0.6.1 (Nicholas C. Zakas)
-* Upgrade: Optionator to 0.4.0 (fixes #885) (Nicholas C. Zakas)
-* 0.6.0 (Nicholas C. Zakas)
-
-v0.6.0 - May 17, 2014
-
-* 0.6.0 (Nicholas C. Zakas)
-* Fix: Remove -r alias for --rule (fixes #882) (Nicholas C. Zakas)
-* Docs: Update dev setup, contributing, default-case descriptions (Nicholas C. Zakas)
-* Update: valid-jsdoc now allows you to optionally turn off parameter description checks (fixes #822) (Nicholas C. Zakas)
-* Breaking: brace-style now disallows block statements where curlies are on the same line (fixes #758) (Nicholas C. Zakas)
-* Add linting Makefile.js (fixes #870) (icebox)
-* add rule flag, closes #692 (George Zahariev)
-* Add check between rules doc and index (fixes #865) (icebox)
-* Add Build Next mention in integrations README. (icebox)
-* document new IIFE exception for no-extra parens added as part of #655 (Michael Ficarra)
-* (fixes #622) Add rule ID on documentation pages (Delapouite)
-* fixes #655: add IIFE exception to no-extra-parens (Michael Ficarra)
-* add new rule "no-new-require" (Wil Moore III)
-* exit with non-zero status when tests fail (fixes #858) (Márton Salomváry)
-* removed unicode zero width space character from messages (fixes #857) (Márton Salomváry)
-* Change: --rulesdir now can be specified multiple times (fixes #830) (Nicholas C. Zakas)
-* Update: Node 0.8 no longer supported (fixes #734) (Nicholas C. Zakas)
-* Update: Add typed arrays into builtin environment globals (fixes #846) (Nicholas C. Zakas)
-* Fix: Add prototype methods to global scope (fixes #700) (Nicholas C. Zakas)
-* Rule: no-restricted-modules (fixes #791) (Christian)
-* Upgrade: Esprima to 1.2 (fixes #842) (Nicholas C. Zakas)
-* Docs: reporting level 2 is an error (fixes #843) (Brandon Mills)
-* Upgrade: Esprima to 1.2, switch to using Esprima comment attachment (fixes #730) (Nicholas C. Zakas)
-* Fix: Semi rule incorrectly flagging extra semicolon (fixes #840) (Nicholas C. Zakas)
-* Build: Update Travis to only test Node 0.10 (refs #734) (Nicholas C. Zakas)
-* Add "nofunc" option (fixes #829) (Conrad Zimmerman)
-* Rule: no-inner-declarations (fixes #587) (Brandon Mills)
-* Rule 'block-scoped-var': correct scope for functions, arguments (fixes #832) (Aliaksei Shytkin)
-* Rule: default-case (fixes #787) (Aliaksei Shytkin)
-* Ignored files are excluded unless --force is passed on the CLI (Nick Fisher)
-* Fixes a typo and a broken link in the documentation (Nick Fisher)
-* Replaces .some() with .indexOf() where appropriate (Nick Fisher)
-* Fix correct config merge for array values (fixes #819) (Aliaksei Shytkin)
-* Remove warning about ESLint being in Alpha (Nick Fisher)
-* Adds `space-after-keywords` rule (fixes #807) (Nick Fisher)
-* Rule: no-lonely-if (fixes #790) (Brandon Mills)
-* Add ignore comments in file (fixes #305) (Aliaksei Shytkin)
-* 0.5.1 (Nicholas C. Zakas)
-* Change: no-unused-vars default to 'all' (fixes #760) (Nicholas C. Zakas)
-
-v0.5.1 - April 17, 2014
-
-* 0.5.1 (Nicholas C. Zakas)
-* Fix general config not to be modified by comment config in files (fixes #806) (Aliaksei Shytkin)
-* SVG badges (Ryuichi Okumura)
-* fixes #804: clean up implementation of #803 (which fixed #781) (Michael Ficarra)
-* Build: Fix perf test to take median of three runs (fixes #781) (Nicholas C. Zakas)
-* Fix: --reset will now properly ignore default rules in environments.json (fixes #800) (Nicholas C. Zakas)
-* Docs: Updated contributor guidelines (Nicholas C. Zakas)
-* Added Mocha global variables for TDD style. Fixes #793. (Golo Roden)
-* Rule: no-sequences (fixes #561) (Brandon Mills)
-* Change .eslintignore to plain text (fixes #761) (Brandon Mills)
-* Change 'no-spaced-func' message (fixes #762) (Aliaksei Shytkin)
-* Rule 'block-scoped-var' works correct when object inits (fixes #783) (Aliaksei Shytkin)
-* Build: Always build docs site on top of origin/master (Nicholas C. Zakas)
-* 0.5.0 (Nicholas C. Zakas)
-
-v0.5.0 - April 10, 2014
-
-* 0.5.0 (Nicholas C. Zakas)
-* Build: Bump perf limit so Travis won't fail every time (fixes #780) (Nicholas C. Zakas)
-* Add tests to cover 100% of eslint.js (Aliaksei Shytkin)
-* Fix: Make sure no-path-concat doesn't flag non-concat operations (fixes #776) (Nicholas C. Zakas)
-* Rule 'no-unused-var' in functional expression with identifier (fixes #775) (Aliaksei Shytkin)
-* Rule: valid-typeof (Ian Christian Myers)
-* Add global cli flag (ref #692) (Brandon Mills)
-* update to latest Optionator (George Zahariev)
-* Add options for rule 'no-unused-vars' to check all arguments in functions (fixes #728) (Aliaksei Shytkin)
-* Fix: Cleanup package.json (Nicholas C. Zakas)
-* New: Experimental support for CSS Auron (fixes #765) (Nicholas C. Zakas)
-* Lint tests on build (fixes #764) (Aliaksei Shytkin)
-* Rule block-scoped-var works correct with object properties (fixes #755) (Aliaksei Shytkin)
-* Breaking: implement eslint-env and remove jshint/jslint environment comment support (fixes #759) (Aliaksei Shytkin)
-* readme: npm i -> npm install (Linus Unnebäck)
-* Add env flag to cli options summary (fixes #752) (Brandon Mills)
-* Fix: Give the perf test a better calculated budget (fixes #749) (Nicholas C. Zakas)
-* give the `env` flag type `[String]`, improve code (fixes #748) (George Zahariev)
-* fixes #735: add new, more efficient getTokens interfaces (Michael Ficarra)
-* Add --env cli flag (ref #692) (Brandon Mills)
-* Fixes #740 - Make sure callbacks exist before marking them as 'handled'. (mstuart)
-* fixes #743: wrap-regex rule warns on regex used in dynamic member access (Michael Ficarra)
-* replace tab indents with 4 spaces in lib/rules/handle-callback-err.js (Michael Ficarra)
-* Adding homepage and bugs links to package.json (Peter deHaan)
-* JSDoc for rules (Anton Rudeshko)
-* 0.4.5 (Nicholas C. Zakas)
-
-v0.4.5 - March 29, 2014
-
-* 0.4.5 (Nicholas C. Zakas)
-* Build: Add perf check into Travis build to better monitor performance regressions (fixes #732) (Nicholas C. Zakas)
-* Fix: Make sure semi reports correct location of missing semicolon (fixes #726) (Nicholas C. Zakas)
-* Add --no-eslintrc cli flag (ref #717) (Brandon Mills)
-* Fix #716 crash with reset flag (Brandon Mills)
-* Fixed JSON formatting and highlighting (Anton Rudeshko (Tesla))
-* fixes #723: block-scoped-var throws on unnamed function expression (Michael Ficarra)
-* Fix: Make stroustrup brace-style closing message make sense (fixes #719) (Nicholas C. Zakas)
-* no-comma-dangle reports correct line number (Andrey Popp)
-* Upgrade: Esprima to 1.1.1 and EScope to 1.0.1 (fixes #718) (Nicholas C. Zakas)
-* Add reset cli flag (refs #692) (Brandon Mills)
-* Relax eqeqeq null check (fixes #669) (Brandon Mills)
-* 0.4.4 (Nicholas C. Zakas)
-* New Rule: handle-callback-err (fixes #567) (Jamund Ferguson)
-
-v0.4.4 - March 25, 2014
-
-* 0.4.4 (Nicholas C. Zakas)
-* Fix no-used-vars to report FunctionExpression params (fixes #697). (Andrey Popp)
-* fixes #711: eslint reports wrong line number for files with shebang (Michael Ficarra)
-* Fix for no-unused-vars and MemberExpression (Andrey Popp)
-* added no-warning-comments rule (Alexander Schmidt)
-* fixes #699: brace-style does not check function expressions (Michael Ficarra)
-* rewrite block-scoped-var (Michael Ficarra)
-* recommend using hasOwnProperty from Object.prototype in guard-for-in docs (Michael Ficarra)
-* change conf/environments.json spacing to be simpler and more consistent (Michael Ficarra)
-* Update API to use context.getFilename() instead of .filename. (Loren Segal)
-* Small changes, JSDoc is clarified (Aliaksei Shytkin)
-* Move FileFinder to separate file (Aliaksei Shytkin)
-* Cache if file is not found (Aliaksei Shytkin)
-* Use cache on config files seach (Aliaksei Shytkin)
-* Added .eslintignore to load from parents folders (fixes #681) (Aliaksei Shytkin)
-* fix 'node-modules' typo in docs (Fred K. Schott)
-* Upgrade to the latest version of doctrine. (Brian Di Palma)
-* Document optional filename and default it to `input`. (Loren Segal)
-* Fix: Compatibility for Node 0.8 (Nicholas C. Zakas)
-* Update: Makefile.js now uses shelljs-nodecli (Nicholas C. Zakas)
-* #681 apply all .eslintignore exclusions (Aliaksei Shytkin)
-* Add RuleContext.filename property (for eslint/eslint#468). (Loren Segal)
-* 0.4.3 (Nicholas C. Zakas)
-
-v0.4.3 - March 18, 2014
-
-* 0.4.3 (Nicholas C. Zakas)
-* fixes #682: rewrite no-constant-condition rule (Michael Ficarra)
-* Fixes #673 allow configuration of @return errors via requireReturn - (fixes #673) (Brian Di Palma)
-* Tweaking inline code formatting for "if, while, dowhile" (Peter deHaan)
-* Fixes #677 getJSDocComment() should not search beyond FunctionExpression or FunctionDeclaration parent nodes. (Brian Di Palma)
-* Relaxed enforcement of camelcase rule (Ian Christian Myers)
-* Fixing issue #675. Incorrect triggering of no-else-return rule. (Brian Di Palma)
-* Added style option for wrap-iife (Mathias Schreck)
-* Fix: Issues with named function expressions in no-unused-vars and no-shadow (fixes #662) (Nicholas C. Zakas)
-* Update: camelcase rule now doesn't flag function calls (fixes #656) (Nicholas C. Zakas)
-* Updating documentation description for: no-space-before-semi rule, changing rules to exempt strings with semicolons and test for that condition. Fixes #629. (Jonathan Kingston)
-* Adding in rule no-space-before-semi to prevent spaces before semicolons. fixes #629 (Jonathan Kingston)
-* show NPM version (Paul Verest)
-* adapt code formatting (Mathias Schreck)
-* Added a TextMate 2 integration to the docs (Nate Silva)
-* 0.4.2 (Nicholas C. Zakas)
-
-v0.4.2 - March 3, 2014
-
-* 0.4.2 (Nicholas C. Zakas)
-* fixes #651: disable no-catch-shadow rule in node environment (Michael Ficarra)
-* Fixed context.report message parsing (Ian Christian Myers)
-* fixe #648: wrap-iife rule should actually check that IIFEs are wrapped (Michael Ficarra)
-* Added "stroustrup" option for brace-style (Ian Christian Myers)
-* 0.4.1 (Nicholas C. Zakas)
-
-v0.4.1 - February 27, 2014
-
-* 0.4.1 (Nicholas C. Zakas)
-* Created space-in-brackets rule (Ian Christian Myers)
-* Update: Allow valid-jsdoc to specify replacement tags (fixes #637) (Nicholas C. Zakas)
-* Fix: Ensure getJSDocComment() works for all function declarations (fixes #638) (Nicholas C. Zakas)
-* Added broccoli-eslint to integration docs (Christian)
-* fixes #634: getters/setters shouldn't trigger no-dupe-keys (Michael Ficarra)
-* Update: semi to also enforce not using semicolons (fixes #618) (Nicholas C. Zakas)
-* New Rule: no-constant-condition  - removed SwitchStatement discriminant check  - removed AssignmentExpression with right Identifier  - fixed copy paste error  - added DoWhileStatement, ForStatement based on discussion: https://github.com/eslint/eslint/pull/624 (fixes #621) (Christian)
-* New Rule: no-constant-condition (fixes #621) (Christian)
-* Adding mimosa-eslint to Build System list (dbashford)
-* Fix: Make sure semi flags return statements without a semicolon (fixes #616) (Nicholas C. Zakas)
-* Fix: stylish formatter blue text -> white text (fixes #607) (Nicholas C. Zakas)
-* Fix: radix rule should warn (not throw error) when parseInt() is called without arguments (fixes #611) (Nicholas C. Zakas)
-* Update README.md (Dmitry)
-* Adding JSDoc comments for TAP format helper functions (Jonathan Kingston)
-* Updating documentation to include TAP format option (Jonathan Kingston)
-* Fixing validation issues to TAP formatter (Jonathan Kingston)
-* Adding TAP formatter and basic tests (Jonathan Kingston)
-* Docs: Updated integrations page (Nicholas C. Zakas)
-* 0.4.0 (Nicholas C. Zakas)
-
-v0.4.0 - February 12, 2014
-
-* 0.4.0 (Nicholas C. Zakas)
-* Change: Switch :after to :exit (fixes #605) (Nicholas C. Zakas)
-* Fix: Make sure no-unused-vars doesn't get confused by nested functions (fixes #584) (Nicholas C. Zakas)
-* Update: .eslintrc to check more things (Nicholas C. Zakas)
-* Fix: Make sure JSDoc parser accepts JSDoc3-style optional parameters (Nicholas C. Zakas)
-* Docs: Update documentation with linking instructions for ESLintTester (Nicholas C. Zakas)
-* New Rule: valid-jsdoc (fixes #536) (Nicholas C. Zakas)
-* #595 improved func-names documentation (Kyle Nunery)
-* #595 added more func-names tests (Kyle Nunery)
-* #595 fix rule message and add more tests (Kyle Nunery)
-* use optionator for option parsing, not optimist (George Zahariev)
-* Include instructions for working with ESLintTester (Nicholas C. Zakas)
-* #595 remove needless 'function Foo() {}' in tests (Kyle Nunery)
-* #595 fix whitespace (Kyle Nunery)
-* #595 fix markdown for js code blocks (Kyle Nunery)
-* Adding information about Yeomen generator (Ilya Volodin)
-* #595 add docs for rule func-names (Kyle Nunery)
-* #595 add func-names rule (Kyle Nunery)
-* migrate variables array to map (Brandon Mills)
-* Perf: Move try-catch out of verify() function to allow V8 optimization (refs #574) (Nicholas C. Zakas)
-* Docs: Added instructions for running npm run profile (Nicholas C. Zakas)
-* refactor variable name lookup into a separate function (Brandon Mills)
-* optimize findVariable() in no-unused-vars (Brandon Mills)
-* move to tests/bench (Chris Dickinson)
-* add `npm run profile`. (Chris Dickinson)
-* #586 refactor based on https://github.com/eslint/eslint/pull/590#discussion_r9476367 (Christian)
-* #586 added no-unreachable jsdoc, documentation note on hoisting case (Christian)
-* #586 add hoisting check to no-unreachable (Christian)
-* readme: Remove stray asterisk (Timo Tijhof)
-* #580 Remove eslint.getAllComments(), related docs, related tests (Christian)
-* Added test for bug fix #582. Test Passes (Shmueli Englard)
-* Added curly braces to if statment (Shmueli Englard)
-* Added new test for fix to #582 (fixes 582) (Shmueli Englard)
-* Bug #582: Added check if node.value isn't a string just exit (Shmueli Englard)
-* Update Rule: implement curly options for single-statement bodies (fixes #511) (Nicholas C. Zakas)
-* New Rule: no-extra-boolean-cast (fixes #557) (Brandon Mills)
-* New Rule: no-sparse-arrays (fixes #499) (Nicholas C. Zakas)
-* Fix: no-spaced-func is now an error (Nicholas C. Zakas)
-* New Rule: no-process-exit (fixes #568) (Nicholas C. Zakas)
-* New Rule: no-labels (fixes #550) (Nicholas C. Zakas)
-* New Rule: no-lone-blocks (fixes #512) (Brandon Mills)
-* Added Emacs/Flycheck integration (Nikolai Prokoschenko)
-* Build: Add perf test (Nicholas C. Zakas)
-* Fix: no-cond-assign shouldn't throw error when there's a for loop with an empty conditional (fixes #53) (Nicholas C. Zakas)
-* Docs: Add docs for no-regex-spaces and all doc errors now break build (closes #562) (Nicholas C. Zakas)
-* Rename: regex-spaces to no-regex-spaces (Nicholas C. Zakas)
-* Docs: Add docs for no-underscore-dangle (refs #562) (Nicholas C. Zakas)
-* Docs: Add docs for no-undef-init (refs #562) (Nicholas C. Zakas)
-* Docs: Add docs for no-return-assign (refs #562) (Nicholas C. Zakas)
-* Fix: Misspelling in no-return-assign message (Nicholas C. Zakas)
-* Docs: Add docs for no-new-wrappers (refs #562) (Nicholas C. Zakas)
-* Docs: Add docs for no-new-object (refs #562) (Nicholas C. Zakas)
-* Docs: Add docs for no-implied-eval (refs #562) (Nicholas C. Zakas)
-* Docs: Updated documentation for developing rules (Nicholas C. Zakas)
-* Testing: Move ESLintTester to be external dependency (fixes #480) (Nicholas C. Zakas)
-* Docs: Add list of known integrations (Nicholas C. Zakas)
-* Fix #570 (dmp42)
-* document no-array-constructor rule (Michael Ficarra)
-* fixes #500: no-array-constructor should not flag 1-argument construction (Michael Ficarra)
-* fixes #501: no-array-constructor recognises CallExpression form (Michael Ficarra)
-* rename no-new-array rule to no-array-constructor; ref #501 (Michael Ficarra)
-* Fix: Make radix rule warn on invalid second parameter (fixes #563) (Nicholas C. Zakas)
-* Docs: Added no-floating-decimal docs (refs #562) (Nicholas C. Zakas)
-* New Rule: no-path-concat (fixes #540) (Nicholas C. Zakas)
-* Docs: Add some missing rule docs (refs #562) (Nicholas C. Zakas)
-* Fix: CLI should not output anything when there are no warnings (fixes #558) (Nicholas C. Zakas)
-* New Rule: no-yoda (fixes #504) (Nicholas C. Zakas)
-* New Rule: consistent-return (fixes #481) (Nicholas C. Zakas)
-* Rewrite configuration documentation to include information about globals (fixes #555) (Nicholas C. Zakas)
-* Allow YAML configuration files (fixes #491) (Nicholas C. Zakas)
-* 0.3.0 (Nicholas C. Zakas)
-
-v0.3.0 - January 20, 2014
-
-* 0.3.0 (Nicholas C. Zakas)
-* Config: Allow comments in JSON configuration files (fixes #492) (Nicholas C. Zakas)
-* Bug: max-len fix to report correct line number (fixes #552) (Nicholas C. Zakas)
-* Build: Use browserify to create browser-ready ESLint (fixes #119) (Nicholas C. Zakas)
-* Docs: Ensure all rules have entry on top-level rules index page (Nicholas C. Zakas)
-* Docs: Add docs for no-fallthrough rule (Nicholas C. Zakas)
-* Update README.md (Peter deHaan)
-* Update README.md (Peter deHaan)
-* Update package.json (Peter deHaan)
-* Docs: Added documentation for semi rule (Nicholas C. Zakas)
-* Build: Reset branch coverage target (Nicholas C. Zakas)
-* Update build system to generate eslint.org during release (Nicholas C. Zakas)
-* Updated setup doc (Nicholas C. Zakas)
-* Fix #525 & #528 (Mangled Deutz)
-* Improve no-negated-in-lhs description (David Bruant)
-* Fixing typo (David Bruant)
-* Update no-new.md (Tamas Fodor)
-* Update no-extra-semi.md (Tamas Fodor)
-* Fixing broken links in documentation (Ilya Volodin)
-* Update about page (Nicholas C. Zakas)
-* Site generation build step and documentation updates to support it (fixes #478) (Nicholas C. Zakas)
-* Change message for brace-style rule (fixes #490) (Nicholas C. Zakas)
-* Add question about ES6 support to FAQ (fixes #530) (Nicholas C. Zakas)
-* Set unlimited number of listeners for event emitter (fixes #524) (Nicholas C. Zakas)
-* Add support for comment events (fixes #531) Add :after events for comments (Nicholas C. Zakas)
-* Add :after events for comments (Nicholas C. Zakas)
-* Allow config files to have any name (fixes #486). (Aparajita Fishman)
-* List available formatters (fixes #533). (Aparajita Fishman)
-* Add support for comment events (fixes #531) (Nicholas C. Zakas)
-* Add Stylish formatter and make it default. Fixes #517 (Sindre Sorhus)
-* Fix missing code exit (Mangled Deutz)
-* Added unit test for calling Config.getConfig with no arguments. (Aparajita Fishman)
-* Typo (Mangled Deutz)
-* Fixed docs typo (Nicholas C. Zakas)
-* Mark functions as used when any method is called on them (Nicholas C. Zakas)
-* Fixed: Config.getConfig is called either with a file path or with no args (fixes #520) (Aparajita Fishman)
-* Fix minor bug in no-empty rule (Nicholas C. Zakas)
-* add more info for failure messages (Nicholas C. Zakas)
-* Add ruleId to all formatters output (fixes #472) (Nicholas C. Zakas)
-* Remove unused code (Nicholas C. Zakas)
-* Correctly handle case with both finally and catch in no-empty (Nicholas C. Zakas)
-* Update documentation for no-unused-vars (Nicholas C. Zakas)
-* Ensure that bound function expressions are reported as being used (fixes #510) (Nicholas C. Zakas)
-* Allow empty catch/finally blocks (fixes #514) and update documentation (fixes #513) (Nicholas C. Zakas)
-* Updated contribution guidelines (Nicholas C. Zakas)
-* Add default setting for no-cond-assign (Nicholas C. Zakas)
-* Add build step to check rule consistency (Nicholas C. Zakas)
-* update docs: explicit cli args are exempt from eslintignore exclusions (Michael Ficarra)
-* fixes #505: no-cond-assign should ignore doubly parenthesised tests (Michael Ficarra)
-* Renamed unnecessary-strict to no-extra-strict (Nicholas C. Zakas)
-* Fixed missing documentation links (Nicholas C. Zakas)
-* Add build task to check for missing docs and tests for rules (Nicholas C. Zakas)
-* Slight reorganization of rule groups (Nicholas C. Zakas)
-* Added one-var and sorted some rules (Nicholas C. Zakas)
-* Updated Travis badge for new location (Nicholas C. Zakas)
-* fixes #494: allow shebangs in processed JS files (Michael Ficarra)
-* fixes #496: lint ignored files when explicitly specified via the CLI (Michael Ficarra)
-* More tests (Ilya Volodin)
-* Upgrade Istanbul (Ilya Volodin)
-* fixes #495: holey arrays cause no-comma-dangle rule to throw (Michael Ficarra)
-* Documentation and minor changes (Ilya Volodin)
-* Adding missing package registration (Ilya Volodin)
-* Adding support for .eslintignore and .jshintignore (Closes #484) (Ilya Volodin)
-* fixes #482: brace-style bug with multiline conditions (Michael Ficarra)
-* Switching Travis to use ESLint (Closes #462) (Ilya Volodin)
-* 0.2.0 (Nicholas C. Zakas)
-
-v0.2.0 - January 1, 2014
-
-* 0.2.0 (Nicholas C. Zakas)
-* Bump code coverage checks (Nicholas C. Zakas)
-* Take care of unreachable code in case statement (Nicholas C. Zakas)
-* Updated rule messaging and added extra tests (Nicholas C. Zakas)
-* Fixing eslint errors and unittests (Ilya Volodin)
-* Rule: max-nested-callbacks (Ian Christian Myers)
-* Fix fall-through rule with nested switch statements (fixes #430) (Nicholas C. Zakas)
-* Fixed trailing comma (Nicholas C. Zakas)
-* Added more tests for func-style (Nicholas C. Zakas)
-* Fixed documentation for func-style (Nicholas C. Zakas)
-* Fixed linting error (Nicholas C. Zakas)
-* Rule to enforce function style (fixes #460) (Nicholas C. Zakas)
-* Rule is off by default. Updated documentation (Ilya Volodin)
-* Rule: sort variables. Closes #457 (Ilya Volodin)
-* Update architecture.md (Nicholas C. Zakas)
-* Change quotes option to avoid-escapes and update docs (fixes #199) (Brandon Payton)
-* Add allow-avoiding-escaped-quotes option to quotes rule (fixes #199) (Brandon Payton)
-* Update no-empty-class.md (Nicholas C. Zakas)
-* Updated titles on all rule documentation (fixes #348) (Nicholas C. Zakas)
-* Fixing eslint errors in codebase (Ilya Volodin)
-* fixes #464: space-infix-ops checks for VariableDeclarator init spacing (Michael Ficarra)
-* Add options to no-unused-vars. Fixes #367 (Ilya Volodin)
-* rename escape function to xmlEscape in checkstyle formatter (Michael Ficarra)
-* The semi rule now reports correct line number (Ian Christian Myers)
-* context.report now takes optional location (Ian Christian Myers)
-* fixes #454: escape values for XML in checkstyle formatter (Michael Ficarra)
-* Add color to Mocha test reporting (Ian Christian Myers)
-* Rule no-nested-ternary (Ian Christian Myers)
-* Fixing no-unused-var and no-redeclare (Ilya Volodin)
-* fixes #449: no-mixed-requires throws TypeError when grouping is enabled (Michael Ficarra)
-* Fixed reported line number for trailing comma error (Ian Christian Myers)
-* Update doc title for quote (Matthew DuVall)
-* fixes #446: join paths without additional delimiters (Michael Ficarra)
-* docs: add documentation for quotes rule (Matthew DuVall)
-* minor style changes to lib/rules/space-infix-ops.js as requested in #444 (Michael Ficarra)
-* remove "function invalid(){ return D }" from some tests (Michael Ficarra)
-* fixes #429: require spaces around infix operators; enabled by default (Michael Ficarra)
-* simplify fix for #442 (Michael Ficarra)
-* Fix broken test, ensure tests get run before a release is pushed (Nicholas C. Zakas)
-* 0.1.4 (Nicholas C. Zakas)
-
-v0.1.4 - December 5, 2013
-
-* 0.1.4 (Nicholas C. Zakas)
-* Add release scripts to package.json (Nicholas C. Zakas)
-* Fixed release error in Makefile (Nicholas C. Zakas)
-* Fix JSHint warnings (Nicholas C. Zakas)
-* Make sure 'default' isn't flagged by no-space-returns-throw rule (fixes #442) (Nicholas C. Zakas)
-* Fixing documentation (Ilya Volodin)
-* Fixing disabling rules with invalid comments Closes #435 (Ilya Volodin)
-* improve assertion on wrong number of errors (Christoph Neuroth)
-* fixes #431: no-unused-expressions should not flag statement level void (Michael Ficarra)
-* fixes #437: fragile no-extend-native rule (Michael Ficarra)
-* change space-* rule documentation headers to be more descriptive (Michael Ficarra)
-* Moved to tabs, added comments, a few more tests (Jamund Ferguson)
-* split GH-332 rule into space-unary-word-ops and space-return-throw-case (Michael Ficarra)
-* fixes #346: validate strings passed to the RegExp constructor (Michael Ficarra)
-* change some documentation extensions from js to md (Michael Ficarra)
-* fixes #332: unary word operators must be followed by whitespace (Michael Ficarra)
-* Add some docs (Jamund Ferguson)
-* DRYing cli tests and improving code coverage (Ilya Volodin)
-* fixes #371: add no-shadow-restricted-names rule (Michael Ficarra)
-* Added Support for Object.defineProperty() checking (Jamund Ferguson)
-* fixes #333: add rule to disallow gratuitously parenthesised expressions (Michael Ficarra)
-* improve rule test coverage (Michael Ficarra)
-* No Extend Native (Jamund Ferguson)
-* change getTokens 2nd/3rd arguments to count tokens, not characters (Michael Ficarra)
-* fixes #416: no-fallthrough flagging last case + reporting wrong line num (Michael Ficarra)
-* fixes #415: fix unnecessary-strict rule false positives (Michael Ficarra)
-* Add missing dependency (Nicholas C. Zakas)
-* Update docs related to running unit tests (Nicholas C. Zakas)
-* Add JSHint as missing dependency (Nicholas C. Zakas)
-* Switch to using ShellJS makefile (fixes #418) (Nicholas C. Zakas)
-* Updated documentation to reflect test changes (refs #417) (Nicholas C. Zakas)
-* Change to eslintTester.addRuleTest (fixes #417) (Nicholas C. Zakas)
-* Fix false positives for no-script-url (fixes #400) (Nicholas C. Zakas)
-* Fix lint warning (Nicholas C. Zakas)
-* Fixing ESLint warnings, introducing Makefile.js (not yet wired in) (Nicholas C. Zakas)
-* fixes #384: include builtin module list to avoid repl dependency (Michael Ficarra)
-* 0.1.3 (Nicholas C. Zakas)
-
-v0.1.3 - November 25, 2013
-
-* 0.1.3 (Nicholas C. Zakas)
-* Updated changelog (Nicholas C. Zakas)
-* Vows is gone. Mocha is now default (Ilya Volodin)
-* fixes #412: remove last remaining false positives in no-spaced-func (Michael Ficarra)
-* fixes #407: no-spaced-func rule flagging non-argument-list spaced parens (Michael Ficarra)
-* Add no-extra-semi to configuration (fixes #386) (Nicholas C. Zakas)
-* Converting formatter tests and core (Ilya Volodin)
-* Don't output anything when there are no errors in compact formatter (fixes #408) (Nicholas C. Zakas)
-* Removing Node 0.11 test - it fails all the time (Nicholas C. Zakas)
-* Completing conversion of rule's tests to mocha (Ilya Volodin)
-* added mocha conversion tests for strict, quote-props and one-var; enhanced one of the invalid one-var tests that was expecting two messages (Michael Paulukonis)
-
-
-v0.1.2 - November 23, 2013
-
-* 0.1.2 (Nicholas C. Zakas)
-* added mocha tests for radix and quotes; fixed some of the internals on quotes from vows annotations (Michael Paulukonis)
-* added tests for regex-spaces, strict, unnecessary-strict; fixed some types in overview/author notes in other tests. (Michael Paulukonis)
-* Converting unittests to mocha (Ilya Volodin)
-* mocha conversions of tests for 'use-isnan' and 'wrap-iife' (Michael Paulukonis)
-* added mocha tests semi.js and wrap-regex.js (Michael Paulukonis)
-* Converting more tests to mocha (Ilya Volodin)
-* Update CONTRIBUTING.md (Nicholas C. Zakas)
-* Cleaning up eslintTester (Ilya Volodin)
-* DRYing unittests and converting them to mocha (Ilya Volodin)
-* Reformatted Gruntfile (Nicholas C. Zakas)
-* Add tests to config load order: base, env, user. (icebox)
-* Fixing indent in gruntfile (Ilya Volodin)
-* Removing jake, adding Grunt, Travis now runs grunt (Ilya Volodin)
-* Add rules per environments to config. (icebox)
-* Add globals property to the environments. (icebox)
-* Fix error about IIFE if the function is in a new (Marsup)
-* Fix a broken link in the docs (Brian J Brennan)
-* Add test coverage for additional cases, fix open paren at beginning of expr (Matthew DuVall)
-* Fixing no-undef for eval use case (Ilya Volodin)
-* fixes #372: disallow negated left operand in `in` operator (Michael Ficarra)
-* Fixing no-self-compare rule to check for operator (Ilya Volodin)
-* bug: open parens in args causes no-spaced-func to trigger (Matthew DuVall)
-* fixes #369: restrict UnaryExpressions to delete in no-unused-expressions (Michael Ficarra)
-* Make sure delete operator isn't flagged as unused expression (fixes #364) (Nicholas C. Zakas)
-* Don't flag ++ or -- as unused expressions (fixes #366) (Nicholas C. Zakas)
-* Ensure that 'use strict' isn't flagged as an unused expression (fixes #361) (Nicholas C. Zakas)
-* Increase test coverage for strict-related rules (refs #361) (Nicholas C. Zakas)
-* Up code coverage numbers (Nicholas C. Zakas)
-* Fixes error in new-cap rule when 'new' is used without a constructor (fixes #360) (Nicholas C. Zakas)
-* added files array in package json (Christian)
-* removed unused jshint dependency (Christian)
-* Add test coverage for new Foo constructor usage (Matt DuVall)
-* Pull code coverage up by removing unused method (Matt DuVall)
-* recognise CallExpression variant of RegExp ctor in no-control-regex rule (Michael Ficarra)
-* Merge smart-eqeqeq into eqeqeq (Matt DuVall)
-* Catch additional cases for a.b, new F, iife (Matt DuVall)
-* 0.2.0-dev (Nicholas C. Zakas)
-* Version 0.1.0 (Nicholas C. Zakas)
-* rule: no-spaced-func disallow spaces between function identifier and application (Matt DuVall)
-
-v0.1.1 - November 09, 2013
-
-* Ensure mergeConfigs() doesn't thrown an error when keys are missing in base config (fixes #358) (Nicholas C. Zakas)
-
-v0.1.0 - November 03, 2013
-
-* Version 0.1.0 (Nicholas C. Zakas)
-* Updated Readme for v0.1.0 (Nicholas C. Zakas)
-* Bump code coverage verification to 95% across the board (Nicholas C. Zakas)
-* Fixed broken links (Nicholas C. Zakas)
-* Added information about runtime rules (Nicholas C. Zakas)
-* Added documentation about configuration files (Nicholas C. Zakas)
-* Added description of -v option (Nicholas C. Zakas)
-* Updated architecture documentation (Nicholas C. Zakas)
-* Fix bug in no-control-regex (fixes #347) (Nicholas C. Zakas)
-* Fix link to architecture doc in readme (azu)
-* Rule: No control characters in regular expressions (fixes #338) (Nicholas C. Zakas)
-* Add escaping \= test (Matt DuVall)
-* Add docs for rule (Matt DuVall)
-* rule: no-div-regex for catching ambiguous division operators in regexes (Matt DuVall)
-* Change context-var to block-scoped-var (Matt DuVall)
-* Implement config.globals (Oleg Grenrus)
-* Add 'config-declared global' test (Oleg Grenrus)
-* Adding ability to separate rules with comma (Ilya Volodin)
-* Added rule for missing 'use strict' (fixes #321) (Nicholas C. Zakas)
-* Fixing unittests and finishing code (Ilya Volodin)
-* Disabling/enabling rules through comments (Ilya Volodin)
-* Rename rule to context-var and add documentation (Matt DuVall)
-* Added link to no-global-strict doc in readme (Nicholas C. Zakas)
-* Add try-catch scoping with tests (Matt DuVall)
-* Fix linting error (Matt DuVall)
-* Store FunctionDeclarations in scope as they can be used as literals (Matt DuVall)
-* Fix to use getTokens and add test for MemberExpression usage (Matt DuVall)
-* rule: block-scope-var to check for variables declared in block-scope (Matt DuVall)
-* no-unused-expressions rule: add test and doc mention for `a && b()` (Michael Ficarra)
-* rule: wrap-regex for parens around regular expression literals (Matt DuVall)
-* fixes #308: implement no-unused-expressions rule; ref. jshint rule W030 (Michael Ficarra)
-* Updated change log script to filter out merge messages (Nicholas C. Zakas)
-* Updated changelog (Nicholas C. Zakas)
-* 0.1.0-dev (Nicholas C. Zakas)
-
-v0.0.9 - October 5, 2013
-
-* Version 0.0.9 release (Nicholas C. Zakas)
-* Added rule for no global strict mode (fixes #322) (Nicholas C. Zakas)
-* Change default on to be errors instead of warnings (fixes #326) (Nicholas C. Zakas)
-* Fixed bug where JSHint was using the wrong file in lint task (Nicholas C. Zakas)
-* Updated docs for no-unused vars rule. (Andrew de Andrade)
-* Removed console.log in tests. (Andrew de Andrade)
-* Added link to roadmap and JSHint feature parity list. (Andrew de Andrade)
-* Fixed warning when unused var declared as param in FunctionExpression/Declaration can be ignored because later param is used (Andrew de Andrade)
-* Rename test for smartereqeqeq.js to smarter-eqeqeq.js (Andrew de Andrade)
-* Keep test filename inline with rule name (Andrew de Andrade)
-* Added further instructions for multiline test cases. (Andrew de Andrade)
-* Protecting private method (Seth McLaughlin)
-* Updating look up algorithm for local config files (Seth McLaughlin)
-* Fixing ESLint errors (Ilya Volodin)
-* Implemented local default config file (Seth McLaughlin)
-* Upgrading escope version and fixing related bugs (Ilya Volodin)
-* Fixing assignment during initialization issue (Ilya Volodin)
-* add plain-English regexp description to no-empty-class rule (Michael Ficarra)
-* fixes #289: no-empty-class flags regexps with... flags (Michael Ficarra)
-* Rule: no-catch-shadow (Ian Christian Myers)
-* Update no-empty for compatibility with esprima@1.0.4 (fixes #290) (Mark Macdonald)
-* Fixing bug with _ in MemberExpression (Ilya Volodin)
-* Rule: no-func-assign (Ian Christian Myers)
-* Fix false warning from no-undef rule (fixes #283) (Mark Macdonald)
-* Adding eslint to jake (Ilya Volodin)
-* Rule no redeclare (Ilya Volodin)
-* Fixing no use before define issues (Ilya Volodin)
-* Rule: no-octal-escape (Ian Christian Myers)
-* Fix for `no-proto` and `no-iterator` false positive (Ian Christian Myers)
-* Rule: no-iterator (Ian Christian Myers)
-* Fixing type in guard-for-in documentation (Ilya Volodin)
-* Rule No use before define (Ilya Volodin)
-* Added documentation for the `no-new` rule (Ian Christian Myers)
-* Added documentation for the `no-eval` rule (Ian Christian Myers)
-* Added documentation for the `no-caller` rule (Ian Christian Myers)
-* Added documentation for the `no-bitwise` rule (Ian Christian Myers)
-* simplify no-empty-class rule (Michael Ficarra)
-* Fix `no-empty-class` false negatives (Ian Christian Myers)
-* Added documentation for the `no-alert` rule (Ian Christian Myers)
-* Added documentation for the `new-parens` rule (Ian Christian Myers)
-* Added documentation for the `max-params` rule (Ian Christian Myers)
-* Added documentation for `max-len` rule (Ian Christian Myers)
-* Created link from rules README.md to no-plusplus.md documentation (Ian Christian Myers)
-* Added documentation for `guard-for-in` rule (Ian Christian Myers)
-* Added documentation for `dot-notation` rule (Ian Christian Myers)
-* Added documentation for `curly` rule (Ian Christian Myers)
-* Updated `camelcase` rule documentation (Ian Christian Myers)
-* Added documentation for `complexity` rule (Ian Christian Myers)
-* Changed `no-dangle` documentation to `no-comma-dangle` (Ian Christian Myers)
-* Rule: no-empty-class (Ian Christian Myers)
-* Increased test coverage for max-depth (Ian Christian Myers)
-* Increased test coverage for no-shadow (Ian Christian Myers)
-* Increased test coverage on no-mixed-requires (Ian Christian Myers)
-* Added docs for eqeqeq and no-with (fixes #262) (Raphael Pigulla)
-* Create camelcase.md (Micah Eschbacher)
-* Fix issues with function in no-unused-vars (Ilya Volodin)
-* Rule: No shadow (Ilya Volodin)
-* fixes #252: semi rule errors on VariableDeclarations in ForInStatements (Michael Ficarra)
-* rule: max-len to lint maximum length of a line (Matt DuVall)
-* Fixes #249 (Raphael Pigulla)
-* Merge branch 'master' of https://github.com/beardtwizzle/eslint (Jonathan Mahoney)
-* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
-* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
-* Rule: no-else-return (Ian Christian Myers)
-* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
-* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
-* Fix no-unused-vars to report correct line numbers (Ilya Volodin)
-* Rule: no proto (Ilya Volodin)
-* Rule: No Script URL (Ilya Volodin)
-* Rule: max-depth (Ian Christian Myers)
-* Fix: Error severity for rules with options. (Ian Christian Myers)
-* Rule: No wrap func (Ilya Volodin)
-* bug: Fixes semi rule for VariableDeclaration in ForStatement (Matt DuVall)
-* Individual perf tests for rules (Ilya Volodin)
-* Fix loading rules from a rules directory (Ian Christian Myers)
-* Rule no-mixed-requires (fixes #221) (Raphael Pigulla)
-* bug: Add ForStatement for no-cond-assign check (Matthew DuVall)
-* JSLint XML formatter now escapes special characters in the evidence and reason attributes. (Ian Christian Myers)
-* Formatter: JSLint XML (Ian Christian Myers)
-* Refactored `max-statements` rule. (Ian Christian Myers)
-* Fix tests broken due to new rule message text (James Allardice)
-* Merge branch 'master' into match-jshint-messages (James Allardice)
-* Refactored `one-var` rule. (Ian Christian Myers)
-* split eslint.define into eslint.defineRule and eslint.defineRules (Michael Ficarra)
-* Removed unnecessary rules.js test. (Ian Christian Myers)
-* Rule: one-var (Ian Christian Myers)
-* Rule: No unused variables (Ilya Volodin)
-* expose interface for defining new rules at runtime without fs access (Michael Ficarra)
-* disallow 00 in no-octal rule (Michael Ficarra)
-* Increased test coverage for `lib/cli.js`. (Ian Christian Myers)
-* Increased test coverage for `lib/rules.js` (Ian Christian Myers)
-* Increased test coverage for jUnit formatter. (Ian Christian Myers)
-* scripts/bundle: output bundle+map to /build directory (Michael Ficarra)
-* add test for 0X... hex literals in no-octal tests (Michael Ficarra)
-* fixes #200: no-octals should not see leading-0 floats as violations (Michael Ficarra)
-* add back tests for loading rules from a directory (Michael Ficarra)
-* add back in ability to load rules from a directory (Michael Ficarra)
-* Increased test coverage for `complexity` rule. (Ian Christian Myers)
-* Increased test coverage for `max-params` rule. (Ian Christian Myers)
-* also output source map when generating bundle (Michael Ficarra)
-* Rule: unnecessary-strict (Ian Christian Myers)
-* Improve performance of getTokens (Ilya Volodin)
-* Performance jake task (Ilya Volodin)
-* don't force explicit listing of rules; generate listing for bundle (Michael Ficarra)
-* Rule: no-dupe-keys (Ian Christian Myers)
-* fixes #145: create a browser bundle (Michael Ficarra)
-* Fixing no-caller bug (Ilya Volodin)
-* Check for use of underscore library as an exception for var declarations (Matthew DuVall)
-* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matthew DuVall)
-* Fixing spelling (Ilya Volodin)
-* Rule: no-empty-label (Ilya Volodin)
-* Add builtin globals to the global scope (fixes #185) (Mark Macdonald)
-* Rule: no-loop-func (Ilya Volodin)
-* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matt DuVall)
-* Use proper node declarations and __proto__ exception (Matt DuVall)
-* Updating no-undef patch (see pull request #164) - Simplify parseBoolean() - Make knowledge of```/*jshint*/``` and ```/*global */``` internal to eslint object - Put user-declared globals in Program scope (Mark Macdonald)
-* Rule: no-eq-null (Ian Christian Myers)
-* fixed broken merge (Raphael Pigulla)
-* fixes #143 (Raphael Pigulla)
-* added consistent-this rule (Raphael Pigulla)
-* Rule: no-sync to encourage async usage (Matt DuVall)
-* Update eslint.json with no-underscore-dangle rule (Matt DuVall)
-* Rule: no-underscore-dangle for func/var declarations (Matt DuVall)
-* Warn on finding the bitwise NOT operator (James Allardice)
-* Updating no-undef patch (see pull request #164) 3. Move parsing of ```/*global */``` and ```/*jshint */``` to eslint.js (Mark Macdonald)
-* Warn on finding a bitwise shift operator (fixes #170) (James Allardice)
-* Fix broken test (James Allardice)
-* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
-* Removing nasty leading underscores (Patrick Brosset)
-* Added tests and test cases for a few files (Patrick Brosset)
-* CLI: -f now accepts a file path (Ian Christian Myers)
-* Updating no-undef patch (see pull request #164) 1. Move predefined globals to ```conf/environments.json``` 2. Move mixin() to ```lib/util.js``` (Mark Macdonald)
-* Match messages to JS[LH]int where appropriate, and ensure consistent message formatting (closes #163) (James Allardice)
-* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
-* Removing nasty leading underscores (Patrick Brosset)
-* Added tests and test cases for a few files (Patrick Brosset)
-* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
-* Added acceptance criteria for rules to docs (Nicholas C. Zakas)
-* Add no-undef (fixes #6) (Mark Macdonald)
-* Fixing no-self-compare (Ilya Volodin)
-* Rule: No multiline strings (Ilya Volodin)
-* CLI refactor to remove process.exit(), file not found now a regular error message, updated formatters to handle this case (Nicholas C. Zakas)
-* Rule: no-self-compare (Ilya Volodin)
-* Rule: No unnecessary semicolons (fixes #158) (Nicholas C. Zakas)
-* Fixed error in no-ex-assign when return statement as found in catch clause (Nicholas C. Zakas)
-* Rename no-exc-assign to no-ex-assign and add to config (Nicholas C. Zakas)
-* Renamed count-spaces to regex-spaces (Nicholas C. Zakas)
-* Documentation updates (Nicholas C. Zakas)
-* Put all rules into strict mode and update docs accordingly (Nicholas C. Zakas)
-* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
-* Ensure getScope() works properly when called from Program node (fixes #148) (Nicholas C. Zakas)
-* Rule: wrap-iife (Ilya Volodin)
-* add additional test for no-cond-assign rule (Stephen Murray)
-* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
-* Experimental support for Jake as a build system (fixes #151) (Nicholas C. Zakas)
-* fixes #152 (Stephen Murray)
-* add docs for no-exc-assign (Stephen Murray)
-* Merge branch 'master' of https://github.com/nzakas/eslint into no-new-object-array-literals (Matt DuVall)
-* Merge branch 'master' of https://github.com/nzakas/eslint into count-spaces (Matt DuVall)
-* Added a test for getting global scope from Program node (refs #148) (Nicholas C. Zakas)
-* Add positive test case for `object.Array` (Matthew DuVall)
-* Only support space characters for repetitions (Matthew DuVall)
-* fix line length per code conventions (Stephen Murray)
-* fix indentation per code conventions (Stephen Murray)
-* fixes #149 (Stephen Murray)
-* Rule: no-ternary (Ian Christian Myers)
-* Check that the return statement has an argument before checking its type (James Allardice)
-* Rule: count-spaces for multiple spaces in regular expressions (Matt DuVall)
-* Update eslint.json configuration file for literal rules (Matt DuVall)
-* Created no-label-var rule. (Ian Christian Myers)
-* Rule: no-new-array and no-new-object (Matt DuVall)
-* Added ability to retrieve scope using escope. (Ian Christian Myers)
-* Corrected unused arguments (Patrick Brosset)
-* Reporting function complexity on function:after and using array push/pop to handle nesting (Patrick Brosset)
-* Fixing style issues discovered while npm testing (Patrick Brosset)
-* First draft proposal for a cyclomatic complexity ESLint rule (Patrick Brosset)
-* Corrected file extension on no-plusplus rule documentation. (Ian Christian Myers)
-* Documentation for no-delete-var rule. Closes #129 (Ilya Volodin)
-* Rule: max-statements (Ian Christian Myers)
-* Better documentation for the `no-plusplus` rule. (Ian Christian Myers)
-* Rule: no-plusplus (Ian Christian Myers)
-* Rule: no assignment in return statement (Ilya Volodin)
-* Updating max-params rule name (Ilya Volodin)
-* Rule: Function has too many parameters (Ilya Volodin)
-* Removing merge originals (Ilya Volodin)
-* Rebasing on master (Ilya Volodin)
-* Rule: Variables should not be deleted (Ilya Volodin)
-* Fixes incorrect reporting of missing semicolon (Ian Christian Myers)
-* Rebase against master branch (Mathias Bynens)
-* Rule to warn on use of Math and JSON as functions (James Allardice)
-* Formatter: Checkstyle (Ian Christian Myers)
-* docs: Clean up structure (Mathias Bynens)
-* Merging no-native-reassign and no-redefine (Ilya Volodin)
-* Rule: no native reassignment (Ilya Volodin)
-* 0.0.8-dev (Nicholas C. Zakas)
-* v0.0.7 released (Nicholas C. Zakas)
-* Updated Tests, etc. (Jamund Ferguson)
-* Added jUnit Support (Fixes #16) (Jamund Ferguson)
-
-v0.0.7 - July 22, 2013
-
-* 0.0.7 (Nicholas C. Zakas)
-* Add code coverage checks to npm test and update rule tests to have better coverage (Nicholas C. Zakas)
-* Fixed CLI output on serial programatic executions (Ian Christian Myers)
-* Removes line length from code style convention docs (Josh Perez)
-* Adds escapeRegExp and fixes documentation (Josh Perez)
-* Add quotes rule and test coverage for configuration options (Matt DuVall)
-* Adds templating for lint messages and refactors rules to use it (Josh Perez)
-* Fixes lint rules for unchecked test file (Josh Perez)
-* Changes dotnotation rule to match JSHint style (Josh Perez)
-* Change configInfo to options and add test coverage (Matt DuVall)
-* Merge branch 'master' of https://github.com/nzakas/eslint into optional-args-for-rule (Matt DuVall)
-* Adds dot notation lint rule (Josh Perez)
-* Strip trailing underscores in camelcase rule - Fixes #94 (Patrick Brosset)
-* add mailing list link (Douglas Campos)
-* Strip leading underscores in camelcase rule - Fixes #94 (Patrick Brosset)
-* Created no-dangle rule. (Ian Christian Myers)
-* Fixed rule name (James Allardice)
-* Make sure the callee type is Identifier (James Allardice)
-* Add rule for implied eval via setTimeout/Interval (James Allardice)
-* Fix rule name in config (James Allardice)
-* Fixes #90 -- updates docstrings (Stephen Murray)
-* Fixes issue with fs.existsSync on NodeJS 0.6 (Ian Christian Myers)
-* Fixing -c config option. (Ian Christian Myers)
-* Allow arrays to be passed as multiple args to rule (Matt DuVall)
-* Test to make sure empty case with one line break is safe (Matt DuVall)
-* Rule: The Function constructor is eval (Ilya Volodin)
-* Enabled require("eslint") and exposed out CLI. (Ian Christian Myers)
-* Adds test and fix for issue #82 (Mark Macdonald)
-* Merge branch 'master' of https://github.com/nzakas/eslint into ok (Yusuke Suzuki)
-* Created brace-style rule. (Ian Christian Myers)
-* Formatters can now process multiple files at once (Jamund Ferguson)
-* Rule: Do not use 'new' for side effects (Ilya Volodin)
-* Adds smarter-eqeqeq rule (Josh Perez)
-* Add EditorConfig file for consistent editor/IDE behavior (Jed Hunsaker)
-* Fix the positive case for no-unreachable where there is no return statement at all, or if the return is at the end. Those cases should not return any errors. The error condition was not be checked before throwing the rule error. (Joel Feenstra)
-* Adds test and fix for no-octal on 0 literal (Mark Macdonald)
-* Don't report no-empty warnings when a parent is FunctionExpression / FunctionDeclaration (Yusuke Suzuki)
-* Add api.getAncestors (Yusuke Suzuki)
-* Ensure estraverse version 1.2.0 or later (Yusuke Suzuki)
-* Fixes no-alert lint rule for non identifier calls (Josh Perez)
-* Fixes exception when init is null (Josh Perez)
-* Fixes no-octal check to only check for numbers (Josh Perez)
-* 0.0.7-dev (Nicholas C. Zakas)
-* 0.0.6 (Nicholas C. Zakas)
-* Follow the rule naming conventions (James Allardice)
-* Add rule for missing radix argument to parseInt (James Allardice)
-* Allow return, falls-through comment, and throw for falls-through (Matt DuVall)
-* Merge branch 'master' of https://github.com/nzakas/eslint into rule-fall-through (Matt DuVall)
-* Globals are not good, declare len (Matt DuVall)
-* Rule to add no-fall-through (Matt DuVall)
-
-v0.0.6 - July 16, 2013
-
-* 0.0.6 (Nicholas C. Zakas)
-* Changed semi rule to use tokens instead of source (Nicholas C. Zakas)
-* Renaming new-parens rule (Ilya Volodin)
-* Renaming no-new-wrappers rule and adding tests (Ilya Volodin)
-* Add license URL (Nick Schonning)
-* Remove unused sinon requires (Nick Schonning)
-* Remove redundant JSHint directives (Nick Schonning)
-* Rule: Do not use constructor for wrapper objects (Ilya Volodin)
-* Test node 0.11 unstable but allow it to fail (Nick Schonning)
-* Rule: Constructor should use parentheses (Ilya Volodin)
-* Fix reference to "CSS Lint" in Contributing documentation (Brian McKenna)
-* Add git attributes file for line endings (Andy Hu)
-* Rename to create an 'index' file in GH web view (Evan Goer)
-* Avoid accidentally creating a markdown link (Evan Goer)
-* Add headings and correct internal links (Evan Goer)
-* Add wiki files to docs directory (Evan Goer)
-* Add rules for leading/trailing decimal points (James Allardice)
-* Add rule to prevent comparisons with value NaN (James Allardice)
-* Fixing jshint error (Ilya Volodin)
-* Rule: no octal literals (Ilya Volodin)
-* Rule: no undefined when initializing variables (Ilya Volodin)
-* Updated CONTRIBUTING.md (Nicholas C. Zakas)
-* Make sure namespaces are honored in new-cap (Nicholas C. Zakas)
-* Make sure no-empty also checks for ';;' (Nicholas C. Zakas)
-* Add CLI option to output version (Nicholas C. Zakas)
-* Updated contribution guidelines (Nicholas C. Zakas)
-* Fixing jshint complaints. (Joel Feenstra)
-* Converting to a switch statement and declaring variables. (Joel Feenstra)
-* Added .jshintrc file (until ESLint can lint itself) and cleaned up JSHint warnings (Nicholas C. Zakas)
-* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
-* A bit of cleanup (Nicholas C. Zakas)
-* Add unreachable code detection for switch cases and after continue/break. (Joel Feenstra)
-* Add support for detecting unreachable code after a throw or return statement. (Joel Feenstra)
-* Fix curly brace check when an if statement is the alternate. (Joel Feenstra)
-* Check for empty switch statements with no cases. (Matt DuVall)
-* Added CONTRIBUTING.md (Nicholas C. Zakas)
-* Added rule to check for missing semicolons (fixes #9) (Nicholas C. Zakas)
-* Verify that file paths exist before reading the file (Matt DuVall)
-* Added guard-for-in rule (fixes #1) (Nicholas C. Zakas)
-* Run linting with npm test as well (Nicholas C. Zakas)
-* Removed foo.txt (Nicholas C. Zakas)
-* Updated config file with new no-caller ID (Nicholas C. Zakas)
-* Changed name of no-arg to no-caller (Nicholas C. Zakas)
-* Increased test coverage (Nicholas C. Zakas)
-* Got npm test to work with istanbul, huzzah\! (Nicholas C. Zakas)
-* Moved /config to /conf (Nicholas C. Zakas)
-* Added script to auto-generate changelog (Nicholas C. Zakas)
-* Add `quote-props` rule (Mathias Bynens)
-* Cleaned up relationship between bin/eslint, lib/cli.js, and lib/eslint.js (Nicholas C. Zakas)
-* Add problem count to compact formatter (Nicholas C. Zakas)
-* Fix merge conflict (Nicholas C. Zakas)
-* Change reporters to formatters, add format command line option. Also added tests for compact format. (Nicholas C. Zakas)
-* Change reporters to formatters, add format command line option (Nicholas C. Zakas)
-* Start development of 0.0.6-dev (Nicholas C. Zakas)
diff --git a/node_modules/eslint/LICENSE b/node_modules/eslint/LICENSE
index 7fe552a86..b607bb36e 100644
--- a/node_modules/eslint/LICENSE
+++ b/node_modules/eslint/LICENSE
@@ -1,4 +1,4 @@
-Copyright JS Foundation and other contributors, https://js.foundation
+Copyright OpenJS Foundation and other contributors, 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/node_modules/eslint/README.md b/node_modules/eslint/README.md
index 2edb836bb..040654c14 100644
--- a/node_modules/eslint/README.md
+++ b/node_modules/eslint/README.md
@@ -10,14 +10,13 @@
 # ESLint
 
 [Website](https://eslint.org) |
-[Configuring](https://eslint.org/docs/user-guide/configuring) |
+[Configure ESLint](https://eslint.org/docs/latest/use/configure) |
 [Rules](https://eslint.org/docs/rules/) |
-[Contributing](https://eslint.org/docs/developer-guide/contributing) |
-[Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
+[Contribute to ESLint](https://eslint.org/docs/latest/contribute) |
+[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) |
 [Code of Conduct](https://eslint.org/conduct) |
 [Twitter](https://twitter.com/geteslint) |
-[Mailing List](https://groups.google.com/group/eslint) |
-[Chat Room](https://eslint.org/chat)
+[Discord](https://eslint.org/chat)
 
 ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
 
@@ -31,7 +30,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
 2. [Configuration](#configuration)
 3. [Code of Conduct](#code-of-conduct)
 4. [Filing Issues](#filing-issues)
-5. [Frequently Asked Questions](#faq)
+5. [Frequently Asked Questions](#frequently-asked-questions)
 6. [Releases](#releases)
 7. [Security Policy](#security-policy)
 8. [Semantic Versioning Policy](#semantic-versioning-policy)
@@ -41,31 +40,25 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
 12. [Sponsors](#sponsors)
 13. [Technology Sponsors](#technology-sponsors)
 
-## Installation and Usage
+## Installation and Usage
 
-Prerequisites: [Node.js](https://nodejs.org/) (`^10.12.0`, or `>=12.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
+Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
 
-You can install ESLint using npm:
+You can install and configure ESLint using this command:
 
-```
-$ npm install eslint --save-dev
-```
-
-You should then set up a configuration file:
-
-```
-$ ./node_modules/.bin/eslint --init
+```shell
+npm init @eslint/config
 ```
 
 After that, you can run ESLint on any file or directory like this:
 
-```
-$ ./node_modules/.bin/eslint yourfile.js
+```shell
+./node_modules/.bin/eslint yourfile.js
 ```
 
-## Configuration
+## Configuration
 
-After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
+After running `npm init @eslint/config`, you'll have an `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
 
 ```json
 {
@@ -82,28 +75,28 @@ The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/do
 * `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
 * `"error"` or `2` - turn the rule on as an error (exit code will be 1)
 
-The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)).
+The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/latest/use/configure)).
 
-## Code of Conduct
+## Code of Conduct
 
 ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct).
 
-## Filing Issues
+## Filing Issues
 
 Before filing an issue, please be sure to read the guidelines for what you're reporting:
 
-* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs)
-* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules)
-* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes)
-* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes)
+* [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs)
+* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule)
+* [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change)
+* [Request a Change](https://eslint.org/docs/latest/contribute/request-change)
 
-## Frequently Asked Questions
+## Frequently Asked Questions
 
 ### I'm using JSCS, should I migrate to ESLint?
 
 Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported.
 
-We have prepared a [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration.
+We have prepared a [migration guide](https://eslint.org/docs/latest/use/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration.
 
 We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process.
 
@@ -119,23 +112,23 @@ No, ESLint does both traditional linting (looking for problematic patterns) and
 
 ### Does ESLint support JSX?
 
-Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
+Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/latest/use/configure)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
 
 ### What ECMAScript versions does ESLint support?
 
-ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, and 2020. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
+ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/latest/use/configure).
 
 ### What about experimental features?
 
 ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis.
 
-In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use the [babel-eslint](https://github.com/babel/babel-eslint) parser and [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) to use any option available in Babel.
+In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) to use any option available in Babel.
 
-Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
+Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/latest/contribute). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
 
 ### Where to ask for help?
 
-Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://eslint.org/chat).
+Open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat).
 
 ### Why doesn't ESLint lock dependency versions?
 
@@ -147,15 +140,15 @@ We intentionally don't lock dependency versions so that we have the latest compa
 
 The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more.
 
-## Releases
+## Releases
 
 We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release.
 
-## Security Policy
+## Security Policy
 
 ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).
 
-## Semantic Versioning Policy
+## Semantic Versioning Policy
 
 ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
 
@@ -188,7 +181,7 @@ ESLint follows [semantic versioning](https://semver.org). However, due to the na
 
 According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
 
-## Stylistic Rule Updates
+## Stylistic Rule Updates
 
 Stylistic rules are frozen according to [our policy](https://eslint.org/blog/2020/05/changes-to-rules-policies) on how we evaluate new rules and rule changes.
 This means:
@@ -197,15 +190,16 @@ This means:
 * **New ECMAScript features**: We will also make sure stylistic rules are compatible with new ECMAScript features.
 * **New options**: We will **not** add any new options to stylistic rules unless an option is the only way to fix a bug or support a newly-added ECMAScript feature.
 
-## License
+## License
 
 [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large)
 
-## Team
+## Team
 
 These folks keep the project moving and are resources for help.
 
 
+
 
 
 ### Technical Steering Committee (TSC)
@@ -218,23 +212,12 @@ The people who manage releases, review feature requests, and meet regularly to e
 Nicholas C. Zakas
 
 
-
-
-Brandon Mills -
- - -
-Toru Nagashima -
-
Milos Djermanovic
- ### Reviewers The people who review and implement new features. @@ -242,26 +225,33 @@ The people who review and implement new features.

-薛定谔的猫 +唯然 +
+
+ +
+Nitin Kumar
- - - ### Committers The people who review and fix bugs and help triage issues.
- -
-Pig Fang +
+
+Bryan Mishkin
- -
-Anix +
+
+Brandon Mills +
+
+ +
+Francesco Trotta
@@ -270,23 +260,43 @@ YeonJuan
+### Website Team + +Team members who focus specifically on eslint.org + +
+ +
+Amaresh S M +
+
+ +
+Strek +
+
+ +
+Percy Ma +
+
-## Sponsors +## Sponsors The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website.

Platinum Sponsors

-

Automattic

Gold Sponsors

-

Nx (by Nrwl) Chrome's Web Framework & Tools Performance Fund Shopify Salesforce Airbnb Substack Microsoft FOSS Fund Sponsorships

Silver Sponsors

-

Retool Liftoff

Bronze Sponsors

-

Buy.Fineproxy.Org Anagram Solver Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Fire Stick Tricks

+

Chrome Frameworks Fund Automattic

Gold Sponsors

+

RIDI Salesforce Airbnb

Silver Sponsors

+

Sentry Liftoff American Express

Bronze Sponsors

+

PayDay Say ThemeIsle Nx (by Nrwl) Anagram Solver Icons8: free icons, photos, illustrations, and music Discord Transloadit Ignition HeroCoders QuickBooks Tool hub

-## Technology Sponsors +## Technology Sponsors * Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com) * Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com) diff --git a/node_modules/eslint/bin/eslint.js b/node_modules/eslint/bin/eslint.js index 86291b0f5..7094ac77b 100755 --- a/node_modules/eslint/bin/eslint.js +++ b/node_modules/eslint/bin/eslint.js @@ -5,13 +5,10 @@ * @author Nicholas C. Zakas */ -/* eslint no-console:off */ +/* eslint no-console:off -- CLI */ "use strict"; -// to use V8's code cache to speed up instantiation time -require("v8-compile-cache"); - // must do this initialization *before* other requires in order to work if (process.argv.includes("--debug")) { require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*"); @@ -66,13 +63,10 @@ function readStdin() { */ function getErrorMessage(error) { - // Lazy loading because those are used only if error happened. - const fs = require("fs"); - const path = require("path"); + // Lazy loading because this is used only if an error happened. const util = require("util"); - const lodash = require("lodash"); - // Foolproof -- thirdparty module might throw non-object. + // Foolproof -- third-party module might throw non-object. if (typeof error !== "object" || error === null) { return String(error); } @@ -80,14 +74,7 @@ function getErrorMessage(error) { // Use templates if `error.messageTemplate` is present. if (typeof error.messageTemplate === "string") { try { - const templateFilePath = path.resolve( - __dirname, - `../messages/${error.messageTemplate}.txt` - ); - - // Use sync API because Node.js should exit at this tick. - const templateText = fs.readFileSync(templateFilePath, "utf-8"); - const template = lodash.template(templateText); + const template = require(`../messages/${error.messageTemplate}.js`); return template(error.messageData || {}); } catch { @@ -134,13 +121,20 @@ ${message}`); // Call the config initializer if `--init` is present. if (process.argv.includes("--init")) { - await require("../lib/init/config-initializer").initializeConfig(); + + // `eslint --init` has been moved to `@eslint/create-config` + console.warn("You can also run this command directly using 'npm init @eslint/config'."); + + const spawn = require("cross-spawn"); + + spawn.sync("npm", ["init", "@eslint/config"], { encoding: "utf8", stdio: "inherit" }); return; } // Otherwise, call the CLI. process.exitCode = await require("../lib/cli").execute( process.argv, - process.argv.includes("--stdin") ? await readStdin() : null + process.argv.includes("--stdin") ? await readStdin() : null, + true ); }()).catch(onFatalError); diff --git a/node_modules/eslint/conf/eslint-all.js b/node_modules/eslint/conf/eslint-all.js deleted file mode 100644 index 10c5304fd..000000000 --- a/node_modules/eslint/conf/eslint-all.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @fileoverview Config to enable all rules. - * @author Robert Fletcher - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const builtInRules = require("../lib/rules"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -const allRules = {}; - -for (const [ruleId, rule] of builtInRules) { - if (!rule.meta.deprecated) { - allRules[ruleId] = "error"; - } -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** @type {import("../lib/shared/types").ConfigData} */ -module.exports = { rules: allRules }; diff --git a/node_modules/eslint/conf/globals.js b/node_modules/eslint/conf/globals.js new file mode 100644 index 000000000..6018b7af1 --- /dev/null +++ b/node_modules/eslint/conf/globals.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Globals for ecmaVersion/sourceType + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Globals +//----------------------------------------------------------------------------- + +const commonjs = { + exports: true, + global: false, + module: false, + require: false +}; + +const es3 = { + Array: false, + Boolean: false, + constructor: false, + Date: false, + decodeURI: false, + decodeURIComponent: false, + encodeURI: false, + encodeURIComponent: false, + Error: false, + escape: false, + eval: false, + EvalError: false, + Function: false, + hasOwnProperty: false, + Infinity: false, + isFinite: false, + isNaN: false, + isPrototypeOf: false, + Math: false, + NaN: false, + Number: false, + Object: false, + parseFloat: false, + parseInt: false, + propertyIsEnumerable: false, + RangeError: false, + ReferenceError: false, + RegExp: false, + String: false, + SyntaxError: false, + toLocaleString: false, + toString: false, + TypeError: false, + undefined: false, + unescape: false, + URIError: false, + valueOf: false +}; + +const es5 = { + ...es3, + JSON: false +}; + +const es2015 = { + ...es5, + ArrayBuffer: false, + DataView: false, + Float32Array: false, + Float64Array: false, + Int16Array: false, + Int32Array: false, + Int8Array: false, + Map: false, + Promise: false, + Proxy: false, + Reflect: false, + Set: false, + Symbol: false, + Uint16Array: false, + Uint32Array: false, + Uint8Array: false, + Uint8ClampedArray: false, + WeakMap: false, + WeakSet: false +}; + +// no new globals in ES2016 +const es2016 = { + ...es2015 +}; + +const es2017 = { + ...es2016, + Atomics: false, + SharedArrayBuffer: false +}; + +// no new globals in ES2018 +const es2018 = { + ...es2017 +}; + +// no new globals in ES2019 +const es2019 = { + ...es2018 +}; + +const es2020 = { + ...es2019, + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const es2021 = { + ...es2020, + AggregateError: false, + FinalizationRegistry: false, + WeakRef: false +}; + +const es2022 = { + ...es2021 +}; + +const es2023 = { + ...es2022 +}; + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + commonjs, + es3, + es5, + es2015, + es2016, + es2017, + es2018, + es2019, + es2020, + es2021, + es2022, + es2023 +}; diff --git a/node_modules/eslint/conf/category-list.json b/node_modules/eslint/conf/rule-type-list.json similarity index 66% rename from node_modules/eslint/conf/category-list.json rename to node_modules/eslint/conf/rule-type-list.json index cd3b816b6..d5823acc8 100644 --- a/node_modules/eslint/conf/category-list.json +++ b/node_modules/eslint/conf/rule-type-list.json @@ -1,20 +1,17 @@ { - "categories": [ - { "name": "Possible Errors", "description": "These rules relate to possible syntax or logic errors in JavaScript code:" }, - { "name": "Best Practices", "description": "These rules relate to better ways of doing things to help you avoid problems:" }, - { "name": "Strict Mode", "description": "These rules relate to strict mode directives:" }, - { "name": "Variables", "description": "These rules relate to variable declarations:" }, - { "name": "Stylistic Issues", "description": "These rules relate to style guidelines, and are therefore quite subjective:" }, - { "name": "ECMAScript 6", "description": "These rules relate to ES6, also known as ES2015:" } + "types": [ + { "name": "problem", "displayName": "Possible Problems", "description": "These rules relate to possible logic errors in code:" }, + { "name": "suggestion", "displayName": "Suggestions", "description": "These rules suggest alternate ways of doing things:" }, + { "name": "layout", "displayName": "Layout & Formatting", "description": "These rules care about how the code looks rather than how it executes:" } ], "deprecated": { "name": "Deprecated", - "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", + "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", "rules": [] }, "removed": { "name": "Removed", - "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", + "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", "rules": [ { "removed": "generator-star", "replacedBy": ["generator-star-spacing"] }, { "removed": "global-strict", "replacedBy": ["strict"] }, diff --git a/node_modules/eslint/lib/api.js b/node_modules/eslint/lib/api.js index e4b6643b4..3dde09855 100644 --- a/node_modules/eslint/lib/api.js +++ b/node_modules/eslint/lib/api.js @@ -5,30 +5,22 @@ "use strict"; -const { CLIEngine } = require("./cli-engine"); +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + const { ESLint } = require("./eslint"); const { Linter } = require("./linter"); const { RuleTester } = require("./rule-tester"); const { SourceCode } = require("./source-code"); +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + module.exports = { Linter, - CLIEngine, ESLint, RuleTester, SourceCode }; - -// DOTO: remove deprecated API. -let deprecatedLinterInstance = null; - -Object.defineProperty(module.exports, "linter", { - enumerable: false, - get() { - if (!deprecatedLinterInstance) { - deprecatedLinterInstance = new Linter(); - } - - return deprecatedLinterInstance; - } -}); diff --git a/node_modules/eslint/lib/cli-engine/cli-engine.js b/node_modules/eslint/lib/cli-engine/cli-engine.js index b1befaa04..5bca1618b 100644 --- a/node_modules/eslint/lib/cli-engine/cli-engine.js +++ b/node_modules/eslint/lib/cli-engine/cli-engine.js @@ -27,16 +27,11 @@ const { naming, CascadingConfigArrayFactory, IgnorePattern, - getUsedExtractedConfigs + getUsedExtractedConfigs, + ModuleResolver } } = require("@eslint/eslintrc"); -/* - * For some reason, ModuleResolver must be included via filepath instead of by - * API exports in order to work properly. That's why this is separated out onto - * its own require() statement. - */ -const ModuleResolver = require("@eslint/eslintrc/lib/shared/relative-module-resolver"); const { FileEnumerator } = require("./file-enumerator"); const { Linter } = require("../linter"); @@ -46,7 +41,7 @@ const hash = require("./hash"); const LintResultCache = require("./lint-result-cache"); const debug = require("debug")("eslint:cli-engine"); -const validFixTypes = new Set(["problem", "suggestion", "layout"]); +const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]); //------------------------------------------------------------------------------ // Typedefs @@ -56,12 +51,14 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]); /** @typedef {import("../shared/types").ConfigData} ConfigData */ /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ /** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ /** @typedef {import("../shared/types").ParserOptions} ParserOptions */ /** @typedef {import("../shared/types").Plugin} Plugin */ /** @typedef {import("../shared/types").RuleConf} RuleConf */ /** @typedef {import("../shared/types").Rule} Rule */ -/** @typedef {ReturnType} ConfigArray */ -/** @typedef {ReturnType} ExtractedConfig */ +/** @typedef {import("../shared/types").FormatterFunction} FormatterFunction */ +/** @typedef {ReturnType} ConfigArray */ +/** @typedef {ReturnType} ExtractedConfig */ /** * The options to configure a CLI engine with. @@ -96,7 +93,9 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]); * @typedef {Object} LintResult * @property {string} filePath The path to the file that was linted. * @property {LintMessage[]} messages All of the messages for the result. + * @property {SuppressedLintMessage[]} suppressedMessages All of the suppressed messages for the result. * @property {number} errorCount Number of errors for the result. + * @property {number} fatalErrorCount Number of fatal errors for the result. * @property {number} warningCount Number of warnings for the result. * @property {number} fixableErrorCount Number of fixable errors for the result. * @property {number} fixableWarningCount Number of fixable warnings for the result. @@ -109,6 +108,7 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]); * @typedef {Object} LintReport * @property {LintResult[]} results All of the result. * @property {number} errorCount Number of errors for the result. + * @property {number} fatalErrorCount Number of fatal errors for the result. * @property {number} warningCount Number of warnings for the result. * @property {number} fixableErrorCount Number of fixable errors for the result. * @property {number} fixableWarningCount Number of fixable warnings for the result. @@ -161,6 +161,9 @@ function calculateStatsPerFile(messages) { return messages.reduce((stat, message) => { if (message.fatal || message.severity === 2) { stat.errorCount++; + if (message.fatal) { + stat.fatalErrorCount++; + } if (message.fix) { stat.fixableErrorCount++; } @@ -173,6 +176,7 @@ function calculateStatsPerFile(messages) { return stat; }, { errorCount: 0, + fatalErrorCount: 0, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0 @@ -188,12 +192,14 @@ function calculateStatsPerFile(messages) { function calculateStatsPerRun(results) { return results.reduce((stat, result) => { stat.errorCount += result.errorCount; + stat.fatalErrorCount += result.fatalErrorCount; stat.warningCount += result.warningCount; stat.fixableErrorCount += result.fixableErrorCount; stat.fixableWarningCount += result.fixableWarningCount; return stat; }, { errorCount: 0, + fatalErrorCount: 0, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0 @@ -260,6 +266,7 @@ function verifyText({ const result = { filePath, messages, + suppressedMessages: linter.getSuppressedMessages(), ...calculateStatsPerFile(messages) }; @@ -279,7 +286,7 @@ function verifyText({ /** * Returns result with warning by ignore settings * @param {string} filePath File path of checked code - * @param {string} baseDir Absolute path of base directory + * @param {string} baseDir Absolute path of base directory * @returns {LintResult} Result with single warning * @private */ @@ -306,7 +313,9 @@ function createIgnoreResult(filePath, baseDir) { message } ], + suppressedMessages: [], errorCount: 0, + fatalErrorCount: 0, warningCount: 1, fixableErrorCount: 0, fixableWarningCount: 0 @@ -330,6 +339,23 @@ function getRule(ruleId, configArrays) { return builtInRules.get(ruleId) || null; } +/** + * Checks whether a message's rule type should be fixed. + * @param {LintMessage} message The message to check. + * @param {ConfigArray[]} lastConfigArrays The list of config arrays that the last `executeOnFiles` or `executeOnText` used. + * @param {string[]} fixTypes An array of fix types to check. + * @returns {boolean} Whether the message should be fixed. + */ +function shouldMessageBeFixed(message, lastConfigArrays, fixTypes) { + if (!message.ruleId) { + return fixTypes.has("directive"); + } + + const rule = message.ruleId && getRule(message.ruleId, lastConfigArrays); + + return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type)); +} + /** * Collect used deprecated rules. * @param {ConfigArray[]} usedConfigArrays The config arrays which were used. @@ -340,9 +366,7 @@ function *iterateRuleDeprecationWarnings(usedConfigArrays) { // Flatten used configs. /** @type {ExtractedConfig[]} */ - const configs = [].concat( - ...usedConfigArrays.map(getUsedExtractedConfigs) - ); + const configs = usedConfigArrays.flatMap(getUsedExtractedConfigs); // Traverse rule configs. for (const config of configs) { @@ -390,7 +414,7 @@ function isErrorMessage(message) { * a directory or looks like a directory (ends in `path.sep`), in which case the file * name will be the `cacheFile/.cache_hashOfCWD` * - * if cacheFile points to a file or looks like a file then in will just use that file + * if cacheFile points to a file or looks like a file then it will just use that file * @param {string} cacheFile The name of file to be used to store the cache * @param {string} cwd Current working directory * @returns {string} the resolved path to the cache file @@ -462,6 +486,7 @@ function getCacheFile(cacheFile, cwd) { * @param {string[]|null} keys The keys to assign true. * @param {boolean} defaultValue The default value for each property. * @param {string} displayName The property name which is used in error message. + * @throws {Error} Requires array. * @returns {Record} The boolean map. */ function toBooleanMap(keys, defaultValue, displayName) { @@ -525,6 +550,7 @@ function createConfigDataFromOptions(options) { /** * Checks whether a directory exists at the given location * @param {string} resolvedPath A path from the CWD + * @throws {Error} As thrown by `fs.statSync` or `fs.isDirectory`. * @returns {boolean} `true` if a directory exists */ function directoryExists(resolvedPath) { @@ -542,13 +568,18 @@ function directoryExists(resolvedPath) { // Public Interface //------------------------------------------------------------------------------ +/** + * Core CLI. + */ class CLIEngine { /** * Creates a new instance of the core CLI engine. * @param {CLIEngineOptions} providedOptions The options for this instance. + * @param {Object} [additionalData] Additional settings that are not CLIEngineOptions. + * @param {Record|null} [additionalData.preloadedPlugins] Preloaded plugins. */ - constructor(providedOptions) { + constructor(providedOptions, { preloadedPlugins } = {}) { const options = Object.assign( Object.create(null), defaultOptions, @@ -561,6 +592,13 @@ class CLIEngine { } const additionalPluginPool = new Map(); + + if (preloadedPlugins) { + for (const [id, plugin] of Object.entries(preloadedPlugins)) { + additionalPluginPool.set(id, plugin); + } + } + const cacheFilePath = getCacheFile( options.cacheLocation || options.cacheFile, options.cwd @@ -577,8 +615,8 @@ class CLIEngine { useEslintrc: options.useEslintrc, builtInRules, loadRules, - eslintRecommendedPath: path.resolve(__dirname, "../../conf/eslint-recommended.js"), - eslintAllPath: path.resolve(__dirname, "../../conf/eslint-all.js") + getEslintRecommendedConfig: () => require("@eslint/js").configs.recommended, + getEslintAllConfig: () => require("@eslint/js").configs.all }); const fileEnumerator = new FileEnumerator({ configArrayFactory, @@ -622,12 +660,7 @@ class CLIEngine { const originalFix = (typeof options.fix === "function") ? options.fix : () => true; - options.fix = message => { - const rule = message.ruleId && getRule(message.ruleId, lastConfigArrays); - const matches = rule && rule.meta && fixTypes.has(rule.meta.type); - - return matches && originalFix(message); - }; + options.fix = message => shouldMessageBeFixed(message, lastConfigArrays, fixTypes) && originalFix(message); } } @@ -653,11 +686,13 @@ class CLIEngine { results.forEach(result => { const filteredMessages = result.messages.filter(isErrorMessage); + const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage); if (filteredMessages.length > 0) { filtered.push({ ...result, messages: filteredMessages, + suppressedMessages: filteredSuppressedMessages, errorCount: filteredMessages.length, warningCount: 0, fixableErrorCount: result.fixableErrorCount, @@ -680,26 +715,6 @@ class CLIEngine { }); } - - /** - * Add a plugin by passing its configuration - * @param {string} name Name of the plugin. - * @param {Plugin} pluginObject Plugin configuration object. - * @returns {void} - */ - addPlugin(name, pluginObject) { - const { - additionalPluginPool, - configArrayFactory, - lastConfigArrays - } = internalSlotsMap.get(this); - - additionalPluginPool.set(name, pluginObject); - configArrayFactory.clearCache(); - lastConfigArrays.length = 1; - lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); - } - /** * Resolves the patterns passed into executeOnFiles() into glob-based patterns * for easier handling. @@ -729,6 +744,7 @@ class CLIEngine { /** * Executes the current configuration on an array of file and directory names. * @param {string[]} patterns An array of file and directory names. + * @throws {Error} As may be thrown by `fs.unlinkSync`. * @returns {LintReport} The results for all files that were linted. */ executeOnFiles(patterns) { @@ -935,6 +951,7 @@ class CLIEngine { * This is the same logic used by the ESLint CLI executable to determine * configuration for each file it processes. * @param {string} filePath The path of the file to retrieve a config object for. + * @throws {Error} If filepath a directory path. * @returns {ConfigData} A configuration object for the file. */ getConfigForFile(filePath) { @@ -983,7 +1000,8 @@ class CLIEngine { * Returns the formatter representing the given format or null if the `format` is not a string. * @param {string} [format] The name of the format to load or the path to a * custom formatter. - * @returns {(Function|null)} The formatter function or null if the `format` is not a string. + * @throws {any} As may be thrown by requiring of formatter + * @returns {(FormatterFunction|null)} The formatter function or null if the `format` is not a string. */ getFormatter(format) { @@ -1003,7 +1021,7 @@ class CLIEngine { let formatterPath; // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) - if (!namespace && normalizedFormatName.indexOf("/") > -1) { + if (!namespace && normalizedFormatName.includes("/")) { formatterPath = path.resolve(cwd, normalizedFormatName); } else { try { @@ -1018,7 +1036,11 @@ class CLIEngine { try { return require(formatterPath); } catch (ex) { - ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; + if (format === "table" || format === "codeframe") { + ex.message = `The ${format} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${format}\``; + } else { + ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; + } throw ex; } diff --git a/node_modules/eslint/lib/cli-engine/file-enumerator.js b/node_modules/eslint/lib/cli-engine/file-enumerator.js index bd89ec733..5dff8d09c 100644 --- a/node_modules/eslint/lib/cli-engine/file-enumerator.js +++ b/node_modules/eslint/lib/cli-engine/file-enumerator.js @@ -38,7 +38,7 @@ const fs = require("fs"); const path = require("path"); const getGlobParent = require("glob-parent"); const isGlob = require("is-glob"); -const { escapeRegExp } = require("lodash"); +const escapeRegExp = require("escape-string-regexp"); const { Minimatch } = require("minimatch"); const { @@ -60,7 +60,7 @@ const IGNORED_SILENTLY = 1; const IGNORED = 2; // For VSCode intellisense -/** @typedef {ReturnType} ConfigArray */ +/** @typedef {ReturnType} ConfigArray */ /** * @typedef {Object} FileEnumeratorOptions @@ -114,6 +114,7 @@ function isGlobPattern(pattern) { /** * Get stats of a given path. * @param {string} filePath The path to target file. + * @throws {Error} As may be thrown by `fs.statSync`. * @returns {fs.Stats|null} The stats. * @private */ @@ -121,7 +122,8 @@ function statSafeSync(filePath) { try { return fs.statSync(filePath); } catch (error) { - /* istanbul ignore next */ + + /* c8 ignore next */ if (error.code !== "ENOENT") { throw error; } @@ -132,6 +134,7 @@ function statSafeSync(filePath) { /** * Get filenames in a given path to a directory. * @param {string} directoryPath The path to target directory. + * @throws {Error} As may be thrown by `fs.readdirSync`. * @returns {import("fs").Dirent[]} The filenames. * @private */ @@ -139,7 +142,8 @@ function readdirSafeSync(directoryPath) { try { return fs.readdirSync(directoryPath, { withFileTypes: true }); } catch (error) { - /* istanbul ignore next */ + + /* c8 ignore next */ if (error.code !== "ENOENT") { throw error; } @@ -173,7 +177,6 @@ function createExtensionRegExp(extensions) { */ class NoFilesFoundError extends Error { - // eslint-disable-next-line jsdoc/require-description /** * @param {string} pattern The glob pattern which was not found. * @param {boolean} globDisabled If `true` then the pattern was a glob pattern, but glob was disabled. @@ -190,7 +193,6 @@ class NoFilesFoundError extends Error { */ class AllFilesIgnoredError extends Error { - // eslint-disable-next-line jsdoc/require-description /** * @param {string} pattern The glob pattern which was not found. */ @@ -215,8 +217,8 @@ class FileEnumerator { cwd = process.cwd(), configArrayFactory = new CascadingConfigArrayFactory({ cwd, - eslintRecommendedPath: path.resolve(__dirname, "../../conf/eslint-recommended.js"), - eslintAllPath: path.resolve(__dirname, "../../conf/eslint-all.js") + getEslintRecommendedConfig: () => require("@eslint/js").configs.recommended, + getEslintAllConfig: () => require("@eslint/js").configs.all }), extensions = null, globInputPaths = true, @@ -270,6 +272,7 @@ class FileEnumerator { /** * Iterate files which are matched by given glob patterns. * @param {string|string[]} patternOrPatterns The glob patterns to iterate files. + * @throws {NoFilesFoundError|AllFilesIgnoredError} On an unmatched pattern. * @returns {IterableIterator} The found files. */ *iterateFiles(patternOrPatterns) { @@ -346,7 +349,7 @@ class FileEnumerator { return this._iterateFilesWithFile(absolutePath); } if (globInputPaths && isGlobPattern(pattern)) { - return this._iterateFilesWithGlob(absolutePath, isDot); + return this._iterateFilesWithGlob(pattern, isDot); } return []; @@ -395,15 +398,17 @@ class FileEnumerator { _iterateFilesWithGlob(pattern, dotfiles) { debug(`Glob: ${pattern}`); - const directoryPath = path.resolve(getGlobParent(pattern)); - const globPart = pattern.slice(directoryPath.length + 1); + const { cwd } = internalSlotsMap.get(this); + const directoryPath = path.resolve(cwd, getGlobParent(pattern)); + const absolutePath = path.resolve(cwd, pattern); + const globPart = absolutePath.slice(directoryPath.length + 1); /* * recursive if there are `**` or path separators in the glob part. * Otherwise, patterns such as `src/*.js`, it doesn't need recursive. */ const recursive = /\*\*|\/|\\/u.test(globPart); - const selector = new Minimatch(pattern, minimatchOpts); + const selector = new Minimatch(absolutePath, minimatchOpts); debug(`recursive? ${recursive}`); diff --git a/node_modules/eslint/lib/cli-engine/formatters/codeframe.js b/node_modules/eslint/lib/cli-engine/formatters/codeframe.js deleted file mode 100644 index 41e3ab7b0..000000000 --- a/node_modules/eslint/lib/cli-engine/formatters/codeframe.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @fileoverview Codeframe reporter - * @author Vitor Balocco - */ -"use strict"; - -const chalk = require("chalk"); -const { codeFrameColumns } = require("@babel/code-frame"); -const path = require("path"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Given a word and a count, append an s if count is not one. - * @param {string} word A word in its singular form. - * @param {number} count A number controlling whether word should be pluralized. - * @returns {string} The original word with an s on the end if count is not one. - */ -function pluralize(word, count) { - return (count === 1 ? word : `${word}s`); -} - -/** - * Gets a formatted relative file path from an absolute path and a line/column in the file. - * @param {string} filePath The absolute file path to format. - * @param {number} line The line from the file to use for formatting. - * @param {number} column The column from the file to use for formatting. - * @returns {string} The formatted file path. - */ -function formatFilePath(filePath, line, column) { - let relPath = path.relative(process.cwd(), filePath); - - if (line && column) { - relPath += `:${line}:${column}`; - } - - return chalk.green(relPath); -} - -/** - * Gets the formatted output for a given message. - * @param {Object} message The object that represents this message. - * @param {Object} parentResult The result object that this message belongs to. - * @returns {string} The formatted output. - */ -function formatMessage(message, parentResult) { - const type = (message.fatal || message.severity === 2) ? chalk.red("error") : chalk.yellow("warning"); - const msg = `${chalk.bold(message.message.replace(/([^ ])\.$/u, "$1"))}`; - const ruleId = message.fatal ? "" : chalk.dim(`(${message.ruleId})`); - const filePath = formatFilePath(parentResult.filePath, message.line, message.column); - const sourceCode = parentResult.output ? parentResult.output : parentResult.source; - - const firstLine = [ - `${type}:`, - `${msg}`, - ruleId ? `${ruleId}` : "", - sourceCode ? `at ${filePath}:` : `at ${filePath}` - ].filter(String).join(" "); - - const result = [firstLine]; - - if (sourceCode) { - result.push( - codeFrameColumns(sourceCode, { start: { line: message.line, column: message.column } }, { highlightCode: false }) - ); - } - - return result.join("\n"); -} - -/** - * Gets the formatted output summary for a given number of errors and warnings. - * @param {number} errors The number of errors. - * @param {number} warnings The number of warnings. - * @param {number} fixableErrors The number of fixable errors. - * @param {number} fixableWarnings The number of fixable warnings. - * @returns {string} The formatted output summary. - */ -function formatSummary(errors, warnings, fixableErrors, fixableWarnings) { - const summaryColor = errors > 0 ? "red" : "yellow"; - const summary = []; - const fixablesSummary = []; - - if (errors > 0) { - summary.push(`${errors} ${pluralize("error", errors)}`); - } - - if (warnings > 0) { - summary.push(`${warnings} ${pluralize("warning", warnings)}`); - } - - if (fixableErrors > 0) { - fixablesSummary.push(`${fixableErrors} ${pluralize("error", fixableErrors)}`); - } - - if (fixableWarnings > 0) { - fixablesSummary.push(`${fixableWarnings} ${pluralize("warning", fixableWarnings)}`); - } - - let output = chalk[summaryColor].bold(`${summary.join(" and ")} found.`); - - if (fixableErrors || fixableWarnings) { - output += chalk[summaryColor].bold(`\n${fixablesSummary.join(" and ")} potentially fixable with the \`--fix\` option.`); - } - - return output; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - let errors = 0; - let warnings = 0; - let fixableErrors = 0; - let fixableWarnings = 0; - - const resultsWithMessages = results.filter(result => result.messages.length > 0); - - let output = resultsWithMessages.reduce((resultsOutput, result) => { - const messages = result.messages.map(message => `${formatMessage(message, result)}\n\n`); - - errors += result.errorCount; - warnings += result.warningCount; - fixableErrors += result.fixableErrorCount; - fixableWarnings += result.fixableWarningCount; - - return resultsOutput.concat(messages); - }, []).join("\n"); - - output += "\n"; - output += formatSummary(errors, warnings, fixableErrors, fixableWarnings); - - return (errors + warnings) > 0 ? output : ""; -}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json b/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json new file mode 100644 index 000000000..bcd35e504 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json @@ -0,0 +1,46 @@ +[ + { + "name": "checkstyle", + "description": "Outputs results to the [Checkstyle](https://checkstyle.sourceforge.io/) format." + }, + { + "name": "compact", + "description": "Human-readable output format. Mimics the default output of JSHint." + }, + { + "name": "html", + "description": "Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser." + }, + { + "name": "jslint-xml", + "description": "Outputs results to format compatible with the [JSLint Jenkins plugin](https://plugins.jenkins.io/jslint/)." + }, + { + "name": "json-with-metadata", + "description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint." + }, + { + "name": "json", + "description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint." + }, + { + "name": "junit", + "description": "Outputs results to format compatible with the [JUnit Jenkins plugin](https://plugins.jenkins.io/junit/)." + }, + { + "name": "stylish", + "description": "Human-readable output format. This is the default formatter." + }, + { + "name": "tap", + "description": "Outputs results to the [Test Anything Protocol (TAP)](https://testanything.org/) specification format." + }, + { + "name": "unix", + "description": "Outputs results to a format similar to many commands in UNIX-like systems. Parsable with tools such as [grep](https://www.gnu.org/software/grep/manual/grep.html), [sed](https://www.gnu.org/software/sed/manual/sed.html), and [awk](https://www.gnu.org/software/gawk/manual/gawk.html)." + }, + { + "name": "visualstudio", + "description": "Outputs results to format compatible with the integrated terminal of the [Visual Studio](https://visualstudio.microsoft.com/) IDE. When using Visual Studio, you can click on the linting results in the integrated terminal to go to the issue in the source code." + } +] \ No newline at end of file diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html deleted file mode 100644 index 93795a1bd..000000000 --- a/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html +++ /dev/null @@ -1,8 +0,0 @@ - - <%= lineNumber %>:<%= columnNumber %> - <%= severityName %> - <%- message %> - - <%= ruleId %> - - diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html deleted file mode 100644 index 4016576fa..000000000 --- a/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - ESLint Report - - - -
-

ESLint Report

-
- <%= reportSummary %> - Generated on <%= date %> -
-
- - - <%= results %> - -
- - - diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html deleted file mode 100644 index f4a55933c..000000000 --- a/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html +++ /dev/null @@ -1,6 +0,0 @@ - - - [+] <%- filePath %> - <%- summary %> - - diff --git a/node_modules/eslint/lib/cli-engine/formatters/html.js b/node_modules/eslint/lib/cli-engine/formatters/html.js index 5d4b7e560..1aa66fcef 100644 --- a/node_modules/eslint/lib/cli-engine/formatters/html.js +++ b/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -4,17 +4,180 @@ */ "use strict"; -const lodash = require("lodash"); -const fs = require("fs"); -const path = require("path"); - //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ -const pageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-page.html"), "utf-8")); -const messageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-message.html"), "utf-8")); -const resultTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-result.html"), "utf-8")); +const encodeHTML = (function() { + const encodeHTMLRules = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + const matchHTML = /[&<>"']/ug; + + return function(code) { + return code + ? code.toString().replace(matchHTML, m => encodeHTMLRules[m] || m) + : ""; + }; +}()); + +/** + * Get the final HTML document. + * @param {Object} it data for the document. + * @returns {string} HTML document. + */ +function pageTemplate(it) { + const { reportColor, reportSummary, date, results } = it; + + return ` + + + + + ESLint Report + + + + + +
+

ESLint Report

+
+ ${reportSummary} - Generated on ${date} +
+
+ + + ${results} + +
+ + + +`.trimStart(); +} /** * Given a word and a count, append an s if count is not one. @@ -58,6 +221,35 @@ function renderColor(totalErrors, totalWarnings) { return 0; } +/** + * Get HTML (table row) describing a single message. + * @param {Object} it data for the message. + * @returns {string} HTML (table row) describing the message. + */ +function messageTemplate(it) { + const { + parentIndex, + lineNumber, + columnNumber, + severityNumber, + severityName, + message, + ruleUrl, + ruleId + } = it; + + return ` + + ${lineNumber}:${columnNumber} + ${severityName} + ${encodeHTML(message)} + + ${ruleId ? ruleId : ""} + + +`.trimStart(); +} + /** * Get HTML (table rows) describing the messages. * @param {Array} messages Messages. @@ -80,7 +272,9 @@ function renderMessages(messages, parentIndex, rulesMeta) { if (rulesMeta) { const meta = rulesMeta[message.ruleId]; - ruleUrl = lodash.get(meta, "docs.url", null); + if (meta && meta.docs && meta.docs.url) { + ruleUrl = meta.docs.url; + } } return messageTemplate({ @@ -96,8 +290,26 @@ function renderMessages(messages, parentIndex, rulesMeta) { }).join("\n"); } -// eslint-disable-next-line jsdoc/require-description /** + * Get HTML (table row) describing the result for a single file. + * @param {Object} it data for the file. + * @returns {string} HTML (table row) describing the result for the file. + */ +function resultTemplate(it) { + const { color, index, filePath, summary } = it; + + return ` + + + [+] ${encodeHTML(filePath)} + ${encodeHTML(summary)} + + +`.trimStart(); +} + +/** + * Render the results. * @param {Array} results Test results. * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. * @returns {string} HTML string describing the results. @@ -108,7 +320,6 @@ function renderResults(results, rulesMeta) { color: renderColor(result.errorCount, result.warningCount), filePath: result.filePath, summary: renderSummary(result.errorCount, result.warningCount) - }) + renderMessages(result.messages, index, rulesMeta)).join("\n"); } diff --git a/node_modules/eslint/lib/cli-engine/formatters/table.js b/node_modules/eslint/lib/cli-engine/formatters/table.js deleted file mode 100644 index a74cce0d5..000000000 --- a/node_modules/eslint/lib/cli-engine/formatters/table.js +++ /dev/null @@ -1,159 +0,0 @@ -/** - * @fileoverview "table reporter. - * @author Gajus Kuizinas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const chalk = require("chalk"), - table = require("table").table; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Given a word and a count, append an "s" if count is not one. - * @param {string} word A word. - * @param {number} count Quantity. - * @returns {string} The original word with an s on the end if count is not one. - */ -function pluralize(word, count) { - return (count === 1 ? word : `${word}s`); -} - -/** - * Draws text table. - * @param {Array} messages Error messages relating to a specific file. - * @returns {string} A text table. - */ -function drawTable(messages) { - const rows = []; - - if (messages.length === 0) { - return ""; - } - - rows.push([ - chalk.bold("Line"), - chalk.bold("Column"), - chalk.bold("Type"), - chalk.bold("Message"), - chalk.bold("Rule ID") - ]); - - messages.forEach(message => { - let messageType; - - if (message.fatal || message.severity === 2) { - messageType = chalk.red("error"); - } else { - messageType = chalk.yellow("warning"); - } - - rows.push([ - message.line || 0, - message.column || 0, - messageType, - message.message, - message.ruleId || "" - ]); - }); - - return table(rows, { - columns: { - 0: { - width: 8, - wrapWord: true - }, - 1: { - width: 8, - wrapWord: true - }, - 2: { - width: 8, - wrapWord: true - }, - 3: { - paddingRight: 5, - width: 50, - wrapWord: true - }, - 4: { - width: 20, - wrapWord: true - } - }, - drawHorizontalLine(index) { - return index === 1; - } - }); -} - -/** - * Draws a report (multiple tables). - * @param {Array} results Report results for every file. - * @returns {string} A column of text tables. - */ -function drawReport(results) { - let files; - - files = results.map(result => { - if (!result.messages.length) { - return ""; - } - - return `\n${result.filePath}\n\n${drawTable(result.messages)}`; - }); - - files = files.filter(content => content.trim()); - - return files.join(""); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(report) { - let result, - errorCount, - warningCount; - - result = ""; - errorCount = 0; - warningCount = 0; - - report.forEach(fileReport => { - errorCount += fileReport.errorCount; - warningCount += fileReport.warningCount; - }); - - if (errorCount || warningCount) { - result = drawReport(report); - } - - result += `\n${table([ - [ - chalk.red(pluralize(`${errorCount} Error`, errorCount)) - ], - [ - chalk.yellow(pluralize(`${warningCount} Warning`, warningCount)) - ] - ], { - columns: { - 0: { - width: 110, - wrapWord: true - } - }, - drawHorizontalLine() { - return true; - } - })}`; - - return result; -}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/tap.js b/node_modules/eslint/lib/cli-engine/formatters/tap.js index 354872a0c..e4148a3b3 100644 --- a/node_modules/eslint/lib/cli-engine/formatters/tap.js +++ b/node_modules/eslint/lib/cli-engine/formatters/tap.js @@ -31,7 +31,7 @@ function outputDiagnostics(diagnostic) { const prefix = " "; let output = `${prefix}---\n`; - output += prefix + yaml.safeDump(diagnostic).split("\n").join(`\n${prefix}`); + output += prefix + yaml.dump(diagnostic).split("\n").join(`\n${prefix}`); output += "...\n"; return output; } diff --git a/node_modules/eslint/lib/cli-engine/hash.js b/node_modules/eslint/lib/cli-engine/hash.js index 6d7ef8bf1..8e467734a 100644 --- a/node_modules/eslint/lib/cli-engine/hash.js +++ b/node_modules/eslint/lib/cli-engine/hash.js @@ -21,8 +21,8 @@ const murmur = require("imurmurhash"); /** * hash the given string - * @param {string} str the string to hash - * @returns {string} the hash + * @param {string} str the string to hash + * @returns {string} the hash */ function hash(str) { return murmur(str).result().toString(36); diff --git a/node_modules/eslint/lib/cli-engine/lint-result-cache.js b/node_modules/eslint/lib/cli-engine/lint-result-cache.js index 3304d429d..e36eb74ba 100644 --- a/node_modules/eslint/lib/cli-engine/lint-result-cache.js +++ b/node_modules/eslint/lib/cli-engine/lint-result-cache.js @@ -36,7 +36,7 @@ const invalidCacheStrategyErrorMessage = `Cache strategy must be one of: ${valid */ function isValidCacheStrategy(cacheStrategy) { return ( - validCacheStrategies.indexOf(cacheStrategy) !== -1 + validCacheStrategies.includes(cacheStrategy) ); } diff --git a/node_modules/eslint/lib/cli-engine/xml-escape.js b/node_modules/eslint/lib/cli-engine/xml-escape.js index 175c2c0c2..2e52dbaac 100644 --- a/node_modules/eslint/lib/cli-engine/xml-escape.js +++ b/node_modules/eslint/lib/cli-engine/xml-escape.js @@ -15,7 +15,7 @@ * @private */ module.exports = function(s) { - return (`${s}`).replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, c => { // eslint-disable-line no-control-regex + return (`${s}`).replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, c => { // eslint-disable-line no-control-regex -- Converting controls to entities switch (c) { case "<": return "<"; diff --git a/node_modules/eslint/lib/cli.js b/node_modules/eslint/lib/cli.js index 4216126b6..afd1e65cb 100644 --- a/node_modules/eslint/lib/cli.js +++ b/node_modules/eslint/lib/cli.js @@ -6,7 +6,7 @@ "use strict"; /* - * The CLI object should *not* call process.exit() directly. It should only return + * NOTE: The CLI object should *not* call process.exit() directly. It should only return * exit codes. This allows other programs to use the CLI object and still control * when the program exits. */ @@ -19,9 +19,13 @@ const fs = require("fs"), path = require("path"), { promisify } = require("util"), { ESLint } = require("./eslint"), - CLIOptions = require("./options"), + { FlatESLint } = require("./eslint/flat-eslint"), + createCLIOptions = require("./options"), log = require("./shared/logging"), RuntimeInfo = require("./shared/runtime-info"); +const { Legacy: { naming } } = require("@eslint/eslintrc"); +const { findFlatConfigFile } = require("./eslint/flat-eslint"); +const { ModuleImporter } = require("@humanwhocodes/module-importer"); const debug = require("debug")("eslint:cli"); @@ -32,6 +36,8 @@ const debug = require("debug")("eslint:cli"); /** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */ /** @typedef {import("./eslint/eslint").LintMessage} LintMessage */ /** @typedef {import("./eslint/eslint").LintResult} LintResult */ +/** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */ +/** @typedef {import("./shared/types").ResultsMeta} ResultsMeta */ //------------------------------------------------------------------------------ // Helpers @@ -53,17 +59,20 @@ function quietFixPredicate(message) { } /** - * Translates the CLI options into the options expected by the CLIEngine. - * @param {Object} cliOptions The CLI options to translate. - * @returns {ESLintOptions} The options object for the CLIEngine. + * Translates the CLI options into the options expected by the ESLint constructor. + * @param {ParsedCLIOptions} cliOptions The CLI options to translate. + * @param {"flat"|"eslintrc"} [configType="eslintrc"] The format of the + * config to generate. + * @returns {Promise} The options object for the ESLint constructor. * @private */ -function translateOptions({ +async function translateOptions({ cache, cacheFile, cacheLocation, cacheStrategy, config, + configLookup, env, errorOnUnmatchedPattern, eslintrc, @@ -84,19 +93,60 @@ function translateOptions({ resolvePluginsRelativeTo, rule, rulesdir -}) { - return { - allowInlineConfig: inlineConfig, - cache, - cacheLocation: cacheLocation || cacheFile, - cacheStrategy, - errorOnUnmatchedPattern, - extensions: ext, - fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), - fixTypes: fixType, - ignore, - ignorePath, - overrideConfig: { +}, configType) { + + let overrideConfig, overrideConfigFile; + const importer = new ModuleImporter(); + + if (configType === "flat") { + overrideConfigFile = (typeof config === "string") ? config : !configLookup; + if (overrideConfigFile === false) { + overrideConfigFile = void 0; + } + + let globals = {}; + + if (global) { + globals = global.reduce((obj, name) => { + if (name.endsWith(":true")) { + obj[name.slice(0, -5)] = "writable"; + } else { + obj[name] = "readonly"; + } + return obj; + }, globals); + } + + overrideConfig = [{ + languageOptions: { + globals, + parserOptions: parserOptions || {} + }, + rules: rule ? rule : {} + }]; + + if (parser) { + overrideConfig[0].languageOptions.parser = await importer.import(parser); + } + + if (plugin) { + const plugins = {}; + + for (const pluginName of plugin) { + + const shortName = naming.getShorthandName(pluginName, "eslint-plugin"); + const longName = naming.normalizePackageName(pluginName, "eslint-plugin"); + + plugins[shortName] = await importer.import(longName); + } + + overrideConfig[0].plugins = plugins; + } + + } else { + overrideConfigFile = config; + + overrideConfig = { env: env && env.reduce((obj, name) => { obj[name] = true; return obj; @@ -114,30 +164,53 @@ function translateOptions({ parserOptions, plugins: plugin, rules: rule - }, - overrideConfigFile: config, - reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0, - resolvePluginsRelativeTo, - rulePaths: rulesdir, - useEslintrc: eslintrc + }; + } + + const options = { + allowInlineConfig: inlineConfig, + cache, + cacheLocation: cacheLocation || cacheFile, + cacheStrategy, + errorOnUnmatchedPattern, + fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), + fixTypes: fixType, + ignore, + overrideConfig, + overrideConfigFile, + reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0 }; + + if (configType === "flat") { + options.ignorePatterns = ignorePattern; + } else { + options.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + options.rulePaths = rulesdir; + options.useEslintrc = eslintrc; + options.extensions = ext; + options.ignorePath = ignorePath; + } + + return options; } /** * Count error messages. * @param {LintResult[]} results The lint results. - * @returns {{errorCount:number;warningCount:number}} The number of error messages. + * @returns {{errorCount:number;fatalErrorCount:number,warningCount:number}} The number of error messages. */ function countErrors(results) { let errorCount = 0; + let fatalErrorCount = 0; let warningCount = 0; for (const result of results) { errorCount += result.errorCount; + fatalErrorCount += result.fatalErrorCount; warningCount += result.warningCount; } - return { errorCount, warningCount }; + return { errorCount, fatalErrorCount, warningCount }; } /** @@ -162,10 +235,11 @@ async function isDirectory(filePath) { * @param {LintResult[]} results The results to print. * @param {string} format The name of the formatter to use or the path to the formatter. * @param {string} outputFile The path for the output file. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. * @returns {Promise} True if the printing succeeds, false if not. * @private */ -async function printResults(engine, results, format, outputFile) { +async function printResults(engine, results, format, outputFile, resultsMeta) { let formatter; try { @@ -175,7 +249,7 @@ async function printResults(engine, results, format, outputFile) { return false; } - const output = formatter.format(results); + const output = await formatter.format(results, resultsMeta); if (output) { if (outputFile) { @@ -201,6 +275,31 @@ async function printResults(engine, results, format, outputFile) { return true; } +/** + * Returns whether flat config should be used. + * @param {boolean} [allowFlatConfig] Whether or not to allow flat config. + * @returns {Promise} Where flat config should be used. + */ +async function shouldUseFlatConfig(allowFlatConfig) { + if (!allowFlatConfig) { + return false; + } + + switch (process.env.ESLINT_USE_FLAT_CONFIG) { + case "true": + return true; + case "false": + return false; + default: + + /* + * If neither explicitly enabled nor disabled, then use the presence + * of a flat config file to determine enablement. + */ + return !!(await findFlatConfigFile(process.cwd())); + } +} + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -215,17 +314,34 @@ const cli = { * Executes the CLI based on an array of arguments that is passed in. * @param {string|Array|Object} args The arguments to process. * @param {string} [text] The text to lint (used for TTY). + * @param {boolean} [allowFlatConfig] Whether or not to allow flat config. * @returns {Promise} The exit code for the operation. */ - async execute(args, text) { + async execute(args, text, allowFlatConfig) { if (Array.isArray(args)) { debug("CLI args: %o", args.slice(2)); } + + /* + * Before doing anything, we need to see if we are using a + * flat config file. If so, then we need to change the way command + * line args are parsed. This is temporary, and when we fully + * switch to flat config we can remove this logic. + */ + + const usingFlatConfig = await shouldUseFlatConfig(allowFlatConfig); + + debug("Using flat config?", usingFlatConfig); + + const CLIOptions = createCLIOptions(usingFlatConfig); + + /** @type {ParsedCLIOptions} */ let options; try { options = CLIOptions.parse(args); } catch (error) { + debug("Error parsing CLI options:", error.message); log.error(error.message); return 2; } @@ -246,6 +362,7 @@ const cli = { log.info(RuntimeInfo.environment()); return 0; } catch (err) { + debug("Error retrieving environment info"); log.error(err.message); return 2; } @@ -261,7 +378,9 @@ const cli = { return 2; } - const engine = new ESLint(translateOptions(options)); + const engine = usingFlatConfig + ? new FlatESLint(await translateOptions(options, "flat")) + : new ESLint(await translateOptions(options)); const fileConfig = await engine.calculateConfigForFile(options.printConfig); @@ -284,7 +403,9 @@ const cli = { return 2; } - const engine = new ESLint(translateOptions(options)); + const ActiveESLint = usingFlatConfig ? FlatESLint : ESLint; + + const engine = new ActiveESLint(await translateOptions(options, usingFlatConfig ? "flat" : "eslintrc")); let results; if (useStdin) { @@ -298,27 +419,45 @@ const cli = { if (options.fix) { debug("Fix mode enabled - applying fixes"); - await ESLint.outputFixes(results); + await ActiveESLint.outputFixes(results); } + let resultsToPrint = results; + if (options.quiet) { debug("Quiet mode enabled - filtering out warnings"); - results = ESLint.getErrorResults(results); + resultsToPrint = ActiveESLint.getErrorResults(resultsToPrint); } - if (await printResults(engine, results, options.format, options.outputFile)) { - const { errorCount, warningCount } = countErrors(results); - const tooManyWarnings = - options.maxWarnings >= 0 && warningCount > options.maxWarnings; + const resultCounts = countErrors(results); + const tooManyWarnings = options.maxWarnings >= 0 && resultCounts.warningCount > options.maxWarnings; + const resultsMeta = tooManyWarnings + ? { + maxWarningsExceeded: { + maxWarnings: options.maxWarnings, + foundWarnings: resultCounts.warningCount + } + } + : {}; + + if (await printResults(engine, resultsToPrint, options.format, options.outputFile, resultsMeta)) { - if (!errorCount && tooManyWarnings) { + // Errors and warnings from the original unfiltered results should determine the exit code + const shouldExitForFatalErrors = + options.exitOnFatalError && resultCounts.fatalErrorCount > 0; + + if (!resultCounts.errorCount && tooManyWarnings) { log.error( "ESLint found too many warnings (maximum: %s).", options.maxWarnings ); } - return (errorCount || tooManyWarnings) ? 1 : 0; + if (shouldExitForFatalErrors) { + return 2; + } + + return (resultCounts.errorCount || tooManyWarnings) ? 1 : 0; } return 2; diff --git a/node_modules/eslint/lib/config/default-config.js b/node_modules/eslint/lib/config/default-config.js new file mode 100644 index 000000000..aa0dfb2a5 --- /dev/null +++ b/node_modules/eslint/lib/config/default-config.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Default configuration + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const Rules = require("../rules"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +exports.defaultConfig = [ + { + plugins: { + "@": { + parsers: { + espree: require("espree") + }, + + /* + * Because we try to delay loading rules until absolutely + * necessary, a proxy allows us to hook into the lazy-loading + * aspect of the rules map while still keeping all of the + * relevant configuration inside of the config array. + */ + rules: new Proxy({}, { + get(target, property) { + return Rules.get(property); + }, + + has(target, property) { + return Rules.has(property); + } + }) + } + }, + languageOptions: { + sourceType: "module", + ecmaVersion: "latest", + parser: "@/espree", + parserOptions: {} + } + }, + + // default ignores are listed here + { + ignores: [ + "**/node_modules/*", + ".git/" + ] + }, + + // intentionally empty config to ensure these files are globbed by default + { + files: ["**/*.js", "**/*.mjs"] + }, + { + files: ["**/*.cjs"], + languageOptions: { + sourceType: "commonjs", + ecmaVersion: "latest" + } + } +]; diff --git a/node_modules/eslint/lib/config/flat-config-array.js b/node_modules/eslint/lib/config/flat-config-array.js new file mode 100644 index 000000000..78b4ef44b --- /dev/null +++ b/node_modules/eslint/lib/config/flat-config-array.js @@ -0,0 +1,275 @@ +/** + * @fileoverview Flat Config Array + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { ConfigArray, ConfigArraySymbol } = require("@humanwhocodes/config-array"); +const { flatConfigSchema } = require("./flat-config-schema"); +const { RuleValidator } = require("./rule-validator"); +const { defaultConfig } = require("./default-config"); +const jsPlugin = require("@eslint/js"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const ruleValidator = new RuleValidator(); + +/** + * Splits a plugin identifier in the form a/b/c into two parts: a/b and c. + * @param {string} identifier The identifier to parse. + * @returns {{objectName: string, pluginName: string}} The parts of the plugin + * name. + */ +function splitPluginIdentifier(identifier) { + const parts = identifier.split("/"); + + return { + objectName: parts.pop(), + pluginName: parts.join("/") + }; +} + +/** + * Returns the name of an object in the config by reading its `meta` key. + * @param {Object} object The object to check. + * @returns {string?} The name of the object if found or `null` if there + * is no name. + */ +function getObjectId(object) { + + // first check old-style name + let name = object.name; + + if (!name) { + + if (!object.meta) { + return null; + } + + name = object.meta.name; + + if (!name) { + return null; + } + } + + // now check for old-style version + let version = object.version; + + if (!version) { + version = object.meta && object.meta.version; + } + + // if there's a version then append that + if (version) { + return `${name}@${version}`; + } + + return name; +} + +const originalBaseConfig = Symbol("originalBaseConfig"); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Represents an array containing configuration information for ESLint. + */ +class FlatConfigArray extends ConfigArray { + + /** + * Creates a new instance. + * @param {*[]} configs An array of configuration information. + * @param {{basePath: string, shouldIgnore: boolean, baseConfig: FlatConfig}} options The options + * to use for the config array instance. + */ + constructor(configs, { + basePath, + shouldIgnore = true, + baseConfig = defaultConfig + } = {}) { + super(configs, { + basePath, + schema: flatConfigSchema + }); + + if (baseConfig[Symbol.iterator]) { + this.unshift(...baseConfig); + } else { + this.unshift(baseConfig); + } + + /** + * The base config used to build the config array. + * @type {Array} + */ + this[originalBaseConfig] = baseConfig; + Object.defineProperty(this, originalBaseConfig, { writable: false }); + + /** + * Determines if `ignores` fields should be honored. + * If true, then all `ignores` fields are honored. + * if false, then only `ignores` fields in the baseConfig are honored. + * @type {boolean} + */ + this.shouldIgnore = shouldIgnore; + Object.defineProperty(this, "shouldIgnore", { writable: false }); + } + + /* eslint-disable class-methods-use-this -- Desired as instance method */ + /** + * Replaces a config with another config to allow us to put strings + * in the config array that will be replaced by objects before + * normalization. + * @param {Object} config The config to preprocess. + * @returns {Object} The preprocessed config. + */ + [ConfigArraySymbol.preprocessConfig](config) { + if (config === "eslint:recommended") { + + // if we are in a Node.js environment warn the user + if (typeof process !== "undefined" && process.emitWarning) { + process.emitWarning("The 'eslint:recommended' string configuration is deprecated and will be replaced by the @eslint/js package's 'recommended' config."); + } + + return jsPlugin.configs.recommended; + } + + if (config === "eslint:all") { + + // if we are in a Node.js environment warn the user + if (typeof process !== "undefined" && process.emitWarning) { + process.emitWarning("The 'eslint:all' string configuration is deprecated and will be replaced by the @eslint/js package's 'all' config."); + } + + return jsPlugin.configs.all; + } + + /* + * If `shouldIgnore` is false, we remove any ignore patterns specified + * in the config so long as it's not a default config and it doesn't + * have a `files` entry. + */ + if ( + !this.shouldIgnore && + !this[originalBaseConfig].includes(config) && + config.ignores && + !config.files + ) { + /* eslint-disable-next-line no-unused-vars -- need to strip off other keys */ + const { ignores, ...otherKeys } = config; + + return otherKeys; + } + + return config; + } + + /** + * Finalizes the config by replacing plugin references with their objects + * and validating rule option schemas. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + * @throws {TypeError} If the config is invalid. + */ + [ConfigArraySymbol.finalizeConfig](config) { + + const { plugins, languageOptions, processor } = config; + let parserName, processorName; + let invalidParser = false, + invalidProcessor = false; + + // Check parser value + if (languageOptions && languageOptions.parser) { + const { parser } = languageOptions; + + if (typeof parser === "string") { + const { pluginName, objectName: localParserName } = splitPluginIdentifier(parser); + + parserName = parser; + + if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[localParserName]) { + throw new TypeError(`Key "parser": Could not find "${localParserName}" in plugin "${pluginName}".`); + } + + languageOptions.parser = plugins[pluginName].parsers[localParserName]; + } else if (typeof parser === "object") { + parserName = getObjectId(parser); + + if (!parserName) { + invalidParser = true; + } + + } else { + invalidParser = true; + } + } + + // Check processor value + if (processor) { + if (typeof processor === "string") { + const { pluginName, objectName: localProcessorName } = splitPluginIdentifier(processor); + + processorName = processor; + + if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[localProcessorName]) { + throw new TypeError(`Key "processor": Could not find "${localProcessorName}" in plugin "${pluginName}".`); + } + + config.processor = plugins[pluginName].processors[localProcessorName]; + } else if (typeof processor === "object") { + processorName = getObjectId(processor); + + if (!processorName) { + invalidProcessor = true; + } + + } else { + invalidProcessor = true; + } + } + + ruleValidator.validate(config); + + // apply special logic for serialization into JSON + /* eslint-disable object-shorthand -- shorthand would change "this" value */ + Object.defineProperty(config, "toJSON", { + value: function() { + + if (invalidParser) { + throw new Error("Could not serialize parser object (missing 'meta' object)."); + } + + if (invalidProcessor) { + throw new Error("Could not serialize processor object (missing 'meta' object)."); + } + + return { + ...this, + plugins: Object.keys(plugins), + languageOptions: { + ...languageOptions, + parser: parserName + }, + processor: processorName + }; + } + }); + /* eslint-enable object-shorthand -- ok to enable now */ + + return config; + } + /* eslint-enable class-methods-use-this -- Desired as instance method */ + +} + +exports.FlatConfigArray = FlatConfigArray; diff --git a/node_modules/eslint/lib/config/flat-config-helpers.js b/node_modules/eslint/lib/config/flat-config-helpers.js new file mode 100644 index 000000000..e00c56434 --- /dev/null +++ b/node_modules/eslint/lib/config/flat-config-helpers.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Shared functions to work with configs. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Functions +//----------------------------------------------------------------------------- + +/** + * Parses a ruleId into its plugin and rule parts. + * @param {string} ruleId The rule ID to parse. + * @returns {{pluginName:string,ruleName:string}} The plugin and rule + * parts of the ruleId; + */ +function parseRuleId(ruleId) { + let pluginName, ruleName; + + // distinguish between core rules and plugin rules + if (ruleId.includes("/")) { + + // mimic scoped npm packages + if (ruleId.startsWith("@")) { + pluginName = ruleId.slice(0, ruleId.lastIndexOf("/")); + } else { + pluginName = ruleId.slice(0, ruleId.indexOf("/")); + } + + ruleName = ruleId.slice(pluginName.length + 1); + } else { + pluginName = "@"; + ruleName = ruleId; + } + + return { + pluginName, + ruleName + }; +} + +/** + * Retrieves a rule instance from a given config based on the ruleId. + * @param {string} ruleId The rule ID to look for. + * @param {FlatConfig} config The config to search. + * @returns {import("../shared/types").Rule|undefined} The rule if found + * or undefined if not. + */ +function getRuleFromConfig(ruleId, config) { + + const { pluginName, ruleName } = parseRuleId(ruleId); + + const plugin = config.plugins && config.plugins[pluginName]; + let rule = plugin && plugin.rules && plugin.rules[ruleName]; + + + // normalize function rules into objects + if (rule && typeof rule === "function") { + rule = { + create: rule + }; + } + + return rule; +} + +/** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ +function getRuleOptionsSchema(rule) { + + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + parseRuleId, + getRuleFromConfig, + getRuleOptionsSchema +}; diff --git a/node_modules/eslint/lib/config/flat-config-schema.js b/node_modules/eslint/lib/config/flat-config-schema.js new file mode 100644 index 000000000..cb8e7961a --- /dev/null +++ b/node_modules/eslint/lib/config/flat-config-schema.js @@ -0,0 +1,457 @@ +/** + * @fileoverview Flat config schema + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Type Definitions +//----------------------------------------------------------------------------- + +/** + * @typedef ObjectPropertySchema + * @property {Function|string} merge The function or name of the function to call + * to merge multiple objects with this property. + * @property {Function|string} validate The function or name of the function to call + * to validate the value of this property. + */ + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const ruleSeverities = new Map([ + [0, 0], ["off", 0], + [1, 1], ["warn", 1], + [2, 2], ["error", 2] +]); + +const globalVariablesValues = new Set([ + true, "true", "writable", "writeable", + false, "false", "readonly", "readable", null, + "off" +]); + +/** + * Check if a value is a non-null object. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(value) { + return typeof value === "object" && value !== null; +} + +/** + * Check if a value is undefined. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is undefined. + */ +function isUndefined(value) { + return typeof value === "undefined"; +} + +/** + * Deeply merges two objects. + * @param {Object} first The base object. + * @param {Object} second The overrides object. + * @returns {Object} An object with properties from both first and second. + */ +function deepMerge(first = {}, second = {}) { + + /* + * If the second value is an array, just return it. We don't merge + * arrays because order matters and we can't know the correct order. + */ + if (Array.isArray(second)) { + return second; + } + + /* + * First create a result object where properties from the second object + * overwrite properties from the first. This sets up a baseline to use + * later rather than needing to inspect and change every property + * individually. + */ + const result = { + ...first, + ...second + }; + + for (const key of Object.keys(second)) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + const firstValue = first[key]; + const secondValue = second[key]; + + if (isNonNullObject(firstValue)) { + result[key] = deepMerge(firstValue, secondValue); + } else if (isUndefined(firstValue)) { + if (isNonNullObject(secondValue)) { + result[key] = deepMerge( + Array.isArray(secondValue) ? [] : {}, + secondValue + ); + } else if (!isUndefined(secondValue)) { + result[key] = secondValue; + } + } + } + + return result; + +} + +/** + * Normalizes the rule options config for a given rule by ensuring that + * it is an array and that the first item is 0, 1, or 2. + * @param {Array|string|number} ruleOptions The rule options config. + * @returns {Array} An array of rule options. + */ +function normalizeRuleOptions(ruleOptions) { + + const finalOptions = Array.isArray(ruleOptions) + ? ruleOptions.slice(0) + : [ruleOptions]; + + finalOptions[0] = ruleSeverities.get(finalOptions[0]); + return finalOptions; +} + +//----------------------------------------------------------------------------- +// Assertions +//----------------------------------------------------------------------------- + +/** + * Validates that a value is a valid rule options entry. + * @param {any} value The value to check. + * @returns {void} + * @throws {TypeError} If the value isn't a valid rule options. + */ +function assertIsRuleOptions(value) { + + if (typeof value !== "string" && typeof value !== "number" && !Array.isArray(value)) { + throw new TypeError("Expected a string, number, or array."); + } +} + +/** + * Validates that a value is valid rule severity. + * @param {any} value The value to check. + * @returns {void} + * @throws {TypeError} If the value isn't a valid rule severity. + */ +function assertIsRuleSeverity(value) { + const severity = typeof value === "string" + ? ruleSeverities.get(value.toLowerCase()) + : ruleSeverities.get(value); + + if (typeof severity === "undefined") { + throw new TypeError("Expected severity of \"off\", 0, \"warn\", 1, \"error\", or 2."); + } +} + +/** + * Validates that a given string is the form pluginName/objectName. + * @param {string} value The string to check. + * @returns {void} + * @throws {TypeError} If the string isn't in the correct format. + */ +function assertIsPluginMemberName(value) { + if (!/[@a-z0-9-_$]+(?:\/(?:[a-z0-9-_$]+))+$/iu.test(value)) { + throw new TypeError(`Expected string in the form "pluginName/objectName" but found "${value}".`); + } +} + +/** + * Validates that a value is an object. + * @param {any} value The value to check. + * @returns {void} + * @throws {TypeError} If the value isn't an object. + */ +function assertIsObject(value) { + if (!isNonNullObject(value)) { + throw new TypeError("Expected an object."); + } +} + +/** + * Validates that a value is an object or a string. + * @param {any} value The value to check. + * @returns {void} + * @throws {TypeError} If the value isn't an object or a string. + */ +function assertIsObjectOrString(value) { + if ((!value || typeof value !== "object") && typeof value !== "string") { + throw new TypeError("Expected an object or string."); + } +} + +//----------------------------------------------------------------------------- +// Low-Level Schemas +//----------------------------------------------------------------------------- + +/** @type {ObjectPropertySchema} */ +const booleanSchema = { + merge: "replace", + validate: "boolean" +}; + +/** @type {ObjectPropertySchema} */ +const deepObjectAssignSchema = { + merge(first = {}, second = {}) { + return deepMerge(first, second); + }, + validate: "object" +}; + +//----------------------------------------------------------------------------- +// High-Level Schemas +//----------------------------------------------------------------------------- + +/** @type {ObjectPropertySchema} */ +const globalsSchema = { + merge: "assign", + validate(value) { + + assertIsObject(value); + + for (const key of Object.keys(value)) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + if (key !== key.trim()) { + throw new TypeError(`Global "${key}" has leading or trailing whitespace.`); + } + + if (!globalVariablesValues.has(value[key])) { + throw new TypeError(`Key "${key}": Expected "readonly", "writable", or "off".`); + } + } + } +}; + +/** @type {ObjectPropertySchema} */ +const parserSchema = { + merge: "replace", + validate(value) { + assertIsObjectOrString(value); + + if (typeof value === "object" && typeof value.parse !== "function" && typeof value.parseForESLint !== "function") { + throw new TypeError("Expected object to have a parse() or parseForESLint() method."); + } + + if (typeof value === "string") { + assertIsPluginMemberName(value); + } + } +}; + +/** @type {ObjectPropertySchema} */ +const pluginsSchema = { + merge(first = {}, second = {}) { + const keys = new Set([...Object.keys(first), ...Object.keys(second)]); + const result = {}; + + // manually validate that plugins are not redefined + for (const key of keys) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + if (key in first && key in second && first[key] !== second[key]) { + throw new TypeError(`Cannot redefine plugin "${key}".`); + } + + result[key] = second[key] || first[key]; + } + + return result; + }, + validate(value) { + + // first check the value to be sure it's an object + if (value === null || typeof value !== "object") { + throw new TypeError("Expected an object."); + } + + // second check the keys to make sure they are objects + for (const key of Object.keys(value)) { + + // avoid hairy edge case + if (key === "__proto__") { + continue; + } + + if (value[key] === null || typeof value[key] !== "object") { + throw new TypeError(`Key "${key}": Expected an object.`); + } + } + } +}; + +/** @type {ObjectPropertySchema} */ +const processorSchema = { + merge: "replace", + validate(value) { + if (typeof value === "string") { + assertIsPluginMemberName(value); + } else if (value && typeof value === "object") { + if (typeof value.preprocess !== "function" || typeof value.postprocess !== "function") { + throw new TypeError("Object must have a preprocess() and a postprocess() method."); + } + } else { + throw new TypeError("Expected an object or a string."); + } + } +}; + +/** @type {ObjectPropertySchema} */ +const rulesSchema = { + merge(first = {}, second = {}) { + + const result = { + ...first, + ...second + }; + + for (const ruleId of Object.keys(result)) { + + // avoid hairy edge case + if (ruleId === "__proto__") { + + /* eslint-disable-next-line no-proto -- Though deprecated, may still be present */ + delete result.__proto__; + continue; + } + + result[ruleId] = normalizeRuleOptions(result[ruleId]); + + /* + * If either rule config is missing, then the correct + * config is already present and we just need to normalize + * the severity. + */ + if (!(ruleId in first) || !(ruleId in second)) { + continue; + } + + const firstRuleOptions = normalizeRuleOptions(first[ruleId]); + const secondRuleOptions = normalizeRuleOptions(second[ruleId]); + + /* + * If the second rule config only has a severity (length of 1), + * then use that severity and keep the rest of the options from + * the first rule config. + */ + if (secondRuleOptions.length === 1) { + result[ruleId] = [secondRuleOptions[0], ...firstRuleOptions.slice(1)]; + continue; + } + + /* + * In any other situation, then the second rule config takes + * precedence. That means the value at `result[ruleId]` is + * already correct and no further work is necessary. + */ + } + + return result; + }, + + validate(value) { + assertIsObject(value); + + let lastRuleId; + + // Performance: One try-catch has less overhead than one per loop iteration + try { + + /* + * We are not checking the rule schema here because there is no + * guarantee that the rule definition is present at this point. Instead + * we wait and check the rule schema during the finalization step + * of calculating a config. + */ + for (const ruleId of Object.keys(value)) { + + // avoid hairy edge case + if (ruleId === "__proto__") { + continue; + } + + lastRuleId = ruleId; + + const ruleOptions = value[ruleId]; + + assertIsRuleOptions(ruleOptions); + + if (Array.isArray(ruleOptions)) { + assertIsRuleSeverity(ruleOptions[0]); + } else { + assertIsRuleSeverity(ruleOptions); + } + } + } catch (error) { + error.message = `Key "${lastRuleId}": ${error.message}`; + throw error; + } + } +}; + +/** @type {ObjectPropertySchema} */ +const ecmaVersionSchema = { + merge: "replace", + validate(value) { + if (typeof value === "number" || value === "latest") { + return; + } + + throw new TypeError("Expected a number or \"latest\"."); + } +}; + +/** @type {ObjectPropertySchema} */ +const sourceTypeSchema = { + merge: "replace", + validate(value) { + if (typeof value !== "string" || !/^(?:script|module|commonjs)$/u.test(value)) { + throw new TypeError("Expected \"script\", \"module\", or \"commonjs\"."); + } + } +}; + +//----------------------------------------------------------------------------- +// Full schema +//----------------------------------------------------------------------------- + +exports.flatConfigSchema = { + settings: deepObjectAssignSchema, + linterOptions: { + schema: { + noInlineConfig: booleanSchema, + reportUnusedDisableDirectives: booleanSchema + } + }, + languageOptions: { + schema: { + ecmaVersion: ecmaVersionSchema, + sourceType: sourceTypeSchema, + globals: globalsSchema, + parser: parserSchema, + parserOptions: deepObjectAssignSchema + } + }, + processor: processorSchema, + plugins: pluginsSchema, + rules: rulesSchema +}; diff --git a/node_modules/eslint/lib/config/rule-validator.js b/node_modules/eslint/lib/config/rule-validator.js new file mode 100644 index 000000000..0b5858fb3 --- /dev/null +++ b/node_modules/eslint/lib/config/rule-validator.js @@ -0,0 +1,157 @@ +/** + * @fileoverview Rule Validator + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const ajv = require("../shared/ajv")(); +const { + parseRuleId, + getRuleFromConfig, + getRuleOptionsSchema +} = require("./flat-config-helpers"); +const ruleReplacements = require("../../conf/replacements.json"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Throws a helpful error when a rule cannot be found. + * @param {Object} ruleId The rule identifier. + * @param {string} ruleId.pluginName The ID of the rule to find. + * @param {string} ruleId.ruleName The ID of the rule to find. + * @param {Object} config The config to search in. + * @throws {TypeError} For missing plugin or rule. + * @returns {void} + */ +function throwRuleNotFoundError({ pluginName, ruleName }, config) { + + const ruleId = pluginName === "@" ? ruleName : `${pluginName}/${ruleName}`; + + const errorMessageHeader = `Key "rules": Key "${ruleId}"`; + let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}".`; + + // if the plugin exists then we need to check if the rule exists + if (config.plugins && config.plugins[pluginName]) { + const replacementRuleName = ruleReplacements.rules[ruleName]; + + if (pluginName === "@" && replacementRuleName) { + + errorMessage = `${errorMessageHeader}: Rule "${ruleName}" was removed and replaced by "${replacementRuleName}".`; + + } else { + + errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`; + + // otherwise, let's see if we can find the rule name elsewhere + for (const [otherPluginName, otherPlugin] of Object.entries(config.plugins)) { + if (otherPlugin.rules && otherPlugin.rules[ruleName]) { + errorMessage += ` Did you mean "${otherPluginName}/${ruleName}"?`; + break; + } + } + + } + + // falls through to throw error + } + + throw new TypeError(errorMessage); +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +/** + * Implements validation functionality for the rules portion of a config. + */ +class RuleValidator { + + /** + * Creates a new instance. + */ + constructor() { + + /** + * A collection of compiled validators for rules that have already + * been validated. + * @type {WeakMap} + */ + this.validators = new WeakMap(); + } + + /** + * Validates all of the rule configurations in a config against each + * rule's schema. + * @param {Object} config The full config to validate. This object must + * contain both the rules section and the plugins section. + * @returns {void} + * @throws {Error} If a rule's configuration does not match its schema. + */ + validate(config) { + + if (!config.rules) { + return; + } + + for (const [ruleId, ruleOptions] of Object.entries(config.rules)) { + + // check for edge case + if (ruleId === "__proto__") { + continue; + } + + /* + * If a rule is disabled, we don't do any validation. This allows + * users to safely set any value to 0 or "off" without worrying + * that it will cause a validation error. + * + * Note: ruleOptions is always an array at this point because + * this validation occurs after FlatConfigArray has merged and + * normalized values. + */ + if (ruleOptions[0] === 0) { + continue; + } + + const rule = getRuleFromConfig(ruleId, config); + + if (!rule) { + throwRuleNotFoundError(parseRuleId(ruleId), config); + } + + // Precompile and cache validator the first time + if (!this.validators.has(rule)) { + const schema = getRuleOptionsSchema(rule); + + if (schema) { + this.validators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = this.validators.get(rule); + + if (validateRule) { + + validateRule(ruleOptions.slice(1)); + + if (validateRule.errors) { + throw new Error(`Key "rules": Key "${ruleId}": ${ + validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("") + }`); + } + } + } + } +} + +exports.RuleValidator = RuleValidator; diff --git a/node_modules/eslint/lib/eslint/eslint-helpers.js b/node_modules/eslint/lib/eslint/eslint-helpers.js new file mode 100644 index 000000000..54b0c69d7 --- /dev/null +++ b/node_modules/eslint/lib/eslint/eslint-helpers.js @@ -0,0 +1,903 @@ +/** + * @fileoverview Helper functions for ESLint class + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const path = require("path"); +const fs = require("fs"); +const fsp = fs.promises; +const isGlob = require("is-glob"); +const hash = require("../cli-engine/hash"); +const minimatch = require("minimatch"); +const util = require("util"); +const fswalk = require("@nodelib/fs.walk"); +const globParent = require("glob-parent"); +const isPathInside = require("is-path-inside"); + +//----------------------------------------------------------------------------- +// Fixup references +//----------------------------------------------------------------------------- + +const doFsWalk = util.promisify(fswalk.walk); +const Minimatch = minimatch.Minimatch; +const MINIMATCH_OPTIONS = { dot: true }; + +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- + +/** + * @typedef {Object} GlobSearch + * @property {Array} patterns The normalized patterns to use for a search. + * @property {Array} rawPatterns The patterns as entered by the user + * before doing any normalization. + */ + +//----------------------------------------------------------------------------- +// Errors +//----------------------------------------------------------------------------- + +/** + * The error type when no files match a glob. + */ +class NoFilesFoundError extends Error { + + /** + * @param {string} pattern The glob pattern which was not found. + * @param {boolean} globEnabled If `false` then the pattern was a glob pattern, but glob was disabled. + */ + constructor(pattern, globEnabled) { + super(`No files matching '${pattern}' were found${!globEnabled ? " (glob was disabled)" : ""}.`); + this.messageTemplate = "file-not-found"; + this.messageData = { pattern, globDisabled: !globEnabled }; + } +} + +/** + * The error type when a search fails to match multiple patterns. + */ +class UnmatchedSearchPatternsError extends Error { + + /** + * @param {Object} options The options for the error. + * @param {string} options.basePath The directory that was searched. + * @param {Array} options.unmatchedPatterns The glob patterns + * which were not found. + * @param {Array} options.patterns The glob patterns that were + * searched. + * @param {Array} options.rawPatterns The raw glob patterns that + * were searched. + */ + constructor({ basePath, unmatchedPatterns, patterns, rawPatterns }) { + super(`No files matching '${rawPatterns}' in '${basePath}' were found.`); + this.basePath = basePath; + this.unmatchedPatterns = unmatchedPatterns; + this.patterns = patterns; + this.rawPatterns = rawPatterns; + } +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class AllFilesIgnoredError extends Error { + + /** + * @param {string} pattern The glob pattern which was not found. + */ + constructor(pattern) { + super(`All files matched by '${pattern}' are ignored.`); + this.messageTemplate = "all-files-ignored"; + this.messageData = { pattern }; + } +} + + +//----------------------------------------------------------------------------- +// General Helpers +//----------------------------------------------------------------------------- + +/** + * Check if a given value is a non-empty string or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is a non-empty string. + */ +function isNonEmptyString(x) { + return typeof x === "string" && x.trim() !== ""; +} + +/** + * Check if a given value is an array of non-empty strings or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of non-empty strings. + */ +function isArrayOfNonEmptyString(x) { + return Array.isArray(x) && x.every(isNonEmptyString); +} + +//----------------------------------------------------------------------------- +// File-related Helpers +//----------------------------------------------------------------------------- + +/** + * Normalizes slashes in a file pattern to posix-style. + * @param {string} pattern The pattern to replace slashes in. + * @returns {string} The pattern with slashes normalized. + */ +function normalizeToPosix(pattern) { + return pattern.replace(/\\/gu, "/"); +} + +/** + * Check if a string is a glob pattern or not. + * @param {string} pattern A glob pattern. + * @returns {boolean} `true` if the string is a glob pattern. + */ +function isGlobPattern(pattern) { + return isGlob(path.sep === "\\" ? normalizeToPosix(pattern) : pattern); +} + + +/** + * Determines if a given glob pattern will return any results. + * Used primarily to help with useful error messages. + * @param {Object} options The options for the function. + * @param {string} options.basePath The directory to search. + * @param {string} options.pattern A glob pattern to match. + * @returns {Promise} True if there is a glob match, false if not. + */ +function globMatch({ basePath, pattern }) { + + let found = false; + const patternToUse = path.isAbsolute(pattern) + ? normalizeToPosix(path.relative(basePath, pattern)) + : pattern; + + const matcher = new Minimatch(patternToUse, MINIMATCH_OPTIONS); + + const fsWalkSettings = { + + deepFilter(entry) { + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + + return !found && matcher.match(relativePath, true); + }, + + entryFilter(entry) { + if (found || entry.dirent.isDirectory()) { + return false; + } + + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + + if (matcher.match(relativePath)) { + found = true; + return true; + } + + return false; + } + }; + + return new Promise(resolve => { + + // using a stream so we can exit early because we just need one match + const globStream = fswalk.walkStream(basePath, fsWalkSettings); + + globStream.on("data", () => { + globStream.destroy(); + resolve(true); + }); + + // swallow errors as they're not important here + globStream.on("error", () => { }); + + globStream.on("end", () => { + resolve(false); + }); + globStream.read(); + }); + +} + +/** + * Searches a directory looking for matching glob patterns. This uses + * the config array's logic to determine if a directory or file should + * be ignored, so it is consistent with how ignoring works throughout + * ESLint. + * @param {Object} options The options for this function. + * @param {string} options.basePath The directory to search. + * @param {Array} options.patterns An array of glob patterns + * to match. + * @param {Array} options.rawPatterns An array of glob patterns + * as the user inputted them. Used for errors. + * @param {FlatConfigArray} options.configs The config array to use for + * determining what to ignore. + * @param {boolean} options.errorOnUnmatchedPattern Determines if an error + * should be thrown when a pattern is unmatched. + * @returns {Promise>} An array of matching file paths + * or an empty array if there are no matches. + * @throws {UnmatchedSearchPatternsError} If there is a pattern that doesn't + * match any files. + */ +async function globSearch({ + basePath, + patterns, + rawPatterns, + configs, + errorOnUnmatchedPattern +}) { + + if (patterns.length === 0) { + return []; + } + + /* + * In this section we are converting the patterns into Minimatch + * instances for performance reasons. Because we are doing the same + * matches repeatedly, it's best to compile those patterns once and + * reuse them multiple times. + * + * To do that, we convert any patterns with an absolute path into a + * relative path and normalize it to Posix-style slashes. We also keep + * track of the relative patterns to map them back to the original + * patterns, which we need in order to throw an error if there are any + * unmatched patterns. + */ + const relativeToPatterns = new Map(); + const matchers = patterns.map((pattern, i) => { + const patternToUse = path.isAbsolute(pattern) + ? normalizeToPosix(path.relative(basePath, pattern)) + : pattern; + + relativeToPatterns.set(patternToUse, patterns[i]); + + return new Minimatch(patternToUse, MINIMATCH_OPTIONS); + }); + + /* + * We track unmatched patterns because we may want to throw an error when + * they occur. To start, this set is initialized with all of the patterns. + * Every time a match occurs, the pattern is removed from the set, making + * it easy to tell if we have any unmatched patterns left at the end of + * search. + */ + const unmatchedPatterns = new Set([...relativeToPatterns.keys()]); + + const filePaths = (await doFsWalk(basePath, { + + deepFilter(entry) { + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + const matchesPattern = matchers.some(matcher => matcher.match(relativePath, true)); + + return matchesPattern && !configs.isDirectoryIgnored(entry.path); + }, + entryFilter(entry) { + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + + // entries may be directories or files so filter out directories + if (entry.dirent.isDirectory()) { + return false; + } + + /* + * Optimization: We need to track when patterns are left unmatched + * and so we use `unmatchedPatterns` to do that. There is a bit of + * complexity here because the same file can be matched by more than + * one pattern. So, when we start, we actually need to test every + * pattern against every file. Once we know there are no remaining + * unmatched patterns, then we can switch to just looking for the + * first matching pattern for improved speed. + */ + const matchesPattern = unmatchedPatterns.size > 0 + ? matchers.reduce((previousValue, matcher) => { + const pathMatches = matcher.match(relativePath); + + /* + * We updated the unmatched patterns set only if the path + * matches and the file isn't ignored. If the file is + * ignored, that means there wasn't a match for the + * pattern so it should not be removed. + * + * Performance note: isFileIgnored() aggressively caches + * results so there is no performance penalty for calling + * it twice with the same argument. + */ + if (pathMatches && !configs.isFileIgnored(entry.path)) { + unmatchedPatterns.delete(matcher.pattern); + } + + return pathMatches || previousValue; + }, false) + : matchers.some(matcher => matcher.match(relativePath)); + + return matchesPattern && !configs.isFileIgnored(entry.path); + } + + })).map(entry => entry.path); + + // now check to see if we have any unmatched patterns + if (errorOnUnmatchedPattern && unmatchedPatterns.size > 0) { + throw new UnmatchedSearchPatternsError({ + basePath, + unmatchedPatterns: [...unmatchedPatterns].map( + pattern => relativeToPatterns.get(pattern) + ), + patterns, + rawPatterns + }); + } + + return filePaths; +} + +/** + * Throws an error for unmatched patterns. The error will only contain information about the first one. + * Checks to see if there are any ignored results for a given search. + * @param {Object} options The options for this function. + * @param {string} options.basePath The directory to search. + * @param {Array} options.patterns An array of glob patterns + * that were used in the original search. + * @param {Array} options.rawPatterns An array of glob patterns + * as the user inputted them. Used for errors. + * @param {Array} options.unmatchedPatterns A non-empty array of glob patterns + * that were unmatched in the original search. + * @returns {void} Always throws an error. + * @throws {NoFilesFoundError} If the first unmatched pattern + * doesn't match any files even when there are no ignores. + * @throws {AllFilesIgnoredError} If the first unmatched pattern + * matches some files when there are no ignores. + */ +async function throwErrorForUnmatchedPatterns({ + basePath, + patterns, + rawPatterns, + unmatchedPatterns +}) { + + const pattern = unmatchedPatterns[0]; + const rawPattern = rawPatterns[patterns.indexOf(pattern)]; + + const patternHasMatch = await globMatch({ + basePath, + pattern + }); + + if (patternHasMatch) { + throw new AllFilesIgnoredError(rawPattern); + } + + // if we get here there are truly no matches + throw new NoFilesFoundError(rawPattern, true); +} + +/** + * Performs multiple glob searches in parallel. + * @param {Object} options The options for this function. + * @param {Map} options.searches + * An array of glob patterns to match. + * @param {FlatConfigArray} options.configs The config array to use for + * determining what to ignore. + * @param {boolean} options.errorOnUnmatchedPattern Determines if an + * unmatched glob pattern should throw an error. + * @returns {Promise>} An array of matching file paths + * or an empty array if there are no matches. + */ +async function globMultiSearch({ searches, configs, errorOnUnmatchedPattern }) { + + /* + * For convenience, we normalized the search map into an array of objects. + * Next, we filter out all searches that have no patterns. This happens + * primarily for the cwd, which is prepopulated in the searches map as an + * optimization. However, if it has no patterns, it means all patterns + * occur outside of the cwd and we can safely filter out that search. + */ + const normalizedSearches = [...searches].map( + ([basePath, { patterns, rawPatterns }]) => ({ basePath, patterns, rawPatterns }) + ).filter(({ patterns }) => patterns.length > 0); + + const results = await Promise.allSettled( + normalizedSearches.map( + ({ basePath, patterns, rawPatterns }) => globSearch({ + basePath, + patterns, + rawPatterns, + configs, + errorOnUnmatchedPattern + }) + ) + ); + + const filePaths = []; + + for (let i = 0; i < results.length; i++) { + + const result = results[i]; + const currentSearch = normalizedSearches[i]; + + if (result.status === "fulfilled") { + + // if the search was successful just add the results + if (result.value.length > 0) { + filePaths.push(...result.value); + } + + continue; + } + + // if we make it here then there was an error + const error = result.reason; + + // unexpected errors should be re-thrown + if (!error.basePath) { + throw error; + } + + if (errorOnUnmatchedPattern) { + + await throwErrorForUnmatchedPatterns({ + ...currentSearch, + unmatchedPatterns: error.unmatchedPatterns + }); + + } + + } + + return [...new Set(filePaths)]; + +} + +/** + * Finds all files matching the options specified. + * @param {Object} args The arguments objects. + * @param {Array} args.patterns An array of glob patterns. + * @param {boolean} args.globInputPaths true to interpret glob patterns, + * false to not interpret glob patterns. + * @param {string} args.cwd The current working directory to find from. + * @param {FlatConfigArray} args.configs The configs for the current run. + * @param {boolean} args.errorOnUnmatchedPattern Determines if an unmatched pattern + * should throw an error. + * @returns {Promise>} The fully resolved file paths. + * @throws {AllFilesIgnoredError} If there are no results due to an ignore pattern. + * @throws {NoFilesFoundError} If no files matched the given patterns. + */ +async function findFiles({ + patterns, + globInputPaths, + cwd, + configs, + errorOnUnmatchedPattern +}) { + + const results = []; + const missingPatterns = []; + let globbyPatterns = []; + let rawPatterns = []; + const searches = new Map([[cwd, { patterns: globbyPatterns, rawPatterns: [] }]]); + + // check to see if we have explicit files and directories + const filePaths = patterns.map(filePath => path.resolve(cwd, filePath)); + const stats = await Promise.all( + filePaths.map( + filePath => fsp.stat(filePath).catch(() => { }) + ) + ); + + stats.forEach((stat, index) => { + + const filePath = filePaths[index]; + const pattern = normalizeToPosix(patterns[index]); + + if (stat) { + + // files are added directly to the list + if (stat.isFile()) { + results.push({ + filePath, + ignored: configs.isFileIgnored(filePath) + }); + } + + // directories need extensions attached + if (stat.isDirectory()) { + + // group everything in cwd together and split out others + if (isPathInside(filePath, cwd)) { + ({ patterns: globbyPatterns, rawPatterns } = searches.get(cwd)); + } else { + if (!searches.has(filePath)) { + searches.set(filePath, { patterns: [], rawPatterns: [] }); + } + ({ patterns: globbyPatterns, rawPatterns } = searches.get(filePath)); + } + + globbyPatterns.push(`${normalizeToPosix(filePath)}/**`); + rawPatterns.push(pattern); + } + + return; + } + + // save patterns for later use based on whether globs are enabled + if (globInputPaths && isGlobPattern(pattern)) { + + const basePath = path.resolve(cwd, globParent(pattern)); + + // group in cwd if possible and split out others + if (isPathInside(basePath, cwd)) { + ({ patterns: globbyPatterns, rawPatterns } = searches.get(cwd)); + } else { + if (!searches.has(basePath)) { + searches.set(basePath, { patterns: [], rawPatterns: [] }); + } + ({ patterns: globbyPatterns, rawPatterns } = searches.get(basePath)); + } + + globbyPatterns.push(filePath); + rawPatterns.push(pattern); + } else { + missingPatterns.push(pattern); + } + }); + + // there were patterns that didn't match anything, tell the user + if (errorOnUnmatchedPattern && missingPatterns.length) { + throw new NoFilesFoundError(missingPatterns[0], globInputPaths); + } + + // now we are safe to do the search + const globbyResults = await globMultiSearch({ + searches, + configs, + errorOnUnmatchedPattern + }); + + return [ + ...results, + ...globbyResults.map(filePath => ({ + filePath: path.resolve(filePath), + ignored: false + })) + ]; +} + +//----------------------------------------------------------------------------- +// Results-related Helpers +//----------------------------------------------------------------------------- + +/** + * Checks if the given message is an error message. + * @param {LintMessage} message The message to check. + * @returns {boolean} Whether or not the message is an error message. + * @private + */ +function isErrorMessage(message) { + return message.severity === 2; +} + +/** + * Returns result with warning by ignore settings + * @param {string} filePath File path of checked code + * @param {string} baseDir Absolute path of base directory + * @returns {LintResult} Result with single warning + * @private + */ +function createIgnoreResult(filePath, baseDir) { + let message; + const isHidden = filePath.split(path.sep) + .find(segment => /^\./u.test(segment)); + const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules"); + + if (isHidden) { + message = "File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."; + } else if (isInNodeModules) { + message = "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override."; + } else { + message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."; + } + + return { + filePath: path.resolve(filePath), + messages: [ + { + fatal: false, + severity: 1, + message + } + ], + suppressedMessages: [], + errorCount: 0, + warningCount: 1, + fatalErrorCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; +} + +//----------------------------------------------------------------------------- +// Options-related Helpers +//----------------------------------------------------------------------------- + + +/** + * Check if a given value is a valid fix type or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is valid fix type. + */ +function isFixType(x) { + return x === "directive" || x === "problem" || x === "suggestion" || x === "layout"; +} + +/** + * Check if a given value is an array of fix types or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of fix types. + */ +function isFixTypeArray(x) { + return Array.isArray(x) && x.every(isFixType); +} + +/** + * The error for invalid options. + */ +class ESLintInvalidOptionsError extends Error { + constructor(messages) { + super(`Invalid Options:\n- ${messages.join("\n- ")}`); + this.code = "ESLINT_INVALID_OPTIONS"; + Error.captureStackTrace(this, ESLintInvalidOptionsError); + } +} + +/** + * Validates and normalizes options for the wrapped CLIEngine instance. + * @param {FlatESLintOptions} options The options to process. + * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors. + * @returns {FlatESLintOptions} The normalized options. + */ +function processOptions({ + allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. + baseConfig = null, + cache = false, + cacheLocation = ".eslintcache", + cacheStrategy = "metadata", + cwd = process.cwd(), + errorOnUnmatchedPattern = true, + fix = false, + fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property. + globInputPaths = true, + ignore = true, + ignorePatterns = null, + overrideConfig = null, + overrideConfigFile = null, + plugins = {}, + reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that. + ...unknownOptions +}) { + const errors = []; + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length >= 1) { + errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`); + if (unknownOptionKeys.includes("cacheFile")) { + errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead."); + } + if (unknownOptionKeys.includes("configFile")) { + errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead."); + } + if (unknownOptionKeys.includes("envs")) { + errors.push("'envs' has been removed."); + } + if (unknownOptionKeys.includes("extensions")) { + errors.push("'extensions' has been removed."); + } + if (unknownOptionKeys.includes("resolvePluginsRelativeTo")) { + errors.push("'resolvePluginsRelativeTo' has been removed."); + } + if (unknownOptionKeys.includes("globals")) { + errors.push("'globals' has been removed. Please use the 'overrideConfig.languageOptions.globals' option instead."); + } + if (unknownOptionKeys.includes("ignorePath")) { + errors.push("'ignorePath' has been removed."); + } + if (unknownOptionKeys.includes("ignorePattern")) { + errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead."); + } + if (unknownOptionKeys.includes("parser")) { + errors.push("'parser' has been removed. Please use the 'overrideConfig.languageOptions.parser' option instead."); + } + if (unknownOptionKeys.includes("parserOptions")) { + errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.languageOptions.parserOptions' option instead."); + } + if (unknownOptionKeys.includes("rules")) { + errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); + } + if (unknownOptionKeys.includes("rulePaths")) { + errors.push("'rulePaths' has been removed. Please define your rules using plugins."); + } + } + if (typeof allowInlineConfig !== "boolean") { + errors.push("'allowInlineConfig' must be a boolean."); + } + if (typeof baseConfig !== "object") { + errors.push("'baseConfig' must be an object or null."); + } + if (typeof cache !== "boolean") { + errors.push("'cache' must be a boolean."); + } + if (!isNonEmptyString(cacheLocation)) { + errors.push("'cacheLocation' must be a non-empty string."); + } + if ( + cacheStrategy !== "metadata" && + cacheStrategy !== "content" + ) { + errors.push("'cacheStrategy' must be any of \"metadata\", \"content\"."); + } + if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) { + errors.push("'cwd' must be an absolute path."); + } + if (typeof errorOnUnmatchedPattern !== "boolean") { + errors.push("'errorOnUnmatchedPattern' must be a boolean."); + } + if (typeof fix !== "boolean" && typeof fix !== "function") { + errors.push("'fix' must be a boolean or a function."); + } + if (fixTypes !== null && !isFixTypeArray(fixTypes)) { + errors.push("'fixTypes' must be an array of any of \"directive\", \"problem\", \"suggestion\", and \"layout\"."); + } + if (typeof globInputPaths !== "boolean") { + errors.push("'globInputPaths' must be a boolean."); + } + if (typeof ignore !== "boolean") { + errors.push("'ignore' must be a boolean."); + } + if (typeof overrideConfig !== "object") { + errors.push("'overrideConfig' must be an object or null."); + } + if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null && overrideConfigFile !== true) { + errors.push("'overrideConfigFile' must be a non-empty string, null, or true."); + } + if (typeof plugins !== "object") { + errors.push("'plugins' must be an object or null."); + } else if (plugins !== null && Object.keys(plugins).includes("")) { + errors.push("'plugins' must not include an empty string."); + } + if (Array.isArray(plugins)) { + errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead."); + } + if ( + reportUnusedDisableDirectives !== "error" && + reportUnusedDisableDirectives !== "warn" && + reportUnusedDisableDirectives !== "off" && + reportUnusedDisableDirectives !== null + ) { + errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null."); + } + if (errors.length > 0) { + throw new ESLintInvalidOptionsError(errors); + } + + return { + allowInlineConfig, + baseConfig, + cache, + cacheLocation, + cacheStrategy, + + // when overrideConfigFile is true that means don't do config file lookup + configFile: overrideConfigFile === true ? false : overrideConfigFile, + overrideConfig, + cwd, + errorOnUnmatchedPattern, + fix, + fixTypes, + globInputPaths, + ignore, + ignorePatterns, + reportUnusedDisableDirectives + }; +} + + +//----------------------------------------------------------------------------- +// Cache-related helpers +//----------------------------------------------------------------------------- + +/** + * return the cacheFile to be used by eslint, based on whether the provided parameter is + * a directory or looks like a directory (ends in `path.sep`), in which case the file + * name will be the `cacheFile/.cache_hashOfCWD` + * + * if cacheFile points to a file or looks like a file then in will just use that file + * @param {string} cacheFile The name of file to be used to store the cache + * @param {string} cwd Current working directory + * @returns {string} the resolved path to the cache file + */ +function getCacheFile(cacheFile, cwd) { + + /* + * make sure the path separators are normalized for the environment/os + * keeping the trailing path separator if present + */ + const normalizedCacheFile = path.normalize(cacheFile); + + const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile); + const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep; + + /** + * return the name for the cache file in case the provided parameter is a directory + * @returns {string} the resolved path to the cacheFile + */ + function getCacheFileForDirectory() { + return path.join(resolvedCacheFile, `.cache_${hash(cwd)}`); + } + + let fileStats; + + try { + fileStats = fs.lstatSync(resolvedCacheFile); + } catch { + fileStats = null; + } + + + /* + * in case the file exists we need to verify if the provided path + * is a directory or a file. If it is a directory we want to create a file + * inside that directory + */ + if (fileStats) { + + /* + * is a directory or is a file, but the original file the user provided + * looks like a directory but `path.resolve` removed the `last path.sep` + * so we need to still treat this like a directory + */ + if (fileStats.isDirectory() || looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + // is file so just use that file + return resolvedCacheFile; + } + + /* + * here we known the file or directory doesn't exist, + * so we will try to infer if its a directory if it looks like a directory + * for the current operating system. + */ + + // if the last character passed is a path separator we assume is a directory + if (looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + return resolvedCacheFile; +} + + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + isGlobPattern, + findFiles, + + isNonEmptyString, + isArrayOfNonEmptyString, + + createIgnoreResult, + isErrorMessage, + + processOptions, + + getCacheFile +}; diff --git a/node_modules/eslint/lib/eslint/eslint.js b/node_modules/eslint/lib/eslint/eslint.js index ae2d21008..e1d211694 100644 --- a/node_modules/eslint/lib/eslint/eslint.js +++ b/node_modules/eslint/lib/eslint/eslint.js @@ -32,9 +32,17 @@ const { version } = require("../../package.json"); /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ /** @typedef {import("../shared/types").ConfigData} ConfigData */ /** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ /** @typedef {import("../shared/types").Plugin} Plugin */ /** @typedef {import("../shared/types").Rule} Rule */ -/** @typedef {import("./load-formatter").Formatter} Formatter */ +/** @typedef {import("../shared/types").LintResult} LintResult */ +/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */ + +/** + * The main formatter object. + * @typedef LoadedFormatter + * @property {(results: LintResult[], resultsMeta: ResultsMeta) => string | Promise} format format function. + */ /** * The options with which to configure the ESLint instance. @@ -54,7 +62,7 @@ const { version } = require("../../package.json"); * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance * @property {string} [overrideConfigFile] The configuration file to use. - * @property {Record} [plugins] An array of plugin implementations. + * @property {Record|null} [plugins] Preloaded plugins. This is a map-like object, keys are plugin IDs and each value is implementation. * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD. * @property {string[]} [rulePaths] An array of directories to load custom rules from. @@ -68,20 +76,6 @@ const { version } = require("../../package.json"); * @property {Object} definition The plugin definition. */ -/** - * A linting result. - * @typedef {Object} LintResult - * @property {string} filePath The path to the file that was linted. - * @property {LintMessage[]} messages All of the messages for the result. - * @property {number} errorCount Number of errors for the result. - * @property {number} warningCount Number of warnings for the result. - * @property {number} fixableErrorCount Number of fixable errors for the result. - * @property {number} fixableWarningCount Number of fixable warnings for the result. - * @property {string} [source] The source code of the file that was linted. - * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. - * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. - */ - /** * Private members for the `ESLint` instance. * @typedef {Object} ESLintPrivateMembers @@ -111,9 +105,9 @@ function isNonEmptyString(x) { } /** - * Check if a given value is an array of non-empty stringss or not. + * Check if a given value is an array of non-empty strings or not. * @param {any} x The value to check. - * @returns {boolean} `true` if `x` is an array of non-empty stringss. + * @returns {boolean} `true` if `x` is an array of non-empty strings. */ function isArrayOfNonEmptyString(x) { return Array.isArray(x) && x.every(isNonEmptyString); @@ -125,7 +119,7 @@ function isArrayOfNonEmptyString(x) { * @returns {boolean} `true` if `x` is valid fix type. */ function isFixType(x) { - return x === "problem" || x === "suggestion" || x === "layout"; + return x === "directive" || x === "problem" || x === "suggestion" || x === "layout"; } /** @@ -151,6 +145,7 @@ class ESLintInvalidOptionsError extends Error { /** * Validates and normalizes options for the wrapped CLIEngine instance. * @param {ESLintOptions} options The options to process. + * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors. * @returns {ESLintOptions} The normalized options. */ function processOptions({ @@ -237,7 +232,7 @@ function processOptions({ errors.push("'fix' must be a boolean or a function."); } if (fixTypes !== null && !isFixTypeArray(fixTypes)) { - errors.push("'fixTypes' must be an array of any of \"problem\", \"suggestion\", and \"layout\"."); + errors.push("'fixTypes' must be an array of any of \"directive\", \"problem\", \"suggestion\", and \"layout\"."); } if (typeof globInputPaths !== "boolean") { errors.push("'globInputPaths' must be a boolean."); @@ -421,6 +416,9 @@ function compareResultsByFilePath(a, b) { return 0; } +/** + * Main API. + */ class ESLint { /** @@ -429,26 +427,13 @@ class ESLint { */ constructor(options = {}) { const processedOptions = processOptions(options); - const cliEngine = new CLIEngine(processedOptions); + const cliEngine = new CLIEngine(processedOptions, { preloadedPlugins: options.plugins }); const { - additionalPluginPool, configArrayFactory, lastConfigArrays } = getCLIEngineInternalSlots(cliEngine); let updated = false; - /* - * Address `plugins` to add plugin implementations. - * Operate the `additionalPluginPool` internal slot directly to avoid - * using `addPlugin(id, plugin)` method that resets cache everytime. - */ - if (options.plugins) { - for (const [id, plugin] of Object.entries(options.plugins)) { - additionalPluginPool.set(id, plugin); - updated = true; - } - } - /* * Address `overrideConfig` to set override config. * Operate the `configArrayFactory` internal slot directly because this @@ -514,6 +499,42 @@ class ESLint { return CLIEngine.getErrorResults(results); } + /** + * Returns meta objects for each rule represented in the lint results. + * @param {LintResult[]} results The results to fetch rules meta for. + * @returns {Object} A mapping of ruleIds to rule meta objects. + */ + getRulesMetaForResults(results) { + + const resultRuleIds = new Set(); + + // first gather all ruleIds from all results + + for (const result of results) { + for (const { ruleId } of result.messages) { + resultRuleIds.add(ruleId); + } + for (const { ruleId } of result.suppressedMessages) { + resultRuleIds.add(ruleId); + } + } + + // create a map of all rules in the results + + const { cliEngine } = privateMembersMap.get(this); + const rules = cliEngine.getRules(); + const resultRules = new Map(); + + for (const [ruleId, rule] of rules) { + if (resultRuleIds.has(ruleId)) { + resultRules.set(ruleId, rule); + } + } + + return createRulesMeta(resultRules); + + } + /** * Executes the current configuration on an array of file and directory names. * @param {string[]} patterns An array of file and directory names. @@ -552,9 +573,12 @@ class ESLint { ...unknownOptions } = options || {}; - for (const key of Object.keys(unknownOptions)) { - throw new Error(`'options' must not include the unknown option '${key}'`); + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length > 0) { + throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`); } + if (filePath !== void 0 && !isNonEmptyString(filePath)) { throw new Error("'options.filePath' must be a non-empty string or undefined"); } @@ -576,12 +600,12 @@ class ESLint { * The following values are allowed: * - `undefined` ... Load `stylish` builtin formatter. * - A builtin formatter name ... Load the builtin formatter. - * - A thirdparty formatter name: + * - A third-party formatter name: * - `foo` → `eslint-formatter-foo` * - `@foo` → `@foo/eslint-formatter` * - `@foo/bar` → `@foo/eslint-formatter-bar` * - A file path ... Load the file. - * @returns {Promise} A promise resolving to the formatter object. + * @returns {Promise} A promise resolving to the formatter object. * This promise will be rejected if the given formatter was not found or not * a function. */ @@ -590,7 +614,7 @@ class ESLint { throw new Error("'name' must be a string"); } - const { cliEngine } = privateMembersMap.get(this); + const { cliEngine, options } = privateMembersMap.get(this); const formatter = cliEngine.getFormatter(name); if (typeof formatter !== "function") { @@ -601,15 +625,20 @@ class ESLint { /** * The main formatter method. - * @param {LintResults[]} results The lint results to format. - * @returns {string} The formatted lint results. + * @param {LintResult[]} results The lint results to format. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. + * @returns {string | Promise} The formatted lint results. */ - format(results) { + format(results, resultsMeta) { let rulesMeta = null; results.sort(compareResultsByFilePath); return formatter(results, { + ...resultsMeta, + get cwd() { + return options.cwd; + }, get rulesMeta() { if (!rulesMeta) { rulesMeta = createRulesMeta(cliEngine.getRules()); diff --git a/node_modules/eslint/lib/eslint/flat-eslint.js b/node_modules/eslint/lib/eslint/flat-eslint.js new file mode 100644 index 000000000..d88cf1782 --- /dev/null +++ b/node_modules/eslint/lib/eslint/flat-eslint.js @@ -0,0 +1,1182 @@ +/** + * @fileoverview Main class using flat config + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// Note: Node.js 12 does not support fs/promises. +const fs = require("fs").promises; +const path = require("path"); +const findUp = require("find-up"); +const { version } = require("../../package.json"); +const { Linter } = require("../linter"); +const { getRuleFromConfig } = require("../config/flat-config-helpers"); +const { + Legacy: { + ConfigOps: { + getRuleSeverity + }, + ModuleResolver, + naming + } +} = require("@eslint/eslintrc"); + +const { + findFiles, + getCacheFile, + + isNonEmptyString, + isArrayOfNonEmptyString, + + createIgnoreResult, + isErrorMessage, + + processOptions +} = require("./eslint-helpers"); +const { pathToFileURL } = require("url"); +const { FlatConfigArray } = require("../config/flat-config-array"); +const LintResultCache = require("../cli-engine/lint-result-cache"); + +/* + * This is necessary to allow overwriting writeFile for testing purposes. + * We can just use fs/promises once we drop Node.js 12 support. + */ + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +// For VSCode IntelliSense +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */ +/** @typedef {import("../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {ReturnType} ExtractedConfig */ + +/** + * The options with which to configure the ESLint instance. + * @typedef {Object} FlatESLintOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {"metadata" | "content"} [cacheStrategy] The strategy used to detect changed files. + * @property {string} [cwd] The value to use for the current working directory. + * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] False disables all ignore patterns except for the default ones. + * @property {string[]} [ignorePatterns] Ignore file patterns to use in addition to config ignores. + * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance + * @property {boolean|string} [overrideConfigFile] Searches for default config file when falsy; + * doesn't do any config file lookup when `true`; considered to be a config filename + * when a string. + * @property {Record} [plugins] An array of plugin implementations. + * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const FLAT_CONFIG_FILENAME = "eslint.config.js"; +const debug = require("debug")("eslint:flat-eslint"); +const removedFormatters = new Set(["table", "codeframe"]); +const privateMembers = new WeakMap(); +const importedConfigFileModificationTime = new Map(); + +/** + * It will calculate the error and warning count for collection of messages per file + * @param {LintMessage[]} messages Collection of messages + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerFile(messages) { + return messages.reduce((stat, message) => { + if (message.fatal || message.severity === 2) { + stat.errorCount++; + if (message.fatal) { + stat.fatalErrorCount++; + } + if (message.fix) { + stat.fixableErrorCount++; + } + } else { + stat.warningCount++; + if (message.fix) { + stat.fixableWarningCount++; + } + } + return stat; + }, { + errorCount: 0, + fatalErrorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }); +} + +/** + * It will calculate the error and warning count for collection of results from all files + * @param {LintResult[]} results Collection of messages from all the files + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerRun(results) { + return results.reduce((stat, result) => { + stat.errorCount += result.errorCount; + stat.fatalErrorCount += result.fatalErrorCount; + stat.warningCount += result.warningCount; + stat.fixableErrorCount += result.fixableErrorCount; + stat.fixableWarningCount += result.fixableWarningCount; + return stat; + }, { + errorCount: 0, + fatalErrorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }); +} + +/** + * Create rulesMeta object. + * @param {Map} rules a map of rules from which to generate the object. + * @returns {Object} metadata for all enabled rules. + */ +function createRulesMeta(rules) { + return Array.from(rules).reduce((retVal, [id, rule]) => { + retVal[id] = rule.meta; + return retVal; + }, {}); +} + +/** + * Return the absolute path of a file named `"__placeholder__.js"` in a given directory. + * This is used as a replacement for a missing file path. + * @param {string} cwd An absolute directory path. + * @returns {string} The absolute path of a file named `"__placeholder__.js"` in the given directory. + */ +function getPlaceholderPath(cwd) { + return path.join(cwd, "__placeholder__.js"); +} + +/** @type {WeakMap} */ +const usedDeprecatedRulesCache = new WeakMap(); + +/** + * Create used deprecated rule list. + * @param {CLIEngine} eslint The CLIEngine instance. + * @param {string} maybeFilePath The absolute path to a lint target file or `""`. + * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. + */ +function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) { + const { + configs, + options: { cwd } + } = privateMembers.get(eslint); + const filePath = path.isAbsolute(maybeFilePath) + ? maybeFilePath + : getPlaceholderPath(cwd); + const config = configs.getConfig(filePath); + + // Most files use the same config, so cache it. + if (config && !usedDeprecatedRulesCache.has(config)) { + const retv = []; + + if (config.rules) { + for (const [ruleId, ruleConf] of Object.entries(config.rules)) { + if (getRuleSeverity(ruleConf) === 0) { + continue; + } + const rule = getRuleFromConfig(ruleId, config); + const meta = rule && rule.meta; + + if (meta && meta.deprecated) { + retv.push({ ruleId, replacedBy: meta.replacedBy || [] }); + } + } + } + + + usedDeprecatedRulesCache.set(config, Object.freeze(retv)); + } + + return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]); +} + +/** + * Processes the linting results generated by a CLIEngine linting report to + * match the ESLint class's API. + * @param {CLIEngine} eslint The CLIEngine instance. + * @param {CLIEngineLintReport} report The CLIEngine linting report to process. + * @returns {LintResult[]} The processed linting results. + */ +function processLintReport(eslint, { results }) { + const descriptor = { + configurable: true, + enumerable: true, + get() { + return getOrFindUsedDeprecatedRules(eslint, this.filePath); + } + }; + + for (const result of results) { + Object.defineProperty(result, "usedDeprecatedRules", descriptor); + } + + return results; +} + +/** + * An Array.prototype.sort() compatible compare function to order results by their file path. + * @param {LintResult} a The first lint result. + * @param {LintResult} b The second lint result. + * @returns {number} An integer representing the order in which the two results should occur. + */ +function compareResultsByFilePath(a, b) { + if (a.filePath < b.filePath) { + return -1; + } + + if (a.filePath > b.filePath) { + return 1; + } + + return 0; +} + +/** + * Searches from the current working directory up until finding the + * given flat config filename. + * @param {string} cwd The current working directory to search from. + * @returns {Promise} The filename if found or `null` if not. + */ +function findFlatConfigFile(cwd) { + return findUp( + FLAT_CONFIG_FILENAME, + { cwd } + ); +} + +/** + * Load the config array from the given filename. + * @param {string} filePath The filename to load from. + * @returns {Promise} The config loaded from the config file. + */ +async function loadFlatConfigFile(filePath) { + debug(`Loading config from ${filePath}`); + + const fileURL = pathToFileURL(filePath); + + debug(`Config file URL is ${fileURL}`); + + const mtime = (await fs.stat(filePath)).mtime.getTime(); + + /* + * Append a query with the config file's modification time (`mtime`) in order + * to import the current version of the config file. Without the query, `import()` would + * cache the config file module by the pathname only, and then always return + * the same version (the one that was actual when the module was imported for the first time). + * + * This ensures that the config file module is loaded and executed again + * if it has been changed since the last time it was imported. + * If it hasn't been changed, `import()` will just return the cached version. + * + * Note that we should not overuse queries (e.g., by appending the current time + * to always reload the config file module) as that could cause memory leaks + * because entries are never removed from the import cache. + */ + fileURL.searchParams.append("mtime", mtime); + + /* + * With queries, we can bypass the import cache. However, when import-ing a CJS module, + * Node.js uses the require infrastructure under the hood. That includes the require cache, + * which caches the config file module by its file path (queries have no effect). + * Therefore, we also need to clear the require cache before importing the config file module. + * In order to get the same behavior with ESM and CJS config files, in particular - to reload + * the config file only if it has been changed, we track file modification times and clear + * the require cache only if the file has been changed. + */ + if (importedConfigFileModificationTime.get(filePath) !== mtime) { + delete require.cache[filePath]; + } + + const config = (await import(fileURL)).default; + + importedConfigFileModificationTime.set(filePath, mtime); + + return config; +} + +/** + * Calculates the config array for this run based on inputs. + * @param {FlatESLint} eslint The instance to create the config array for. + * @param {import("./eslint").ESLintOptions} options The ESLint instance options. + * @returns {FlatConfigArray} The config array for `eslint``. + */ +async function calculateConfigArray(eslint, { + cwd, + baseConfig, + overrideConfig, + configFile, + ignore: shouldIgnore, + ignorePatterns +}) { + + // check for cached instance + const slots = privateMembers.get(eslint); + + if (slots.configs) { + return slots.configs; + } + + // determine where to load config file from + let configFilePath; + let basePath = cwd; + + if (typeof configFile === "string") { + debug(`Override config file path is ${configFile}`); + configFilePath = path.resolve(cwd, configFile); + } else if (configFile !== false) { + debug("Searching for eslint.config.js"); + configFilePath = await findFlatConfigFile(cwd); + + if (!configFilePath) { + throw new Error("Could not find config file."); + } + + basePath = path.resolve(path.dirname(configFilePath)); + } + + + const configs = new FlatConfigArray(baseConfig || [], { basePath, shouldIgnore }); + + // load config file + if (configFilePath) { + const fileConfig = await loadFlatConfigFile(configFilePath); + + if (Array.isArray(fileConfig)) { + configs.push(...fileConfig); + } else { + configs.push(fileConfig); + } + } + + // add in any configured defaults + configs.push(...slots.defaultConfigs); + + let allIgnorePatterns = []; + + // append command line ignore patterns + if (ignorePatterns) { + if (typeof ignorePatterns === "string") { + allIgnorePatterns.push(ignorePatterns); + } else { + allIgnorePatterns.push(...ignorePatterns); + } + } + + /* + * If the config file basePath is different than the cwd, then + * the ignore patterns won't work correctly. Here, we adjust the + * ignore pattern to include the correct relative path. Patterns + * loaded from ignore files are always relative to the cwd, whereas + * the config file basePath can be an ancestor of the cwd. + */ + if (basePath !== cwd && allIgnorePatterns.length) { + + const relativeIgnorePath = path.relative(basePath, cwd); + + allIgnorePatterns = allIgnorePatterns.map(pattern => { + const negated = pattern.startsWith("!"); + const basePattern = negated ? pattern.slice(1) : pattern; + + return (negated ? "!" : "") + + path.posix.join(relativeIgnorePath, basePattern); + }); + } + + if (allIgnorePatterns.length) { + + /* + * Ignore patterns are added to the end of the config array + * so they can override default ignores. + */ + configs.push({ + ignores: allIgnorePatterns + }); + } + + if (overrideConfig) { + if (Array.isArray(overrideConfig)) { + configs.push(...overrideConfig); + } else { + configs.push(overrideConfig); + } + } + + await configs.normalize(); + + // cache the config array for this instance + slots.configs = configs; + + return configs; +} + +/** + * Processes an source code using ESLint. + * @param {Object} config The config object. + * @param {string} config.text The source code to verify. + * @param {string} config.cwd The path to the current working directory. + * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses ``. + * @param {FlatConfigArray} config.configs The config. + * @param {boolean} config.fix If `true` then it does fix. + * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments. + * @param {boolean} config.reportUnusedDisableDirectives If `true` then it reports unused `eslint-disable` comments. + * @param {Linter} config.linter The linter instance to verify. + * @returns {LintResult} The result of linting. + * @private + */ +function verifyText({ + text, + cwd, + filePath: providedFilePath, + configs, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + linter +}) { + const filePath = providedFilePath || ""; + + debug(`Lint ${filePath}`); + + /* + * Verify. + * `config.extractConfig(filePath)` requires an absolute path, but `linter` + * doesn't know CWD, so it gives `linter` an absolute path always. + */ + const filePathToVerify = filePath === "" ? getPlaceholderPath(cwd) : filePath; + const { fixed, messages, output } = linter.verifyAndFix( + text, + configs, + { + allowInlineConfig, + filename: filePathToVerify, + fix, + reportUnusedDisableDirectives, + + /** + * Check if the linter should adopt a given code block or not. + * @param {string} blockFilename The virtual filename of a code block. + * @returns {boolean} `true` if the linter should adopt the code block. + */ + filterCodeBlock(blockFilename) { + return configs.isExplicitMatch(blockFilename); + } + } + ); + + // Tweak and return. + const result = { + filePath: filePath === "" ? filePath : path.resolve(filePath), + messages, + suppressedMessages: linter.getSuppressedMessages(), + ...calculateStatsPerFile(messages) + }; + + if (fixed) { + result.output = output; + } + + if ( + result.errorCount + result.warningCount > 0 && + typeof result.output === "undefined" + ) { + result.source = text; + } + + return result; +} + +/** + * Checks whether a message's rule type should be fixed. + * @param {LintMessage} message The message to check. + * @param {FlatConfig} config The config for the file that generated the message. + * @param {string[]} fixTypes An array of fix types to check. + * @returns {boolean} Whether the message should be fixed. + */ +function shouldMessageBeFixed(message, config, fixTypes) { + if (!message.ruleId) { + return fixTypes.has("directive"); + } + + const rule = message.ruleId && getRuleFromConfig(message.ruleId, config); + + return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type)); +} + +/** + * Collect used deprecated rules. + * @param {Array} configs The configs to evaluate. + * @returns {IterableIterator} Used deprecated rules. + */ +function *iterateRuleDeprecationWarnings(configs) { + const processedRuleIds = new Set(); + + for (const config of configs) { + for (const [ruleId, ruleConfig] of Object.entries(config.rules)) { + + // Skip if it was processed. + if (processedRuleIds.has(ruleId)) { + continue; + } + processedRuleIds.add(ruleId); + + // Skip if it's not used. + if (!getRuleSeverity(ruleConfig)) { + continue; + } + const rule = getRuleFromConfig(ruleId, config); + + // Skip if it's not deprecated. + if (!(rule && rule.meta && rule.meta.deprecated)) { + continue; + } + + // This rule was used and deprecated. + yield { + ruleId, + replacedBy: rule.meta.replacedBy || [] + }; + } + } +} + +/** + * Creates an error to be thrown when an array of results passed to `getRulesMetaForResults` was not created by the current engine. + * @returns {TypeError} An error object. + */ +function createExtraneousResultsError() { + return new TypeError("Results object was not created from this ESLint instance."); +} + +//----------------------------------------------------------------------------- +// Main API +//----------------------------------------------------------------------------- + +/** + * Primary Node.js API for ESLint. + */ +class FlatESLint { + + /** + * Creates a new instance of the main ESLint API. + * @param {FlatESLintOptions} options The options for this instance. + */ + constructor(options = {}) { + + const defaultConfigs = []; + const processedOptions = processOptions(options); + const linter = new Linter({ + cwd: processedOptions.cwd, + configType: "flat" + }); + + const cacheFilePath = getCacheFile( + processedOptions.cacheLocation, + processedOptions.cwd + ); + + const lintResultCache = processedOptions.cache + ? new LintResultCache(cacheFilePath, processedOptions.cacheStrategy) + : null; + + privateMembers.set(this, { + options: processedOptions, + linter, + cacheFilePath, + lintResultCache, + defaultConfigs, + defaultIgnores: () => false, + configs: null + }); + + /** + * If additional plugins are passed in, add that to the default + * configs for this instance. + */ + if (options.plugins) { + + const plugins = {}; + + for (const [pluginName, plugin] of Object.entries(options.plugins)) { + plugins[naming.getShorthandName(pluginName, "eslint-plugin")] = plugin; + } + + defaultConfigs.push({ + plugins + }); + } + + } + + /** + * The version text. + * @type {string} + */ + static get version() { + return version; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintResult[]} results The lint results. + * @returns {Promise} Returns a promise that is used to track side effects. + */ + static async outputFixes(results) { + if (!Array.isArray(results)) { + throw new Error("'results' must be an array"); + } + + await Promise.all( + results + .filter(result => { + if (typeof result !== "object" || result === null) { + throw new Error("'results' must include only objects"); + } + return ( + typeof result.output === "string" && + path.isAbsolute(result.filePath) + ); + }) + .map(r => fs.writeFile(r.filePath, r.output)) + ); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + const filtered = []; + + results.forEach(result => { + const filteredMessages = result.messages.filter(isErrorMessage); + const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage); + + if (filteredMessages.length > 0) { + filtered.push({ + ...result, + messages: filteredMessages, + suppressedMessages: filteredSuppressedMessages, + errorCount: filteredMessages.length, + warningCount: 0, + fixableErrorCount: result.fixableErrorCount, + fixableWarningCount: 0 + }); + } + }); + + return filtered; + } + + /** + * Returns meta objects for each rule represented in the lint results. + * @param {LintResult[]} results The results to fetch rules meta for. + * @returns {Object} A mapping of ruleIds to rule meta objects. + * @throws {TypeError} When the results object wasn't created from this ESLint instance. + * @throws {TypeError} When a plugin or rule is missing. + */ + getRulesMetaForResults(results) { + + // short-circuit simple case + if (results.length === 0) { + return {}; + } + + const resultRules = new Map(); + const { + configs, + options: { cwd } + } = privateMembers.get(this); + + /* + * We can only accurately return rules meta information for linting results if the + * results were created by this instance. Otherwise, the necessary rules data is + * not available. So if the config array doesn't already exist, just throw an error + * to let the user know we can't do anything here. + */ + if (!configs) { + throw createExtraneousResultsError(); + } + + for (const result of results) { + + /* + * Normalize filename for . + */ + const filePath = result.filePath === "" + ? getPlaceholderPath(cwd) : result.filePath; + const allMessages = result.messages.concat(result.suppressedMessages); + + for (const { ruleId } of allMessages) { + if (!ruleId) { + continue; + } + + /* + * All of the plugin and rule information is contained within the + * calculated config for the given file. + */ + const config = configs.getConfig(filePath); + + if (!config) { + throw createExtraneousResultsError(); + } + const rule = getRuleFromConfig(ruleId, config); + + // ensure the rule exists + if (!rule) { + throw new TypeError(`Could not find the rule "${ruleId}".`); + } + + resultRules.set(ruleId, rule); + } + } + + return createRulesMeta(resultRules); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string|string[]} patterns An array of file and directory names. + * @returns {Promise} The results of linting the file patterns given. + */ + async lintFiles(patterns) { + if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) { + throw new Error("'patterns' must be a non-empty string or an array of non-empty strings"); + } + + const { + cacheFilePath, + lintResultCache, + linter, + options: eslintOptions + } = privateMembers.get(this); + const configs = await calculateConfigArray(this, eslintOptions); + const { + allowInlineConfig, + cache, + cwd, + fix, + fixTypes, + reportUnusedDisableDirectives, + globInputPaths, + errorOnUnmatchedPattern + } = eslintOptions; + const startTime = Date.now(); + const usedConfigs = []; + const fixTypesSet = fixTypes ? new Set(fixTypes) : null; + + // Delete cache file; should this be done here? + if (!cache && cacheFilePath) { + debug(`Deleting cache file at ${cacheFilePath}`); + + try { + await fs.unlink(cacheFilePath); + } catch (error) { + const errorCode = error && error.code; + + // Ignore errors when no such file exists or file system is read only (and cache file does not exist) + if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !(await fs.exists(cacheFilePath)))) { + throw error; + } + } + } + + const filePaths = await findFiles({ + patterns: typeof patterns === "string" ? [patterns] : patterns, + cwd, + globInputPaths, + configs, + errorOnUnmatchedPattern + }); + + debug(`${filePaths.length} files found in: ${Date.now() - startTime}ms`); + + /* + * Because we need to process multiple files, including reading from disk, + * it is most efficient to start by reading each file via promises so that + * they can be done in parallel. Then, we can lint the returned text. This + * ensures we are waiting the minimum amount of time in between lints. + */ + const results = await Promise.all( + + filePaths.map(({ filePath, ignored }) => { + + /* + * If a filename was entered that matches an ignore + * pattern, then notify the user. + */ + if (ignored) { + return createIgnoreResult(filePath, cwd); + } + + const config = configs.getConfig(filePath); + + /* + * Sometimes a file found through a glob pattern will + * be ignored. In this case, `config` will be undefined + * and we just silently ignore the file. + */ + if (!config) { + return void 0; + } + + /* + * Store used configs for: + * - this method uses to collect used deprecated rules. + * - `--fix-type` option uses to get the loaded rule's meta data. + */ + if (!usedConfigs.includes(config)) { + usedConfigs.push(config); + } + + // Skip if there is cached result. + if (lintResultCache) { + const cachedResult = + lintResultCache.getCachedLintResults(filePath, config); + + if (cachedResult) { + const hadMessages = + cachedResult.messages && + cachedResult.messages.length > 0; + + if (hadMessages && fix) { + debug(`Reprocessing cached file to allow autofix: ${filePath}`); + } else { + debug(`Skipping file since it hasn't changed: ${filePath}`); + return cachedResult; + } + } + } + + + // set up fixer for fixTypes if necessary + let fixer = fix; + + if (fix && fixTypesSet) { + + // save original value of options.fix in case it's a function + const originalFix = (typeof fix === "function") + ? fix : () => true; + + fixer = message => shouldMessageBeFixed(message, config, fixTypesSet) && originalFix(message); + } + + return fs.readFile(filePath, "utf8") + .then(text => { + + // do the linting + const result = verifyText({ + text, + filePath, + configs, + cwd, + fix: fixer, + allowInlineConfig, + reportUnusedDisableDirectives, + linter + }); + + /* + * Store the lint result in the LintResultCache. + * NOTE: The LintResultCache will remove the file source and any + * other properties that are difficult to serialize, and will + * hydrate those properties back in on future lint runs. + */ + if (lintResultCache) { + lintResultCache.setCachedLintResults(filePath, config, result); + } + + return result; + }); + + }) + ); + + // Persist the cache to disk. + if (lintResultCache) { + lintResultCache.reconcile(); + } + + let usedDeprecatedRules; + const finalResults = results.filter(result => !!result); + + return processLintReport(this, { + results: finalResults, + ...calculateStatsPerRun(finalResults), + + // Initialize it lazily because CLI and `ESLint` API don't use it. + get usedDeprecatedRules() { + if (!usedDeprecatedRules) { + usedDeprecatedRules = Array.from( + iterateRuleDeprecationWarnings(usedConfigs) + ); + } + return usedDeprecatedRules; + } + }); + } + + /** + * Executes the current configuration on text. + * @param {string} code A string of JavaScript code to lint. + * @param {Object} [options] The options. + * @param {string} [options.filePath] The path to the file of the source code. + * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path. + * @returns {Promise} The results of linting the string of code given. + */ + async lintText(code, options = {}) { + + // Parameter validation + + if (typeof code !== "string") { + throw new Error("'code' must be a string"); + } + + if (typeof options !== "object") { + throw new Error("'options' must be an object, null, or undefined"); + } + + // Options validation + + const { + filePath, + warnIgnored = false, + ...unknownOptions + } = options || {}; + + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length > 0) { + throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`); + } + + if (filePath !== void 0 && !isNonEmptyString(filePath)) { + throw new Error("'options.filePath' must be a non-empty string or undefined"); + } + + if (typeof warnIgnored !== "boolean") { + throw new Error("'options.warnIgnored' must be a boolean or undefined"); + } + + // Now we can get down to linting + + const { + linter, + options: eslintOptions + } = privateMembers.get(this); + const configs = await calculateConfigArray(this, eslintOptions); + const { + allowInlineConfig, + cwd, + fix, + reportUnusedDisableDirectives + } = eslintOptions; + const results = []; + const startTime = Date.now(); + const resolvedFilename = path.resolve(cwd, filePath || "__placeholder__.js"); + let config; + + // Clear the last used config arrays. + if (resolvedFilename && await this.isPathIgnored(resolvedFilename)) { + if (warnIgnored) { + results.push(createIgnoreResult(resolvedFilename, cwd)); + } + } else { + + // TODO: Needed? + config = configs.getConfig(resolvedFilename); + + // Do lint. + results.push(verifyText({ + text: code, + filePath: resolvedFilename.endsWith("__placeholder__.js") ? "" : resolvedFilename, + configs, + cwd, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + linter + })); + } + + debug(`Linting complete in: ${Date.now() - startTime}ms`); + let usedDeprecatedRules; + + return processLintReport(this, { + results, + ...calculateStatsPerRun(results), + + // Initialize it lazily because CLI and `ESLint` API don't use it. + get usedDeprecatedRules() { + if (!usedDeprecatedRules) { + usedDeprecatedRules = Array.from( + iterateRuleDeprecationWarnings(config) + ); + } + return usedDeprecatedRules; + } + }); + + } + + /** + * Returns the formatter representing the given formatter name. + * @param {string} [name] The name of the formatter to load. + * The following values are allowed: + * - `undefined` ... Load `stylish` builtin formatter. + * - A builtin formatter name ... Load the builtin formatter. + * - A third-party formatter name: + * - `foo` → `eslint-formatter-foo` + * - `@foo` → `@foo/eslint-formatter` + * - `@foo/bar` → `@foo/eslint-formatter-bar` + * - A file path ... Load the file. + * @returns {Promise} A promise resolving to the formatter object. + * This promise will be rejected if the given formatter was not found or not + * a function. + */ + async loadFormatter(name = "stylish") { + if (typeof name !== "string") { + throw new Error("'name' must be a string"); + } + + // replace \ with / for Windows compatibility + const normalizedFormatName = name.replace(/\\/gu, "/"); + const namespace = naming.getNamespaceFromTerm(normalizedFormatName); + + // grab our options + const { cwd } = privateMembers.get(this).options; + + + let formatterPath; + + // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) + if (!namespace && normalizedFormatName.includes("/")) { + formatterPath = path.resolve(cwd, normalizedFormatName); + } else { + try { + const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter"); + + // TODO: This is pretty dirty...would be nice to clean up at some point. + formatterPath = ModuleResolver.resolve(npmFormat, getPlaceholderPath(cwd)); + } catch { + formatterPath = path.resolve(__dirname, "../", "cli-engine", "formatters", `${normalizedFormatName}.js`); + } + } + + let formatter; + + try { + formatter = (await import(pathToFileURL(formatterPath))).default; + } catch (ex) { + + // check for formatters that have been removed + if (removedFormatters.has(name)) { + ex.message = `The ${name} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${name}\``; + } else { + ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; + } + + throw ex; + } + + + if (typeof formatter !== "function") { + throw new TypeError(`Formatter must be a function, but got a ${typeof formatter}.`); + } + + const eslint = this; + + return { + + /** + * The main formatter method. + * @param {LintResults[]} results The lint results to format. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. + * @returns {string} The formatted lint results. + */ + format(results, resultsMeta) { + let rulesMeta = null; + + results.sort(compareResultsByFilePath); + + return formatter(results, { + ...resultsMeta, + cwd, + get rulesMeta() { + if (!rulesMeta) { + rulesMeta = eslint.getRulesMetaForResults(results); + } + + return rulesMeta; + } + }); + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {Promise} A configuration object for the file + * or `undefined` if there is no configuration data for the object. + */ + async calculateConfigForFile(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const options = privateMembers.get(this).options; + const absolutePath = path.resolve(options.cwd, filePath); + const configs = await calculateConfigArray(this, options); + + return configs.getConfig(absolutePath); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {Promise} Whether or not the given path is ignored. + */ + async isPathIgnored(filePath) { + const config = await this.calculateConfigForFile(filePath); + + return config === void 0; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + FlatESLint, + findFlatConfigFile +}; diff --git a/node_modules/eslint/lib/eslint/index.js b/node_modules/eslint/lib/eslint/index.js index c9185ee0e..017b768ec 100644 --- a/node_modules/eslint/lib/eslint/index.js +++ b/node_modules/eslint/lib/eslint/index.js @@ -1,7 +1,9 @@ "use strict"; const { ESLint } = require("./eslint"); +const { FlatESLint } = require("./flat-eslint"); module.exports = { - ESLint + ESLint, + FlatESLint }; diff --git a/node_modules/eslint/lib/init/autoconfig.js b/node_modules/eslint/lib/init/autoconfig.js deleted file mode 100644 index 19d016a54..000000000 --- a/node_modules/eslint/lib/init/autoconfig.js +++ /dev/null @@ -1,348 +0,0 @@ -/** - * @fileoverview Used for creating a suggested configuration based on project code. - * @author Ian VanSchooten - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const lodash = require("lodash"), - recConfig = require("../../conf/eslint-recommended"), - ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), - { Linter } = require("../linter"), - configRule = require("./config-rule"); - -const debug = require("debug")("eslint:autoconfig"); -const linter = new Linter(); - -//------------------------------------------------------------------------------ -// Data -//------------------------------------------------------------------------------ - -const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only - RECOMMENDED_CONFIG_NAME = "eslint:recommended"; - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/** - * Information about a rule configuration, in the context of a Registry. - * @typedef {Object} registryItem - * @param {ruleConfig} config A valid configuration for the rule - * @param {number} specificity The number of elements in the ruleConfig array - * @param {number} errorCount The number of errors encountered when linting with the config - */ - -/** - * This callback is used to measure execution status in a progress bar - * @callback progressCallback - * @param {number} The total number of times the callback will be called. - */ - -/** - * Create registryItems for rules - * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items - * @returns {Object} registryItems for each rule in provided rulesConfig - */ -function makeRegistryItems(rulesConfig) { - return Object.keys(rulesConfig).reduce((accumulator, ruleId) => { - accumulator[ruleId] = rulesConfig[ruleId].map(config => ({ - config, - specificity: config.length || 1, - errorCount: void 0 - })); - return accumulator; - }, {}); -} - -/** - * Creates an object in which to store rule configs and error counts - * - * Unless a rulesConfig is provided at construction, the registry will not contain - * any rules, only methods. This will be useful for building up registries manually. - * - * Registry class - */ -class Registry { - - // eslint-disable-next-line jsdoc/require-description - /** - * @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations - */ - constructor(rulesConfig) { - this.rules = (rulesConfig) ? makeRegistryItems(rulesConfig) : {}; - } - - /** - * Populate the registry with core rule configs. - * - * It will set the registry's `rule` property to an object having rule names - * as keys and an array of registryItems as values. - * @returns {void} - */ - populateFromCoreRules() { - const rulesConfig = configRule.createCoreRuleConfigs(/* noDeprecated = */ true); - - this.rules = makeRegistryItems(rulesConfig); - } - - /** - * Creates sets of rule configurations which can be used for linting - * and initializes registry errors to zero for those configurations (side effect). - * - * This combines as many rules together as possible, such that the first sets - * in the array will have the highest number of rules configured, and later sets - * will have fewer and fewer, as not all rules have the same number of possible - * configurations. - * - * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. - * @returns {Object[]} "rules" configurations to use for linting - */ - buildRuleSets() { - let idx = 0; - const ruleIds = Object.keys(this.rules), - ruleSets = []; - - /** - * Add a rule configuration from the registry to the ruleSets - * - * This is broken out into its own function so that it doesn't need to be - * created inside of the while loop. - * @param {string} rule The ruleId to add. - * @returns {void} - */ - const addRuleToRuleSet = function(rule) { - - /* - * This check ensures that there is a rule configuration and that - * it has fewer than the max combinations allowed. - * If it has too many configs, we will only use the most basic of - * the possible configurations. - */ - const hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS); - - if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) { - - /* - * If the rule has too many possible combinations, only take - * simple ones, avoiding objects. - */ - if (!hasFewCombos && typeof this.rules[rule][idx].config[1] === "object") { - return; - } - - ruleSets[idx] = ruleSets[idx] || {}; - ruleSets[idx][rule] = this.rules[rule][idx].config; - - /* - * Initialize errorCount to zero, since this is a config which - * will be linted. - */ - this.rules[rule][idx].errorCount = 0; - } - }.bind(this); - - while (ruleSets.length === idx) { - ruleIds.forEach(addRuleToRuleSet); - idx += 1; - } - - return ruleSets; - } - - /** - * Remove all items from the registry with a non-zero number of errors - * - * Note: this also removes rule configurations which were not linted - * (meaning, they have an undefined errorCount). - * @returns {void} - */ - stripFailingConfigs() { - const ruleIds = Object.keys(this.rules), - newRegistry = new Registry(); - - newRegistry.rules = Object.assign({}, this.rules); - ruleIds.forEach(ruleId => { - const errorFreeItems = newRegistry.rules[ruleId].filter(registryItem => (registryItem.errorCount === 0)); - - if (errorFreeItems.length > 0) { - newRegistry.rules[ruleId] = errorFreeItems; - } else { - delete newRegistry.rules[ruleId]; - } - }); - - return newRegistry; - } - - /** - * Removes rule configurations which were not included in a ruleSet - * @returns {void} - */ - stripExtraConfigs() { - const ruleIds = Object.keys(this.rules), - newRegistry = new Registry(); - - newRegistry.rules = Object.assign({}, this.rules); - ruleIds.forEach(ruleId => { - newRegistry.rules[ruleId] = newRegistry.rules[ruleId].filter(registryItem => (typeof registryItem.errorCount !== "undefined")); - }); - - return newRegistry; - } - - /** - * Creates a registry of rules which had no error-free configs. - * The new registry is intended to be analyzed to determine whether its rules - * should be disabled or set to warning. - * @returns {Registry} A registry of failing rules. - */ - getFailingRulesRegistry() { - const ruleIds = Object.keys(this.rules), - failingRegistry = new Registry(); - - ruleIds.forEach(ruleId => { - const failingConfigs = this.rules[ruleId].filter(registryItem => (registryItem.errorCount > 0)); - - if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) { - failingRegistry.rules[ruleId] = failingConfigs; - } - }); - - return failingRegistry; - } - - /** - * Create an eslint config for any rules which only have one configuration - * in the registry. - * @returns {Object} An eslint config with rules section populated - */ - createConfig() { - const ruleIds = Object.keys(this.rules), - config = { rules: {} }; - - ruleIds.forEach(ruleId => { - if (this.rules[ruleId].length === 1) { - config.rules[ruleId] = this.rules[ruleId][0].config; - } - }); - - return config; - } - - /** - * Return a cloned registry containing only configs with a desired specificity - * @param {number} specificity Only keep configs with this specificity - * @returns {Registry} A registry of rules - */ - filterBySpecificity(specificity) { - const ruleIds = Object.keys(this.rules), - newRegistry = new Registry(); - - newRegistry.rules = Object.assign({}, this.rules); - ruleIds.forEach(ruleId => { - newRegistry.rules[ruleId] = this.rules[ruleId].filter(registryItem => (registryItem.specificity === specificity)); - }); - - return newRegistry; - } - - /** - * Lint SourceCodes against all configurations in the registry, and record results - * @param {Object[]} sourceCodes SourceCode objects for each filename - * @param {Object} config ESLint config object - * @param {progressCallback} [cb] Optional callback for reporting execution status - * @returns {Registry} New registry with errorCount populated - */ - lintSourceCode(sourceCodes, config, cb) { - let lintedRegistry = new Registry(); - - lintedRegistry.rules = Object.assign({}, this.rules); - - const ruleSets = lintedRegistry.buildRuleSets(); - - lintedRegistry = lintedRegistry.stripExtraConfigs(); - - debug("Linting with all possible rule combinations"); - - const filenames = Object.keys(sourceCodes); - const totalFilesLinting = filenames.length * ruleSets.length; - - filenames.forEach(filename => { - debug(`Linting file: ${filename}`); - - let ruleSetIdx = 0; - - ruleSets.forEach(ruleSet => { - const lintConfig = Object.assign({}, config, { rules: ruleSet }); - const lintResults = linter.verify(sourceCodes[filename], lintConfig); - - lintResults.forEach(result => { - - /* - * It is possible that the error is from a configuration comment - * in a linted file, in which case there may not be a config - * set in this ruleSetIdx. - * (https://github.com/eslint/eslint/issues/5992) - * (https://github.com/eslint/eslint/issues/7860) - */ - if ( - lintedRegistry.rules[result.ruleId] && - lintedRegistry.rules[result.ruleId][ruleSetIdx] - ) { - lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1; - } - }); - - ruleSetIdx += 1; - - if (cb) { - cb(totalFilesLinting); // eslint-disable-line node/callback-return - } - }); - - // Deallocate for GC - sourceCodes[filename] = null; - }); - - return lintedRegistry; - } -} - -/** - * Extract rule configuration into eslint:recommended where possible. - * - * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and - * only the rules which have configurations different from the recommended config. - * @param {Object} config config object - * @returns {Object} config object using `"extends": ["eslint:recommended"]` - */ -function extendFromRecommended(config) { - const newConfig = Object.assign({}, config); - - ConfigOps.normalizeToStrings(newConfig); - - const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); - - recRules.forEach(ruleId => { - if (lodash.isEqual(recConfig.rules[ruleId], newConfig.rules[ruleId])) { - delete newConfig.rules[ruleId]; - } - }); - newConfig.extends.unshift(RECOMMENDED_CONFIG_NAME); - return newConfig; -} - - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - Registry, - extendFromRecommended -}; diff --git a/node_modules/eslint/lib/init/config-file.js b/node_modules/eslint/lib/init/config-file.js deleted file mode 100644 index fc62b8152..000000000 --- a/node_modules/eslint/lib/init/config-file.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * @fileoverview Helper to locate and load configuration files. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const fs = require("fs"), - path = require("path"), - stringify = require("json-stable-stringify-without-jsonify"); - -const debug = require("debug")("eslint:config-file"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Determines sort order for object keys for json-stable-stringify - * - * see: https://github.com/samn/json-stable-stringify#cmp - * @param {Object} a The first comparison object ({key: akey, value: avalue}) - * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) - * @returns {number} 1 or -1, used in stringify cmp method - */ -function sortByKey(a, b) { - return a.key > b.key ? 1 : -1; -} - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/** - * Writes a configuration file in JSON format. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @private - */ -function writeJSONConfigFile(config, filePath) { - debug(`Writing JSON config file: ${filePath}`); - - const content = `${stringify(config, { cmp: sortByKey, space: 4 })}\n`; - - fs.writeFileSync(filePath, content, "utf8"); -} - -/** - * Writes a configuration file in YAML format. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @private - */ -function writeYAMLConfigFile(config, filePath) { - debug(`Writing YAML config file: ${filePath}`); - - // lazy load YAML to improve performance when not used - const yaml = require("js-yaml"); - - const content = yaml.safeDump(config, { sortKeys: true }); - - fs.writeFileSync(filePath, content, "utf8"); -} - -/** - * Writes a configuration file in JavaScript format. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @throws {Error} If an error occurs linting the config file contents. - * @returns {void} - * @private - */ -function writeJSConfigFile(config, filePath) { - debug(`Writing JS config file: ${filePath}`); - - let contentToWrite; - const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};\n`; - - try { - const { CLIEngine } = require("../cli-engine"); - const linter = new CLIEngine({ - baseConfig: config, - fix: true, - useEslintrc: false - }); - const report = linter.executeOnText(stringifiedContent); - - contentToWrite = report.results[0].output || stringifiedContent; - } catch (e) { - debug("Error linting JavaScript config file, writing unlinted version"); - const errorMessage = e.message; - - contentToWrite = stringifiedContent; - e.message = "An error occurred while generating your JavaScript config file. "; - e.message += "A config file was still generated, but the config file itself may not follow your linting rules."; - e.message += `\nError: ${errorMessage}`; - throw e; - } finally { - fs.writeFileSync(filePath, contentToWrite, "utf8"); - } -} - -/** - * Writes a configuration file. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @throws {Error} When an unknown file type is specified. - * @private - */ -function write(config, filePath) { - switch (path.extname(filePath)) { - case ".js": - writeJSConfigFile(config, filePath); - break; - - case ".json": - writeJSONConfigFile(config, filePath); - break; - - case ".yaml": - case ".yml": - writeYAMLConfigFile(config, filePath); - break; - - default: - throw new Error("Can't write to unknown file type."); - } -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - write -}; diff --git a/node_modules/eslint/lib/init/config-initializer.js b/node_modules/eslint/lib/init/config-initializer.js deleted file mode 100644 index 6f62e7db8..000000000 --- a/node_modules/eslint/lib/init/config-initializer.js +++ /dev/null @@ -1,691 +0,0 @@ -/** - * @fileoverview Config initialization wizard. - * @author Ilya Volodin - */ - - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const util = require("util"), - path = require("path"), - enquirer = require("enquirer"), - ProgressBar = require("progress"), - semver = require("semver"), - espree = require("espree"), - recConfig = require("../../conf/eslint-recommended"), - ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), - log = require("../shared/logging"), - naming = require("@eslint/eslintrc/lib/shared/naming"), - ModuleResolver = require("../shared/relative-module-resolver"), - autoconfig = require("./autoconfig.js"), - ConfigFile = require("./config-file"), - npmUtils = require("./npm-utils"), - { getSourceCodeOfFiles } = require("./source-code-utils"); - -const debug = require("debug")("eslint:config-initializer"); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/* istanbul ignore next: hard to test fs function */ -/** - * Create .eslintrc file in the current working directory - * @param {Object} config object that contains user's answers - * @param {string} format The file format to write to. - * @returns {void} - */ -function writeFile(config, format) { - - // default is .js - let extname = ".js"; - - if (format === "YAML") { - extname = ".yml"; - } else if (format === "JSON") { - extname = ".json"; - } - - const installedESLint = config.installedESLint; - - delete config.installedESLint; - - ConfigFile.write(config, `./.eslintrc${extname}`); - log.info(`Successfully created .eslintrc${extname} file in ${process.cwd()}`); - - if (installedESLint) { - log.info("ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy."); - } -} - -/** - * Get the peer dependencies of the given module. - * This adds the gotten value to cache at the first time, then reuses it. - * In a process, this function is called twice, but `npmUtils.fetchPeerDependencies` needs to access network which is relatively slow. - * @param {string} moduleName The module name to get. - * @returns {Object} The peer dependencies of the given module. - * This object is the object of `peerDependencies` field of `package.json`. - * Returns null if npm was not found. - */ -function getPeerDependencies(moduleName) { - let result = getPeerDependencies.cache.get(moduleName); - - if (!result) { - log.info(`Checking peerDependencies of ${moduleName}`); - - result = npmUtils.fetchPeerDependencies(moduleName); - getPeerDependencies.cache.set(moduleName, result); - } - - return result; -} -getPeerDependencies.cache = new Map(); - -/** - * Return necessary plugins, configs, parsers, etc. based on the config - * @param {Object} config config object - * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint. - * @returns {string[]} An array of modules to be installed. - */ -function getModulesList(config, installESLint) { - const modules = {}; - - // Create a list of modules which should be installed based on config - if (config.plugins) { - for (const plugin of config.plugins) { - const moduleName = naming.normalizePackageName(plugin, "eslint-plugin"); - - modules[moduleName] = "latest"; - } - } - if (config.extends) { - const extendList = Array.isArray(config.extends) ? config.extends : [config.extends]; - - for (const extend of extendList) { - if (extend.startsWith("eslint:") || extend.startsWith("plugin:")) { - continue; - } - const moduleName = naming.normalizePackageName(extend, "eslint-config"); - - modules[moduleName] = "latest"; - Object.assign( - modules, - getPeerDependencies(`${moduleName}@latest`) - ); - } - } - - const parser = config.parser || (config.parserOptions && config.parserOptions.parser); - - if (parser) { - modules[parser] = "latest"; - } - - if (installESLint === false) { - delete modules.eslint; - } else { - const installStatus = npmUtils.checkDevDeps(["eslint"]); - - // Mark to show messages if it's new installation of eslint. - if (installStatus.eslint === false) { - log.info("Local ESLint installation not found."); - modules.eslint = modules.eslint || "latest"; - config.installedESLint = true; - } - } - - return Object.keys(modules).map(name => `${name}@${modules[name]}`); -} - -/** - * Set the `rules` of a config by examining a user's source code - * - * Note: This clones the config object and returns a new config to avoid mutating - * the original config parameter. - * @param {Object} answers answers received from enquirer - * @param {Object} config config object - * @returns {Object} config object with configured rules - */ -function configureRules(answers, config) { - const BAR_TOTAL = 20, - BAR_SOURCE_CODE_TOTAL = 4, - newConfig = Object.assign({}, config), - disabledConfigs = {}; - let sourceCodes, - registry; - - // Set up a progress bar, as this process can take a long time - const bar = new ProgressBar("Determining Config: :percent [:bar] :elapseds elapsed, eta :etas ", { - width: 30, - total: BAR_TOTAL - }); - - bar.tick(0); // Shows the progress bar - - // Get the SourceCode of all chosen files - const patterns = answers.patterns.split(/[\s]+/u); - - try { - sourceCodes = getSourceCodeOfFiles(patterns, { baseConfig: newConfig, useEslintrc: false }, total => { - bar.tick((BAR_SOURCE_CODE_TOTAL / total)); - }); - } catch (e) { - log.info("\n"); - throw e; - } - const fileQty = Object.keys(sourceCodes).length; - - if (fileQty === 0) { - log.info("\n"); - throw new Error("Automatic Configuration failed. No files were able to be parsed."); - } - - // Create a registry of rule configs - registry = new autoconfig.Registry(); - registry.populateFromCoreRules(); - - // Lint all files with each rule config in the registry - registry = registry.lintSourceCode(sourceCodes, newConfig, total => { - bar.tick((BAR_TOTAL - BAR_SOURCE_CODE_TOTAL) / total); // Subtract out ticks used at beginning - }); - debug(`\nRegistry: ${util.inspect(registry.rules, { depth: null })}`); - - // Create a list of recommended rules, because we don't want to disable them - const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); - - // Find and disable rules which had no error-free configuration - const failingRegistry = registry.getFailingRulesRegistry(); - - Object.keys(failingRegistry.rules).forEach(ruleId => { - - // If the rule is recommended, set it to error, otherwise disable it - disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0; - }); - - // Now that we know which rules to disable, strip out configs with errors - registry = registry.stripFailingConfigs(); - - /* - * If there is only one config that results in no errors for a rule, we should use it. - * createConfig will only add rules that have one configuration in the registry. - */ - const singleConfigs = registry.createConfig().rules; - - /* - * The "sweet spot" for number of options in a config seems to be two (severity plus one option). - * Very often, a third option (usually an object) is available to address - * edge cases, exceptions, or unique situations. We will prefer to use a config with - * specificity of two. - */ - const specTwoConfigs = registry.filterBySpecificity(2).createConfig().rules; - - // Maybe a specific combination using all three options works - const specThreeConfigs = registry.filterBySpecificity(3).createConfig().rules; - - // If all else fails, try to use the default (severity only) - const defaultConfigs = registry.filterBySpecificity(1).createConfig().rules; - - // Combine configs in reverse priority order (later take precedence) - newConfig.rules = Object.assign({}, disabledConfigs, defaultConfigs, specThreeConfigs, specTwoConfigs, singleConfigs); - - // Make sure progress bar has finished (floating point rounding) - bar.update(BAR_TOTAL); - - // Log out some stats to let the user know what happened - const finalRuleIds = Object.keys(newConfig.rules); - const totalRules = finalRuleIds.length; - const enabledRules = finalRuleIds.filter(ruleId => (newConfig.rules[ruleId] !== 0)).length; - const resultMessage = [ - `\nEnabled ${enabledRules} out of ${totalRules}`, - `rules based on ${fileQty}`, - `file${(fileQty === 1) ? "." : "s."}` - ].join(" "); - - log.info(resultMessage); - - ConfigOps.normalizeToStrings(newConfig); - return newConfig; -} - -/** - * process user's answers and create config object - * @param {Object} answers answers received from enquirer - * @returns {Object} config object - */ -function processAnswers(answers) { - let config = { - rules: {}, - env: {}, - parserOptions: {}, - extends: [] - }; - - config.parserOptions.ecmaVersion = espree.latestEcmaVersion; - config.env.es2021 = true; - - // set the module type - if (answers.moduleType === "esm") { - config.parserOptions.sourceType = "module"; - } else if (answers.moduleType === "commonjs") { - config.env.commonjs = true; - } - - // add in browser and node environments if necessary - answers.env.forEach(env => { - config.env[env] = true; - }); - - // add in library information - if (answers.framework === "react") { - config.parserOptions.ecmaFeatures = { - jsx: true - }; - config.plugins = ["react"]; - config.extends.push("plugin:react/recommended"); - } else if (answers.framework === "vue") { - config.plugins = ["vue"]; - config.extends.push("plugin:vue/essential"); - } - - if (answers.typescript) { - if (answers.framework === "vue") { - config.parserOptions.parser = "@typescript-eslint/parser"; - } else { - config.parser = "@typescript-eslint/parser"; - } - - if (Array.isArray(config.plugins)) { - config.plugins.push("@typescript-eslint"); - } else { - config.plugins = ["@typescript-eslint"]; - } - } - - // setup rules based on problems/style enforcement preferences - if (answers.purpose === "problems") { - config.extends.unshift("eslint:recommended"); - } else if (answers.purpose === "style") { - if (answers.source === "prompt") { - config.extends.unshift("eslint:recommended"); - config.rules.indent = ["error", answers.indent]; - config.rules.quotes = ["error", answers.quotes]; - config.rules["linebreak-style"] = ["error", answers.linebreak]; - config.rules.semi = ["error", answers.semi ? "always" : "never"]; - } else if (answers.source === "auto") { - config = configureRules(answers, config); - config = autoconfig.extendFromRecommended(config); - } - } - if (answers.typescript && config.extends.includes("eslint:recommended")) { - config.extends.push("plugin:@typescript-eslint/recommended"); - } - - // normalize extends - if (config.extends.length === 0) { - delete config.extends; - } else if (config.extends.length === 1) { - config.extends = config.extends[0]; - } - - ConfigOps.normalizeToStrings(config); - return config; -} - -/** - * Get the version of the local ESLint. - * @returns {string|null} The version. If the local ESLint was not found, returns null. - */ -function getLocalESLintVersion() { - try { - const eslintPath = ModuleResolver.resolve("eslint", path.join(process.cwd(), "__placeholder__.js")); - const eslint = require(eslintPath); - - return eslint.linter.version || null; - } catch { - return null; - } -} - -/** - * Get the shareable config name of the chosen style guide. - * @param {Object} answers The answers object. - * @returns {string} The shareable config name. - */ -function getStyleGuideName(answers) { - if (answers.styleguide === "airbnb" && answers.framework !== "react") { - return "airbnb-base"; - } - return answers.styleguide; -} - -/** - * Check whether the local ESLint version conflicts with the required version of the chosen shareable config. - * @param {Object} answers The answers object. - * @returns {boolean} `true` if the local ESLint is found then it conflicts with the required version of the chosen shareable config. - */ -function hasESLintVersionConflict(answers) { - - // Get the local ESLint version. - const localESLintVersion = getLocalESLintVersion(); - - if (!localESLintVersion) { - return false; - } - - // Get the required range of ESLint version. - const configName = getStyleGuideName(answers); - const moduleName = `eslint-config-${configName}@latest`; - const peerDependencies = getPeerDependencies(moduleName) || {}; - const requiredESLintVersionRange = peerDependencies.eslint; - - if (!requiredESLintVersionRange) { - return false; - } - - answers.localESLintVersion = localESLintVersion; - answers.requiredESLintVersionRange = requiredESLintVersionRange; - - // Check the version. - if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) { - answers.installESLint = false; - return false; - } - - return true; -} - -/** - * Install modules. - * @param {string[]} modules Modules to be installed. - * @returns {void} - */ -function installModules(modules) { - log.info(`Installing ${modules.join(", ")}`); - npmUtils.installSyncSaveDev(modules); -} - -/* istanbul ignore next: no need to test enquirer */ -/** - * Ask user to install modules. - * @param {string[]} modules Array of modules to be installed. - * @param {boolean} packageJsonExists Indicates if package.json is existed. - * @returns {Promise} Answer that indicates if user wants to install. - */ -function askInstallModules(modules, packageJsonExists) { - - // If no modules, do nothing. - if (modules.length === 0) { - return Promise.resolve(); - } - - log.info("The config that you've selected requires the following dependencies:\n"); - log.info(modules.join(" ")); - return enquirer.prompt([ - { - type: "toggle", - name: "executeInstallation", - message: "Would you like to install them now with npm?", - enabled: "Yes", - disabled: "No", - initial: 1, - skip() { - return !(modules.length && packageJsonExists); - }, - result(input) { - return this.skipped ? null : input; - } - } - ]).then(({ executeInstallation }) => { - if (executeInstallation) { - installModules(modules); - } - }); -} - -/* istanbul ignore next: no need to test enquirer */ -/** - * Ask use a few questions on command prompt - * @returns {Promise} The promise with the result of the prompt - */ -function promptUser() { - - return enquirer.prompt([ - { - type: "select", - name: "purpose", - message: "How would you like to use ESLint?", - - // The returned number matches the name value of nth in the choices array. - initial: 1, - choices: [ - { message: "To check syntax only", name: "syntax" }, - { message: "To check syntax and find problems", name: "problems" }, - { message: "To check syntax, find problems, and enforce code style", name: "style" } - ] - }, - { - type: "select", - name: "moduleType", - message: "What type of modules does your project use?", - initial: 0, - choices: [ - { message: "JavaScript modules (import/export)", name: "esm" }, - { message: "CommonJS (require/exports)", name: "commonjs" }, - { message: "None of these", name: "none" } - ] - }, - { - type: "select", - name: "framework", - message: "Which framework does your project use?", - initial: 0, - choices: [ - { message: "React", name: "react" }, - { message: "Vue.js", name: "vue" }, - { message: "None of these", name: "none" } - ] - }, - { - type: "toggle", - name: "typescript", - message: "Does your project use TypeScript?", - enabled: "Yes", - disabled: "No", - initial: 0 - }, - { - type: "multiselect", - name: "env", - message: "Where does your code run?", - hint: "(Press to select, to toggle all, to invert selection)", - initial: 0, - choices: [ - { message: "Browser", name: "browser" }, - { message: "Node", name: "node" } - ] - }, - { - type: "select", - name: "source", - message: "How would you like to define a style for your project?", - choices: [ - { message: "Use a popular style guide", name: "guide" }, - { message: "Answer questions about your style", name: "prompt" }, - { message: "Inspect your JavaScript file(s)", name: "auto" } - ], - skip() { - return this.state.answers.purpose !== "style"; - }, - result(input) { - return this.skipped ? null : input; - } - }, - { - type: "select", - name: "styleguide", - message: "Which style guide do you want to follow?", - choices: [ - { message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" }, - { message: "Standard: https://github.com/standard/standard", name: "standard" }, - { message: "Google: https://github.com/google/eslint-config-google", name: "google" } - ], - skip() { - this.state.answers.packageJsonExists = npmUtils.checkPackageJson(); - return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists); - }, - result(input) { - return this.skipped ? null : input; - } - }, - { - type: "input", - name: "patterns", - message: "Which file(s), path(s), or glob(s) should be examined?", - skip() { - return this.state.answers.source !== "auto"; - }, - validate(input) { - if (!this.skipped && input.trim().length === 0 && input.trim() !== ",") { - return "You must tell us what code to examine. Try again."; - } - return true; - } - }, - { - type: "select", - name: "format", - message: "What format do you want your config file to be in?", - initial: 0, - choices: ["JavaScript", "YAML", "JSON"] - }, - { - type: "toggle", - name: "installESLint", - message() { - const { answers } = this.state; - const verb = semver.ltr(answers.localESLintVersion, answers.requiredESLintVersionRange) - ? "upgrade" - : "downgrade"; - - return `The style guide "${answers.styleguide}" requires eslint@${answers.requiredESLintVersionRange}. You are currently using eslint@${answers.localESLintVersion}.\n Do you want to ${verb}?`; - }, - enabled: "Yes", - disabled: "No", - initial: 1, - skip() { - return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists && hasESLintVersionConflict(this.state.answers)); - }, - result(input) { - return this.skipped ? null : input; - } - } - ]).then(earlyAnswers => { - - // early exit if no style guide is necessary - if (earlyAnswers.purpose !== "style") { - const config = processAnswers(earlyAnswers); - const modules = getModulesList(config); - - return askInstallModules(modules, earlyAnswers.packageJsonExists) - .then(() => writeFile(config, earlyAnswers.format)); - } - - // early exit if you are using a style guide - if (earlyAnswers.source === "guide") { - if (!earlyAnswers.packageJsonExists) { - log.info("A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again."); - return void 0; - } - if (earlyAnswers.installESLint === false && !semver.satisfies(earlyAnswers.localESLintVersion, earlyAnswers.requiredESLintVersionRange)) { - log.info(`Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`); - } - if (earlyAnswers.styleguide === "airbnb" && earlyAnswers.framework !== "react") { - earlyAnswers.styleguide = "airbnb-base"; - } - - const config = processAnswers(earlyAnswers); - - if (Array.isArray(config.extends)) { - config.extends.push(earlyAnswers.styleguide); - } else if (config.extends) { - config.extends = [config.extends, earlyAnswers.styleguide]; - } else { - config.extends = [earlyAnswers.styleguide]; - } - - const modules = getModulesList(config); - - return askInstallModules(modules, earlyAnswers.packageJsonExists) - .then(() => writeFile(config, earlyAnswers.format)); - - } - - if (earlyAnswers.source === "auto") { - const combinedAnswers = Object.assign({}, earlyAnswers); - const config = processAnswers(combinedAnswers); - const modules = getModulesList(config); - - return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); - } - - // continue with the style questions otherwise... - return enquirer.prompt([ - { - type: "select", - name: "indent", - message: "What style of indentation do you use?", - initial: 0, - choices: [{ message: "Tabs", name: "tab" }, { message: "Spaces", name: 4 }] - }, - { - type: "select", - name: "quotes", - message: "What quotes do you use for strings?", - initial: 0, - choices: [{ message: "Double", name: "double" }, { message: "Single", name: "single" }] - }, - { - type: "select", - name: "linebreak", - message: "What line endings do you use?", - initial: 0, - choices: [{ message: "Unix", name: "unix" }, { message: "Windows", name: "windows" }] - }, - { - type: "toggle", - name: "semi", - message: "Do you require semicolons?", - enabled: "Yes", - disabled: "No", - initial: 1 - } - ]).then(answers => { - const totalAnswers = Object.assign({}, earlyAnswers, answers); - - const config = processAnswers(totalAnswers); - const modules = getModulesList(config); - - return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); - }); - }); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -const init = { - getModulesList, - hasESLintVersionConflict, - installModules, - processAnswers, - /* istanbul ignore next */initializeConfig() { - return promptUser(); - } -}; - -module.exports = init; diff --git a/node_modules/eslint/lib/init/config-rule.js b/node_modules/eslint/lib/init/config-rule.js deleted file mode 100644 index 7aec89c3d..000000000 --- a/node_modules/eslint/lib/init/config-rule.js +++ /dev/null @@ -1,317 +0,0 @@ -/** - * @fileoverview Create configurations for a rule - * @author Ian VanSchooten - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const builtInRules = require("../rules"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Wrap all of the elements of an array into arrays. - * @param {*[]} xs Any array. - * @returns {Array[]} An array of arrays. - */ -function explodeArray(xs) { - return xs.reduce((accumulator, x) => { - accumulator.push([x]); - return accumulator; - }, []); -} - -/** - * Mix two arrays such that each element of the second array is concatenated - * onto each element of the first array. - * - * For example: - * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] - * @param {Array} arr1 The first array to combine. - * @param {Array} arr2 The second array to combine. - * @returns {Array} A mixture of the elements of the first and second arrays. - */ -function combineArrays(arr1, arr2) { - const res = []; - - if (arr1.length === 0) { - return explodeArray(arr2); - } - if (arr2.length === 0) { - return explodeArray(arr1); - } - arr1.forEach(x1 => { - arr2.forEach(x2 => { - res.push([].concat(x1, x2)); - }); - }); - return res; -} - -/** - * Group together valid rule configurations based on object properties - * - * e.g.: - * groupByProperty([ - * {before: true}, - * {before: false}, - * {after: true}, - * {after: false} - * ]); - * - * will return: - * [ - * [{before: true}, {before: false}], - * [{after: true}, {after: false}] - * ] - * @param {Object[]} objects Array of objects, each with one property/value pair - * @returns {Array[]} Array of arrays of objects grouped by property - */ -function groupByProperty(objects) { - const groupedObj = objects.reduce((accumulator, obj) => { - const prop = Object.keys(obj)[0]; - - accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj]; - return accumulator; - }, {}); - - return Object.keys(groupedObj).map(prop => groupedObj[prop]); -} - - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/** - * Configuration settings for a rule. - * - * A configuration can be a single number (severity), or an array where the first - * element in the array is the severity, and is the only required element. - * Configs may also have one or more additional elements to specify rule - * configuration or options. - * @typedef {Array|number} ruleConfig - * @param {number} 0 The rule's severity (0, 1, 2). - */ - -/** - * Object whose keys are rule names and values are arrays of valid ruleConfig items - * which should be linted against the target source code to determine error counts. - * (a ruleConfigSet.ruleConfigs). - * - * e.g. rulesConfig = { - * "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]], - * "no-console": [2] - * } - * @typedef rulesConfig - */ - - -/** - * Create valid rule configurations by combining two arrays, - * with each array containing multiple objects each with a - * single property/value pair and matching properties. - * - * e.g.: - * combinePropertyObjects( - * [{before: true}, {before: false}], - * [{after: true}, {after: false}] - * ); - * - * will return: - * [ - * {before: true, after: true}, - * {before: true, after: false}, - * {before: false, after: true}, - * {before: false, after: false} - * ] - * @param {Object[]} objArr1 Single key/value objects, all with the same key - * @param {Object[]} objArr2 Single key/value objects, all with another key - * @returns {Object[]} Combined objects for each combination of input properties and values - */ -function combinePropertyObjects(objArr1, objArr2) { - const res = []; - - if (objArr1.length === 0) { - return objArr2; - } - if (objArr2.length === 0) { - return objArr1; - } - objArr1.forEach(obj1 => { - objArr2.forEach(obj2 => { - const combinedObj = {}; - const obj1Props = Object.keys(obj1); - const obj2Props = Object.keys(obj2); - - obj1Props.forEach(prop1 => { - combinedObj[prop1] = obj1[prop1]; - }); - obj2Props.forEach(prop2 => { - combinedObj[prop2] = obj2[prop2]; - }); - res.push(combinedObj); - }); - }); - return res; -} - -/** - * Creates a new instance of a rule configuration set - * - * A rule configuration set is an array of configurations that are valid for a - * given rule. For example, the configuration set for the "semi" rule could be: - * - * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]] - * - * Rule configuration set class - */ -class RuleConfigSet { - - // eslint-disable-next-line jsdoc/require-description - /** - * @param {ruleConfig[]} configs Valid rule configurations - */ - constructor(configs) { - - /** - * Stored valid rule configurations for this instance - * @type {Array} - */ - this.ruleConfigs = configs || []; - } - - /** - * Add a severity level to the front of all configs in the instance. - * This should only be called after all configs have been added to the instance. - * @returns {void} - */ - addErrorSeverity() { - const severity = 2; - - this.ruleConfigs = this.ruleConfigs.map(config => { - config.unshift(severity); - return config; - }); - - // Add a single config at the beginning consisting of only the severity - this.ruleConfigs.unshift(severity); - } - - /** - * Add rule configs from an array of strings (schema enums) - * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"]) - * @returns {void} - */ - addEnums(enums) { - this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums)); - } - - /** - * Add rule configurations from a schema object - * @param {Object} obj Schema item with type === "object" - * @returns {boolean} true if at least one schema for the object could be generated, false otherwise - */ - addObject(obj) { - const objectConfigSet = { - objectConfigs: [], - add(property, values) { - for (let idx = 0; idx < values.length; idx++) { - const optionObj = {}; - - optionObj[property] = values[idx]; - this.objectConfigs.push(optionObj); - } - }, - - combine() { - this.objectConfigs = groupByProperty(this.objectConfigs).reduce((accumulator, objArr) => combinePropertyObjects(accumulator, objArr), []); - } - }; - - /* - * The object schema could have multiple independent properties. - * If any contain enums or booleans, they can be added and then combined - */ - Object.keys(obj.properties).forEach(prop => { - if (obj.properties[prop].enum) { - objectConfigSet.add(prop, obj.properties[prop].enum); - } - if (obj.properties[prop].type && obj.properties[prop].type === "boolean") { - objectConfigSet.add(prop, [true, false]); - } - }); - objectConfigSet.combine(); - - if (objectConfigSet.objectConfigs.length > 0) { - this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs)); - return true; - } - - return false; - } -} - -/** - * Generate valid rule configurations based on a schema object - * @param {Object} schema A rule's schema object - * @returns {Array[]} Valid rule configurations - */ -function generateConfigsFromSchema(schema) { - const configSet = new RuleConfigSet(); - - if (Array.isArray(schema)) { - for (const opt of schema) { - if (opt.enum) { - configSet.addEnums(opt.enum); - } else if (opt.type && opt.type === "object") { - if (!configSet.addObject(opt)) { - break; - } - - // TODO (IanVS): support oneOf - } else { - - // If we don't know how to fill in this option, don't fill in any of the following options. - break; - } - } - } - configSet.addErrorSeverity(); - return configSet.ruleConfigs; -} - -/** - * Generate possible rule configurations for all of the core rules - * @param {boolean} noDeprecated Indicates whether ignores deprecated rules or not. - * @returns {rulesConfig} Hash of rule names and arrays of possible configurations - */ -function createCoreRuleConfigs(noDeprecated = false) { - return Array.from(builtInRules).reduce((accumulator, [id, rule]) => { - const schema = (typeof rule === "function") ? rule.schema : rule.meta.schema; - const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated; - - if (noDeprecated && isDeprecated) { - return accumulator; - } - - accumulator[id] = generateConfigsFromSchema(schema); - return accumulator; - }, {}); -} - - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - generateConfigsFromSchema, - createCoreRuleConfigs -}; diff --git a/node_modules/eslint/lib/init/npm-utils.js b/node_modules/eslint/lib/init/npm-utils.js deleted file mode 100644 index 555ea2b2b..000000000 --- a/node_modules/eslint/lib/init/npm-utils.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @fileoverview Utility for executing npm commands. - * @author Ian VanSchooten - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const fs = require("fs"), - spawn = require("cross-spawn"), - path = require("path"), - log = require("../shared/logging"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Find the closest package.json file, starting at process.cwd (by default), - * and working up to root. - * @param {string} [startDir=process.cwd()] Starting directory - * @returns {string} Absolute path to closest package.json file - */ -function findPackageJson(startDir) { - let dir = path.resolve(startDir || process.cwd()); - - do { - const pkgFile = path.join(dir, "package.json"); - - if (!fs.existsSync(pkgFile) || !fs.statSync(pkgFile).isFile()) { - dir = path.join(dir, ".."); - continue; - } - return pkgFile; - } while (dir !== path.resolve(dir, "..")); - return null; -} - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/** - * Install node modules synchronously and save to devDependencies in package.json - * @param {string|string[]} packages Node module or modules to install - * @returns {void} - */ -function installSyncSaveDev(packages) { - const packageList = Array.isArray(packages) ? packages : [packages]; - const npmProcess = spawn.sync("npm", ["i", "--save-dev"].concat(packageList), - { stdio: "inherit" }); - const error = npmProcess.error; - - if (error && error.code === "ENOENT") { - const pluralS = packageList.length > 1 ? "s" : ""; - - log.error(`Could not execute npm. Please install the following package${pluralS} with a package manager of your choice: ${packageList.join(", ")}`); - } -} - -/** - * Fetch `peerDependencies` of the given package by `npm show` command. - * @param {string} packageName The package name to fetch peerDependencies. - * @returns {Object} Gotten peerDependencies. Returns null if npm was not found. - */ -function fetchPeerDependencies(packageName) { - const npmProcess = spawn.sync( - "npm", - ["show", "--json", packageName, "peerDependencies"], - { encoding: "utf8" } - ); - - const error = npmProcess.error; - - if (error && error.code === "ENOENT") { - return null; - } - const fetchedText = npmProcess.stdout.trim(); - - return JSON.parse(fetchedText || "{}"); - - -} - -/** - * Check whether node modules are include in a project's package.json. - * @param {string[]} packages Array of node module names - * @param {Object} opt Options Object - * @param {boolean} opt.dependencies Set to true to check for direct dependencies - * @param {boolean} opt.devDependencies Set to true to check for development dependencies - * @param {boolean} opt.startdir Directory to begin searching from - * @returns {Object} An object whose keys are the module names - * and values are booleans indicating installation. - */ -function check(packages, opt) { - const deps = new Set(); - const pkgJson = (opt) ? findPackageJson(opt.startDir) : findPackageJson(); - let fileJson; - - if (!pkgJson) { - throw new Error("Could not find a package.json file. Run 'npm init' to create one."); - } - - try { - fileJson = JSON.parse(fs.readFileSync(pkgJson, "utf8")); - } catch (e) { - const error = new Error(e); - - error.messageTemplate = "failed-to-read-json"; - error.messageData = { - path: pkgJson, - message: e.message - }; - throw error; - } - - ["dependencies", "devDependencies"].forEach(key => { - if (opt[key] && typeof fileJson[key] === "object") { - Object.keys(fileJson[key]).forEach(dep => deps.add(dep)); - } - }); - - return packages.reduce((status, pkg) => { - status[pkg] = deps.has(pkg); - return status; - }, {}); -} - -/** - * Check whether node modules are included in the dependencies of a project's - * package.json. - * - * Convenience wrapper around check(). - * @param {string[]} packages Array of node modules to check. - * @param {string} rootDir The directory containing a package.json - * @returns {Object} An object whose keys are the module names - * and values are booleans indicating installation. - */ -function checkDeps(packages, rootDir) { - return check(packages, { dependencies: true, startDir: rootDir }); -} - -/** - * Check whether node modules are included in the devDependencies of a project's - * package.json. - * - * Convenience wrapper around check(). - * @param {string[]} packages Array of node modules to check. - * @returns {Object} An object whose keys are the module names - * and values are booleans indicating installation. - */ -function checkDevDeps(packages) { - return check(packages, { devDependencies: true }); -} - -/** - * Check whether package.json is found in current path. - * @param {string} [startDir] Starting directory - * @returns {boolean} Whether a package.json is found in current path. - */ -function checkPackageJson(startDir) { - return !!findPackageJson(startDir); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - installSyncSaveDev, - fetchPeerDependencies, - checkDeps, - checkDevDeps, - checkPackageJson -}; diff --git a/node_modules/eslint/lib/init/source-code-utils.js b/node_modules/eslint/lib/init/source-code-utils.js deleted file mode 100644 index dca6541d1..000000000 --- a/node_modules/eslint/lib/init/source-code-utils.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @fileoverview Tools for obtaining SourceCode objects. - * @author Ian VanSchooten - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const { CLIEngine } = require("../cli-engine"); - -/* - * This is used for: - * - * 1. Enumerate target file because we have not expose such a API on `CLIEngine` - * (https://github.com/eslint/eslint/issues/11222). - * 2. Create `SourceCode` instances. Because we don't have any function which - * instantiate `SourceCode` so it needs to take the created `SourceCode` - * instance out after linting. - * - * TODO1: Expose the API that enumerates target files. - * TODO2: Extract the creation logic of `SourceCode` from `Linter` class. - */ -const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require - -const debug = require("debug")("eslint:source-code-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Get the SourceCode object for a single file - * @param {string} filename The fully resolved filename to get SourceCode from. - * @param {Object} engine A CLIEngine. - * @returns {Array} Array of the SourceCode object representing the file - * and fatal error message. - */ -function getSourceCodeOfFile(filename, engine) { - debug("getting sourceCode of", filename); - const results = engine.executeOnFiles([filename]); - - if (results && results.results[0] && results.results[0].messages[0] && results.results[0].messages[0].fatal) { - const msg = results.results[0].messages[0]; - - throw new Error(`(${filename}:${msg.line}:${msg.column}) ${msg.message}`); - } - - // TODO: extract the logic that creates source code objects to `SourceCode#parse(text, options)` or something like. - const { linter } = getCLIEngineInternalSlots(engine); - const sourceCode = linter.getSourceCode(); - - return sourceCode; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - - -/** - * This callback is used to measure execution status in a progress bar - * @callback progressCallback - * @param {number} The total number of times the callback will be called. - */ - -/** - * Gets the SourceCode of a single file, or set of files. - * @param {string[]|string} patterns A filename, directory name, or glob, or an array of them - * @param {Object} options A CLIEngine options object. If not provided, the default cli options will be used. - * @param {progressCallback} callback Callback for reporting execution status - * @returns {Object} The SourceCode of all processed files. - */ -function getSourceCodeOfFiles(patterns, options, callback) { - const sourceCodes = {}; - const globPatternsList = typeof patterns === "string" ? [patterns] : patterns; - const engine = new CLIEngine({ ...options, rules: {} }); - - // TODO: make file iteration as a public API and use it. - const { fileEnumerator } = getCLIEngineInternalSlots(engine); - const filenames = - Array.from(fileEnumerator.iterateFiles(globPatternsList)) - .filter(entry => !entry.ignored) - .map(entry => entry.filePath); - - if (filenames.length === 0) { - debug(`Did not find any files matching pattern(s): ${globPatternsList}`); - } - - filenames.forEach(filename => { - const sourceCode = getSourceCodeOfFile(filename, engine); - - if (sourceCode) { - debug("got sourceCode of", filename); - sourceCodes[filename] = sourceCode; - } - if (callback) { - callback(filenames.length); // eslint-disable-line node/callback-return - } - }); - - return sourceCodes; -} - -module.exports = { - getSourceCodeOfFiles -}; diff --git a/node_modules/eslint/lib/linter/apply-disable-directives.js b/node_modules/eslint/lib/linter/apply-disable-directives.js index 41d6934ab..459c85911 100644 --- a/node_modules/eslint/lib/linter/apply-disable-directives.js +++ b/node_modules/eslint/lib/linter/apply-disable-directives.js @@ -5,7 +5,7 @@ "use strict"; -const lodash = require("lodash"); +const escapeRegExp = require("escape-string-regexp"); /** * Compares the locations of two objects in a source file @@ -18,6 +18,177 @@ function compareLocations(itemA, itemB) { return itemA.line - itemB.line || itemA.column - itemB.column; } +/** + * Groups a set of directives into sub-arrays by their parent comment. + * @param {Directive[]} directives Unused directives to be removed. + * @returns {Directive[][]} Directives grouped by their parent comment. + */ +function groupByParentComment(directives) { + const groups = new Map(); + + for (const directive of directives) { + const { unprocessedDirective: { parentComment } } = directive; + + if (groups.has(parentComment)) { + groups.get(parentComment).push(directive); + } else { + groups.set(parentComment, [directive]); + } + } + + return [...groups.values()]; +} + +/** + * Creates removal details for a set of directives within the same comment. + * @param {Directive[]} directives Unused directives to be removed. + * @param {Token} commentToken The backing Comment token. + * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems. + */ +function createIndividualDirectivesRemoval(directives, commentToken) { + + /* + * `commentToken.value` starts right after `//` or `/*`. + * All calculated offsets will be relative to this index. + */ + const commentValueStart = commentToken.range[0] + "//".length; + + // Find where the list of rules starts. `\S+` matches with the directive name (e.g. `eslint-disable-line`) + const listStartOffset = /^\s*\S+\s+/u.exec(commentToken.value)[0].length; + + /* + * Get the list text without any surrounding whitespace. In order to preserve the original + * formatting, we don't want to change that whitespace. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ + const listText = commentToken.value + .slice(listStartOffset) // remove directive name and all whitespace before the list + .split(/\s-{2,}\s/u)[0] // remove `-- comment`, if it exists + .trimEnd(); // remove all whitespace after the list + + /* + * We can assume that `listText` contains multiple elements. + * Otherwise, this function wouldn't be called - if there is + * only one rule in the list, then the whole comment must be removed. + */ + + return directives.map(directive => { + const { ruleId } = directive; + + const regex = new RegExp(String.raw`(?:^|\s*,\s*)${escapeRegExp(ruleId)}(?:\s*,\s*|$)`, "u"); + const match = regex.exec(listText); + const matchedText = match[0]; + const matchStartOffset = listStartOffset + match.index; + const matchEndOffset = matchStartOffset + matchedText.length; + + const firstIndexOfComma = matchedText.indexOf(","); + const lastIndexOfComma = matchedText.lastIndexOf(","); + + let removalStartOffset, removalEndOffset; + + if (firstIndexOfComma !== lastIndexOfComma) { + + /* + * Since there are two commas, this must one of the elements in the middle of the list. + * Matched range starts where the previous rule name ends, and ends where the next rule name starts. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^^^^ + * + * We want to remove only the content between the two commas, and also one of the commas. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^ + */ + removalStartOffset = matchStartOffset + firstIndexOfComma; + removalEndOffset = matchStartOffset + lastIndexOfComma; + + } else { + + /* + * This is either the first element or the last element. + * + * If this is the first element, matched range starts where the first rule name starts + * and ends where the second rule name starts. This is exactly the range we want + * to remove so that the second rule name will start where the first one was starting + * and thus preserve the original formatting. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^ + * + * Similarly, if this is the last element, we've already matched the range we want to + * remove. The previous rule name will end where the last one was ending, relative + * to the content on the right side. + * + * // eslint-disable-line rule-one , rule-two , rule-three -- comment + * ^^^^^^^^^^^^^ + */ + removalStartOffset = matchStartOffset; + removalEndOffset = matchEndOffset; + } + + return { + description: `'${ruleId}'`, + fix: { + range: [ + commentValueStart + removalStartOffset, + commentValueStart + removalEndOffset + ], + text: "" + }, + unprocessedDirective: directive.unprocessedDirective + }; + }); +} + +/** + * Creates a description of deleting an entire unused disable comment. + * @param {Directive[]} directives Unused directives to be removed. + * @param {Token} commentToken The backing Comment token. + * @returns {{ description, fix, unprocessedDirective }} Details for later creation of an output Problem. + */ +function createCommentRemoval(directives, commentToken) { + const { range } = commentToken; + const ruleIds = directives.filter(directive => directive.ruleId).map(directive => `'${directive.ruleId}'`); + + return { + description: ruleIds.length <= 2 + ? ruleIds.join(" or ") + : `${ruleIds.slice(0, ruleIds.length - 1).join(", ")}, or ${ruleIds[ruleIds.length - 1]}`, + fix: { + range, + text: " " + }, + unprocessedDirective: directives[0].unprocessedDirective + }; +} + +/** + * Parses details from directives to create output Problems. + * @param {Directive[]} allDirectives Unused directives to be removed. + * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems. + */ +function processUnusedDisableDirectives(allDirectives) { + const directiveGroups = groupByParentComment(allDirectives); + + return directiveGroups.flatMap( + directives => { + const { parentComment } = directives[0].unprocessedDirective; + const remainingRuleIds = new Set(parentComment.ruleIds); + + for (const directive of directives) { + remainingRuleIds.delete(directive.ruleId); + } + + return remainingRuleIds.size + ? createIndividualDirectivesRemoval(directives, parentComment.commentToken) + : [createCommentRemoval(directives, parentComment.commentToken)]; + } + ); +} + /** * This is the same as the exported function, except that it * doesn't handle disable-line and disable-next-line directives, and it always reports unused @@ -26,105 +197,106 @@ function compareLocations(itemA, itemB) { * for the exported function, except that `reportUnusedDisableDirectives` is not supported * (this function always reports unused disable directives). * @returns {{problems: Problem[], unusedDisableDirectives: Problem[]}} An object with a list - * of filtered problems and unused eslint-disable directives + * of problems (including suppressed ones) and unused eslint-disable directives */ function applyDirectives(options) { const problems = []; - let nextDirectiveIndex = 0; - let currentGlobalDisableDirective = null; - const disabledRuleMap = new Map(); - - // enabledRules is only used when there is a current global disable directive. - const enabledRules = new Set(); const usedDisableDirectives = new Set(); for (const problem of options.problems) { + let disableDirectivesForProblem = []; + let nextDirectiveIndex = 0; + while ( nextDirectiveIndex < options.directives.length && compareLocations(options.directives[nextDirectiveIndex], problem) <= 0 ) { const directive = options.directives[nextDirectiveIndex++]; - switch (directive.type) { - case "disable": - if (directive.ruleId === null) { - currentGlobalDisableDirective = directive; - disabledRuleMap.clear(); - enabledRules.clear(); - } else if (currentGlobalDisableDirective) { - enabledRules.delete(directive.ruleId); - disabledRuleMap.set(directive.ruleId, directive); - } else { - disabledRuleMap.set(directive.ruleId, directive); - } - break; - - case "enable": - if (directive.ruleId === null) { - currentGlobalDisableDirective = null; - disabledRuleMap.clear(); - } else if (currentGlobalDisableDirective) { - enabledRules.add(directive.ruleId); - disabledRuleMap.delete(directive.ruleId); - } else { - disabledRuleMap.delete(directive.ruleId); - } - break; - - // no default + if (directive.ruleId === null || directive.ruleId === problem.ruleId) { + switch (directive.type) { + case "disable": + disableDirectivesForProblem.push(directive); + break; + + case "enable": + disableDirectivesForProblem = []; + break; + + // no default + } } } - if (disabledRuleMap.has(problem.ruleId)) { - usedDisableDirectives.add(disabledRuleMap.get(problem.ruleId)); - } else if (currentGlobalDisableDirective && !enabledRules.has(problem.ruleId)) { - usedDisableDirectives.add(currentGlobalDisableDirective); - } else { - problems.push(problem); + if (disableDirectivesForProblem.length > 0) { + const suppressions = disableDirectivesForProblem.map(directive => ({ + kind: "directive", + justification: directive.unprocessedDirective.justification + })); + + if (problem.suppressions) { + problem.suppressions = problem.suppressions.concat(suppressions); + } else { + problem.suppressions = suppressions; + usedDisableDirectives.add(disableDirectivesForProblem[disableDirectivesForProblem.length - 1]); + } } + + problems.push(problem); } - const unusedDisableDirectives = options.directives - .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)) - .map(directive => ({ - ruleId: null, - message: directive.ruleId - ? `Unused eslint-disable directive (no problems were reported from '${directive.ruleId}').` - : "Unused eslint-disable directive (no problems were reported).", - line: directive.unprocessedDirective.line, - column: directive.unprocessedDirective.column, - severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2, - nodeType: null - })); + const unusedDisableDirectivesToReport = options.directives + .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)); + + const processed = processUnusedDisableDirectives(unusedDisableDirectivesToReport); + + const unusedDisableDirectives = processed + .map(({ description, fix, unprocessedDirective }) => { + const { parentComment, type, line, column } = unprocessedDirective; + + return { + ruleId: null, + message: description + ? `Unused eslint-disable directive (no problems were reported from ${description}).` + : "Unused eslint-disable directive (no problems were reported).", + line: type === "disable-next-line" ? parentComment.commentToken.loc.start.line : line, + column: type === "disable-next-line" ? parentComment.commentToken.loc.start.column + 1 : column, + severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2, + nodeType: null, + ...options.disableFixes ? {} : { fix } + }; + }); return { problems, unusedDisableDirectives }; } /** * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list - * of reported problems, determines which problems should be reported. + * of reported problems, adds the suppression information to the problems. * @param {Object} options Information about directives and problems * @param {{ * type: ("disable"|"enable"|"disable-line"|"disable-next-line"), * ruleId: (string|null), * line: number, - * column: number + * column: number, + * justification: string * }} options.directives Directive comments found in the file, with one-based columns. * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable * comment for two different rules is represented as two directives). * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns. * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives - * @returns {{ruleId: (string|null), line: number, column: number}[]} - * A list of reported problems that were not disabled by the directive comments. + * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties. + * @returns {{ruleId: (string|null), line: number, column: number, suppressions?: {kind: string, justification: string}}[]} + * An object with a list of reported problems, the suppressed of which contain the suppression information. */ -module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off" }) => { +module.exports = ({ directives, disableFixes, problems, reportUnusedDisableDirectives = "off" }) => { const blockDirectives = directives .filter(directive => directive.type === "disable" || directive.type === "enable") .map(directive => Object.assign({}, directive, { unprocessedDirective: directive })) .sort(compareLocations); - const lineDirectives = lodash.flatMap(directives, directive => { + const lineDirectives = directives.flatMap(directive => { switch (directive.type) { case "disable": case "enable": @@ -150,11 +322,13 @@ module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off" const blockDirectivesResult = applyDirectives({ problems, directives: blockDirectives, + disableFixes, reportUnusedDisableDirectives }); const lineDirectivesResult = applyDirectives({ problems: blockDirectivesResult.problems, directives: lineDirectives, + disableFixes, reportUnusedDisableDirectives }); diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js index 47427c11a..2dcc27348 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js @@ -29,6 +29,18 @@ function isCaseNode(node) { return Boolean(node.test); } +/** + * Checks if a given node appears as the value of a PropertyDefinition node. + * @param {ASTNode} node THe node to check. + * @returns {boolean} `true` if the node is a PropertyDefinition value, + * false if not. + */ +function isPropertyDefinitionValue(node) { + const parent = node.parent; + + return parent && parent.type === "PropertyDefinition" && parent.value === node; +} + /** * Checks whether the given logical operator is taken into account for the code * path analysis. @@ -138,6 +150,7 @@ function isIdentifierReference(node) { return parent.id !== node; case "Property": + case "PropertyDefinition": case "MethodDefinition": return ( parent.key !== node || @@ -388,29 +401,68 @@ function processCodePathToEnter(analyzer, node) { let state = codePath && CodePath.getState(codePath); const parent = node.parent; + /** + * Creates a new code path and trigger the onCodePathStart event + * based on the currently selected node. + * @param {string} origin The reason the code path was started. + * @returns {void} + */ + function startCodePath(origin) { + if (codePath) { + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); + } + + // Create the code path of this scope. + codePath = analyzer.codePath = new CodePath({ + id: analyzer.idGenerator.next(), + origin, + upper: codePath, + onLooped: analyzer.onLooped + }); + state = CodePath.getState(codePath); + + // Emits onCodePathStart events. + debug.dump(`onCodePathStart ${codePath.id}`); + analyzer.emitter.emit("onCodePathStart", codePath, node); + } + + /* + * Special case: The right side of class field initializer is considered + * to be its own function, so we need to start a new code path in this + * case. + */ + if (isPropertyDefinitionValue(node)) { + startCodePath("class-field-initializer"); + + /* + * Intentional fall through because `node` needs to also be + * processed by the code below. For example, if we have: + * + * class Foo { + * a = () => {} + * } + * + * In this case, we also need start a second code path. + */ + + } + switch (node.type) { case "Program": + startCodePath("program"); + break; + case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": - if (codePath) { - - // Emits onCodePathSegmentStart events if updated. - forwardCurrentToHead(analyzer, node); - debug.dumpState(node, state, false); - } - - // Create the code path of this scope. - codePath = analyzer.codePath = new CodePath( - analyzer.idGenerator.next(), - codePath, - analyzer.onLooped - ); - state = CodePath.getState(codePath); + startCodePath("function"); + break; - // Emits onCodePathStart events. - debug.dump(`onCodePathStart ${codePath.id}`); - analyzer.emitter.emit("onCodePathStart", codePath, node); + case "StaticBlock": + startCodePath("class-static-block"); break; case "ChainExpression": @@ -503,6 +555,7 @@ function processCodePathToEnter(analyzer, node) { * @returns {void} */ function processCodePathToExit(analyzer, node) { + const codePath = analyzer.codePath; const state = CodePath.getState(codePath); let dontForward = false; @@ -627,28 +680,39 @@ function processCodePathToExit(analyzer, node) { * @returns {void} */ function postprocess(analyzer, node) { - switch (node.type) { - case "Program": - case "FunctionDeclaration": - case "FunctionExpression": - case "ArrowFunctionExpression": { - let codePath = analyzer.codePath; - // Mark the current path as the final node. - CodePath.getState(codePath).makeFinal(); + /** + * Ends the code path for the current node. + * @returns {void} + */ + function endCodePath() { + let codePath = analyzer.codePath; + + // Mark the current path as the final node. + CodePath.getState(codePath).makeFinal(); - // Emits onCodePathSegmentEnd event of the current segments. - leaveFromCurrentSegment(analyzer, node); + // Emits onCodePathSegmentEnd event of the current segments. + leaveFromCurrentSegment(analyzer, node); - // Emits onCodePathEnd event of this code path. - debug.dump(`onCodePathEnd ${codePath.id}`); - analyzer.emitter.emit("onCodePathEnd", codePath, node); - debug.dumpDot(codePath); + // Emits onCodePathEnd event of this code path. + debug.dump(`onCodePathEnd ${codePath.id}`); + analyzer.emitter.emit("onCodePathEnd", codePath, node); + debug.dumpDot(codePath); - codePath = analyzer.codePath = analyzer.codePath.upper; - if (codePath) { - debug.dumpState(node, CodePath.getState(codePath), true); - } + codePath = analyzer.codePath = analyzer.codePath.upper; + if (codePath) { + debug.dumpState(node, CodePath.getState(codePath), true); + } + + } + + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "StaticBlock": { + endCodePath(); break; } @@ -662,6 +726,27 @@ function postprocess(analyzer, node) { default: break; } + + /* + * Special case: The right side of class field initializer is considered + * to be its own function, so we need to end a code path in this + * case. + * + * We need to check after the other checks in order to close the + * code paths in the correct order for code like this: + * + * + * class Foo { + * a = () => {} + * } + * + * In this case, The ArrowFunctionExpression code path is closed first + * and then we need to close the code path for the PropertyDefinition + * value. + */ + if (isPropertyDefinitionValue(node)) { + endCodePath(); + } } //------------------------------------------------------------------------------ @@ -674,7 +759,6 @@ function postprocess(analyzer, node) { */ class CodePathAnalyzer { - // eslint-disable-next-line jsdoc/require-description /** * @param {EventGenerator} eventGenerator An event generator to wrap. */ diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js index ca96ad341..fd2726a99 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js @@ -33,7 +33,6 @@ function isReachable(segment) { */ class CodePathSegment { - // eslint-disable-next-line jsdoc/require-description /** * @param {string} id An identifier. * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. @@ -89,10 +88,10 @@ class CodePathSegment { } }); - /* istanbul ignore if */ + /* c8 ignore start */ if (debug.enabled) { this.internal.nodes = []; - } + }/* c8 ignore stop */ } /** @@ -101,7 +100,7 @@ class CodePathSegment { * @returns {boolean} `true` if the segment is coming from the end of a loop. */ isLoopedPrevSegment(segment) { - return this.internal.loopedPrevSegments.indexOf(segment) !== -1; + return this.internal.loopedPrevSegments.includes(segment); } /** diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js index f75e60e28..d187297d3 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js @@ -33,7 +33,7 @@ function addToReturnedOrThrown(dest, others, all, segments) { const segment = segments[i]; dest.push(segment); - if (others.indexOf(segment) === -1) { + if (!others.includes(segment)) { all.push(segment); } } @@ -59,7 +59,7 @@ function getContinueContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next */ return null; } @@ -79,7 +79,7 @@ function getBreakContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next */ return null; } @@ -219,7 +219,6 @@ function finalizeTestSegmentsOfFor(context, choiceContext, head) { */ class CodePathState { - // eslint-disable-next-line jsdoc/require-description /** * @param {IdGenerator} idGenerator An id generator to generate id for code * path segments. @@ -360,6 +359,7 @@ class CodePathState { /** * Pops the last choice context and finalizes it. + * @throws {Error} (Unreachable.) * @returns {ChoiceContext} The popped context. */ popChoiceContext() { @@ -433,7 +433,7 @@ class CodePathState { */ return context; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } @@ -450,6 +450,7 @@ class CodePathState { /** * Makes a code path segment of the right-hand operand of a logical * expression. + * @throws {Error} (Unreachable.) * @returns {void} */ makeLogicalRight() { @@ -965,6 +966,7 @@ class CodePathState { * `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`, * and `ForStatement`. * @param {string|null} label A label of the node which was triggered. + * @throws {Error} (Unreachable - unknown type.) * @returns {void} */ pushLoopContext(type, label) { @@ -1028,7 +1030,7 @@ class CodePathState { }; break; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error(`unknown type: "${type}"`); } @@ -1036,6 +1038,7 @@ class CodePathState { /** * Pops the last context of a loop statement and finalizes it. + * @throws {Error} (Unreachable - unknown type.) * @returns {void} */ popLoopContext() { @@ -1092,7 +1095,7 @@ class CodePathState { ); break; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } @@ -1389,11 +1392,12 @@ class CodePathState { const context = getBreakContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ + if (context) { context.brokenForkContext.add(forkContext.head); } + /* c8 ignore next */ forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); } @@ -1414,7 +1418,6 @@ class CodePathState { const context = getContinueContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ if (context) { if (context.continueDestSegments) { makeLooped(this, forkContext.head, context.continueDestSegments); diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js index 49b37c6b2..a028ca694 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js @@ -21,13 +21,15 @@ const IdGenerator = require("./id-generator"); */ class CodePath { - // eslint-disable-next-line jsdoc/require-description /** - * @param {string} id An identifier. - * @param {CodePath|null} upper The code path of the upper function scope. - * @param {Function} onLooped A callback function to notify looping. + * Creates a new instance. + * @param {Object} options Options for the function (see below). + * @param {string} options.id An identifier. + * @param {string} options.origin The type of code path origin. + * @param {CodePath|null} options.upper The code path of the upper function scope. + * @param {Function} options.onLooped A callback function to notify looping. */ - constructor(id, upper, onLooped) { + constructor({ id, origin, upper, onLooped }) { /** * The identifier of this code path. @@ -36,6 +38,13 @@ class CodePath { */ this.id = id; + /** + * The reason that this code path was started. May be "program", + * "function", "class-field-initializer", or "class-static-block". + * @type {string} + */ + this.origin = origin; + /** * The code path of the upper function scope. * @type {CodePath|null} @@ -203,7 +212,7 @@ class CodePath { } // Reset the flag of skipping if all branches have been skipped. - if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) { + if (skippedSegment && segment.prevSegments.includes(skippedSegment)) { skippedSegment = null; } visited[segment.id] = true; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js index a4cb99a22..e06b6cde5 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js @@ -20,8 +20,8 @@ const debug = require("debug")("eslint:code-path"); * @param {CodePathSegment} segment A segment to get. * @returns {string} Id of the segment. */ -/* istanbul ignore next */ -function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc +/* c8 ignore next */ +function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc -- Ignoring return segment.id + (segment.reachable ? "" : "!"); } @@ -67,7 +67,7 @@ module.exports = { * @param {boolean} leaving A flag whether or not it's leaving * @returns {void} */ - dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) { + dumpState: !debug.enabled ? debug : /* c8 ignore next */ function(node, state, leaving) { for (let i = 0; i < state.currentSegments.length; ++i) { const segInternal = state.currentSegments[i].internal; @@ -98,7 +98,7 @@ module.exports = { * @see http://www.graphviz.org * @see http://www.webgraphviz.com */ - dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) { + dumpDot: !debug.enabled ? debug : /* c8 ignore next */ function(codePath) { let text = "\n" + "digraph {\n" + @@ -115,7 +115,7 @@ module.exports = { const traceMap = Object.create(null); const arrows = this.makeDotArrows(codePath, traceMap); - for (const id in traceMap) { // eslint-disable-line guard-for-in + for (const id in traceMap) { // eslint-disable-line guard-for-in -- Want ability to traverse prototype const segment = traceMap[id]; text += `${id}[`; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js index 2e872b5c0..04c59b5e4 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js @@ -97,7 +97,6 @@ function mergeExtraSegments(context, segments) { */ class ForkContext { - // eslint-disable-next-line jsdoc/require-description /** * @param {IdGenerator} idGenerator An identifier generator for segments. * @param {ForkContext|null} upper An upper fork context. diff --git a/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js index 4cb2e0e3d..b580104e1 100644 --- a/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +++ b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js @@ -18,7 +18,6 @@ */ class IdGenerator { - // eslint-disable-next-line jsdoc/require-description /** * @param {string} prefix Optional. A prefix of generated ids. */ @@ -34,10 +33,10 @@ class IdGenerator { next() { this.n = 1 + this.n | 0; - /* istanbul ignore if */ + /* c8 ignore start */ if (this.n < 0) { this.n = 1; - } + }/* c8 ignore stop */ return this.prefix + this.n; } diff --git a/node_modules/eslint/lib/linter/config-comment-parser.js b/node_modules/eslint/lib/linter/config-comment-parser.js index 07bbead28..643de8f2d 100644 --- a/node_modules/eslint/lib/linter/config-comment-parser.js +++ b/node_modules/eslint/lib/linter/config-comment-parser.js @@ -3,7 +3,7 @@ * @author Nicholas C. Zakas */ -/* eslint-disable class-methods-use-this*/ +/* eslint class-methods-use-this: off -- Methods desired on instance */ "use strict"; //------------------------------------------------------------------------------ @@ -11,7 +11,11 @@ //------------------------------------------------------------------------------ const levn = require("levn"), - ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"); + { + Legacy: { + ConfigOps + } + } = require("@eslint/eslintrc/universal"); const debug = require("debug")("eslint:config-comment-parser"); @@ -127,8 +131,7 @@ module.exports = class ConfigCommentParser { const items = {}; - // Collapse whitespace around commas - string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => { + string.split(",").forEach(name => { const trimmedName = name.trim(); if (trimmedName) { diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js index adb5c2155..0f1bd4f77 100644 --- a/node_modules/eslint/lib/linter/linter.js +++ b/node_modules/eslint/lib/linter/linter.js @@ -15,12 +15,19 @@ const eslintScope = require("eslint-scope"), evk = require("eslint-visitor-keys"), espree = require("espree"), - lodash = require("lodash"), - BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), + merge = require("lodash.merge"), pkg = require("../../package.json"), astUtils = require("../shared/ast-utils"), - ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), - ConfigValidator = require("@eslint/eslintrc/lib/shared/config-validator"), + { + directivesPattern + } = require("../shared/directives"), + { + Legacy: { + ConfigOps, + ConfigValidator, + environments: BuiltInEnvironments + } + } = require("@eslint/eslintrc/universal"), Traverser = require("../shared/traverser"), { SourceCode } = require("../source-code"), CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"), @@ -33,38 +40,48 @@ const SourceCodeFixer = require("./source-code-fixer"), timing = require("./timing"), ruleReplacements = require("../../conf/replacements.json"); +const { getRuleFromConfig } = require("../config/flat-config-helpers"); +const { FlatConfigArray } = require("../config/flat-config-array"); const debug = require("debug")("eslint:linter"); const MAX_AUTOFIX_PASSES = 10; const DEFAULT_PARSER_NAME = "espree"; +const DEFAULT_ECMA_VERSION = 5; const commentParser = new ConfigCommentParser(); const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } }; +const parserSymbol = Symbol.for("eslint.RuleTester.parser"); +const globals = require("../../conf/globals"); //------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ -/** @typedef {InstanceType} ConfigArray */ -/** @typedef {InstanceType} ExtractedConfig */ +/** @typedef {InstanceType} ConfigArray */ +/** @typedef {InstanceType} ExtractedConfig */ /** @typedef {import("../shared/types").ConfigData} ConfigData */ /** @typedef {import("../shared/types").Environment} Environment */ /** @typedef {import("../shared/types").GlobalConf} GlobalConf */ /** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ /** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */ /** @typedef {import("../shared/types").Processor} Processor */ /** @typedef {import("../shared/types").Rule} Rule */ +/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ /** * @template T * @typedef {{ [P in keyof T]-?: T[P] }} Required */ +/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ /** * @typedef {Object} DisableDirective - * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type - * @property {number} line - * @property {number} column - * @property {(string|null)} ruleId + * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type Type of directive + * @property {number} line The line number + * @property {number} column The column number + * @property {(string|null)} ruleId The rule ID + * @property {string} justification The justification of directive */ /** @@ -72,6 +89,7 @@ const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, colum * @typedef {Object} LinterInternalSlots * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used. * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used. + * @property {SuppressedLintMessage[]} lastSuppressedMessages The `SuppressedLintMessage[]` instance that the last `verify()` call produced. * @property {Map} parserMap The loaded parsers. * @property {Rules} ruleMap The loaded rules. */ @@ -92,12 +110,12 @@ const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, colum * @typedef {Object} ProcessorOptions * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the * predicate function that selects adopt code blocks. - * @property {Processor["postprocess"]} [postprocess] postprocessor for report + * @property {Processor.postprocess} [postprocess] postprocessor for report * messages. If provided, this should accept an array of the message lists * for each code block returned from the preprocessor, apply a mapping to * the messages as appropriate, and return a one-dimensional array of * messages. - * @property {Processor["preprocess"]} [preprocess] preprocessor for source text. + * @property {Processor.preprocess} [preprocess] preprocessor for source text. * If provided, this should accept a string of source text, and return an * array of code blocks to lint. */ @@ -118,6 +136,38 @@ const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, colum // Helpers //------------------------------------------------------------------------------ +/** + * Determines if a given object is Espree. + * @param {Object} parser The parser to check. + * @returns {boolean} True if the parser is Espree or false if not. + */ +function isEspree(parser) { + return !!(parser === espree || parser[parserSymbol] === espree); +} + +/** + * Retrieves globals for the given ecmaVersion. + * @param {number} ecmaVersion The version to retrieve globals for. + * @returns {Object} The globals for the given ecmaVersion. + */ +function getGlobalsForEcmaVersion(ecmaVersion) { + + switch (ecmaVersion) { + case 3: + return globals.es3; + + case 5: + return globals.es5; + + default: + if (ecmaVersion < 2015) { + return globals[`es${ecmaVersion + 2009}`]; + } + + return globals[`es${ecmaVersion}`]; + } +} + /** * Ensures that variables representing built-in properties of the Global Object, * and any globals declared by special block comments, are present in the global @@ -166,6 +216,7 @@ function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, ena if (variable) { variable.eslintUsed = true; + variable.eslintExported = true; } }); @@ -240,14 +291,15 @@ function createLintingProblem(options) { * Creates a collection of disable directives from a comment * @param {Object} options to create disable directives * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment - * @param {{line: number, column: number}} options.loc The 0-based location of the comment token + * @param {token} options.commentToken The Comment token * @param {string} options.value The value after the directive in the comment * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`) + * @param {string} options.justification The justification of the directive * @param {function(string): {create: Function}} options.ruleMapper A map from rule IDs to defined rules * @returns {Object} Directives and problems from the comment */ function createDisableDirectives(options) { - const { type, loc, value, ruleMapper } = options; + const { commentToken, type, value, justification, ruleMapper } = options; const ruleIds = Object.keys(commentParser.parseListConfig(value)); const directiveRules = ruleIds.length ? ruleIds : [null]; const result = { @@ -255,39 +307,67 @@ function createDisableDirectives(options) { directiveProblems: [] // problems in directives }; + const parentComment = { commentToken, ruleIds }; + for (const ruleId of directiveRules) { // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/) - if (ruleId === null || ruleMapper(ruleId) !== null) { - result.directives.push({ type, line: loc.start.line, column: loc.start.column + 1, ruleId }); + if (ruleId === null || !!ruleMapper(ruleId)) { + if (type === "disable-next-line") { + result.directives.push({ + parentComment, + type, + line: commentToken.loc.end.line, + column: commentToken.loc.end.column + 1, + ruleId, + justification + }); + } else { + result.directives.push({ + parentComment, + type, + line: commentToken.loc.start.line, + column: commentToken.loc.start.column + 1, + ruleId, + justification + }); + } } else { - result.directiveProblems.push(createLintingProblem({ ruleId, loc })); + result.directiveProblems.push(createLintingProblem({ ruleId, loc: commentToken.loc })); } } return result; } /** - * Remove the ignored part from a given directive comment and trim it. - * @param {string} value The comment text to strip. - * @returns {string} The stripped text. + * Extract the directive and the justification from a given directive comment and trim them. + * @param {string} value The comment text to extract. + * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification. */ -function stripDirectiveComment(value) { - return value.split(/\s-{2,}\s/u)[0].trim(); +function extractDirectiveComment(value) { + const match = /\s-{2,}\s/u.exec(value); + + if (!match) { + return { directivePart: value.trim(), justificationPart: "" }; + } + + const directive = value.slice(0, match.index).trim(); + const justification = value.slice(match.index + match[0].length).trim(); + + return { directivePart: directive, justificationPart: justification }; } /** * Parses comments in file to extract file-specific config of rules, globals * and environments and merges them with global config; also code blocks * where reporting is disabled or enabled and merges them with reporting config. - * @param {string} filename The file being checked. * @param {ASTNode} ast The top node of the AST. * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from. * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}} * A collection of the directive comments that were found, along with any problems that occurred when parsing */ -function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { +function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { const configuredRules = {}; const enabledGlobals = Object.create(null); const exportedVariables = {}; @@ -298,8 +378,9 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { }); ast.comments.filter(token => token.type !== "Shebang").forEach(comment => { - const trimmedCommentText = stripDirectiveComment(comment.value); - const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText); + const { directivePart, justificationPart } = extractDirectiveComment(comment.value); + + const match = directivesPattern.exec(directivePart); if (!match) { return; @@ -323,7 +404,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { return; } - if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) { + if (directiveText === "eslint-disable-line" && comment.loc.start.line !== comment.loc.end.line) { const message = `${directiveText} comment should not span multiple lines.`; problems.push(createLintingProblem({ @@ -334,7 +415,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { return; } - const directiveValue = trimmedCommentText.slice(match.index + directiveText.length); + const directiveValue = directivePart.slice(match.index + directiveText.length); switch (directiveText) { case "eslint-disable": @@ -342,7 +423,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { case "eslint-disable-next-line": case "eslint-disable-line": { const directiveType = directiveText.slice("eslint-".length); - const options = { type: directiveType, loc: comment.loc, value: directiveValue, ruleMapper }; + const options = { commentToken: comment, type: directiveType, value: directiveValue, justification: justificationPart, ruleMapper }; const { directives, directiveProblems } = createDisableDirectives(options); disableDirectives.push(...directives); @@ -390,7 +471,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { const rule = ruleMapper(name); const ruleValue = parseResult.config[name]; - if (rule === null) { + if (!rule) { problems.push(createLintingProblem({ ruleId: name, loc: comment.loc })); return; } @@ -432,10 +513,17 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { /** * Normalize ECMAScript version from the initial config - * @param {number} ecmaVersion ECMAScript version from the initial config + * @param {Parser} parser The parser which uses this options. + * @param {number} ecmaVersion ECMAScript version from the initial config * @returns {number} normalized ECMAScript version */ -function normalizeEcmaVersion(ecmaVersion) { +function normalizeEcmaVersion(parser, ecmaVersion) { + + if (isEspree(parser)) { + if (ecmaVersion === "latest") { + return espree.latestEcmaVersion; + } + } /* * Calculate ECMAScript edition number from official year version starting with @@ -444,7 +532,39 @@ function normalizeEcmaVersion(ecmaVersion) { return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion; } -const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gu; +/** + * Normalize ECMAScript version from the initial config into languageOptions (year) + * format. + * @param {any} [ecmaVersion] ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersionForLanguageOptions(ecmaVersion) { + + switch (ecmaVersion) { + case 3: + return 3; + + // void 0 = no ecmaVersion specified so use the default + case 5: + case void 0: + return 5; + + default: + if (typeof ecmaVersion === "number") { + return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009; + } + } + + /* + * We default to the latest supported ecmaVersion for everything else. + * Remember, this is for languageOptions.ecmaVersion, which sets the version + * that is used for a number of processes inside of ESLint. It's normally + * safe to assume people want the latest unless otherwise specified. + */ + return espree.latestEcmaVersion + 2009; +} + +const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)(?:\*\/|$)/gsu; /** * Checks whether or not there is a comment which has "eslint-env *" in a given text. @@ -457,10 +577,12 @@ function findEslintEnv(text) { eslintEnvPattern.lastIndex = 0; while ((match = eslintEnvPattern.exec(text)) !== null) { - retv = Object.assign( - retv || {}, - commentParser.parseListConfig(stripDirectiveComment(match[1])) - ); + if (match[0].endsWith("*/")) { + retv = Object.assign( + retv || {}, + commentParser.parseListConfig(extractDirectiveComment(match[1]).directivePart) + ); + } } return retv; @@ -493,7 +615,11 @@ function normalizeFilename(filename) { * @returns {Required & InternalOptions} Normalized options */ function normalizeVerifyOptions(providedOptions, config) { - const disableInlineConfig = config.noInlineConfig === true; + + const linterOptions = config.linterOptions || config; + + // .noInlineConfig for eslintrc, .linterOptions.noInlineConfig for flat + const disableInlineConfig = linterOptions.noInlineConfig === true; const ignoreInlineConfig = providedOptions.allowInlineConfig === false; const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig ? ` (${config.configNameOfNoInlineConfig})` @@ -505,7 +631,9 @@ function normalizeVerifyOptions(providedOptions, config) { reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off"; } if (typeof reportUnusedDisableDirectives !== "string") { - reportUnusedDisableDirectives = config.reportUnusedDisableDirectives ? "warn" : "off"; + reportUnusedDisableDirectives = + linterOptions.reportUnusedDisableDirectives + ? "warn" : "off"; } return { @@ -521,16 +649,17 @@ function normalizeVerifyOptions(providedOptions, config) { /** * Combines the provided parserOptions with the options from environments - * @param {string} parserName The parser name which uses this options. + * @param {Parser} parser The parser which uses this options. * @param {ParserOptions} providedOptions The provided 'parserOptions' key in a config * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments * @returns {ParserOptions} Resulting parser options after merge */ -function resolveParserOptions(parserName, providedOptions, enabledEnvironments) { +function resolveParserOptions(parser, providedOptions, enabledEnvironments) { + const parserOptionsFromEnv = enabledEnvironments .filter(env => env.parserOptions) - .reduce((parserOptions, env) => lodash.merge(parserOptions, env.parserOptions), {}); - const mergedParserOptions = lodash.merge(parserOptionsFromEnv, providedOptions || {}); + .reduce((parserOptions, env) => merge(parserOptions, env.parserOptions), {}); + const mergedParserOptions = merge(parserOptionsFromEnv, providedOptions || {}); const isModule = mergedParserOptions.sourceType === "module"; if (isModule) { @@ -542,16 +671,35 @@ function resolveParserOptions(parserName, providedOptions, enabledEnvironments) mergedParserOptions.ecmaFeatures = Object.assign({}, mergedParserOptions.ecmaFeatures, { globalReturn: false }); } - /* - * TODO: @aladdin-add - * 1. for a 3rd-party parser, do not normalize parserOptions - * 2. for espree, no need to do this (espree will do it) - */ - mergedParserOptions.ecmaVersion = normalizeEcmaVersion(mergedParserOptions.ecmaVersion); + mergedParserOptions.ecmaVersion = normalizeEcmaVersion(parser, mergedParserOptions.ecmaVersion); return mergedParserOptions; } +/** + * Converts parserOptions to languageOptions for backwards compatibility with eslintrc. + * @param {ConfigData} config Config object. + * @param {Object} config.globals Global variable definitions. + * @param {Parser} config.parser The parser to use. + * @param {ParserOptions} config.parserOptions The parserOptions to use. + * @returns {LanguageOptions} The languageOptions equivalent. + */ +function createLanguageOptions({ globals: configuredGlobals, parser, parserOptions }) { + + const { + ecmaVersion, + sourceType + } = parserOptions; + + return { + globals: configuredGlobals, + ecmaVersion: normalizeEcmaVersionForLanguageOptions(ecmaVersion), + sourceType, + parser, + parserOptions + }; +} + /** * Combines the provided globals object with the globals from environments * @param {Record} providedGlobals The 'globals' key in a config @@ -600,20 +748,21 @@ function getRuleOptions(ruleConfig) { /** * Analyze scope of the given AST. * @param {ASTNode} ast The `Program` node to analyze. - * @param {ParserOptions} parserOptions The parser options. + * @param {LanguageOptions} languageOptions The parser options. * @param {Record} visitorKeys The visitor keys. * @returns {ScopeManager} The analysis result. */ -function analyzeScope(ast, parserOptions, visitorKeys) { +function analyzeScope(ast, languageOptions, visitorKeys) { + const parserOptions = languageOptions.parserOptions; const ecmaFeatures = parserOptions.ecmaFeatures || {}; - const ecmaVersion = parserOptions.ecmaVersion || 5; + const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION; return eslintScope.analyze(ast, { ignoreEval: true, nodejsScope: ecmaFeatures.globalReturn, impliedStrict: ecmaFeatures.impliedStrict, - ecmaVersion, - sourceType: parserOptions.sourceType || "script", + ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6, + sourceType: languageOptions.sourceType || "script", childVisitorKeys: visitorKeys || evk.KEYS, fallback: Traverser.getKeys }); @@ -624,25 +773,29 @@ function analyzeScope(ast, parserOptions, visitorKeys) { * optimization of functions, so it's best to keep the try-catch as isolated * as possible * @param {string} text The text to parse. - * @param {Parser} parser The parser to parse. - * @param {ParserOptions} providedParserOptions Options to pass to the parser + * @param {LanguageOptions} languageOptions Options to pass to the parser * @param {string} filePath The path to the file being parsed. * @returns {{success: false, error: Problem}|{success: true, sourceCode: SourceCode}} * An object containing the AST and parser services if parsing was successful, or the error if parsing failed * @private */ -function parse(text, parser, providedParserOptions, filePath) { +function parse(text, languageOptions, filePath) { const textToParse = stripUnicodeBOM(text).replace(astUtils.shebangPattern, (match, captured) => `//${captured}`); - const parserOptions = Object.assign({}, providedParserOptions, { - loc: true, - range: true, - raw: true, - tokens: true, - comment: true, - eslintVisitorKeys: true, - eslintScopeManager: true, - filePath - }); + const { ecmaVersion, sourceType, parser } = languageOptions; + const parserOptions = Object.assign( + { ecmaVersion, sourceType }, + languageOptions.parserOptions, + { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + eslintVisitorKeys: true, + eslintScopeManager: true, + filePath + } + ); /* * Check for parsing errors first. If there's a parsing error, nothing @@ -651,13 +804,20 @@ function parse(text, parser, providedParserOptions, filePath) { * problem that ESLint identified just like any other. */ try { + debug("Parsing:", filePath); const parseResult = (typeof parser.parseForESLint === "function") ? parser.parseForESLint(textToParse, parserOptions) : { ast: parser.parse(textToParse, parserOptions) }; + + debug("Parsing successful:", filePath); const ast = parseResult.ast; const parserServices = parseResult.services || {}; const visitorKeys = parseResult.visitorKeys || evk.KEYS; - const scopeManager = parseResult.scopeManager || analyzeScope(ast, parserOptions, visitorKeys); + + debug("Scope analysis:", filePath); + const scopeManager = parseResult.scopeManager || analyzeScope(ast, languageOptions, visitorKeys); + + debug("Scope analysis successful:", filePath); return { success: true, @@ -726,13 +886,17 @@ function getScope(scopeManager, currentNode) { * Marks a variable as used in the current scope * @param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function. * @param {ASTNode} currentNode The node currently being traversed - * @param {Object} parserOptions The options used to parse this text + * @param {LanguageOptions} languageOptions The options used to parse this text * @param {string} name The name of the variable that should be marked as used. * @returns {boolean} True if the variable was found and marked as used, false if not. */ -function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) { - const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn; - const specialScope = hasGlobalReturn || parserOptions.sourceType === "module"; +function markVariableAsUsed(scopeManager, currentNode, languageOptions, name) { + const parserOptions = languageOptions.parserOptions; + const sourceType = languageOptions.sourceType; + const hasGlobalReturn = + (parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn) || + sourceType === "commonjs"; + const specialScope = hasGlobalReturn || sourceType === "module"; const currentScope = getScope(scopeManager, currentNode); // Special Node.js scope means we need to start one level deeper @@ -754,6 +918,7 @@ function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) { * Runs a rule, and gets its listeners * @param {Rule} rule A normalized rule with a `create` method * @param {Context} ruleContext The context that should be passed to the rule + * @throws {any} Any error during the rule's `create` * @returns {Object} A map of selector listeners provided by the rule */ function createRuleListeners(rule, ruleContext) { @@ -822,15 +987,16 @@ const BASE_TRAVERSAL_CONTEXT = Object.freeze( * @param {SourceCode} sourceCode A SourceCode object for the given text * @param {Object} configuredRules The rules configuration * @param {function(string): Rule} ruleMapper A mapper function from rule names to rules - * @param {Object} parserOptions The options that were passed to the parser - * @param {string} parserName The name of the parser in the config + * @param {string | undefined} parserName The name of the parser in the config + * @param {LanguageOptions} languageOptions The options for parsing the code. * @param {Object} settings The settings that were enabled in the config * @param {string} filename The reported filename of the code * @param {boolean} disableFixes If true, it doesn't make `fix` properties. * @param {string | undefined} cwd cwd of the cli + * @param {string} physicalFilename The full path of the file on disk without any code block information * @returns {Problem[]} An array of reported problems */ -function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd) { +function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageOptions, settings, filename, disableFixes, cwd, physicalFilename) { const emitter = createEmitter(); const nodeQueue = []; let currentNode = sourceCode.ast; @@ -859,18 +1025,21 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager), getCwd: () => cwd, getFilename: () => filename, + getPhysicalFilename: () => physicalFilename || filename, getScope: () => getScope(sourceCode.scopeManager, currentNode), getSourceCode: () => sourceCode, - markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, parserOptions, name), - parserOptions, + markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, languageOptions, name), + parserOptions: { + ...languageOptions.parserOptions + }, parserPath: parserName, + languageOptions, parserServices: sourceCode.parserServices, settings } ) ); - const lintingProblems = []; Object.keys(configuredRules).forEach(ruleId => { @@ -883,7 +1052,7 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser const rule = ruleMapper(ruleId); - if (rule === null) { + if (!rule) { lintingProblems.push(createLintingProblem({ ruleId })); return; } @@ -919,8 +1088,16 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser } const problem = reportTranslator(...args); - if (problem.fix && rule.meta && !rule.meta.fixable) { - throw new Error("Fixable rules should export a `meta.fixable` property."); + if (problem.fix && !(rule.meta && rule.meta.fixable)) { + throw new Error("Fixable rules must set the `meta.fixable` property to \"code\" or \"whitespace\"."); + } + if (problem.suggestions && !(rule.meta && rule.meta.hasSuggestions === true)) { + if (rule.meta && rule.meta.docs && typeof rule.meta.docs.suggestion !== "undefined") { + + // Encourage migration from the former property name. + throw new Error("Rules with suggestions must set the `meta.hasSuggestions` property to `true`. `meta.docs.suggestion` is ignored by ESLint."); + } + throw new Error("Rules with suggestions must set the `meta.hasSuggestions` property to `true`."); } lintingProblems.push(problem); } @@ -928,15 +1105,37 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser ) ); - const ruleListeners = createRuleListeners(rule, ruleContext); + const ruleListeners = timing.enabled ? timing.time(ruleId, createRuleListeners)(rule, ruleContext) : createRuleListeners(rule, ruleContext); + + /** + * Include `ruleId` in error logs + * @param {Function} ruleListener A rule method that listens for a node. + * @returns {Function} ruleListener wrapped in error handler + */ + function addRuleErrorHandler(ruleListener) { + return function ruleErrorHandler(...listenerArgs) { + try { + return ruleListener(...listenerArgs); + } catch (e) { + e.ruleId = ruleId; + throw e; + } + }; + } + + if (typeof ruleListeners === "undefined" || ruleListeners === null) { + throw new Error(`The create() function for rule '${ruleId}' did not return an object.`); + } // add all the selectors from the rule as listeners Object.keys(ruleListeners).forEach(selector => { + const ruleListener = timing.enabled + ? timing.time(ruleId, ruleListeners[selector]) + : ruleListeners[selector]; + emitter.on( selector, - timing.enabled - ? timing.time(ruleId, ruleListeners[selector]) - : ruleListeners[selector] + addRuleErrorHandler(ruleListener) ); }); }); @@ -1021,7 +1220,7 @@ function normalizeCwd(cwd) { } // It's more explicit to assign the undefined - // eslint-disable-next-line no-undefined + // eslint-disable-next-line no-undefined -- Consistently returning a value return undefined; } @@ -1031,26 +1230,44 @@ function normalizeCwd(cwd) { */ const internalSlotsMap = new WeakMap(); +/** + * Throws an error when the given linter is in flat config mode. + * @param {Linter} linter The linter to check. + * @returns {void} + * @throws {Error} If the linter is in flat config mode. + */ +function assertEslintrcConfig(linter) { + const { configType } = internalSlotsMap.get(linter); + + if (configType === "flat") { + throw new Error("This method cannot be used with flat config. Add your entries directly into the config array."); + } +} + + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ /** * Object that is responsible for verifying JavaScript text - * @name eslint + * @name Linter */ class Linter { /** * Initialize the Linter. * @param {Object} [config] the config object - * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + * @param {"flat"|"eslintrc"} [config.configType="eslintrc"] the type of config used. */ - constructor({ cwd } = {}) { + constructor({ cwd, configType } = {}) { internalSlotsMap.set(this, { cwd: normalizeCwd(cwd), lastConfigArray: null, lastSourceCode: null, + lastSuppressedMessages: [], + configType, // TODO: Remove after flat config conversion parserMap: new Map([["espree", espree]]), ruleMap: new Rules() }); @@ -1072,7 +1289,8 @@ class Linter { * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything. * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. - * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + * @throws {Error} If during rule execution. + * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. */ _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { const slots = internalSlotsMap.get(this); @@ -1121,15 +1339,19 @@ class Linter { .map(envName => getEnv(slots, envName)) .filter(env => env); - const parserOptions = resolveParserOptions(parserName, config.parserOptions || {}, enabledEnvs); + const parserOptions = resolveParserOptions(parser, config.parserOptions || {}, enabledEnvs); const configuredGlobals = resolveGlobals(config.globals || {}, enabledEnvs); const settings = config.settings || {}; + const languageOptions = createLanguageOptions({ + globals: config.globals, + parser, + parserOptions + }); if (!slots.lastSourceCode) { const parseResult = parse( text, - parser, - parserOptions, + languageOptions, options.filename ); @@ -1150,14 +1372,14 @@ class Linter { ast: slots.lastSourceCode.ast, parserServices: slots.lastSourceCode.parserServices, visitorKeys: slots.lastSourceCode.visitorKeys, - scopeManager: analyzeScope(slots.lastSourceCode.ast, parserOptions) + scopeManager: analyzeScope(slots.lastSourceCode.ast, languageOptions) }); } } const sourceCode = slots.lastSourceCode; const commentDirectives = options.allowInlineConfig - ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) + ? getDirectiveComments(sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; // augment global scope with declared global variables @@ -1176,12 +1398,13 @@ class Linter { sourceCode, configuredRules, ruleId => getRule(slots, ruleId), - parserOptions, parserName, + languageOptions, settings, options.filename, options.disableFixes, - slots.cwd + slots.cwd, + providedOptions.physicalFilename ); } catch (err) { err.message += `\nOccurred while linting ${options.filename}`; @@ -1196,11 +1419,17 @@ class Linter { debug("Parser Options:", parserOptions); debug("Parser Path:", parserName); debug("Settings:", settings); + + if (err.ruleId) { + err.message += `\nRule: "${err.ruleId}"`; + } + throw err; } return applyDisableDirectives({ directives: commentDirectives.disableDirectives, + disableFixes: options.disableFixes, problems: lintingProblems .concat(commentDirectives.problems) .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), @@ -1219,23 +1448,293 @@ class Linter { */ verify(textOrSourceCode, config, filenameOrOptions) { debug("Verify"); + + const { configType } = internalSlotsMap.get(this); + const options = typeof filenameOrOptions === "string" ? { filename: filenameOrOptions } : filenameOrOptions || {}; - // CLIEngine passes a `ConfigArray` object. - if (config && typeof config.extractConfig === "function") { - return this._verifyWithConfigArray(textOrSourceCode, config, options); + if (config) { + if (configType === "flat") { + + /* + * Because of how Webpack packages up the files, we can't + * compare directly to `FlatConfigArray` using `instanceof` + * because it's not the same `FlatConfigArray` as in the tests. + * So, we work around it by assuming an array is, in fact, a + * `FlatConfigArray` if it has a `getConfig()` method. + */ + let configArray = config; + + if (!Array.isArray(config) || typeof config.getConfig !== "function") { + configArray = new FlatConfigArray(config); + configArray.normalizeSync(); + } + + return this._distinguishSuppressedMessages(this._verifyWithFlatConfigArray(textOrSourceCode, configArray, options, true)); + } + + if (typeof config.extractConfig === "function") { + return this._distinguishSuppressedMessages(this._verifyWithConfigArray(textOrSourceCode, config, options)); + } } + /* + * If we get to here, it means `config` is just an object rather + * than a config array so we can go right into linting. + */ + /* * `Linter` doesn't support `overrides` property in configuration. * So we cannot apply multiple processors. */ if (options.preprocess || options.postprocess) { - return this._verifyWithProcessor(textOrSourceCode, config, options); + return this._distinguishSuppressedMessages(this._verifyWithProcessor(textOrSourceCode, config, options)); } - return this._verifyWithoutProcessors(textOrSourceCode, config, options); + return this._distinguishSuppressedMessages(this._verifyWithoutProcessors(textOrSourceCode, config, options)); + } + + /** + * Verify with a processor. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {FlatConfig} config The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. + */ + _verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options, configForRecursive) { + const filename = options.filename || ""; + const filenameToExpose = normalizeFilename(filename); + const physicalFilename = options.physicalFilename || filenameToExpose; + const text = ensureText(textOrSourceCode); + const preprocess = options.preprocess || (rawText => [rawText]); + const postprocess = options.postprocess || (messagesList => messagesList.flat()); + const filterCodeBlock = + options.filterCodeBlock || + (blockFilename => blockFilename.endsWith(".js")); + const originalExtname = path.extname(filename); + + let blocks; + + try { + blocks = preprocess(text, filenameToExpose); + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + + debug("%s\n%s", message, ex.stack); + + return [ + { + ruleId: null, + fatal: true, + severity: 2, + message, + line: ex.lineNumber, + column: ex.column + } + ]; + } + + const messageLists = blocks.map((block, i) => { + debug("A code block was found: %o", block.filename || "(unnamed)"); + + // Keep the legacy behavior. + if (typeof block === "string") { + return this._verifyWithFlatConfigArrayAndWithoutProcessors(block, config, options); + } + + const blockText = block.text; + const blockName = path.join(filename, `${i}_${block.filename}`); + + // Skip this block if filtered. + if (!filterCodeBlock(blockName, blockText)) { + debug("This code block was skipped."); + return []; + } + + // Resolve configuration again if the file content or extension was changed. + if (configForRecursive && (text !== blockText || path.extname(blockName) !== originalExtname)) { + debug("Resolving configuration again because the file content or extension was changed."); + return this._verifyWithFlatConfigArray( + blockText, + configForRecursive, + { ...options, filename: blockName, physicalFilename } + ); + } + + // Does lint. + return this._verifyWithFlatConfigArrayAndWithoutProcessors( + blockText, + config, + { ...options, filename: blockName, physicalFilename } + ); + }); + + return postprocess(messageLists, filenameToExpose); + } + + /** + * Same as linter.verify, except without support for processors. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @throws {Error} If during rule execution. + * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. + */ + _verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { + const slots = internalSlotsMap.get(this); + const config = providedConfig || {}; + const options = normalizeVerifyOptions(providedOptions, config); + let text; + + // evaluate arguments + if (typeof textOrSourceCode === "string") { + slots.lastSourceCode = null; + text = textOrSourceCode; + } else { + slots.lastSourceCode = textOrSourceCode; + text = textOrSourceCode.text; + } + + const languageOptions = config.languageOptions; + + languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions( + languageOptions.ecmaVersion + ); + + /* + * add configured globals and language globals + * + * using Object.assign instead of object spread for performance reasons + * https://github.com/eslint/eslint/issues/16302 + */ + const configuredGlobals = Object.assign( + {}, + getGlobalsForEcmaVersion(languageOptions.ecmaVersion), + languageOptions.sourceType === "commonjs" ? globals.commonjs : void 0, + languageOptions.globals + ); + + // double check that there is a parser to avoid mysterious error messages + if (!languageOptions.parser) { + throw new TypeError(`No parser specified for ${options.filename}`); + } + + // Espree expects this information to be passed in + if (isEspree(languageOptions.parser)) { + const parserOptions = languageOptions.parserOptions; + + if (languageOptions.sourceType) { + + parserOptions.sourceType = languageOptions.sourceType; + + if ( + parserOptions.sourceType === "module" && + parserOptions.ecmaFeatures && + parserOptions.ecmaFeatures.globalReturn + ) { + parserOptions.ecmaFeatures.globalReturn = false; + } + } + } + + const settings = config.settings || {}; + + if (!slots.lastSourceCode) { + const parseResult = parse( + text, + languageOptions, + options.filename + ); + + if (!parseResult.success) { + return [parseResult.error]; + } + + slots.lastSourceCode = parseResult.sourceCode; + } else { + + /* + * If the given source code object as the first argument does not have scopeManager, analyze the scope. + * This is for backward compatibility (SourceCode is frozen so it cannot rebind). + */ + if (!slots.lastSourceCode.scopeManager) { + slots.lastSourceCode = new SourceCode({ + text: slots.lastSourceCode.text, + ast: slots.lastSourceCode.ast, + parserServices: slots.lastSourceCode.parserServices, + visitorKeys: slots.lastSourceCode.visitorKeys, + scopeManager: analyzeScope(slots.lastSourceCode.ast, languageOptions) + }); + } + } + + const sourceCode = slots.lastSourceCode; + const commentDirectives = options.allowInlineConfig + ? getDirectiveComments( + sourceCode.ast, + ruleId => getRuleFromConfig(ruleId, config), + options.warnInlineConfig + ) + : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; + + // augment global scope with declared global variables + addDeclaredGlobals( + sourceCode.scopeManager.scopes[0], + configuredGlobals, + { exportedVariables: commentDirectives.exportedVariables, enabledGlobals: commentDirectives.enabledGlobals } + ); + + const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules); + + let lintingProblems; + + try { + lintingProblems = runRules( + sourceCode, + configuredRules, + ruleId => getRuleFromConfig(ruleId, config), + void 0, + languageOptions, + settings, + options.filename, + options.disableFixes, + slots.cwd, + providedOptions.physicalFilename + ); + } catch (err) { + err.message += `\nOccurred while linting ${options.filename}`; + debug("An error occurred while traversing"); + debug("Filename:", options.filename); + if (err.currentNode) { + const { line } = err.currentNode.loc.start; + + debug("Line:", line); + err.message += `:${line}`; + } + debug("Parser Options:", languageOptions.parserOptions); + + // debug("Parser Path:", parserName); + debug("Settings:", settings); + + if (err.ruleId) { + err.message += `\nRule: "${err.ruleId}"`; + } + + throw err; + } + + return applyDisableDirectives({ + directives: commentDirectives.disableDirectives, + disableFixes: options.disableFixes, + problems: lintingProblems + .concat(commentDirectives.problems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives + }); } /** @@ -1243,7 +1742,7 @@ class Linter { * @param {string|SourceCode} textOrSourceCode The source code. * @param {ConfigArray} configArray The config array. * @param {VerifyOptions&ProcessorOptions} options The options. - * @returns {LintMessage[]} The found problems. + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. */ _verifyWithConfigArray(textOrSourceCode, configArray, options) { debug("With ConfigArray: %s", options.filename); @@ -1273,25 +1772,103 @@ class Linter { return this._verifyWithoutProcessors(textOrSourceCode, config, options); } + /** + * Verify a given code with a flat config. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {FlatConfigArray} configArray The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {boolean} [firstCall=false] Indicates if this is being called directly + * from verify(). (TODO: Remove once eslintrc is removed.) + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. + */ + _verifyWithFlatConfigArray(textOrSourceCode, configArray, options, firstCall = false) { + debug("With flat config: %s", options.filename); + + // we need a filename to match configs against + const filename = options.filename || "__placeholder__.js"; + + // Store the config array in order to get plugin envs and rules later. + internalSlotsMap.get(this).lastConfigArray = configArray; + const config = configArray.getConfig(filename); + + if (!config) { + return [ + { + ruleId: null, + severity: 1, + message: `No matching configuration found for ${filename}.`, + line: 0, + column: 0 + } + ]; + } + + // Verify. + if (config.processor) { + debug("Apply the processor: %o", config.processor); + const { preprocess, postprocess, supportsAutofix } = config.processor; + const disableFixes = options.disableFixes || !supportsAutofix; + + return this._verifyWithFlatConfigArrayAndProcessor( + textOrSourceCode, + config, + { ...options, filename, disableFixes, postprocess, preprocess }, + configArray + ); + } + + // check for options-based processing + if (firstCall && (options.preprocess || options.postprocess)) { + return this._verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options); + } + + return this._verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, config, options); + } + /** * Verify with a processor. * @param {string|SourceCode} textOrSourceCode The source code. * @param {ConfigData|ExtractedConfig} config The config array. * @param {VerifyOptions&ProcessorOptions} options The options. * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. - * @returns {LintMessage[]} The found problems. + * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. */ _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) { const filename = options.filename || ""; const filenameToExpose = normalizeFilename(filename); + const physicalFilename = options.physicalFilename || filenameToExpose; const text = ensureText(textOrSourceCode); const preprocess = options.preprocess || (rawText => [rawText]); - const postprocess = options.postprocess || lodash.flatten; + const postprocess = options.postprocess || (messagesList => messagesList.flat()); const filterCodeBlock = options.filterCodeBlock || (blockFilename => blockFilename.endsWith(".js")); const originalExtname = path.extname(filename); - const messageLists = preprocess(text, filenameToExpose).map((block, i) => { + + let blocks; + + try { + blocks = preprocess(text, filenameToExpose); + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + + debug("%s\n%s", message, ex.stack); + + return [ + { + ruleId: null, + fatal: true, + severity: 2, + message, + line: ex.lineNumber, + column: ex.column + } + ]; + } + + const messageLists = blocks.map((block, i) => { debug("A code block was found: %o", block.filename || "(unnamed)"); // Keep the legacy behavior. @@ -1308,13 +1885,13 @@ class Linter { return []; } - // Resolve configuration again if the file extension was changed. - if (configForRecursive && path.extname(blockName) !== originalExtname) { - debug("Resolving configuration again because the file extension was changed."); + // Resolve configuration again if the file content or extension was changed. + if (configForRecursive && (text !== blockText || path.extname(blockName) !== originalExtname)) { + debug("Resolving configuration again because the file content or extension was changed."); return this._verifyWithConfigArray( blockText, configForRecursive, - { ...options, filename: blockName } + { ...options, filename: blockName, physicalFilename } ); } @@ -1322,13 +1899,37 @@ class Linter { return this._verifyWithoutProcessors( blockText, config, - { ...options, filename: blockName } + { ...options, filename: blockName, physicalFilename } ); }); return postprocess(messageLists, filenameToExpose); } + /** + * Given a list of reported problems, distinguish problems between normal messages and suppressed messages. + * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages. + * @param {Problem[]} problems A list of reported problems. + * @returns {LintMessage[]} A list of LintMessage. + */ + _distinguishSuppressedMessages(problems) { + const messages = []; + const suppressedMessages = []; + const slots = internalSlotsMap.get(this); + + for (const problem of problems) { + if (problem.suppressions) { + suppressedMessages.push(problem); + } else { + messages.push(problem); + } + } + + slots.lastSuppressedMessages = suppressedMessages; + + return messages; + } + /** * Gets the SourceCode object representing the parsed source. * @returns {SourceCode} The SourceCode object. @@ -1337,6 +1938,14 @@ class Linter { return internalSlotsMap.get(this).lastSourceCode; } + /** + * Gets the list of SuppressedLintMessage produced in the last running. + * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage + */ + getSuppressedMessages() { + return internalSlotsMap.get(this).lastSuppressedMessages; + } + /** * Defines a new linting rule. * @param {string} ruleId A unique rule identifier @@ -1344,6 +1953,7 @@ class Linter { * @returns {void} */ defineRule(ruleId, ruleModule) { + assertEslintrcConfig(this); internalSlotsMap.get(this).ruleMap.define(ruleId, ruleModule); } @@ -1353,6 +1963,7 @@ class Linter { * @returns {void} */ defineRules(rulesToDefine) { + assertEslintrcConfig(this); Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { this.defineRule(ruleId, rulesToDefine[ruleId]); }); @@ -1363,6 +1974,7 @@ class Linter { * @returns {Map} All loaded rules */ getRules() { + assertEslintrcConfig(this); const { lastConfigArray, ruleMap } = internalSlotsMap.get(this); return new Map(function *() { @@ -1381,6 +1993,7 @@ class Linter { * @returns {void} */ defineParser(parserId, parserModule) { + assertEslintrcConfig(this); internalSlotsMap.get(this).parserMap.set(parserId, parserModule); } @@ -1388,7 +2001,7 @@ class Linter { * Performs multiple autofix passes over the text until as many fixes as possible * have been applied. * @param {string} text The source text to apply fixes to. - * @param {ConfigData|ConfigArray} config The ESLint config object to use. + * @param {ConfigData|ConfigArray|FlatConfigArray} config The ESLint config object to use. * @param {VerifyOptions&ProcessorOptions&FixOptions} options The ESLint options object to use. * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the * SourceCodeFixer. diff --git a/node_modules/eslint/lib/linter/node-event-generator.js b/node_modules/eslint/lib/linter/node-event-generator.js index 0b4e50fc4..d56bef2fa 100644 --- a/node_modules/eslint/lib/linter/node-event-generator.js +++ b/node_modules/eslint/lib/linter/node-event-generator.js @@ -10,7 +10,6 @@ //------------------------------------------------------------------------------ const esquery = require("esquery"); -const lodash = require("lodash"); //------------------------------------------------------------------------------ // Typedefs @@ -32,6 +31,33 @@ const lodash = require("lodash"); // Helpers //------------------------------------------------------------------------------ +/** + * Computes the union of one or more arrays + * @param {...any[]} arrays One or more arrays to union + * @returns {any[]} The union of the input arrays + */ +function union(...arrays) { + return [...new Set(arrays.flat())]; +} + +/** + * Computes the intersection of one or more arrays + * @param {...any[]} arrays One or more arrays to intersect + * @returns {any[]} The intersection of the input arrays + */ +function intersection(...arrays) { + if (arrays.length === 0) { + return []; + } + + let result = [...new Set(arrays[0])]; + + for (const array of arrays.slice(1)) { + result = result.filter(x => array.includes(x)); + } + return result; +} + /** * Gets the possible types of a selector * @param {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector @@ -46,7 +72,7 @@ function getPossibleTypes(parsedSelector) { const typesForComponents = parsedSelector.selectors.map(getPossibleTypes); if (typesForComponents.every(Boolean)) { - return lodash.union(...typesForComponents); + return union(...typesForComponents); } return null; } @@ -63,7 +89,7 @@ function getPossibleTypes(parsedSelector) { * If at least one of the components could only match a particular type, the compound could only match * the intersection of those types. */ - return lodash.intersection(...typesForComponents); + return intersection(...typesForComponents); } case "child": @@ -72,6 +98,13 @@ function getPossibleTypes(parsedSelector) { case "adjacent": return getPossibleTypes(parsedSelector.right); + case "class": + if (parsedSelector.name === "function") { + return ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]; + } + + return null; + default: return null; @@ -166,15 +199,21 @@ function tryParseSelector(rawSelector) { } } +const selectorCache = new Map(); + /** * Parses a raw selector string, and returns the parsed selector along with specificity and type information. * @param {string} rawSelector A raw AST selector * @returns {ASTSelector} A selector descriptor */ -const parseSelector = lodash.memoize(rawSelector => { +function parseSelector(rawSelector) { + if (selectorCache.has(rawSelector)) { + return selectorCache.get(rawSelector); + } + const parsedSelector = tryParseSelector(rawSelector); - return { + const result = { rawSelector, isExit: rawSelector.endsWith(":exit"), parsedSelector, @@ -182,7 +221,10 @@ const parseSelector = lodash.memoize(rawSelector => { attributeCount: countClassAttributes(parsedSelector), identifierCount: countIdentifiers(parsedSelector) }; -}); + + selectorCache.set(rawSelector, result); + return result; +} //------------------------------------------------------------------------------ // Public Interface @@ -202,7 +244,6 @@ const parseSelector = lodash.memoize(rawSelector => { */ class NodeEventGenerator { - // eslint-disable-next-line jsdoc/require-description /** * @param {SafeEmitter} emitter * An SafeEmitter which is the destination of events. This emitter must already diff --git a/node_modules/eslint/lib/linter/report-translator.js b/node_modules/eslint/lib/linter/report-translator.js index 75005c16e..781b3136e 100644 --- a/node_modules/eslint/lib/linter/report-translator.js +++ b/node_modules/eslint/lib/linter/report-translator.js @@ -32,18 +32,18 @@ const interpolate = require("./interpolate"); /** * Information about the report * @typedef {Object} ReportInfo - * @property {string} ruleId - * @property {(0|1|2)} severity - * @property {(string|undefined)} message - * @property {(string|undefined)} [messageId] - * @property {number} line - * @property {number} column - * @property {(number|undefined)} [endLine] - * @property {(number|undefined)} [endColumn] - * @property {(string|null)} nodeType - * @property {string} source - * @property {({text: string, range: (number[]|null)}|null)} [fix] - * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] + * @property {string} ruleId The rule ID + * @property {(0|1|2)} severity Severity of the error + * @property {(string|undefined)} message The message + * @property {(string|undefined)} [messageId] The message ID + * @property {number} line The line number + * @property {number} column The column number + * @property {(number|undefined)} [endLine] The ending line number + * @property {(number|undefined)} [endColumn] The ending column number + * @property {(string|null)} nodeType Type of node + * @property {string} source Source text + * @property {({text: string, range: (number[]|null)}|null)} [fix] The fix object + * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] Suggestion info */ //------------------------------------------------------------------------------ diff --git a/node_modules/eslint/lib/linter/rules.js b/node_modules/eslint/lib/linter/rules.js index a153266ef..647bab687 100644 --- a/node_modules/eslint/lib/linter/rules.js +++ b/node_modules/eslint/lib/linter/rules.js @@ -30,6 +30,9 @@ function normalizeRule(rule) { // Public Interface //------------------------------------------------------------------------------ +/** + * A storage for rules. + */ class Rules { constructor() { this._rules = Object.create(null); diff --git a/node_modules/eslint/lib/linter/safe-emitter.js b/node_modules/eslint/lib/linter/safe-emitter.js index ab212230d..f4837c1dd 100644 --- a/node_modules/eslint/lib/linter/safe-emitter.js +++ b/node_modules/eslint/lib/linter/safe-emitter.js @@ -12,8 +12,8 @@ /** * An event emitter * @typedef {Object} SafeEmitter - * @property {function(eventName: string, listenerFunc: Function): void} on Adds a listener for a given event name - * @property {function(eventName: string, arg1?: any, arg2?: any, arg3?: any)} emit Emits an event with a given name. + * @property {(eventName: string, listenerFunc: Function) => void} on Adds a listener for a given event name + * @property {(eventName: string, arg1?: any, arg2?: any, arg3?: any) => void} emit Emits an event with a given name. * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments. * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners. */ diff --git a/node_modules/eslint/lib/linter/source-code-fixer.js b/node_modules/eslint/lib/linter/source-code-fixer.js index 53dc1dc6b..15386c926 100644 --- a/node_modules/eslint/lib/linter/source-code-fixer.js +++ b/node_modules/eslint/lib/linter/source-code-fixer.js @@ -80,8 +80,8 @@ SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) { /** * Try to use the 'fix' from a problem. - * @param {Message} problem The message object to apply fixes from - * @returns {boolean} Whether fix was successfully applied + * @param {Message} problem The message object to apply fixes from + * @returns {boolean} Whether fix was successfully applied */ function attemptFix(problem) { const fix = problem.fix; diff --git a/node_modules/eslint/lib/linter/timing.js b/node_modules/eslint/lib/linter/timing.js index 582303068..1076ff258 100644 --- a/node_modules/eslint/lib/linter/timing.js +++ b/node_modules/eslint/lib/linter/timing.js @@ -9,7 +9,7 @@ // Helpers //------------------------------------------------------------------------------ -/* istanbul ignore next */ +/* c8 ignore next */ /** * Align the string to left * @param {string} str string to evaluate @@ -22,7 +22,7 @@ function alignLeft(str, len, ch) { return str + new Array(len - str.length + 1).join(ch || " "); } -/* istanbul ignore next */ +/* c8 ignore next */ /** * Align the string to right * @param {string} str string to evaluate @@ -64,7 +64,7 @@ function getListSize() { return TIMING_ENV_VAR_AS_INTEGER > 10 ? TIMING_ENV_VAR_AS_INTEGER : MINIMUM_SIZE; } -/* istanbul ignore next */ +/* c8 ignore next */ /** * display the data * @param {Object} data Data object to be displayed @@ -116,17 +116,17 @@ function display(data) { return ALIGN[index](":", width + extraAlignment, "-"); }).join("|")); - console.log(table.join("\n")); // eslint-disable-line no-console + console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function } -/* istanbul ignore next */ +/* c8 ignore next */ module.exports = (function() { const data = Object.create(null); /** * Time the run - * @param {*} key key from the data object + * @param {any} key key from the data object * @param {Function} fn function to be called * @returns {Function} function to be executed * @private @@ -138,10 +138,11 @@ module.exports = (function() { return function(...args) { let t = process.hrtime(); + const result = fn(...args); - fn(...args); t = process.hrtime(t); data[key] += t[0] * 1e3 + t[1] / 1e6; + return result; }; } diff --git a/node_modules/eslint/lib/options.js b/node_modules/eslint/lib/options.js index 99a38a770..2bc4018af 100644 --- a/node_modules/eslint/lib/options.js +++ b/node_modules/eslint/lib/options.js @@ -11,260 +11,367 @@ const optionator = require("optionator"); +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * The options object parsed by Optionator. + * @typedef {Object} ParsedCLIOptions + * @property {boolean} cache Only check changed files + * @property {string} cacheFile Path to the cache file. Deprecated: use --cache-location + * @property {string} [cacheLocation] Path to the cache file or directory + * @property {"metadata" | "content"} cacheStrategy Strategy to use for detecting changed files in the cache + * @property {boolean} [color] Force enabling/disabling of color + * @property {string} [config] Use this configuration, overriding .eslintrc.* config options if present + * @property {boolean} debug Output debugging information + * @property {string[]} [env] Specify environments + * @property {boolean} envInfo Output execution environment information + * @property {boolean} errorOnUnmatchedPattern Prevent errors when pattern is unmatched + * @property {boolean} eslintrc Disable use of configuration from .eslintrc.* + * @property {string[]} [ext] Specify JavaScript file extensions + * @property {boolean} fix Automatically fix problems + * @property {boolean} fixDryRun Automatically fix problems without saving the changes to the file system + * @property {("directive" | "problem" | "suggestion" | "layout")[]} [fixType] Specify the types of fixes to apply (directive, problem, suggestion, layout) + * @property {string} format Use a specific output format + * @property {string[]} [global] Define global variables + * @property {boolean} [help] Show help + * @property {boolean} ignore Disable use of ignore files and patterns + * @property {string} [ignorePath] Specify path of ignore file + * @property {string[]} [ignorePattern] Pattern of files to ignore (in addition to those in .eslintignore) + * @property {boolean} init Run config initialization wizard + * @property {boolean} inlineConfig Prevent comments from changing config or rules + * @property {number} maxWarnings Number of warnings to trigger nonzero exit code + * @property {string} [outputFile] Specify file to write report to + * @property {string} [parser] Specify the parser to be used + * @property {Object} [parserOptions] Specify parser options + * @property {string[]} [plugin] Specify plugins + * @property {string} [printConfig] Print the configuration for the given file + * @property {boolean | undefined} reportUnusedDisableDirectives Adds reported errors for unused eslint-disable directives + * @property {string} [resolvePluginsRelativeTo] A folder where plugins should be resolved from, CWD by default + * @property {Object} [rule] Specify rules + * @property {string[]} [rulesdir] Load additional rules from this directory. Deprecated: Use rules from plugins + * @property {boolean} stdin Lint code provided on + * @property {string} [stdinFilename] Specify filename to process STDIN as + * @property {boolean} quiet Report errors only + * @property {boolean} [version] Output the version number + * @property {string[]} _ Positional filenames or patterns + */ + //------------------------------------------------------------------------------ // Initialization and Public Interface //------------------------------------------------------------------------------ // exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" -module.exports = optionator({ - prepend: "eslint [options] file.js [file.js] [dir]", - defaults: { - concatRepeatedArrays: true, - mergeRepeatedObjects: true - }, - options: [ - { - heading: "Basic configuration" - }, - { + +/** + * Creates the CLI options for ESLint. + * @param {boolean} usingFlatConfig Indicates if flat config is being used. + * @returns {Object} The optionator instance. + */ +module.exports = function(usingFlatConfig) { + + let lookupFlag; + + if (usingFlatConfig) { + lookupFlag = { + option: "config-lookup", + type: "Boolean", + default: "true", + description: "Disable look up for eslint.config.js" + }; + } else { + lookupFlag = { option: "eslintrc", type: "Boolean", default: "true", description: "Disable use of configuration from .eslintrc.*" - }, - { - option: "config", - alias: "c", - type: "path::String", - description: "Use this configuration, overriding .eslintrc.* config options if present" - }, - { + }; + } + + let envFlag; + + if (!usingFlatConfig) { + envFlag = { option: "env", type: "[String]", description: "Specify environments" - }, - { + }; + } + + let extFlag; + + if (!usingFlatConfig) { + extFlag = { option: "ext", type: "[String]", description: "Specify JavaScript file extensions" - }, - { - option: "global", - type: "[String]", - description: "Define global variables" - }, - { - option: "parser", - type: "String", - description: "Specify the parser to be used" - }, - { - option: "parser-options", - type: "Object", - description: "Specify parser options" - }, - { + }; + } + + let resolvePluginsFlag; + + if (!usingFlatConfig) { + resolvePluginsFlag = { option: "resolve-plugins-relative-to", type: "path::String", description: "A folder where plugins should be resolved from, CWD by default" - }, - { - heading: "Specifying rules and plugins" - }, - { + }; + } + + let rulesDirFlag; + + if (!usingFlatConfig) { + rulesDirFlag = { option: "rulesdir", type: "[path::String]", - description: "Use additional rules from this directory" - }, - { - option: "plugin", - type: "[String]", - description: "Specify plugins" - }, - { - option: "rule", - type: "Object", - description: "Specify rules" - }, - { - heading: "Fixing problems" - }, - { - option: "fix", - type: "Boolean", - default: false, - description: "Automatically fix problems" - }, - { - option: "fix-dry-run", - type: "Boolean", - default: false, - description: "Automatically fix problems without saving the changes to the file system" - }, - { - option: "fix-type", - type: "Array", - description: "Specify the types of fixes to apply (problem, suggestion, layout)" - }, - { - heading: "Ignoring files" - }, - { + description: "Load additional rules from this directory. Deprecated: Use rules from plugins" + }; + } + + let ignorePathFlag; + + if (!usingFlatConfig) { + ignorePathFlag = { option: "ignore-path", type: "path::String", description: "Specify path of ignore file" - }, - { - option: "ignore", - type: "Boolean", - default: "true", - description: "Disable use of ignore files and patterns" - }, - { - option: "ignore-pattern", - type: "[String]", - description: "Pattern of files to ignore (in addition to those in .eslintignore)", - concatRepeatedArrays: [true, { - oneValuePerFlag: true - }] - }, - { - heading: "Using stdin" - }, - { - option: "stdin", - type: "Boolean", - default: "false", - description: "Lint code provided on " - }, - { - option: "stdin-filename", - type: "String", - description: "Specify filename to process STDIN as" - }, - { - heading: "Handling warnings" - }, - { - option: "quiet", - type: "Boolean", - default: "false", - description: "Report errors only" - }, - { - option: "max-warnings", - type: "Int", - default: "-1", - description: "Number of warnings to trigger nonzero exit code" - }, - { - heading: "Output" - }, - { - option: "output-file", - alias: "o", - type: "path::String", - description: "Specify file to write report to" - }, - { - option: "format", - alias: "f", - type: "String", - default: "stylish", - description: "Use a specific output format" - }, - { - option: "color", - type: "Boolean", - alias: "no-color", - description: "Force enabling/disabling of color" - }, - { - heading: "Inline configuration comments" - }, - { - option: "inline-config", - type: "Boolean", - default: "true", - description: "Prevent comments from changing config or rules" - }, - { - option: "report-unused-disable-directives", - type: "Boolean", - default: void 0, - description: "Adds reported errors for unused eslint-disable directives" - }, - { - heading: "Caching" - }, - { - option: "cache", - type: "Boolean", - default: "false", - description: "Only check changed files" - }, - { - option: "cache-file", - type: "path::String", - default: ".eslintcache", - description: "Path to the cache file. Deprecated: use --cache-location" - }, - { - option: "cache-location", - type: "path::String", - description: "Path to the cache file or directory" - }, - { - option: "cache-strategy", - dependsOn: ["cache"], - type: "String", - default: "metadata", - enum: ["metadata", "content"], - description: "Strategy to use for detecting changed files in the cache" - }, - { - heading: "Miscellaneous" - }, - { - option: "init", - type: "Boolean", - default: "false", - description: "Run config initialization wizard" - }, - { - option: "env-info", - type: "Boolean", - default: "false", - description: "Output execution environment information" - }, - { - option: "error-on-unmatched-pattern", - type: "Boolean", - default: "true", - description: "Prevent errors when pattern is unmatched" - }, - { - option: "debug", - type: "Boolean", - default: false, - description: "Output debugging information" - }, - { - option: "help", - alias: "h", - type: "Boolean", - description: "Show help" - }, - { - option: "version", - alias: "v", - type: "Boolean", - description: "Output the version number" - }, - { - option: "print-config", - type: "path::String", - description: "Print the configuration for the given file" - } - ] -}); + }; + } + + return optionator({ + prepend: "eslint [options] file.js [file.js] [dir]", + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true + }, + options: [ + { + heading: "Basic configuration" + }, + lookupFlag, + { + option: "config", + alias: "c", + type: "path::String", + description: usingFlatConfig + ? "Use this configuration instead of eslint.config.js" + : "Use this configuration, overriding .eslintrc.* config options if present" + }, + envFlag, + extFlag, + { + option: "global", + type: "[String]", + description: "Define global variables" + }, + { + option: "parser", + type: "String", + description: "Specify the parser to be used" + }, + { + option: "parser-options", + type: "Object", + description: "Specify parser options" + }, + resolvePluginsFlag, + { + heading: "Specify Rules and Plugins" + }, + { + option: "plugin", + type: "[String]", + description: "Specify plugins" + }, + { + option: "rule", + type: "Object", + description: "Specify rules" + }, + rulesDirFlag, + { + heading: "Fix Problems" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "fix-dry-run", + type: "Boolean", + default: false, + description: "Automatically fix problems without saving the changes to the file system" + }, + { + option: "fix-type", + type: "Array", + description: "Specify the types of fixes to apply (directive, problem, suggestion, layout)" + }, + { + heading: "Ignore Files" + }, + ignorePathFlag, + { + option: "ignore", + type: "Boolean", + default: "true", + description: "Disable use of ignore files and patterns" + }, + { + option: "ignore-pattern", + type: "[String]", + description: "Pattern of files to ignore (in addition to those in .eslintignore)", + concatRepeatedArrays: [true, { + oneValuePerFlag: true + }] + }, + { + heading: "Use stdin" + }, + { + option: "stdin", + type: "Boolean", + default: "false", + description: "Lint code provided on " + }, + { + option: "stdin-filename", + type: "String", + description: "Specify filename to process STDIN as" + }, + { + heading: "Handle Warnings" + }, + { + option: "quiet", + type: "Boolean", + default: "false", + description: "Report errors only" + }, + { + option: "max-warnings", + type: "Int", + default: "-1", + description: "Number of warnings to trigger nonzero exit code" + }, + { + heading: "Output" + }, + { + option: "output-file", + alias: "o", + type: "path::String", + description: "Specify file to write report to" + }, + { + option: "format", + alias: "f", + type: "String", + default: "stylish", + description: "Use a specific output format" + }, + { + option: "color", + type: "Boolean", + alias: "no-color", + description: "Force enabling/disabling of color" + }, + { + heading: "Inline configuration comments" + }, + { + option: "inline-config", + type: "Boolean", + default: "true", + description: "Prevent comments from changing config or rules" + }, + { + option: "report-unused-disable-directives", + type: "Boolean", + default: void 0, + description: "Adds reported errors for unused eslint-disable directives" + }, + { + heading: "Caching" + }, + { + option: "cache", + type: "Boolean", + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + option: "cache-strategy", + dependsOn: ["cache"], + type: "String", + default: "metadata", + enum: ["metadata", "content"], + description: "Strategy to use for detecting changed files in the cache" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" + }, + { + option: "env-info", + type: "Boolean", + default: "false", + description: "Output execution environment information" + }, + { + option: "error-on-unmatched-pattern", + type: "Boolean", + default: "true", + description: "Prevent errors when pattern is unmatched" + }, + { + option: "exit-on-fatal-error", + type: "Boolean", + default: "false", + description: "Exit with exit code 2 in case of fatal error" + }, + { + option: "debug", + type: "Boolean", + default: false, + description: "Output debugging information" + }, + { + option: "help", + alias: "h", + type: "Boolean", + description: "Show help" + }, + { + option: "version", + alias: "v", + type: "Boolean", + description: "Output the version number" + }, + { + option: "print-config", + type: "path::String", + description: "Print the configuration for the given file" + } + ].filter(value => !!value) + }); +}; diff --git a/node_modules/eslint/lib/rule-tester/flat-rule-tester.js b/node_modules/eslint/lib/rule-tester/flat-rule-tester.js new file mode 100644 index 000000000..510cbc688 --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/flat-rule-tester.js @@ -0,0 +1,1044 @@ +/** + * @fileoverview Mocha/Jest test wrapper + * @author Ilya Volodin + */ +"use strict"; + +/* globals describe, it -- Mocha globals */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + assert = require("assert"), + util = require("util"), + equal = require("fast-deep-equal"), + Traverser = require("../shared/traverser"), + { getRuleOptionsSchema } = require("../config/flat-config-helpers"), + { Linter, SourceCodeFixer, interpolate } = require("../linter"); +const { FlatConfigArray } = require("../config/flat-config-array"); +const { defaultConfig } = require("../config/default-config"); + +const ajv = require("../shared/ajv")({ strictDefaults: true }); + +const parserSymbol = Symbol.for("eslint.RuleTester.parser"); +const { SourceCode } = require("../source-code"); +const { ConfigArraySymbol } = require("@humanwhocodes/config-array"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */ + +/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ +/** + * A test case that is expected to pass lint. + * @typedef {Object} ValidTestCase + * @property {string} [name] Name for the test case. + * @property {string} code Code for the test case. + * @property {any[]} [options] Options for the test case. + * @property {LanguageOptions} [languageOptions] The language options to use in the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {boolean} [only] Run only this test case or the subset of test cases with this property. + */ + +/** + * A test case that is expected to fail lint. + * @typedef {Object} InvalidTestCase + * @property {string} [name] Name for the test case. + * @property {string} code Code for the test case. + * @property {number | Array} errors Expected errors. + * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {LanguageOptions} [languageOptions] The language options to use in the test case. + * @property {boolean} [only] Run only this test case or the subset of test cases with this property. + */ + +/** + * A description of a reported error used in a rule tester test. + * @typedef {Object} TestCaseError + * @property {string | RegExp} [message] Message. + * @property {string} [messageId] Message ID. + * @property {string} [type] The type of the reported AST node. + * @property {{ [name: string]: string }} [data] The data used to fill the message template. + * @property {number} [line] The 1-based line number of the reported start location. + * @property {number} [column] The 1-based column number of the reported start location. + * @property {number} [endLine] The 1-based line number of the reported end location. + * @property {number} [endColumn] The 1-based column number of the reported end location. + */ +/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +/* + * testerDefaultConfig must not be modified as it allows to reset the tester to + * the initial default configuration + */ +const testerDefaultConfig = { rules: {} }; + +/* + * RuleTester uses this config as its default. This can be overwritten via + * setDefaultConfig(). + */ +let sharedDefaultConfig = { rules: {} }; + +/* + * List every parameters possible on a test case that are not related to eslint + * configuration + */ +const RuleTesterParameters = [ + "name", + "code", + "filename", + "options", + "errors", + "output", + "only" +]; + +/* + * All allowed property names in error objects. + */ +const errorObjectParameters = new Set([ + "message", + "messageId", + "data", + "type", + "line", + "column", + "endLine", + "endColumn", + "suggestions" +]); +const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +/* + * All allowed property names in suggestion objects. + */ +const suggestionObjectParameters = new Set([ + "desc", + "messageId", + "data", + "output" +]); +const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); + +/** + * Clones a given value deeply. + * Note: This ignores `parent` property. + * @param {any} x A value to clone. + * @returns {any} A cloned value. + */ +function cloneDeeplyExcludesParent(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + return x.map(cloneDeeplyExcludesParent); + } + + const retv = {}; + + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + retv[key] = cloneDeeplyExcludesParent(x[key]); + } + } + + return retv; + } + + return x; +} + +/** + * Freezes a given value deeply. + * @param {any} x A value to freeze. + * @returns {void} + */ +function freezeDeeply(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + x.forEach(freezeDeeply); + } else { + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + freezeDeeply(x[key]); + } + } + } + Object.freeze(x); + } +} + +/** + * Replace control characters by `\u00xx` form. + * @param {string} text The text to sanitize. + * @returns {string} The sanitized text. + */ +function sanitize(text) { + if (typeof text !== "string") { + return ""; + } + return text.replace( + /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls + c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}` + ); +} + +/** + * Define `start`/`end` properties as throwing error. + * @param {string} objName Object name used for error messages. + * @param {ASTNode} node The node to define. + * @returns {void} + */ +function defineStartEndAsError(objName, node) { + Object.defineProperties(node, { + start: { + get() { + throw new Error(`Use ${objName}.range[0] instead of ${objName}.start`); + }, + configurable: true, + enumerable: false + }, + end: { + get() { + throw new Error(`Use ${objName}.range[1] instead of ${objName}.end`); + }, + configurable: true, + enumerable: false + } + }); +} + + +/** + * Define `start`/`end` properties of all nodes of the given AST as throwing error. + * @param {ASTNode} ast The root node to errorize `start`/`end` properties. + * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast. + * @returns {void} + */ +function defineStartEndAsErrorInTree(ast, visitorKeys) { + Traverser.traverse(ast, { visitorKeys, enter: defineStartEndAsError.bind(null, "node") }); + ast.tokens.forEach(defineStartEndAsError.bind(null, "token")); + ast.comments.forEach(defineStartEndAsError.bind(null, "token")); +} + +/** + * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes. + * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties. + * @param {Parser} parser Parser object. + * @returns {Parser} Wrapped parser object. + */ +function wrapParser(parser) { + + if (typeof parser.parseForESLint === "function") { + return { + [parserSymbol]: parser, + parseForESLint(...args) { + const ret = parser.parseForESLint(...args); + + defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys); + return ret; + } + }; + } + + return { + [parserSymbol]: parser, + parse(...args) { + const ast = parser.parse(...args); + + defineStartEndAsErrorInTree(ast); + return ast; + } + }; +} + +/** + * Function to replace `SourceCode.prototype.getComments`. + * @returns {void} + * @throws {Error} Deprecation message. + */ +function getCommentsDeprecation() { + throw new Error( + "`SourceCode#getComments()` is deprecated and will be removed in a future major version. Use `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()` instead." + ); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +// default separators for testing +const DESCRIBE = Symbol("describe"); +const IT = Symbol("it"); +const IT_ONLY = Symbol("itOnly"); + +/** + * This is `it` default handler if `it` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @throws {Error} Any error upon execution of `method`. + * @returns {any} Returned value of `method`. + */ +function itDefaultHandler(text, method) { + try { + return method.call(this); + } catch (err) { + if (err instanceof assert.AssertionError) { + err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`; + } + throw err; + } +} + +/** + * This is `describe` default handler if `describe` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function describeDefaultHandler(text, method) { + return method.call(this); +} + +/** + * Mocha test wrapper. + */ +class FlatRuleTester { + + /** + * Creates a new instance of RuleTester. + * @param {Object} [testerConfig] Optional, extra configuration for the tester + */ + constructor(testerConfig = {}) { + + /** + * The configuration to use for this tester. Combination of the tester + * configuration and the default configuration. + * @type {Object} + */ + this.testerConfig = [ + sharedDefaultConfig, + testerConfig, + { rules: { "rule-tester/validate-ast": "error" } } + ]; + + this.linter = new Linter({ configType: "flat" }); + } + + /** + * Set the configuration to use for all future tests + * @param {Object} config the configuration to use. + * @throws {TypeError} If non-object config. + * @returns {void} + */ + static setDefaultConfig(config) { + if (typeof config !== "object") { + throw new TypeError("FlatRuleTester.setDefaultConfig: config must be an object"); + } + sharedDefaultConfig = config; + + // Make sure the rules object exists since it is assumed to exist later + sharedDefaultConfig.rules = sharedDefaultConfig.rules || {}; + } + + /** + * Get the current configuration used for all tests + * @returns {Object} the current configuration + */ + static getDefaultConfig() { + return sharedDefaultConfig; + } + + /** + * Reset the configuration to the initial configuration of the tester removing + * any changes made until now. + * @returns {void} + */ + static resetDefaultConfig() { + sharedDefaultConfig = { + rules: { + ...testerDefaultConfig.rules + } + }; + } + + + /* + * If people use `mocha test.js --watch` command, `describe` and `it` function + * instances are different for each execution. So `describe` and `it` should get fresh instance + * always. + */ + static get describe() { + return ( + this[DESCRIBE] || + (typeof describe === "function" ? describe : describeDefaultHandler) + ); + } + + static set describe(value) { + this[DESCRIBE] = value; + } + + static get it() { + return ( + this[IT] || + (typeof it === "function" ? it : itDefaultHandler) + ); + } + + static set it(value) { + this[IT] = value; + } + + /** + * Adds the `only` property to a test to run it in isolation. + * @param {string | ValidTestCase | InvalidTestCase} item A single test to run by itself. + * @returns {ValidTestCase | InvalidTestCase} The test with `only` set. + */ + static only(item) { + if (typeof item === "string") { + return { code: item, only: true }; + } + + return { ...item, only: true }; + } + + static get itOnly() { + if (typeof this[IT_ONLY] === "function") { + return this[IT_ONLY]; + } + if (typeof this[IT] === "function" && typeof this[IT].only === "function") { + return Function.bind.call(this[IT].only, this[IT]); + } + if (typeof it === "function" && typeof it.only === "function") { + return Function.bind.call(it.only, it); + } + + if (typeof this[DESCRIBE] === "function" || typeof this[IT] === "function") { + throw new Error( + "Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" + + "See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more." + ); + } + if (typeof it === "function") { + throw new Error("The current test framework does not support exclusive tests with `only`."); + } + throw new Error("To use `only`, use RuleTester with a test framework that provides `it.only()` like Mocha."); + } + + static set itOnly(value) { + this[IT_ONLY] = value; + } + + + /** + * Adds a new rule test to execute. + * @param {string} ruleName The name of the rule to run. + * @param {Function} rule The rule to test. + * @param {{ + * valid: (ValidTestCase | string)[], + * invalid: InvalidTestCase[] + * }} test The collection of tests to run. + * @throws {TypeError|Error} If non-object `test`, or if a required + * scenario of the given type is missing. + * @returns {void} + */ + run(ruleName, rule, test) { + + const testerConfig = this.testerConfig, + requiredScenarios = ["valid", "invalid"], + scenarioErrors = [], + linter = this.linter, + ruleId = `rule-to-test/${ruleName}`; + + if (!test || typeof test !== "object") { + throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`); + } + + requiredScenarios.forEach(scenarioType => { + if (!test[scenarioType]) { + scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); + } + }); + + if (scenarioErrors.length > 0) { + throw new Error([ + `Test Scenarios for rule ${ruleName} is invalid:` + ].concat(scenarioErrors).join("\n")); + } + + const baseConfig = [ + { + plugins: { + + // copy root plugin over + "@": { + + /* + * Parsers are wrapped to detect more errors, so this needs + * to be a new object for each call to run(), otherwise the + * parsers will be wrapped multiple times. + */ + parsers: { + ...defaultConfig[0].plugins["@"].parsers + }, + + /* + * The rules key on the default plugin is a proxy to lazy-load + * just the rules that are needed. So, don't create a new object + * here, just use the default one to keep that performance + * enhancement. + */ + rules: defaultConfig[0].plugins["@"].rules + }, + "rule-to-test": { + rules: { + [ruleName]: Object.assign({}, rule, { + + // Create a wrapper rule that freezes the `context` properties. + create(context) { + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + // freezeDeeply(context.languageOptions); + + return (typeof rule === "function" ? rule : rule.create)(context); + } + }) + } + } + }, + languageOptions: { + ...defaultConfig[0].languageOptions + } + }, + ...defaultConfig.slice(1) + ]; + + /** + * Run the rule for the given item + * @param {string|Object} item Item to run the rule against + * @throws {Error} If an invalid schema. + * @returns {Object} Eslint run result + * @private + */ + function runRuleForItem(item) { + const configs = new FlatConfigArray(testerConfig, { baseConfig }); + + /* + * Modify the returned config so that the parser is wrapped to catch + * access of the start/end properties. This method is called just + * once per code snippet being tested, so each test case gets a clean + * parser. + */ + configs[ConfigArraySymbol.finalizeConfig] = function(...args) { + + // can't do super here :( + const proto = Object.getPrototypeOf(this); + const calculatedConfig = proto[ConfigArraySymbol.finalizeConfig].apply(this, args); + + // wrap the parser to catch start/end property access + calculatedConfig.languageOptions.parser = wrapParser(calculatedConfig.languageOptions.parser); + return calculatedConfig; + }; + + let code, filename, output, beforeAST, afterAST; + + if (typeof item === "string") { + code = item; + } else { + code = item.code; + + /* + * Assumes everything on the item is a config except for the + * parameters used by this tester + */ + const itemConfig = { ...item }; + + for (const parameter of RuleTesterParameters) { + delete itemConfig[parameter]; + } + + // wrap any parsers + if (itemConfig.languageOptions && itemConfig.languageOptions.parser) { + + const parser = itemConfig.languageOptions.parser; + + if (parser && typeof parser !== "object") { + throw new Error("Parser must be an object with a parse() or parseForESLint() method."); + } + + } + + /* + * Create the config object from the tester config and this item + * specific configurations. + */ + configs.push(itemConfig); + } + + if (item.filename) { + filename = item.filename; + } + + let ruleConfig = 1; + + if (hasOwnProperty(item, "options")) { + assert(Array.isArray(item.options), "options must be an array"); + ruleConfig = [1, ...item.options]; + } + + configs.push({ + rules: { + [ruleId]: ruleConfig + } + }); + + const schema = getRuleOptionsSchema(rule); + + /* + * Setup AST getters. + * The goal is to check whether or not AST was modified when + * running the rule under test. + */ + configs.push({ + plugins: { + "rule-tester": { + rules: { + "validate-ast": { + create() { + return { + Program(node) { + beforeAST = cloneDeeplyExcludesParent(node); + }, + "Program:exit"(node) { + afterAST = node; + } + }; + } + } + } + } + } + }); + + if (schema) { + ajv.validateSchema(schema); + + if (ajv.errors) { + const errors = ajv.errors.map(error => { + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `\t${field}: ${error.message}`; + }).join("\n"); + + throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]); + } + + /* + * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"), + * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling + * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result, + * the schema is compiled here separately from checking for `validateSchema` errors. + */ + try { + ajv.compile(schema); + } catch (err) { + throw new Error(`Schema for rule ${ruleName} is invalid: ${err.message}`); + } + } + + // Verify the code. + const { getComments } = SourceCode.prototype; + let messages; + + // check for validation errors + try { + configs.normalizeSync(); + configs.getConfig("test.js"); + } catch (error) { + error.message = `ESLint configuration in rule-tester is invalid: ${error.message}`; + throw error; + } + + try { + SourceCode.prototype.getComments = getCommentsDeprecation; + messages = linter.verify(code, configs, filename); + } finally { + SourceCode.prototype.getComments = getComments; + } + + const fatalErrorMessage = messages.find(m => m.fatal); + + assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); + + // Verify if autofix makes a syntax error or not. + if (messages.some(m => m.fix)) { + output = SourceCodeFixer.applyFixes(code, messages).output; + const errorMessageInFix = linter.verify(output, configs, filename).find(m => m.fatal); + + assert(!errorMessageInFix, [ + "A fatal parsing error occurred in autofix.", + `Error: ${errorMessageInFix && errorMessageInFix.message}`, + "Autofix output:", + output + ].join("\n")); + } else { + output = code; + } + + return { + messages, + output, + beforeAST, + afterAST: cloneDeeplyExcludesParent(afterAST) + }; + } + + /** + * Check if the AST was changed + * @param {ASTNode} beforeAST AST node before running + * @param {ASTNode} afterAST AST node after running + * @returns {void} + * @private + */ + function assertASTDidntChange(beforeAST, afterAST) { + if (!equal(beforeAST, afterAST)) { + assert.fail("Rule should not modify AST."); + } + } + + /** + * Check if the template is valid or not + * all valid cases go through this + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testValidTemplate(item) { + const code = typeof item === "object" ? item.code : item; + + assert.ok(typeof code === "string", "Test case must specify a string value for 'code'"); + if (item.name) { + assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string"); + } + + const result = runRuleForItem(item); + const messages = result.messages; + + assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s", + messages.length, + util.inspect(messages))); + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /** + * Asserts that the message matches its expected value. If the expected + * value is a regular expression, it is checked against the actual + * value. + * @param {string} actual Actual value + * @param {string|RegExp} expected Expected value + * @returns {void} + * @private + */ + function assertMessageMatches(actual, expected) { + if (expected instanceof RegExp) { + + // assert.js doesn't have a built-in RegExp match function + assert.ok( + expected.test(actual), + `Expected '${actual}' to match ${expected}` + ); + } else { + assert.strictEqual(actual, expected); + } + } + + /** + * Check if the template is invalid or not + * all invalid cases go through this. + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testInvalidTemplate(item) { + assert.ok(typeof item.code === "string", "Test case must specify a string value for 'code'"); + if (item.name) { + assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string"); + } + assert.ok(item.errors || item.errors === 0, + `Did not specify errors for an invalid test of ${ruleName}`); + + if (Array.isArray(item.errors) && item.errors.length === 0) { + assert.fail("Invalid cases must have at least one error"); + } + + const ruleHasMetaMessages = hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages"); + const friendlyIDList = ruleHasMetaMessages ? `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]` : null; + + const result = runRuleForItem(item); + const messages = result.messages; + + if (typeof item.errors === "number") { + + if (item.errors === 0) { + assert.fail("Invalid cases must have 'error' value greater than 0"); + } + + assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", + item.errors, + item.errors === 1 ? "" : "s", + messages.length, + util.inspect(messages))); + } else { + assert.strictEqual( + messages.length, item.errors.length, util.format( + "Should have %d error%s but had %d: %s", + item.errors.length, + item.errors.length === 1 ? "" : "s", + messages.length, + util.inspect(messages) + ) + ); + + const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleId); + + for (let i = 0, l = item.errors.length; i < l; i++) { + const error = item.errors[i]; + const message = messages[i]; + + assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested"); + + if (typeof error === "string" || error instanceof RegExp) { + + // Just an error message. + assertMessageMatches(message.message, error); + } else if (typeof error === "object" && error !== null) { + + /* + * Error object. + * This may have a message, messageId, data, node type, line, and/or + * column. + */ + + Object.keys(error).forEach(propertyName => { + assert.ok( + errorObjectParameters.has(propertyName), + `Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.` + ); + }); + + if (hasOwnProperty(error, "message")) { + assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'."); + assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'."); + assertMessageMatches(message.message, error.message); + } else if (hasOwnProperty(error, "messageId")) { + assert.ok( + ruleHasMetaMessages, + "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'." + ); + if (!hasOwnProperty(rule.meta.messages, error.messageId)) { + assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`); + } + assert.strictEqual( + message.messageId, + error.messageId, + `messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.` + ); + if (hasOwnProperty(error, "data")) { + + /* + * if data was provided, then directly compare the returned message to a synthetic + * interpolated message using the same message ID and data provided in the test. + * See https://github.com/eslint/eslint/issues/9890 for context. + */ + const unformattedOriginalMessage = rule.meta.messages[error.messageId]; + const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data); + + assert.strictEqual( + message.message, + rehydratedMessage, + `Hydrated message "${rehydratedMessage}" does not match "${message.message}"` + ); + } + } + + assert.ok( + hasOwnProperty(error, "data") ? hasOwnProperty(error, "messageId") : true, + "Error must specify 'messageId' if 'data' is used." + ); + + if (error.type) { + assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`); + } + + if (hasOwnProperty(error, "line")) { + assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`); + } + + if (hasOwnProperty(error, "column")) { + assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`); + } + + if (hasOwnProperty(error, "endLine")) { + assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`); + } + + if (hasOwnProperty(error, "endColumn")) { + assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`); + } + + if (hasOwnProperty(error, "suggestions")) { + + // Support asserting there are no suggestions + if (!error.suggestions || (Array.isArray(error.suggestions) && error.suggestions.length === 0)) { + if (Array.isArray(message.suggestions) && message.suggestions.length > 0) { + assert.fail(`Error should have no suggestions on error with message: "${message.message}"`); + } + } else { + assert.strictEqual(Array.isArray(message.suggestions), true, `Error should have an array of suggestions. Instead received "${message.suggestions}" on error with message: "${message.message}"`); + assert.strictEqual(message.suggestions.length, error.suggestions.length, `Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`); + + error.suggestions.forEach((expectedSuggestion, index) => { + assert.ok( + typeof expectedSuggestion === "object" && expectedSuggestion !== null, + "Test suggestion in 'suggestions' array must be an object." + ); + Object.keys(expectedSuggestion).forEach(propertyName => { + assert.ok( + suggestionObjectParameters.has(propertyName), + `Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.` + ); + }); + + const actualSuggestion = message.suggestions[index]; + const suggestionPrefix = `Error Suggestion at index ${index} :`; + + if (hasOwnProperty(expectedSuggestion, "desc")) { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test should not specify both 'desc' and 'data'.` + ); + assert.strictEqual( + actualSuggestion.desc, + expectedSuggestion.desc, + `${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "messageId")) { + assert.ok( + ruleHasMetaMessages, + `${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.` + ); + assert.ok( + hasOwnProperty(rule.meta.messages, expectedSuggestion.messageId), + `${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.` + ); + assert.strictEqual( + actualSuggestion.messageId, + expectedSuggestion.messageId, + `${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.` + ); + if (hasOwnProperty(expectedSuggestion, "data")) { + const unformattedMetaMessage = rule.meta.messages[expectedSuggestion.messageId]; + const rehydratedDesc = interpolate(unformattedMetaMessage, expectedSuggestion.data); + + assert.strictEqual( + actualSuggestion.desc, + rehydratedDesc, + `${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".` + ); + } + } else { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test must specify 'messageId' if 'data' is used.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "output")) { + const codeWithAppliedSuggestion = SourceCodeFixer.applyFixes(item.code, [actualSuggestion]).output; + + assert.strictEqual(codeWithAppliedSuggestion, expectedSuggestion.output, `Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`); + } + }); + } + } + } else { + + // Message was an unexpected type + assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`); + } + } + } + + if (hasOwnProperty(item, "output")) { + if (item.output === null) { + assert.strictEqual( + result.output, + item.code, + "Expected no autofixes to be suggested" + ); + } else { + assert.strictEqual(result.output, item.output, "Output is incorrect."); + } + } else { + assert.strictEqual( + result.output, + item.code, + "The rule fixed the code. Please add 'output' property." + ); + } + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /* + * This creates a mocha test suite and pipes all supplied info through + * one of the templates above. + */ + this.constructor.describe(ruleName, () => { + this.constructor.describe("valid", () => { + test.valid.forEach(valid => { + this.constructor[valid.only ? "itOnly" : "it"]( + sanitize(typeof valid === "object" ? valid.name || valid.code : valid), + () => { + testValidTemplate(valid); + } + ); + }); + }); + + this.constructor.describe("invalid", () => { + test.invalid.forEach(invalid => { + this.constructor[invalid.only ? "itOnly" : "it"]( + sanitize(invalid.name || invalid.code), + () => { + testInvalidTemplate(invalid); + } + ); + }); + }); + }); + } +} + +FlatRuleTester[DESCRIBE] = FlatRuleTester[IT] = FlatRuleTester[IT_ONLY] = null; + +module.exports = FlatRuleTester; diff --git a/node_modules/eslint/lib/rule-tester/rule-tester.js b/node_modules/eslint/lib/rule-tester/rule-tester.js index 23b78fba2..48df3b79b 100644 --- a/node_modules/eslint/lib/rule-tester/rule-tester.js +++ b/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -4,7 +4,7 @@ */ "use strict"; -/* global describe, it */ +/* globals describe, it -- Mocha globals */ /* * This is a wrapper around mocha to allow for DRY unittests for eslint @@ -44,7 +44,8 @@ const assert = require("assert"), path = require("path"), util = require("util"), - lodash = require("lodash"), + merge = require("lodash.merge"), + equal = require("fast-deep-equal"), Traverser = require("../../lib/shared/traverser"), { getRuleOptionsSchema, validate } = require("../shared/config-validator"), { Linter, SourceCodeFixer, interpolate } = require("../linter"); @@ -52,6 +53,9 @@ const const ajv = require("../shared/ajv")({ strictDefaults: true }); const espreePath = require.resolve("espree"); +const parserSymbol = Symbol.for("eslint.RuleTester.parser"); + +const { SourceCode } = require("../source-code"); //------------------------------------------------------------------------------ // Typedefs @@ -59,9 +63,11 @@ const espreePath = require.resolve("espree"); /** @typedef {import("../shared/types").Parser} Parser */ +/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ /** * A test case that is expected to pass lint. * @typedef {Object} ValidTestCase + * @property {string} [name] Name for the test case. * @property {string} code Code for the test case. * @property {any[]} [options] Options for the test case. * @property {{ [name: string]: any }} [settings] Settings for the test case. @@ -70,11 +76,13 @@ const espreePath = require.resolve("espree"); * @property {{ [name: string]: any }} [parserOptions] Options for the parser. * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. * @property {{ [name: string]: boolean }} [env] Environments for the test case. + * @property {boolean} [only] Run only this test case or the subset of test cases with this property. */ /** * A test case that is expected to fail lint. * @typedef {Object} InvalidTestCase + * @property {string} [name] Name for the test case. * @property {string} code Code for the test case. * @property {number | Array} errors Expected errors. * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. @@ -85,6 +93,7 @@ const espreePath = require.resolve("espree"); * @property {{ [name: string]: any }} [parserOptions] Options for the parser. * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. * @property {{ [name: string]: boolean }} [env] Environments for the test case. + * @property {boolean} [only] Run only this test case or the subset of test cases with this property. */ /** @@ -99,6 +108,7 @@ const espreePath = require.resolve("espree"); * @property {number} [endLine] The 1-based line number of the reported end location. * @property {number} [endColumn] The 1-based column number of the reported end location. */ +/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ //------------------------------------------------------------------------------ // Private Members @@ -116,11 +126,13 @@ let defaultConfig = { rules: {} }; * configuration */ const RuleTesterParameters = [ + "name", "code", "filename", "options", "errors", - "output" + "output", + "only" ]; /* @@ -204,8 +216,11 @@ function freezeDeeply(x) { * @returns {string} The sanitized text. */ function sanitize(text) { + if (typeof text !== "string") { + return ""; + } return text.replace( - /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex + /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}` ); } @@ -235,6 +250,7 @@ function defineStartEndAsError(objName, node) { }); } + /** * Define `start`/`end` properties of all nodes of the given AST as throwing error. * @param {ASTNode} ast The root node to errorize `start`/`end` properties. @@ -254,8 +270,10 @@ function defineStartEndAsErrorInTree(ast, visitorKeys) { * @returns {Parser} Wrapped parser object. */ function wrapParser(parser) { + if (typeof parser.parseForESLint === "function") { return { + [parserSymbol]: parser, parseForESLint(...args) { const ret = parser.parseForESLint(...args); @@ -264,7 +282,9 @@ function wrapParser(parser) { } }; } + return { + [parserSymbol]: parser, parse(...args) { const ast = parser.parse(...args); @@ -274,6 +294,47 @@ function wrapParser(parser) { }; } +/** + * Function to replace `SourceCode.prototype.getComments`. + * @returns {void} + * @throws {Error} Deprecation message. + */ +function getCommentsDeprecation() { + throw new Error( + "`SourceCode#getComments()` is deprecated and will be removed in a future major version. Use `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()` instead." + ); +} + +/** + * Emit a deprecation warning if function-style format is being used. + * @param {string} ruleName Name of the rule. + * @returns {void} + */ +function emitLegacyRuleAPIWarning(ruleName) { + if (!emitLegacyRuleAPIWarning[`warned-${ruleName}`]) { + emitLegacyRuleAPIWarning[`warned-${ruleName}`] = true; + process.emitWarning( + `"${ruleName}" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/latest/extend/custom-rules`, + "DeprecationWarning" + ); + } +} + +/** + * Emit a deprecation warning if rule has options but is missing the "meta.schema" property + * @param {string} ruleName Name of the rule. + * @returns {void} + */ +function emitMissingSchemaWarning(ruleName) { + if (!emitMissingSchemaWarning[`warned-${ruleName}`]) { + emitMissingSchemaWarning[`warned-${ruleName}`] = true; + process.emitWarning( + `"${ruleName}" rule has options but is missing the "meta.schema" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas`, + "DeprecationWarning" + ); + } +} + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -281,12 +342,14 @@ function wrapParser(parser) { // default separators for testing const DESCRIBE = Symbol("describe"); const IT = Symbol("it"); +const IT_ONLY = Symbol("itOnly"); /** * This is `it` default handler if `it` don't exist. * @this {Mocha} * @param {string} text The description of the test case. * @param {Function} method The logic of the test case. + * @throws {Error} Any error upon execution of `method`. * @returns {any} Returned value of `method`. */ function itDefaultHandler(text, method) { @@ -311,6 +374,9 @@ function describeDefaultHandler(text, method) { return method.call(this); } +/** + * Mocha test wrapper. + */ class RuleTester { /** @@ -324,10 +390,9 @@ class RuleTester { * configuration and the default configuration. * @type {Object} */ - this.testerConfig = lodash.merge( - - // we have to clone because merge uses the first argument for recipient - lodash.cloneDeep(defaultConfig), + this.testerConfig = merge( + {}, + defaultConfig, testerConfig, { rules: { "rule-tester/validate-ast": "error" } } ); @@ -343,6 +408,7 @@ class RuleTester { /** * Set the configuration to use for all future tests * @param {Object} config the configuration to use. + * @throws {TypeError} If non-object config. * @returns {void} */ static setDefaultConfig(config) { @@ -369,7 +435,7 @@ class RuleTester { * @returns {void} */ static resetDefaultConfig() { - defaultConfig = lodash.cloneDeep(testerDefaultConfig); + defaultConfig = merge({}, testerDefaultConfig); } @@ -400,6 +466,46 @@ class RuleTester { this[IT] = value; } + /** + * Adds the `only` property to a test to run it in isolation. + * @param {string | ValidTestCase | InvalidTestCase} item A single test to run by itself. + * @returns {ValidTestCase | InvalidTestCase} The test with `only` set. + */ + static only(item) { + if (typeof item === "string") { + return { code: item, only: true }; + } + + return { ...item, only: true }; + } + + static get itOnly() { + if (typeof this[IT_ONLY] === "function") { + return this[IT_ONLY]; + } + if (typeof this[IT] === "function" && typeof this[IT].only === "function") { + return Function.bind.call(this[IT].only, this[IT]); + } + if (typeof it === "function" && typeof it.only === "function") { + return Function.bind.call(it.only, it); + } + + if (typeof this[DESCRIBE] === "function" || typeof this[IT] === "function") { + throw new Error( + "Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" + + "See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more." + ); + } + if (typeof it === "function") { + throw new Error("The current test framework does not support exclusive tests with `only`."); + } + throw new Error("To use `only`, use RuleTester with a test framework that provides `it.only()` like Mocha."); + } + + static set itOnly(value) { + this[IT_ONLY] = value; + } + /** * Define a rule for one particular run of tests. * @param {string} name The name of the rule to define. @@ -418,6 +524,8 @@ class RuleTester { * valid: (ValidTestCase | string)[], * invalid: InvalidTestCase[] * }} test The collection of tests to run. + * @throws {TypeError|Error} If non-object `test`, or if a required + * scenario of the given type is missing. * @returns {void} */ run(ruleName, rule, test) { @@ -443,6 +551,9 @@ class RuleTester { ].concat(scenarioErrors).join("\n")); } + if (typeof rule === "function") { + emitLegacyRuleAPIWarning(ruleName); + } linter.defineRule(ruleName, Object.assign({}, rule, { @@ -461,11 +572,12 @@ class RuleTester { /** * Run the rule for the given item * @param {string|Object} item Item to run the rule against + * @throws {Error} If an invalid schema. * @returns {Object} Eslint run result * @private */ function runRuleForItem(item) { - let config = lodash.cloneDeep(testerConfig), + let config = merge({}, testerConfig), code, filename, output, beforeAST, afterAST; if (typeof item === "string") { @@ -477,13 +589,17 @@ class RuleTester { * Assumes everything on the item is a config except for the * parameters used by this tester */ - const itemConfig = lodash.omit(item, RuleTesterParameters); + const itemConfig = { ...item }; + + for (const parameter of RuleTesterParameters) { + delete itemConfig[parameter]; + } /* * Create the config object from the tester config and this item * specific configurations. */ - config = lodash.merge( + config = merge( config, itemConfig ); @@ -495,6 +611,15 @@ class RuleTester { if (hasOwnProperty(item, "options")) { assert(Array.isArray(item.options), "options must be an array"); + if ( + item.options.length > 0 && + typeof rule === "object" && + ( + !rule.meta || (rule.meta && (typeof rule.meta.schema === "undefined" || rule.meta.schema === null)) + ) + ) { + emitMissingSchemaWarning(ruleName); + } config.rules[ruleName] = [1].concat(item.options); } else { config.rules[ruleName] = 1; @@ -507,14 +632,18 @@ class RuleTester { * The goal is to check whether or not AST was modified when * running the rule under test. */ - linter.defineRule("rule-tester/validate-ast", () => ({ - Program(node) { - beforeAST = cloneDeeplyExcludesParent(node); - }, - "Program:exit"(node) { - afterAST = node; + linter.defineRule("rule-tester/validate-ast", { + create() { + return { + Program(node) { + beforeAST = cloneDeeplyExcludesParent(node); + }, + "Program:exit"(node) { + afterAST = node; + } + }; } - })); + }); if (typeof config.parser === "string") { assert(path.isAbsolute(config.parser), "Parsers provided as strings to RuleTester must be absolute paths"); @@ -553,7 +682,16 @@ class RuleTester { validate(config, "rule-tester", id => (id === ruleName ? rule : null)); // Verify the code. - const messages = linter.verify(code, config, filename); + const { getComments } = SourceCode.prototype; + let messages; + + try { + SourceCode.prototype.getComments = getCommentsDeprecation; + messages = linter.verify(code, config, filename); + } finally { + SourceCode.prototype.getComments = getComments; + } + const fatalErrorMessage = messages.find(m => m.fatal); assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); @@ -589,7 +727,7 @@ class RuleTester { * @private */ function assertASTDidntChange(beforeAST, afterAST) { - if (!lodash.isEqual(beforeAST, afterAST)) { + if (!equal(beforeAST, afterAST)) { assert.fail("Rule should not modify AST."); } } @@ -602,11 +740,19 @@ class RuleTester { * @private */ function testValidTemplate(item) { + const code = typeof item === "object" ? item.code : item; + + assert.ok(typeof code === "string", "Test case must specify a string value for 'code'"); + if (item.name) { + assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string"); + } + const result = runRuleForItem(item); const messages = result.messages; assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s", - messages.length, util.inspect(messages))); + messages.length, + util.inspect(messages))); assertASTDidntChange(result.beforeAST, result.afterAST); } @@ -641,6 +787,10 @@ class RuleTester { * @private */ function testInvalidTemplate(item) { + assert.ok(typeof item.code === "string", "Test case must specify a string value for 'code'"); + if (item.name) { + assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string"); + } assert.ok(item.errors || item.errors === 0, `Did not specify errors for an invalid test of ${ruleName}`); @@ -661,13 +811,18 @@ class RuleTester { } assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", - item.errors, item.errors === 1 ? "" : "s", messages.length, util.inspect(messages))); + item.errors, + item.errors === 1 ? "" : "s", + messages.length, + util.inspect(messages))); } else { assert.strictEqual( - messages.length, item.errors.length, - util.format( + messages.length, item.errors.length, util.format( "Should have %d error%s but had %d: %s", - item.errors.length, item.errors.length === 1 ? "" : "s", messages.length, util.inspect(messages) + item.errors.length, + item.errors.length === 1 ? "" : "s", + messages.length, + util.inspect(messages) ) ); @@ -861,16 +1016,6 @@ class RuleTester { ); } - // Rules that produce fixes must have `meta.fixable` property. - if (result.output !== item.code) { - assert.ok( - hasOwnProperty(rule, "meta"), - "Fixable rules should export a `meta.fixable` property." - ); - - // Linter throws if a rule that produced a fix has `meta` but doesn't have `meta.fixable`. - } - assertASTDidntChange(result.beforeAST, result.afterAST); } @@ -878,26 +1023,32 @@ class RuleTester { * This creates a mocha test suite and pipes all supplied info through * one of the templates above. */ - RuleTester.describe(ruleName, () => { - RuleTester.describe("valid", () => { + this.constructor.describe(ruleName, () => { + this.constructor.describe("valid", () => { test.valid.forEach(valid => { - RuleTester.it(sanitize(typeof valid === "object" ? valid.code : valid), () => { - testValidTemplate(valid); - }); + this.constructor[valid.only ? "itOnly" : "it"]( + sanitize(typeof valid === "object" ? valid.name || valid.code : valid), + () => { + testValidTemplate(valid); + } + ); }); }); - RuleTester.describe("invalid", () => { + this.constructor.describe("invalid", () => { test.invalid.forEach(invalid => { - RuleTester.it(sanitize(invalid.code), () => { - testInvalidTemplate(invalid); - }); + this.constructor[invalid.only ? "itOnly" : "it"]( + sanitize(invalid.name || invalid.code), + () => { + testInvalidTemplate(invalid); + } + ); }); }); }); } } -RuleTester[DESCRIBE] = RuleTester[IT] = null; +RuleTester[DESCRIBE] = RuleTester[IT] = RuleTester[IT_ONLY] = null; module.exports = RuleTester; diff --git a/node_modules/eslint/lib/rules/accessor-pairs.js b/node_modules/eslint/lib/rules/accessor-pairs.js index 0e0d07a00..112d0ddb8 100644 --- a/node_modules/eslint/lib/rules/accessor-pairs.js +++ b/node_modules/eslint/lib/rules/accessor-pairs.js @@ -134,13 +134,13 @@ function isPropertyDescriptor(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce getter and setter pairs in objects and classes", - category: "Best Practices", + description: "Enforce getter and setter pairs in objects and classes", recommended: false, url: "https://eslint.org/docs/rules/accessor-pairs" }, @@ -299,12 +299,12 @@ module.exports = { * @private */ function checkPropertyDescriptor(node) { - const namesToCheck = node.properties + const namesToCheck = new Set(node.properties .filter(p => p.type === "Property" && p.kind === "init" && !p.computed) - .map(({ key }) => key.name); + .map(({ key }) => key.name)); - const hasGetter = namesToCheck.includes("get"); - const hasSetter = namesToCheck.includes("set"); + const hasGetter = namesToCheck.has("get"); + const hasSetter = namesToCheck.has("set"); if (checkSetWithoutGet && hasSetter && !hasGetter) { report(node, "missingGetter"); diff --git a/node_modules/eslint/lib/rules/array-bracket-newline.js b/node_modules/eslint/lib/rules/array-bracket-newline.js index b4b4dd430..deeae818f 100644 --- a/node_modules/eslint/lib/rules/array-bracket-newline.js +++ b/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce linebreaks after opening and before closing array brackets", - category: "Stylistic Issues", + description: "Enforce linebreaks after opening and before closing array brackets", recommended: false, url: "https://eslint.org/docs/rules/array-bracket-newline" }, diff --git a/node_modules/eslint/lib/rules/array-bracket-spacing.js b/node_modules/eslint/lib/rules/array-bracket-spacing.js index c2b77a641..5e7cea9ba 100644 --- a/node_modules/eslint/lib/rules/array-bracket-spacing.js +++ b/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing inside array brackets", - category: "Stylistic Issues", + description: "Enforce consistent spacing inside array brackets", recommended: false, url: "https://eslint.org/docs/rules/array-bracket-spacing" }, diff --git a/node_modules/eslint/lib/rules/array-callback-return.js b/node_modules/eslint/lib/rules/array-callback-return.js index 726734714..2b0a85592 100644 --- a/node_modules/eslint/lib/rules/array-callback-return.js +++ b/node_modules/eslint/lib/rules/array-callback-return.js @@ -16,7 +16,7 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; -const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort)$/u; +const TARGET_METHODS = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u; /** * Checks a given code path segment is reachable. @@ -125,7 +125,7 @@ function getArrayMethodName(node) { } } - /* istanbul ignore next: unreachable */ + /* c8 ignore next */ return null; } @@ -133,13 +133,13 @@ function getArrayMethodName(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "enforce `return` statements in callbacks of array methods", - category: "Best Practices", + description: "Enforce `return` statements in callbacks of array methods", recommended: false, url: "https://eslint.org/docs/rules/array-callback-return" }, diff --git a/node_modules/eslint/lib/rules/array-element-newline.js b/node_modules/eslint/lib/rules/array-element-newline.js index b7a967865..7ac03ae56 100644 --- a/node_modules/eslint/lib/rules/array-element-newline.js +++ b/node_modules/eslint/lib/rules/array-element-newline.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce line breaks after each array element", - category: "Stylistic Issues", + description: "Enforce line breaks after each array element", recommended: false, url: "https://eslint.org/docs/rules/array-element-newline" }, @@ -47,6 +47,7 @@ module.exports = { ] } }, + type: "array", items: [ { oneOf: [ diff --git a/node_modules/eslint/lib/rules/arrow-body-style.js b/node_modules/eslint/lib/rules/arrow-body-style.js index b2167fde7..8bb9e8c4f 100644 --- a/node_modules/eslint/lib/rules/arrow-body-style.js +++ b/node_modules/eslint/lib/rules/arrow-body-style.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require braces around arrow function bodies", - category: "ECMAScript 6", + description: "Require braces around arrow function bodies", recommended: false, url: "https://eslint.org/docs/rules/arrow-body-style" }, @@ -87,17 +87,17 @@ module.exports = { } /** - * Gets the closing parenthesis which is the pair of the given opening parenthesis. - * @param {Token} token The opening parenthesis token to get. + * Gets the closing parenthesis by the given node. + * @param {ASTNode} node first node after an opening parenthesis. * @returns {Token} The found closing parenthesis token. */ - function findClosingParen(token) { - let node = sourceCode.getNodeByRangeIndex(token.range[0]); + function findClosingParen(node) { + let nodeToCheck = node; - while (!astUtils.isParenthesised(sourceCode, node)) { - node = node.parent; + while (!astUtils.isParenthesised(sourceCode, nodeToCheck)) { + nodeToCheck = nodeToCheck.parent; } - return sourceCode.getTokenAfter(node); + return sourceCode.getTokenAfter(nodeToCheck); } /** @@ -226,12 +226,22 @@ module.exports = { const arrowToken = sourceCode.getTokenBefore(arrowBody, astUtils.isArrowToken); const [firstTokenAfterArrow, secondTokenAfterArrow] = sourceCode.getTokensAfter(arrowToken, { count: 2 }); const lastToken = sourceCode.getLastToken(node); - const isParenthesisedObjectLiteral = + + let parenthesisedObjectLiteral = null; + + if ( astUtils.isOpeningParenToken(firstTokenAfterArrow) && - astUtils.isOpeningBraceToken(secondTokenAfterArrow); + astUtils.isOpeningBraceToken(secondTokenAfterArrow) + ) { + const braceNode = sourceCode.getNodeByRangeIndex(secondTokenAfterArrow.range[0]); + + if (braceNode.type === "ObjectExpression") { + parenthesisedObjectLiteral = braceNode; + } + } // If the value is object literal, remove parentheses which were forced by syntax. - if (isParenthesisedObjectLiteral) { + if (parenthesisedObjectLiteral) { const openingParenToken = firstTokenAfterArrow; const openingBraceToken = secondTokenAfterArrow; @@ -247,7 +257,7 @@ module.exports = { } // Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo() - fixes.push(fixer.remove(findClosingParen(openingBraceToken))); + fixes.push(fixer.remove(findClosingParen(parenthesisedObjectLiteral))); fixes.push(fixer.insertTextAfter(lastToken, "}")); } else { diff --git a/node_modules/eslint/lib/rules/arrow-parens.js b/node_modules/eslint/lib/rules/arrow-parens.js index eaa1aab02..05012fc37 100644 --- a/node_modules/eslint/lib/rules/arrow-parens.js +++ b/node_modules/eslint/lib/rules/arrow-parens.js @@ -27,13 +27,13 @@ function hasBlockBody(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require parentheses around arrow function arguments", - category: "ECMAScript 6", + description: "Require parentheses around arrow function arguments", recommended: false, url: "https://eslint.org/docs/rules/arrow-parens" }, diff --git a/node_modules/eslint/lib/rules/arrow-spacing.js b/node_modules/eslint/lib/rules/arrow-spacing.js index e5110c6c8..2dcc175da 100644 --- a/node_modules/eslint/lib/rules/arrow-spacing.js +++ b/node_modules/eslint/lib/rules/arrow-spacing.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before and after the arrow in arrow functions", - category: "ECMAScript 6", + description: "Enforce consistent spacing before and after the arrow in arrow functions", recommended: false, url: "https://eslint.org/docs/rules/arrow-spacing" }, diff --git a/node_modules/eslint/lib/rules/block-scoped-var.js b/node_modules/eslint/lib/rules/block-scoped-var.js index 481057ba6..731d06d0f 100644 --- a/node_modules/eslint/lib/rules/block-scoped-var.js +++ b/node_modules/eslint/lib/rules/block-scoped-var.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce the use of variables within the scope they are defined", - category: "Best Practices", + description: "Enforce the use of variables within the scope they are defined", recommended: false, url: "https://eslint.org/docs/rules/block-scoped-var" }, @@ -113,6 +113,8 @@ module.exports = { "SwitchStatement:exit": exitScope, CatchClause: enterScope, "CatchClause:exit": exitScope, + StaticBlock: enterScope, + "StaticBlock:exit": exitScope, // Finds and reports references which are outside of valid scope. VariableDeclaration: checkForVariables diff --git a/node_modules/eslint/lib/rules/block-spacing.js b/node_modules/eslint/lib/rules/block-spacing.js index c4b30b0b7..9fbf1594c 100644 --- a/node_modules/eslint/lib/rules/block-spacing.js +++ b/node_modules/eslint/lib/rules/block-spacing.js @@ -11,13 +11,13 @@ const util = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow or enforce spaces inside of blocks after opening block and before closing block", - category: "Stylistic Issues", + description: "Disallow or enforce spaces inside of blocks after opening block and before closing block", recommended: false, url: "https://eslint.org/docs/rules/block-spacing" }, @@ -41,7 +41,7 @@ module.exports = { /** * Gets the open brace token from a given node. - * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to get. * @returns {Token} The token of the open brace. */ function getOpenBrace(node) { @@ -51,6 +51,12 @@ module.exports = { } return sourceCode.getLastToken(node, 1); } + + if (node.type === "StaticBlock") { + return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + } + + // "BlockStatement" return sourceCode.getFirstToken(node); } @@ -73,8 +79,8 @@ module.exports = { } /** - * Reports invalid spacing style inside braces. - * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * Checks and reports invalid spacing style inside braces. + * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to check. * @returns {void} */ function checkSpacingInsideBraces(node) { @@ -158,6 +164,7 @@ module.exports = { return { BlockStatement: checkSpacingInsideBraces, + StaticBlock: checkSpacingInsideBraces, SwitchStatement: checkSpacingInsideBraces }; } diff --git a/node_modules/eslint/lib/rules/brace-style.js b/node_modules/eslint/lib/rules/brace-style.js index 07223d10d..52d89201b 100644 --- a/node_modules/eslint/lib/rules/brace-style.js +++ b/node_modules/eslint/lib/rules/brace-style.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent brace style for blocks", - category: "Stylistic Issues", + description: "Enforce consistent brace style for blocks", recommended: false, url: "https://eslint.org/docs/rules/brace-style" }, @@ -156,6 +156,12 @@ module.exports = { validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); } }, + StaticBlock(node) { + validateCurlyPair( + sourceCode.getFirstToken(node, { skip: 1 }), // skip the `static` token + sourceCode.getLastToken(node) + ); + }, ClassBody(node) { validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); }, diff --git a/node_modules/eslint/lib/rules/callback-return.js b/node_modules/eslint/lib/rules/callback-return.js index fa66e6383..fe5b649b5 100644 --- a/node_modules/eslint/lib/rules/callback-return.js +++ b/node_modules/eslint/lib/rules/callback-return.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforce return after a callback. * @author Jamund Ferguson + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -8,6 +9,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -17,8 +19,7 @@ module.exports = { type: "suggestion", docs: { - description: "require `return` statements after callbacks", - category: "Node.js and CommonJS", + description: "Require `return` statements after callbacks", recommended: false, url: "https://eslint.org/docs/rules/callback-return" }, @@ -52,7 +53,7 @@ module.exports = { if (!node.parent) { return null; } - if (types.indexOf(node.parent.type) === -1) { + if (!types.includes(node.parent.type)) { return findClosestParentOfType(node.parent, types); } return node.parent; @@ -86,7 +87,7 @@ module.exports = { * @returns {boolean} Whether or not this function matches our callback name. */ function isCallback(node) { - return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1; + return containsOnlyIdentifiers(node.callee) && callbacks.includes(sourceCode.getText(node.callee)); } /** diff --git a/node_modules/eslint/lib/rules/camelcase.js b/node_modules/eslint/lib/rules/camelcase.js index d34656cfa..ee1b6bf59 100644 --- a/node_modules/eslint/lib/rules/camelcase.js +++ b/node_modules/eslint/lib/rules/camelcase.js @@ -5,17 +5,23 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce camelcase naming convention", - category: "Stylistic Issues", + description: "Enforce camelcase naming convention", recommended: false, url: "https://eslint.org/docs/rules/camelcase" }, @@ -55,32 +61,25 @@ module.exports = { ], messages: { - notCamelCase: "Identifier '{{name}}' is not in camel case." + notCamelCase: "Identifier '{{name}}' is not in camel case.", + notCamelCasePrivate: "#{{name}} is not in camel case." } }, create(context) { - const options = context.options[0] || {}; - let properties = options.properties || ""; + const properties = options.properties === "never" ? "never" : "always"; const ignoreDestructuring = options.ignoreDestructuring; const ignoreImports = options.ignoreImports; const ignoreGlobals = options.ignoreGlobals; const allow = options.allow || []; - let globalScope; - - if (properties !== "always" && properties !== "never") { - properties = "always"; - } - //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- // contains reported nodes to avoid reporting twice on destructuring with shorthand notation - const reported = []; - const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + const reported = new Set(); /** * Checks if a string contains an underscore and isn't all upper-case @@ -89,9 +88,10 @@ module.exports = { * @private */ function isUnderscored(name) { + const nameBody = name.replace(/^_+|_+$/gu, ""); // if there's an underscore, it might be A_CONSTANT, which is okay - return name.includes("_") && name !== name.toUpperCase(); + return nameBody.includes("_") && nameBody !== nameBody.toUpperCase(); } /** @@ -107,219 +107,292 @@ module.exports = { } /** - * Checks if a parent of a node is an ObjectPattern. - * @param {ASTNode} node The node to check. - * @returns {boolean} if the node is inside an ObjectPattern + * Checks if a given name is good or not. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is good. * @private */ - function isInsideObjectPattern(node) { - let current = node; - - while (current) { - const parent = current.parent; + function isGoodName(name) { + return !isUnderscored(name) || isAllowed(name); + } - if (parent && parent.type === "Property" && parent.computed && parent.key === current) { - return false; - } + /** + * Checks if a given identifier reference or member expression is an assignment + * target. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is an assignment target. + */ + function isAssignmentTarget(node) { + const parent = node.parent; - if (current.type === "ObjectPattern") { + switch (parent.type) { + case "AssignmentExpression": + case "AssignmentPattern": + return parent.left === node; + + case "Property": + return ( + parent.parent.type === "ObjectPattern" && + parent.value === node + ); + case "ArrayPattern": + case "RestElement": return true; - } - current = parent; + default: + return false; } - - return false; } /** - * Checks whether the given node represents assignment target property in destructuring. - * - * For examples: - * ({a: b.foo} = c); // => true for `foo` - * ([a.foo] = b); // => true for `foo` - * ([a.foo = 1] = b); // => true for `foo` - * ({...a.foo} = b); // => true for `foo` - * @param {ASTNode} node An Identifier node to check - * @returns {boolean} True if the node is an assignment target property in destructuring. + * Checks if a given binding identifier uses the original name as-is. + * - If it's in object destructuring or object expression, the original name is its property name. + * - If it's in import declaration, the original name is its exported name. + * @param {ASTNode} node The `Identifier` node to check. + * @returns {boolean} `true` if the identifier uses the original name as-is. */ - function isAssignmentTargetPropertyInDestructuring(node) { - if ( - node.parent.type === "MemberExpression" && - node.parent.property === node && - !node.parent.computed - ) { - const effectiveParent = node.parent.parent; - - return ( - effectiveParent.type === "Property" && - effectiveParent.value === node.parent && - effectiveParent.parent.type === "ObjectPattern" || - effectiveParent.type === "ArrayPattern" || - effectiveParent.type === "RestElement" || - ( - effectiveParent.type === "AssignmentPattern" && - effectiveParent.left === node.parent - ) - ); + function equalsToOriginalName(node) { + const localName = node.name; + const valueNode = node.parent.type === "AssignmentPattern" + ? node.parent + : node; + const parent = valueNode.parent; + + switch (parent.type) { + case "Property": + return ( + (parent.parent.type === "ObjectPattern" || parent.parent.type === "ObjectExpression") && + parent.value === valueNode && + !parent.computed && + parent.key.type === "Identifier" && + parent.key.name === localName + ); + + case "ImportSpecifier": + return ( + parent.local === node && + astUtils.getModuleExportName(parent.imported) === localName + ); + + default: + return false; } - return false; } /** - * Checks whether the given node represents a reference to a global variable that is not declared in the source code. - * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. - * @param {ASTNode} node `Identifier` node to check. - * @returns {boolean} `true` if the node is a reference to a global variable. + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private */ - function isReferenceToGlobalVariable(node) { - const variable = globalScope.set.get(node.name); - - return variable && variable.defs.length === 0 && - variable.references.some(ref => ref.identifier === node); + function report(node) { + if (reported.has(node.range[0])) { + return; + } + reported.add(node.range[0]); + + // Report it. + context.report({ + node, + messageId: node.type === "PrivateIdentifier" + ? "notCamelCasePrivate" + : "notCamelCase", + data: { name: node.name } + }); } /** - * Checks whether the given node represents a reference to a property of an object in an object literal expression. - * This allows to differentiate between a global variable that is allowed to be used as a reference, and the key - * of the expressed object (which shouldn't be allowed). - * @param {ASTNode} node `Identifier` node to check. - * @returns {boolean} `true` if the node is a property name of an object literal expression + * Reports an identifier reference or a binding identifier. + * @param {ASTNode} node The `Identifier` node to report. + * @returns {void} */ - function isPropertyNameInObjectLiteral(node) { - const parent = node.parent; + function reportReferenceId(node) { - return ( - parent.type === "Property" && - parent.parent.type === "ObjectExpression" && - !parent.computed && - parent.key === node - ); - } + /* + * For backward compatibility, if it's in callings then ignore it. + * Not sure why it is. + */ + if ( + node.parent.type === "CallExpression" || + node.parent.type === "NewExpression" + ) { + return; + } - /** - * Reports an AST node as a rule violation. - * @param {ASTNode} node The node to report. - * @returns {void} - * @private - */ - function report(node) { - if (!reported.includes(node)) { - reported.push(node); - context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + /* + * For backward compatibility, if it's a default value of + * destructuring/parameters then ignore it. + * Not sure why it is. + */ + if ( + node.parent.type === "AssignmentPattern" && + node.parent.right === node + ) { + return; } + + /* + * The `ignoreDestructuring` flag skips the identifiers that uses + * the property name as-is. + */ + if (ignoreDestructuring && equalsToOriginalName(node)) { + return; + } + + report(node); } return { + // Report camelcase of global variable references ------------------ Program() { - globalScope = context.getScope(); - }, + const scope = context.getScope(); - Identifier(node) { - - /* - * Leading and trailing underscores are commonly used to flag - * private/protected identifiers, strip them before checking if underscored - */ - const name = node.name, - nameIsUnderscored = isUnderscored(name.replace(/^_+|_+$/gu, "")), - effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + if (!ignoreGlobals) { - // First, we ignore the node if it match the ignore list - if (isAllowed(name)) { - return; - } + // Defined globals in config files or directive comments. + for (const variable of scope.variables) { + if ( + variable.identifiers.length > 0 || + isGoodName(variable.name) + ) { + continue; + } + for (const reference of variable.references) { - // Check if it's a global variable - if (ignoreGlobals && isReferenceToGlobalVariable(node) && !isPropertyNameInObjectLiteral(node)) { - return; + /* + * For backward compatibility, this rule reports read-only + * references as well. + */ + reportReferenceId(reference.identifier); + } + } } - // MemberExpressions get special rules - if (node.parent.type === "MemberExpression") { + // Undefined globals. + for (const reference of scope.through) { + const id = reference.identifier; - // "never" check properties - if (properties === "never") { - return; + if (isGoodName(id.name)) { + continue; } - // Always report underscored object names - if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && nameIsUnderscored) { - report(node); - - // Report AssignmentExpressions only if they are the left side of the assignment - } else if (effectiveParent.type === "AssignmentExpression" && nameIsUnderscored && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) { - report(node); + /* + * For backward compatibility, this rule reports read-only + * references as well. + */ + reportReferenceId(id); + } + }, - } else if (isAssignmentTargetPropertyInDestructuring(node) && nameIsUnderscored) { - report(node); + // Report camelcase of declared variables -------------------------- + [[ + "VariableDeclaration", + "FunctionDeclaration", + "FunctionExpression", + "ArrowFunctionExpression", + "ClassDeclaration", + "ClassExpression", + "CatchClause" + ]](node) { + for (const variable of context.getDeclaredVariables(node)) { + if (isGoodName(variable.name)) { + continue; } + const id = variable.identifiers[0]; - /* - * Properties have their own rules, and - * AssignmentPattern nodes can be treated like Properties: - * e.g.: const { no_camelcased = false } = bar; - */ - } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { - - if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { - if (node.parent.shorthand && node.parent.value.left && nameIsUnderscored) { - report(node); - } - - const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; - - if (nameIsUnderscored && node.parent.computed) { - report(node); - } + // Report declaration. + if (!(ignoreDestructuring && equalsToOriginalName(id))) { + report(id); + } - // prevent checking righthand side of destructured object - if (node.parent.key === node && node.parent.value !== node) { - return; + /* + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. + */ + for (const reference of variable.references) { + if (reference.init) { + continue; // Skip the write references of initializers. } + reportReferenceId(reference.identifier); + } + } + }, - const valueIsUnderscored = node.parent.value.name && nameIsUnderscored; + // Report camelcase in properties ---------------------------------- + [[ + "ObjectExpression > Property[computed!=true] > Identifier.key", + "MethodDefinition[computed!=true] > Identifier.key", + "PropertyDefinition[computed!=true] > Identifier.key", + "MethodDefinition > PrivateIdentifier.key", + "PropertyDefinition > PrivateIdentifier.key" + ]](node) { + if (properties === "never" || isGoodName(node.name)) { + return; + } + report(node); + }, + "MemberExpression[computed!=true] > Identifier.property"(node) { + if ( + properties === "never" || + !isAssignmentTarget(node.parent) || // ← ignore read-only references. + isGoodName(node.name) + ) { + return; + } + report(node); + }, - // ignore destructuring if the option is set, unless a new identifier is created - if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { - report(node); - } + // Report camelcase in import -------------------------------------- + ImportDeclaration(node) { + for (const variable of context.getDeclaredVariables(node)) { + if (isGoodName(variable.name)) { + continue; } + const id = variable.identifiers[0]; - // "never" check properties or always ignore destructuring - if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { - return; + // Report declaration. + if (!(ignoreImports && equalsToOriginalName(id))) { + report(id); } - // don't check right hand side of AssignmentExpression to prevent duplicate warnings - if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { - report(node); + /* + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. + */ + for (const reference of variable.references) { + reportReferenceId(reference.identifier); } + } + }, - // Check if it's an import specifier - } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.parent.type)) { - - if (node.parent.type === "ImportSpecifier" && ignoreImports) { - return; - } + // Report camelcase in re-export ----------------------------------- + [[ + "ExportAllDeclaration > Identifier.exported", + "ExportSpecifier > Identifier.exported" + ]](node) { + if (isGoodName(node.name)) { + return; + } + report(node); + }, - // Report only if the local imported identifier is underscored - if ( - node.parent.local && - node.parent.local.name === node.name && - nameIsUnderscored - ) { - report(node); - } + // Report camelcase in labels -------------------------------------- + [[ + "LabeledStatement > Identifier.label", - // Report anything that is underscored that isn't a CallExpression - } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { - report(node); + /* + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. + */ + "BreakStatement > Identifier.label", + "ContinueStatement > Identifier.label" + ]](node) { + if (isGoodName(node.name)) { + return; } + report(node); } - }; - } }; diff --git a/node_modules/eslint/lib/rules/capitalized-comments.js b/node_modules/eslint/lib/rules/capitalized-comments.js index d7524b878..ba798d428 100644 --- a/node_modules/eslint/lib/rules/capitalized-comments.js +++ b/node_modules/eslint/lib/rules/capitalized-comments.js @@ -99,13 +99,13 @@ function createRegExpForIgnorePatterns(normalizedOptions) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce or disallow capitalization of the first letter of a comment", - category: "Stylistic Issues", + description: "Enforce or disallow capitalization of the first letter of a comment", recommended: false, url: "https://eslint.org/docs/rules/capitalized-comments" }, @@ -185,7 +185,7 @@ module.exports = { return Boolean( previousTokenOrComment && - ["Block", "Line"].indexOf(previousTokenOrComment.type) !== -1 + ["Block", "Line"].includes(previousTokenOrComment.type) ); } diff --git a/node_modules/eslint/lib/rules/class-methods-use-this.js b/node_modules/eslint/lib/rules/class-methods-use-this.js index 2cc5cc418..05a915867 100644 --- a/node_modules/eslint/lib/rules/class-methods-use-this.js +++ b/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce that class methods utilize `this`", - category: "Best Practices", + description: "Enforce that class methods utilize `this`", recommended: false, url: "https://eslint.org/docs/rules/class-methods-use-this" }, @@ -34,6 +34,10 @@ module.exports = { items: { type: "string" } + }, + enforceForClassFields: { + type: "boolean", + default: true } }, additionalProperties: false @@ -45,10 +49,27 @@ module.exports = { }, create(context) { const config = Object.assign({}, context.options[0]); + const enforceForClassFields = config.enforceForClassFields !== false; const exceptMethods = new Set(config.exceptMethods || []); const stack = []; + /** + * Push `this` used flag initialized with `false` onto the stack. + * @returns {void} + */ + function pushContext() { + stack.push(false); + } + + /** + * Pop `this` used flag from the stack. + * @returns {boolean | undefined} `this` used flag + */ + function popContext() { + return stack.pop(); + } + /** * Initializes the current context to false and pushes it onto the stack. * These booleans represent whether 'this' has been used in the context. @@ -56,7 +77,7 @@ module.exports = { * @private */ function enterFunction() { - stack.push(false); + pushContext(); } /** @@ -66,7 +87,14 @@ module.exports = { * @private */ function isInstanceMethod(node) { - return !node.static && node.kind !== "constructor" && node.type === "MethodDefinition"; + switch (node.type) { + case "MethodDefinition": + return !node.static && node.kind !== "constructor"; + case "PropertyDefinition": + return !node.static && enforceForClassFields; + default: + return false; + } } /** @@ -76,8 +104,19 @@ module.exports = { * @private */ function isIncludedInstanceMethod(node) { - return isInstanceMethod(node) && - (node.computed || !exceptMethods.has(node.key.name)); + if (isInstanceMethod(node)) { + if (node.computed) { + return true; + } + + const hashIfNeeded = node.key.type === "PrivateIdentifier" ? "#" : ""; + const name = node.key.type === "Literal" + ? astUtils.getStaticStringValue(node.key) + : (node.key.name || ""); + + return !exceptMethods.has(hashIfNeeded + name); + } + return false; } /** @@ -89,11 +128,12 @@ module.exports = { * @private */ function exitFunction(node) { - const methodUsesThis = stack.pop(); + const methodUsesThis = popContext(); if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) { context.report({ node, + loc: astUtils.getFunctionHeadLoc(node, context.getSourceCode()), messageId: "missingThis", data: { name: astUtils.getFunctionNameWithKind(node) @@ -118,8 +158,30 @@ module.exports = { "FunctionDeclaration:exit": exitFunction, FunctionExpression: enterFunction, "FunctionExpression:exit": exitFunction, + + /* + * Class field value are implicit functions. + */ + "PropertyDefinition > *.key:exit": pushContext, + "PropertyDefinition:exit": popContext, + + /* + * Class static blocks are implicit functions. They aren't required to use `this`, + * but we have to push context so that it captures any use of `this` in the static block + * separately from enclosing contexts, because static blocks have their own `this` and it + * shouldn't count as used `this` in enclosing contexts. + */ + StaticBlock: pushContext, + "StaticBlock:exit": popContext, + ThisExpression: markThisUsed, - Super: markThisUsed + Super: markThisUsed, + ...( + enforceForClassFields && { + "PropertyDefinition > ArrowFunctionExpression.value": enterFunction, + "PropertyDefinition > ArrowFunctionExpression.value:exit": exitFunction + } + ) }; } }; diff --git a/node_modules/eslint/lib/rules/comma-dangle.js b/node_modules/eslint/lib/rules/comma-dangle.js index e22b7f355..09fecd5a4 100644 --- a/node_modules/eslint/lib/rules/comma-dangle.js +++ b/node_modules/eslint/lib/rules/comma-dangle.js @@ -9,7 +9,6 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ @@ -51,7 +50,7 @@ function normalizeOptions(optionValue, ecmaVersion) { objects: optionValue, imports: optionValue, exports: optionValue, - functions: (!ecmaVersion || ecmaVersion < 8) ? "ignore" : optionValue + functions: ecmaVersion < 2017 ? "ignore" : optionValue }; } if (typeof optionValue === "object" && optionValue !== null) { @@ -71,13 +70,13 @@ function normalizeOptions(optionValue, ecmaVersion) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow trailing commas", - category: "Stylistic Issues", + description: "Require or disallow trailing commas", recommended: false, url: "https://eslint.org/docs/rules/comma-dangle" }, @@ -124,7 +123,8 @@ module.exports = { } ] } - ] + ], + additionalItems: false }, messages: { @@ -134,7 +134,7 @@ module.exports = { }, create(context) { - const options = normalizeOptions(context.options[0], context.parserOptions.ecmaVersion); + const options = normalizeOptions(context.options[0], context.languageOptions.ecmaVersion); const sourceCode = context.getSourceCode(); @@ -144,23 +144,33 @@ module.exports = { * @returns {ASTNode|null} The last node or null. */ function getLastItem(node) { + + /** + * Returns the last element of an array + * @param {any[]} array The input array + * @returns {any} The last element + */ + function last(array) { + return array[array.length - 1]; + } + switch (node.type) { case "ObjectExpression": case "ObjectPattern": - return lodash.last(node.properties); + return last(node.properties); case "ArrayExpression": case "ArrayPattern": - return lodash.last(node.elements); + return last(node.elements); case "ImportDeclaration": case "ExportNamedDeclaration": - return lodash.last(node.specifiers); + return last(node.specifiers); case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": - return lodash.last(node.params); + return last(node.params); case "CallExpression": case "NewExpression": - return lodash.last(node.arguments); + return last(node.arguments); default: return null; } @@ -233,8 +243,18 @@ module.exports = { node: lastItem, loc: trailingToken.loc, messageId: "unexpected", - fix(fixer) { - return fixer.remove(trailingToken); + *fix(fixer) { + yield fixer.remove(trailingToken); + + /* + * Extend the range of the fix to include surrounding tokens to ensure + * that the element after which the comma is removed stays _last_. + * This intentionally makes conflicts in fix ranges with rules that may be + * adding or removing elements in the same autofix pass. + * https://github.com/eslint/eslint/issues/15660 + */ + yield fixer.insertTextBefore(sourceCode.getTokenBefore(trailingToken), ""); + yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), ""); } }); } @@ -272,8 +292,18 @@ module.exports = { end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end) }, messageId: "missing", - fix(fixer) { - return fixer.insertTextAfter(trailingToken, ","); + *fix(fixer) { + yield fixer.insertTextAfter(trailingToken, ","); + + /* + * Extend the range of the fix to include surrounding tokens to ensure + * that the element after which the comma is inserted stays _last_. + * This intentionally makes conflicts in fix ranges with rules that may be + * adding or removing elements in the same autofix pass. + * https://github.com/eslint/eslint/issues/15660 + */ + yield fixer.insertTextBefore(trailingToken, ""); + yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), ""); } }); } @@ -316,7 +346,7 @@ module.exports = { "always-multiline": forceTrailingCommaIfMultiline, "only-multiline": allowTrailingCommaIfMultiline, never: forbidTrailingComma, - ignore: lodash.noop + ignore() {} }; return { diff --git a/node_modules/eslint/lib/rules/comma-spacing.js b/node_modules/eslint/lib/rules/comma-spacing.js index 73c10a771..76d5dc46b 100644 --- a/node_modules/eslint/lib/rules/comma-spacing.js +++ b/node_modules/eslint/lib/rules/comma-spacing.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before and after commas", - category: "Stylistic Issues", + description: "Enforce consistent spacing before and after commas", recommended: false, url: "https://eslint.org/docs/rules/comma-spacing" }, @@ -103,38 +103,6 @@ module.exports = { }); } - /** - * Validates the spacing around a comma token. - * @param {Object} tokens The tokens to be validated. - * @param {Token} tokens.comma The token representing the comma. - * @param {Token} [tokens.left] The last token before the comma. - * @param {Token} [tokens.right] The first token after the comma. - * @param {Token|ASTNode} reportItem The item to use when reporting an error. - * @returns {void} - * @private - */ - function validateCommaItemSpacing(tokens, reportItem) { - if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) && - (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma)) - ) { - report(reportItem, "before", tokens.left); - } - - if (tokens.right && astUtils.isClosingParenToken(tokens.right)) { - return; - } - - if (tokens.right && !options.after && tokens.right.type === "Line") { - return; - } - - if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) && - (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right)) - ) { - report(reportItem, "after", tokens.right); - } - } - /** * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. * @param {ASTNode} node An ArrayExpression or ArrayPattern node. @@ -172,18 +140,44 @@ module.exports = { return; } - if (token && token.type === "JSXText") { - return; - } - const previousToken = tokensAndComments[i - 1]; const nextToken = tokensAndComments[i + 1]; - validateCommaItemSpacing({ - comma: token, - left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, - right: astUtils.isCommaToken(nextToken) ? null : nextToken - }, token); + if ( + previousToken && + !astUtils.isCommaToken(previousToken) && // ignore spacing between two commas + + /* + * `commaTokensToIgnore` are ending commas of `null` elements (array holes/elisions). + * In addition to spacing between two commas, this can also ignore: + * + * - Spacing after `[` (controlled by array-bracket-spacing) + * Example: [ , ] + * ^ + * - Spacing after a comment (for backwards compatibility, this was possibly unintentional) + * Example: [a, /* * / ,] + * ^ + */ + !commaTokensToIgnore.includes(token) && + + astUtils.isTokenOnSameLine(previousToken, token) && + options.before !== sourceCode.isSpaceBetweenTokens(previousToken, token) + ) { + report(token, "before", previousToken); + } + + if ( + nextToken && + !astUtils.isCommaToken(nextToken) && // ignore spacing between two commas + !astUtils.isClosingParenToken(nextToken) && // controlled by space-in-parens + !astUtils.isClosingBracketToken(nextToken) && // controlled by array-bracket-spacing + !astUtils.isClosingBraceToken(nextToken) && // controlled by object-curly-spacing + !(!options.after && nextToken.type === "Line") && // special case, allow space before line comment + astUtils.isTokenOnSameLine(token, nextToken) && + options.after !== sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + report(token, "after", nextToken); + } }); }, ArrayExpression: addNullElementsToIgnoreList, diff --git a/node_modules/eslint/lib/rules/comma-style.js b/node_modules/eslint/lib/rules/comma-style.js index f1a23d63b..4969f59d7 100644 --- a/node_modules/eslint/lib/rules/comma-style.js +++ b/node_modules/eslint/lib/rules/comma-style.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent comma style", - category: "Stylistic Issues", + description: "Enforce consistent comma style", recommended: false, url: "https://eslint.org/docs/rules/comma-style" }, @@ -207,8 +207,7 @@ module.exports = { * they are always valid regardless of an undefined item. */ if (astUtils.isCommaToken(commaToken)) { - validateCommaItemSpacing(previousItemToken, commaToken, - currentItemToken, reportItem); + validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem); } if (item) { @@ -217,6 +216,8 @@ module.exports = { previousItemToken = tokenAfterItem ? sourceCode.getTokenBefore(tokenAfterItem) : sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1]; + } else { + previousItemToken = currentItemToken; } }); diff --git a/node_modules/eslint/lib/rules/complexity.js b/node_modules/eslint/lib/rules/complexity.js index 5d62c6ff4..541d3a9bb 100644 --- a/node_modules/eslint/lib/rules/complexity.js +++ b/node_modules/eslint/lib/rules/complexity.js @@ -10,21 +10,20 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); - const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum cyclomatic complexity allowed in a program", - category: "Best Practices", + description: "Enforce a maximum cyclomatic complexity allowed in a program", recommended: false, url: "https://eslint.org/docs/rules/complexity" }, @@ -76,60 +75,16 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- - // Using a stack to store complexity (handling nested functions) - const fns = []; - - /** - * When parsing a new function, store it in our function stack - * @returns {void} - * @private - */ - function startFunction() { - fns.push(1); - } - - /** - * Evaluate the node at the end of function - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function endFunction(node) { - const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); - const complexity = fns.pop(); - - if (complexity > THRESHOLD) { - context.report({ - node, - messageId: "complex", - data: { name, complexity, max: THRESHOLD } - }); - } - } + // Using a stack to store complexity per code path + const complexities = []; /** - * Increase the complexity of the function in context + * Increase the complexity of the code path in context * @returns {void} * @private */ function increaseComplexity() { - if (fns.length) { - fns[fns.length - 1]++; - } - } - - /** - * Increase the switch complexity in context - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function increaseSwitchComplexity(node) { - - // Avoiding `default` - if (node.test) { - increaseComplexity(); - } + complexities[complexities.length - 1]++; } //-------------------------------------------------------------------------- @@ -137,13 +92,14 @@ module.exports = { //-------------------------------------------------------------------------- return { - FunctionDeclaration: startFunction, - FunctionExpression: startFunction, - ArrowFunctionExpression: startFunction, - "FunctionDeclaration:exit": endFunction, - "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction, + onCodePathStart() { + + // The initial complexity is 1, representing one execution path in the CodePath + complexities.push(1); + }, + + // Each branching in the code adds 1 to the complexity CatchClause: increaseComplexity, ConditionalExpression: increaseComplexity, LogicalExpression: increaseComplexity, @@ -151,14 +107,57 @@ module.exports = { ForInStatement: increaseComplexity, ForOfStatement: increaseComplexity, IfStatement: increaseComplexity, - SwitchCase: increaseSwitchComplexity, WhileStatement: increaseComplexity, DoWhileStatement: increaseComplexity, + // Avoid `default` + "SwitchCase[test]": increaseComplexity, + + // Logical assignment operators have short-circuiting behavior AssignmentExpression(node) { if (astUtils.isLogicalAssignmentOperator(node.operator)) { increaseComplexity(); } + }, + + onCodePathEnd(codePath, node) { + const complexity = complexities.pop(); + + /* + * This rule only evaluates complexity of functions, so "program" is excluded. + * Class field initializers and class static blocks are implicit functions. Therefore, + * they shouldn't contribute to the enclosing function's complexity, but their + * own complexity should be evaluated. + */ + if ( + codePath.origin !== "function" && + codePath.origin !== "class-field-initializer" && + codePath.origin !== "class-static-block" + ) { + return; + } + + if (complexity > THRESHOLD) { + let name; + + if (codePath.origin === "class-field-initializer") { + name = "class field initializer"; + } else if (codePath.origin === "class-static-block") { + name = "class static block"; + } else { + name = astUtils.getFunctionNameWithKind(node); + } + + context.report({ + node, + messageId: "complex", + data: { + name: upperCaseFirst(name), + complexity, + max: THRESHOLD + } + }); + } } }; diff --git a/node_modules/eslint/lib/rules/computed-property-spacing.js b/node_modules/eslint/lib/rules/computed-property-spacing.js index 53fdb8f4e..3d033fc00 100644 --- a/node_modules/eslint/lib/rules/computed-property-spacing.js +++ b/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing inside computed property brackets", - category: "Stylistic Issues", + description: "Enforce consistent spacing inside computed property brackets", recommended: false, url: "https://eslint.org/docs/rules/computed-property-spacing" }, @@ -195,7 +195,8 @@ module.exports = { }; if (enforceForClassMembers) { - listeners.MethodDefinition = checkSpacing("key"); + listeners.MethodDefinition = + listeners.PropertyDefinition = listeners.Property; } return listeners; diff --git a/node_modules/eslint/lib/rules/consistent-return.js b/node_modules/eslint/lib/rules/consistent-return.js index 94db253d2..f0072974d 100644 --- a/node_modules/eslint/lib/rules/consistent-return.js +++ b/node_modules/eslint/lib/rules/consistent-return.js @@ -8,8 +8,8 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); //------------------------------------------------------------------------------ // Helpers @@ -40,13 +40,13 @@ function isClassConstructor(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `return` statements to either always or never specify values", - category: "Best Practices", + description: "Require `return` statements to either always or never specify values", recommended: false, url: "https://eslint.org/docs/rules/consistent-return" }, @@ -104,18 +104,18 @@ module.exports = { } else if (node.type === "ArrowFunctionExpression") { // `=>` token - loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc.start; + loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc; } else if ( node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method) ) { // Method name. - loc = node.parent.key.loc.start; + loc = node.parent.key.loc; } else { // Function name or `function` keyword. - loc = (node.id || node).loc.start; + loc = (node.id || context.getSourceCode().getFirstToken(node)).loc; } if (!name) { @@ -164,7 +164,7 @@ module.exports = { funcInfo.data = { name: funcInfo.node.type === "Program" ? "Program" - : lodash.upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) + : upperCaseFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) }; } else if (funcInfo.hasReturnValue !== hasReturnValue) { context.report({ diff --git a/node_modules/eslint/lib/rules/consistent-this.js b/node_modules/eslint/lib/rules/consistent-this.js index e5bc9678d..947873b8e 100644 --- a/node_modules/eslint/lib/rules/consistent-this.js +++ b/node_modules/eslint/lib/rules/consistent-this.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce consistent naming when capturing the current execution context", - category: "Stylistic Issues", + description: "Enforce consistent naming when capturing the current execution context", recommended: false, url: "https://eslint.org/docs/rules/consistent-this" }, @@ -47,7 +47,7 @@ module.exports = { * Reports that a variable declarator or assignment expression is assigning * a non-'this' value to the specified alias. * @param {ASTNode} node The assigning node. - * @param {string} name the name of the alias that was incorrectly used. + * @param {string} name the name of the alias that was incorrectly used. * @returns {void} */ function reportBadAssignment(node, name) { @@ -65,7 +65,7 @@ module.exports = { function checkAssignment(node, name, value) { const isThis = value.type === "ThisExpression"; - if (aliases.indexOf(name) !== -1) { + if (aliases.includes(name)) { if (!isThis || node.operator && node.operator !== "=") { reportBadAssignment(node, name); } diff --git a/node_modules/eslint/lib/rules/constructor-super.js b/node_modules/eslint/lib/rules/constructor-super.js index dfec18fb6..fff658471 100644 --- a/node_modules/eslint/lib/rules/constructor-super.js +++ b/node_modules/eslint/lib/rules/constructor-super.js @@ -116,13 +116,13 @@ function isPossibleConstructor(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "require `super()` calls in constructors", - category: "ECMAScript 6", + description: "Require `super()` calls in constructors", recommended: true, url: "https://eslint.org/docs/rules/constructor-super" }, diff --git a/node_modules/eslint/lib/rules/curly.js b/node_modules/eslint/lib/rules/curly.js index 92d31a647..7b5d140fe 100644 --- a/node_modules/eslint/lib/rules/curly.js +++ b/node_modules/eslint/lib/rules/curly.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce consistent brace style for all control statements", - category: "Best Practices", + description: "Enforce consistent brace style for all control statements", recommended: false, url: "https://eslint.org/docs/rules/curly" }, @@ -131,15 +131,6 @@ module.exports = { return token.value === "else" && token.type === "Keyword"; } - /** - * Gets the `else` keyword token of a given `IfStatement` node. - * @param {ASTNode} node A `IfStatement` node to get. - * @returns {Token} The `else` keyword token. - */ - function getElseKeyword(node) { - return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken); - } - /** * Determines whether the given node has an `else` keyword token as the first token after. * @param {ASTNode} node The node to check. @@ -361,7 +352,7 @@ module.exports = { if (this.expected) { context.report({ node, - loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + loc: body.loc, messageId: opts && opts.condition ? "missingCurlyAfterCondition" : "missingCurlyAfter", data: { name @@ -371,7 +362,7 @@ module.exports = { } else { context.report({ node, - loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + loc: body.loc, messageId: opts && opts.condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter", data: { name diff --git a/node_modules/eslint/lib/rules/default-case-last.js b/node_modules/eslint/lib/rules/default-case-last.js index 80c5d6bda..313a0d8c9 100644 --- a/node_modules/eslint/lib/rules/default-case-last.js +++ b/node_modules/eslint/lib/rules/default-case-last.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce default clauses in switch statements to be last", - category: "Best Practices", + description: "Enforce default clauses in switch statements to be last", recommended: false, url: "https://eslint.org/docs/rules/default-case-last" }, diff --git a/node_modules/eslint/lib/rules/default-case.js b/node_modules/eslint/lib/rules/default-case.js index 821e0d72b..f28de1af9 100644 --- a/node_modules/eslint/lib/rules/default-case.js +++ b/node_modules/eslint/lib/rules/default-case.js @@ -10,13 +10,13 @@ const DEFAULT_COMMENT_PATTERN = /^no default$/iu; // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `default` cases in `switch` statements", - category: "Best Practices", + description: "Require `default` cases in `switch` statements", recommended: false, url: "https://eslint.org/docs/rules/default-case" }, @@ -50,8 +50,8 @@ module.exports = { /** * Shortcut to get last element of array - * @param {*[]} collection Array - * @returns {*} Last element + * @param {*[]} collection Array + * @returns {any} Last element */ function last(collection) { return collection[collection.length - 1]; diff --git a/node_modules/eslint/lib/rules/default-param-last.js b/node_modules/eslint/lib/rules/default-param-last.js index 12e0b5950..61df5f6d2 100644 --- a/node_modules/eslint/lib/rules/default-param-last.js +++ b/node_modules/eslint/lib/rules/default-param-last.js @@ -5,13 +5,13 @@ "use strict"; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce default parameters to be last", - category: "Best Practices", + description: "Enforce default parameters to be last", recommended: false, url: "https://eslint.org/docs/rules/default-param-last" }, @@ -25,8 +25,8 @@ module.exports = { create(context) { - // eslint-disable-next-line jsdoc/require-description /** + * Handler for function contexts. * @param {ASTNode} node function node * @returns {void} */ diff --git a/node_modules/eslint/lib/rules/dot-location.js b/node_modules/eslint/lib/rules/dot-location.js index a8d5a7605..36b50b284 100644 --- a/node_modules/eslint/lib/rules/dot-location.js +++ b/node_modules/eslint/lib/rules/dot-location.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent newlines before and after dots", - category: "Best Practices", + description: "Enforce consistent newlines before and after dots", recommended: false, url: "https://eslint.org/docs/rules/dot-location" }, diff --git a/node_modules/eslint/lib/rules/dot-notation.js b/node_modules/eslint/lib/rules/dot-notation.js index 751b4628e..5f6e818cb 100644 --- a/node_modules/eslint/lib/rules/dot-notation.js +++ b/node_modules/eslint/lib/rules/dot-notation.js @@ -20,13 +20,13 @@ const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; // `null` literal must be handled separately. const literalTypesToCheck = new Set(["string", "boolean"]); +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce dot notation whenever possible", - category: "Best Practices", + description: "Enforce dot notation whenever possible", recommended: false, url: "https://eslint.org/docs/rules/dot-notation" }, @@ -76,7 +76,7 @@ module.exports = { function checkComputedProperty(node, value) { if ( validIdentifier.test(value) && - (allowKeywords || keywords.indexOf(String(value)) === -1) && + (allowKeywords || !keywords.includes(String(value))) && !(allowPattern && allowPattern.test(value)) ) { const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``; @@ -94,7 +94,7 @@ module.exports = { // Don't perform any fixes if there are comments inside the brackets. if (sourceCode.commentsExistBetween(leftBracket, rightBracket)) { - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } // Replace the brackets by an identifier. @@ -141,7 +141,8 @@ module.exports = { if ( !allowKeywords && !node.computed && - keywords.indexOf(String(node.property.name)) !== -1 + node.property.type === "Identifier" && + keywords.includes(String(node.property.name)) ) { context.report({ node: node.property, @@ -154,12 +155,12 @@ module.exports = { // A statement that starts with `let[` is parsed as a destructuring variable declaration, not a MemberExpression. if (node.object.type === "Identifier" && node.object.name === "let" && !node.optional) { - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } // Don't perform any fixes if there are comments between the dot and the property name. if (sourceCode.commentsExistBetween(dotToken, node.property)) { - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } // Replace the identifier to brackets. diff --git a/node_modules/eslint/lib/rules/eol-last.js b/node_modules/eslint/lib/rules/eol-last.js index 89c76acb2..fb87971fc 100644 --- a/node_modules/eslint/lib/rules/eol-last.js +++ b/node_modules/eslint/lib/rules/eol-last.js @@ -4,23 +4,17 @@ */ "use strict"; -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const lodash = require("lodash"); - //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow newline at the end of files", - category: "Stylistic Issues", + description: "Require or disallow newline at the end of files", recommended: false, url: "https://eslint.org/docs/rules/eol-last" }, @@ -48,8 +42,9 @@ module.exports = { Program: function checkBadEOF(node) { const sourceCode = context.getSourceCode(), src = sourceCode.getText(), + lastLine = sourceCode.lines[sourceCode.lines.length - 1], location = { - column: lodash.last(sourceCode.lines).length, + column: lastLine.length, line: sourceCode.lines.length }, LF = "\n", @@ -91,10 +86,15 @@ module.exports = { }); } else if (mode === "never" && endsWithNewline) { + const secondLastLine = sourceCode.lines[sourceCode.lines.length - 2]; + // File is newline-terminated, but shouldn't be context.report({ node, - loc: location, + loc: { + start: { line: sourceCode.lines.length - 1, column: secondLastLine.length }, + end: { line: sourceCode.lines.length, column: 0 } + }, messageId: "unexpected", fix(fixer) { const finalEOLs = /(?:\r?\n)+$/u, diff --git a/node_modules/eslint/lib/rules/eqeqeq.js b/node_modules/eslint/lib/rules/eqeqeq.js index 57926dbed..b3990e214 100644 --- a/node_modules/eslint/lib/rules/eqeqeq.js +++ b/node_modules/eslint/lib/rules/eqeqeq.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require the use of `===` and `!==`", - category: "Best Practices", + description: "Require the use of `===` and `!==`", recommended: false, url: "https://eslint.org/docs/rules/eqeqeq" }, @@ -78,7 +78,7 @@ module.exports = { /** * Checks if an expression is a typeof expression - * @param {ASTNode} node The node to check + * @param {ASTNode} node The node to check * @returns {boolean} if the node is a typeof expression */ function isTypeOf(node) { diff --git a/node_modules/eslint/lib/rules/for-direction.js b/node_modules/eslint/lib/rules/for-direction.js index c15d10e5f..5507a9a1f 100644 --- a/node_modules/eslint/lib/rules/for-direction.js +++ b/node_modules/eslint/lib/rules/for-direction.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "enforce \"for\" loop update clause moving the counter in the right direction.", - category: "Possible Errors", + description: "Enforce \"for\" loop update clause moving the counter in the right direction", recommended: true, url: "https://eslint.org/docs/rules/for-direction" }, diff --git a/node_modules/eslint/lib/rules/func-call-spacing.js b/node_modules/eslint/lib/rules/func-call-spacing.js index 132a58331..fec6763a2 100644 --- a/node_modules/eslint/lib/rules/func-call-spacing.js +++ b/node_modules/eslint/lib/rules/func-call-spacing.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow spacing between function identifiers and their invocations", - category: "Stylistic Issues", + description: "Require or disallow spacing between function identifiers and their invocations", recommended: false, url: "https://eslint.org/docs/rules/func-call-spacing" }, diff --git a/node_modules/eslint/lib/rules/func-name-matching.js b/node_modules/eslint/lib/rules/func-name-matching.js index 755c2ee50..69b47c286 100644 --- a/node_modules/eslint/lib/rules/func-name-matching.js +++ b/node_modules/eslint/lib/rules/func-name-matching.js @@ -44,7 +44,7 @@ function isModuleExports(pattern) { * @returns {boolean} True if the string is a valid identifier */ function isIdentifier(name, ecmaVersion) { - if (ecmaVersion >= 6) { + if (ecmaVersion >= 2015) { return esutils.keyword.isIdentifierES6(name); } return esutils.keyword.isIdentifierES5(name); @@ -68,13 +68,13 @@ const optionsObject = { additionalProperties: false }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require function names to match the name of the variable or property to which they are assigned", - category: "Stylistic Issues", + description: "Require function names to match the name of the variable or property to which they are assigned", recommended: false, url: "https://eslint.org/docs/rules/func-name-matching" }, @@ -104,7 +104,7 @@ module.exports = { const nameMatches = typeof context.options[0] === "string" ? context.options[0] : "always"; const considerPropertyDescriptor = options.considerPropertyDescriptor; const includeModuleExports = options.includeCommonJSModuleExports; - const ecmaVersion = context.parserOptions && context.parserOptions.ecmaVersion ? context.parserOptions.ecmaVersion : 5; + const ecmaVersion = context.languageOptions.ecmaVersion; /** * Check whether node is a certain CallExpression. @@ -196,21 +196,25 @@ module.exports = { const isProp = node.left.type === "MemberExpression"; const name = isProp ? astUtils.getStaticPropertyName(node.left) : node.left.name; - if (node.right.id && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { + if (node.right.id && name && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { report(node, name, node.right.id.name, isProp); } }, - Property(node) { - if (node.value.type !== "FunctionExpression" || !node.value.id || node.computed && !isStringLiteral(node.key)) { + "Property, PropertyDefinition[value]"(node) { + if (!(node.value.type === "FunctionExpression" && node.value.id)) { return; } - if (node.key.type === "Identifier") { + if (node.key.type === "Identifier" && !node.computed) { const functionName = node.value.id.name; let propertyName = node.key.name; - if (considerPropertyDescriptor && propertyName === "value") { + if ( + considerPropertyDescriptor && + propertyName === "value" && + node.parent.type === "ObjectExpression" + ) { if (isPropertyCall("Object", "defineProperty", node.parent.parent) || isPropertyCall("Reflect", "defineProperty", node.parent.parent)) { const property = node.parent.parent.arguments[1]; diff --git a/node_modules/eslint/lib/rules/func-names.js b/node_modules/eslint/lib/rules/func-names.js index ecfedb9e0..ee4664592 100644 --- a/node_modules/eslint/lib/rules/func-names.js +++ b/node_modules/eslint/lib/rules/func-names.js @@ -24,13 +24,13 @@ function isFunctionName(variable) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require or disallow named `function` expressions", - category: "Stylistic Issues", + description: "Require or disallow named `function` expressions", recommended: false, url: "https://eslint.org/docs/rules/func-names" }, @@ -118,6 +118,7 @@ module.exports = { return isObjectOrClassMethod(node) || (parent.type === "VariableDeclarator" && parent.id.type === "Identifier" && parent.init === node) || (parent.type === "Property" && parent.value === node) || + (parent.type === "PropertyDefinition" && parent.value === node) || (parent.type === "AssignmentExpression" && parent.left.type === "Identifier" && parent.right === node) || (parent.type === "AssignmentPattern" && parent.left.type === "Identifier" && parent.right === node); } diff --git a/node_modules/eslint/lib/rules/func-style.js b/node_modules/eslint/lib/rules/func-style.js index e150b1a76..0e1ba9fab 100644 --- a/node_modules/eslint/lib/rules/func-style.js +++ b/node_modules/eslint/lib/rules/func-style.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce the consistent use of either `function` declarations or expressions", - category: "Stylistic Issues", + description: "Enforce the consistent use of either `function` declarations or expressions", recommended: false, url: "https://eslint.org/docs/rules/func-style" }, diff --git a/node_modules/eslint/lib/rules/function-call-argument-newline.js b/node_modules/eslint/lib/rules/function-call-argument-newline.js index b6abbe95f..466109146 100644 --- a/node_modules/eslint/lib/rules/function-call-argument-newline.js +++ b/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce line breaks between arguments of a function call", - category: "Stylistic Issues", + description: "Enforce line breaks between arguments of a function call", recommended: false, url: "https://eslint.org/docs/rules/function-call-argument-newline" }, diff --git a/node_modules/eslint/lib/rules/function-paren-newline.js b/node_modules/eslint/lib/rules/function-paren-newline.js index 9d8d67ba1..e61d17be6 100644 --- a/node_modules/eslint/lib/rules/function-paren-newline.js +++ b/node_modules/eslint/lib/rules/function-paren-newline.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent line breaks inside function parentheses", - category: "Stylistic Issues", + description: "Enforce consistent line breaks inside function parentheses", recommended: false, url: "https://eslint.org/docs/rules/function-paren-newline" }, @@ -183,6 +183,7 @@ module.exports = { /** * Gets the left paren and right paren tokens of a node. * @param {ASTNode} node The node with parens + * @throws {TypeError} Unexpected node type. * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token. * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression * with a single parameter) @@ -190,10 +191,13 @@ module.exports = { function getParenTokens(node) { switch (node.type) { case "NewExpression": - if (!node.arguments.length && !( - astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) && - astUtils.isClosingParenToken(sourceCode.getLastToken(node)) - )) { + if (!node.arguments.length && + !( + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) && + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) && + node.callee.range[1] < node.range[1] + ) + ) { // If the NewExpression does not have parens (e.g. `new Foo`), return null. return null; @@ -226,9 +230,13 @@ module.exports = { return null; } + const rightParen = node.params.length + ? sourceCode.getTokenAfter(node.params[node.params.length - 1], astUtils.isClosingParenToken) + : sourceCode.getTokenAfter(firstToken); + return { leftParen: firstToken, - rightParen: sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken) + rightParen }; } diff --git a/node_modules/eslint/lib/rules/generator-star-spacing.js b/node_modules/eslint/lib/rules/generator-star-spacing.js index 65534f727..d32b21fff 100644 --- a/node_modules/eslint/lib/rules/generator-star-spacing.js +++ b/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -25,13 +25,13 @@ const OVERRIDE_SCHEMA = { ] }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing around `*` operators in generator functions", - category: "ECMAScript 6", + description: "Enforce consistent spacing around `*` operators in generator functions", recommended: false, url: "https://eslint.org/docs/rules/generator-star-spacing" }, diff --git a/node_modules/eslint/lib/rules/getter-return.js b/node_modules/eslint/lib/rules/getter-return.js index c54ebfb4f..6d0e37bba 100644 --- a/node_modules/eslint/lib/rules/getter-return.js +++ b/node_modules/eslint/lib/rules/getter-return.js @@ -29,13 +29,13 @@ function isReachable(segment) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "enforce `return` statements in getters", - category: "Possible Errors", + description: "Enforce `return` statements in getters", recommended: true, url: "https://eslint.org/docs/rules/getter-return" }, @@ -112,18 +112,24 @@ module.exports = { } if (parent.type === "Property" && astUtils.getStaticPropertyName(parent) === "get" && parent.parent.type === "ObjectExpression") { - // Object.defineProperty() - if (parent.parent.parent.type === "CallExpression" && - astUtils.getStaticPropertyName(parent.parent.parent.callee) === "defineProperty") { - return true; + // Object.defineProperty() or Reflect.defineProperty() + if (parent.parent.parent.type === "CallExpression") { + const callNode = parent.parent.parent.callee; + + if (astUtils.isSpecificMemberAccess(callNode, "Object", "defineProperty") || + astUtils.isSpecificMemberAccess(callNode, "Reflect", "defineProperty")) { + return true; + } } - // Object.defineProperties() + // Object.defineProperties() or Object.create() if (parent.parent.parent.type === "Property" && parent.parent.parent.parent.type === "ObjectExpression" && - parent.parent.parent.parent.parent.type === "CallExpression" && - astUtils.getStaticPropertyName(parent.parent.parent.parent.parent.callee) === "defineProperties") { - return true; + parent.parent.parent.parent.parent.type === "CallExpression") { + const callNode = parent.parent.parent.parent.parent.callee; + + return astUtils.isSpecificMemberAccess(callNode, "Object", "defineProperties") || + astUtils.isSpecificMemberAccess(callNode, "Object", "create"); } } } diff --git a/node_modules/eslint/lib/rules/global-require.js b/node_modules/eslint/lib/rules/global-require.js index 09d033200..ceb0a8e84 100644 --- a/node_modules/eslint/lib/rules/global-require.js +++ b/node_modules/eslint/lib/rules/global-require.js @@ -1,11 +1,12 @@ /** * @fileoverview Rule for disallowing require() outside of the top-level module context * @author Jamund Ferguson + * @deprecated in ESLint v7.0.0 */ "use strict"; -const ACCEPTABLE_PARENTS = [ +const ACCEPTABLE_PARENTS = new Set([ "AssignmentExpression", "VariableDeclarator", "MemberExpression", @@ -15,7 +16,7 @@ const ACCEPTABLE_PARENTS = [ "Program", "VariableDeclaration", "ChainExpression" -]; +]); /** * Finds the eslint-scope reference in the given scope. @@ -27,10 +28,11 @@ function findReference(scope, node) { const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && reference.identifier.range[1] === node.range[1]); - /* istanbul ignore else: correctly returns null */ if (references.length === 1) { return references[0]; } + + /* c8 ignore next */ return null; } @@ -47,6 +49,7 @@ function isShadowed(scope, node) { return reference && reference.resolved && reference.resolved.defs.length > 0; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -56,8 +59,7 @@ module.exports = { type: "suggestion", docs: { - description: "require `require()` calls to be placed at top-level module scope", - category: "Node.js and CommonJS", + description: "Require `require()` calls to be placed at top-level module scope", recommended: false, url: "https://eslint.org/docs/rules/global-require" }, @@ -74,7 +76,7 @@ module.exports = { const currentScope = context.getScope(); if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { - const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1); + const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.has(parent.type)); if (!isGoodRequire) { context.report({ node, messageId: "unexpected" }); diff --git a/node_modules/eslint/lib/rules/grouped-accessor-pairs.js b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js index a790f8375..21374be21 100644 --- a/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +++ b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js @@ -90,13 +90,13 @@ function isAccessorKind(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require grouped accessor pairs in object literals and classes", - category: "Best Practices", + description: "Require grouped accessor pairs in object literals and classes", recommended: false, url: "https://eslint.org/docs/rules/grouped-accessor-pairs" }, diff --git a/node_modules/eslint/lib/rules/guard-for-in.js b/node_modules/eslint/lib/rules/guard-for-in.js index 2c0976d99..3b99143fe 100644 --- a/node_modules/eslint/lib/rules/guard-for-in.js +++ b/node_modules/eslint/lib/rules/guard-for-in.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `for-in` loops to include an `if` statement", - category: "Best Practices", + description: "Require `for-in` loops to include an `if` statement", recommended: false, url: "https://eslint.org/docs/rules/guard-for-in" }, diff --git a/node_modules/eslint/lib/rules/handle-callback-err.js b/node_modules/eslint/lib/rules/handle-callback-err.js index b92490ad1..5189564b6 100644 --- a/node_modules/eslint/lib/rules/handle-callback-err.js +++ b/node_modules/eslint/lib/rules/handle-callback-err.js @@ -1,6 +1,7 @@ /** * @fileoverview Ensure handling of errors when we know they exist. * @author Jamund Ferguson + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -9,6 +10,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -18,8 +20,7 @@ module.exports = { type: "suggestion", docs: { - description: "require error handling in callbacks", - category: "Node.js and CommonJS", + description: "Require error handling in callbacks", recommended: false, url: "https://eslint.org/docs/rules/handle-callback-err" }, diff --git a/node_modules/eslint/lib/rules/id-blacklist.js b/node_modules/eslint/lib/rules/id-blacklist.js index 4fbba909f..5ea61e94f 100644 --- a/node_modules/eslint/lib/rules/id-blacklist.js +++ b/node_modules/eslint/lib/rules/id-blacklist.js @@ -2,6 +2,7 @@ * @fileoverview Rule that warns when identifier names that are * specified in the configuration are used. * @author Keith Cirkel (http://keithcirkel.co.uk) + * @deprecated in ESLint v7.5.0 */ "use strict"; @@ -109,6 +110,7 @@ function isShorthandPropertyDefinition(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -117,8 +119,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow specified identifiers", - category: "Stylistic Issues", + description: "Disallow specified identifiers", recommended: false, url: "https://eslint.org/docs/rules/id-blacklist" }, @@ -205,7 +206,17 @@ module.exports = { * @private */ function report(node) { - if (!reportedNodes.has(node)) { + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (!reportedNodes.has(node.range.toString())) { context.report({ node, messageId: "restricted", @@ -213,8 +224,9 @@ module.exports = { name: node.name } }); - reportedNodes.add(node); + reportedNodes.add(node.range.toString()); } + } return { diff --git a/node_modules/eslint/lib/rules/id-denylist.js b/node_modules/eslint/lib/rules/id-denylist.js index 112fd8a9d..fe0a0b50b 100644 --- a/node_modules/eslint/lib/rules/id-denylist.js +++ b/node_modules/eslint/lib/rules/id-denylist.js @@ -69,14 +69,14 @@ function isRenamedImport(node) { } /** - * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * Checks whether the given node is an ObjectPattern destructuring. * * Examples: - * const { a : b } = foo; // node `a` is renamed node. + * const { a : b } = foo; * @param {ASTNode} node `Identifier` node to check. - * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + * @returns {boolean} `true` if the node is in an ObjectPattern destructuring. */ -function isRenamedInDestructuring(node) { +function isPropertyNameInDestructuring(node) { const parent = node.parent; return ( @@ -84,38 +84,22 @@ function isRenamedInDestructuring(node) { !parent.computed && parent.type === "Property" && parent.parent.type === "ObjectPattern" && - parent.value !== node && parent.key === node ) ); } -/** - * Checks whether the given node represents shorthand definition of a property in an object literal. - * @param {ASTNode} node `Identifier` node to check. - * @returns {boolean} `true` if the node is a shorthand property definition. - */ -function isShorthandPropertyDefinition(node) { - const parent = node.parent; - - return ( - parent.type === "Property" && - parent.parent.type === "ObjectExpression" && - parent.shorthand - ); -} - //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow specified identifiers", - category: "Stylistic Issues", + description: "Disallow specified identifiers", recommended: false, url: "https://eslint.org/docs/rules/id-denylist" }, @@ -128,7 +112,8 @@ module.exports = { uniqueItems: true }, messages: { - restricted: "Identifier '{{name}}' is restricted." + restricted: "Identifier '{{name}}' is restricted.", + restrictedPrivate: "Identifier '#{{name}}' is restricted." } }, @@ -187,11 +172,8 @@ module.exports = { parent.type !== "CallExpression" && parent.type !== "NewExpression" && !isRenamedImport(node) && - !isRenamedInDestructuring(node) && - !( - isReferenceToGlobalVariable(node) && - !isShorthandPropertyDefinition(node) - ) + !isPropertyNameInDestructuring(node) && + !isReferenceToGlobalVariable(node) ); } @@ -202,15 +184,27 @@ module.exports = { * @private */ function report(node) { - if (!reportedNodes.has(node)) { + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (!reportedNodes.has(node.range.toString())) { + const isPrivate = node.type === "PrivateIdentifier"; + context.report({ node, - messageId: "restricted", + messageId: isPrivate ? "restrictedPrivate" : "restricted", data: { name: node.name } }); - reportedNodes.add(node); + reportedNodes.add(node.range.toString()); } } @@ -220,7 +214,10 @@ module.exports = { globalScope = context.getScope(); }, - Identifier(node) { + [[ + "Identifier", + "PrivateIdentifier" + ]](node) { if (isRestricted(node.name) && shouldCheck(node)) { report(node); } diff --git a/node_modules/eslint/lib/rules/id-length.js b/node_modules/eslint/lib/rules/id-length.js index 4df081ff9..bd269b998 100644 --- a/node_modules/eslint/lib/rules/id-length.js +++ b/node_modules/eslint/lib/rules/id-length.js @@ -6,17 +6,56 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const GraphemeSplitter = require("grapheme-splitter"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the string given as argument is ASCII or not. + * @param {string} value A string that you want to know if it is ASCII or not. + * @returns {boolean} `true` if `value` is ASCII string. + */ +function isASCII(value) { + if (typeof value !== "string") { + return false; + } + return /^[\u0020-\u007f]*$/u.test(value); +} + +/** @type {GraphemeSplitter | undefined} */ +let splitter; + +/** + * Gets the length of the string. If the string is not in ASCII, counts graphemes. + * @param {string} value A string that you want to get the length. + * @returns {number} The length of `value`. + */ +function getStringLength(value) { + if (isASCII(value)) { + return value.length; + } + if (!splitter) { + splitter = new GraphemeSplitter(); + } + return splitter.countGraphemes(value); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce minimum and maximum identifier lengths", - category: "Stylistic Issues", + description: "Enforce minimum and maximum identifier lengths", recommended: false, url: "https://eslint.org/docs/rules/id-length" }, @@ -55,7 +94,9 @@ module.exports = { ], messages: { tooShort: "Identifier name '{{name}}' is too short (< {{min}}).", - tooLong: "Identifier name '{{name}}' is too long (> {{max}})." + tooShortPrivate: "Identifier name '#{{name}}' is too short (< {{min}}).", + tooLong: "Identifier name '{{name}}' is too long (> {{max}}).", + tooLongPrivate: "Identifier name #'{{name}}' is too long (> {{max}})." } }, @@ -66,7 +107,7 @@ module.exports = { const properties = options.properties !== "never"; const exceptions = new Set(options.exceptions); const exceptionPatterns = (options.exceptionPatterns || []).map(pattern => new RegExp(pattern, "u")); - const reportedNode = new Set(); + const reportedNodes = new Set(); /** * Checks if a string matches the provided exception patterns @@ -99,12 +140,14 @@ module.exports = { Property(parent, node) { if (parent.parent.type === "ObjectPattern") { + const isKeyAndValueSame = parent.value.name === parent.key.name; + return ( - parent.value !== parent.key && parent.value === node || - parent.value === parent.key && parent.key === node && properties + !isKeyAndValueSame && parent.value === node || + isKeyAndValueSame && parent.key === node && properties ); } - return properties && !parent.computed && parent.key === node; + return properties && !parent.computed && parent.key.name === node.name; }, ImportDefaultSpecifier: true, RestElement: true, @@ -113,17 +156,23 @@ module.exports = { ClassDeclaration: true, FunctionDeclaration: true, MethodDefinition: true, + PropertyDefinition: true, CatchClause: true, ArrayPattern: true }; return { - Identifier(node) { + [[ + "Identifier", + "PrivateIdentifier" + ]](node) { const name = node.name; const parent = node.parent; - const isShort = name.length < minLength; - const isLong = name.length > maxLength; + const nameLength = getStringLength(name); + + const isShort = nameLength < minLength; + const isLong = nameLength > maxLength; if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { return; // Nothing to report @@ -131,11 +180,27 @@ module.exports = { const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; - if (isValidExpression && !reportedNode.has(node) && (isValidExpression === true || isValidExpression(parent, node))) { - reportedNode.add(node); + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (isValidExpression && !reportedNodes.has(node.range.toString()) && (isValidExpression === true || isValidExpression(parent, node))) { + reportedNodes.add(node.range.toString()); + + let messageId = isShort ? "tooShort" : "tooLong"; + + if (node.type === "PrivateIdentifier") { + messageId += "Private"; + } + context.report({ node, - messageId: isShort ? "tooShort" : "tooLong", + messageId, data: { name, min: minLength, max: maxLength } }); } diff --git a/node_modules/eslint/lib/rules/id-match.js b/node_modules/eslint/lib/rules/id-match.js index 7e400d037..ec87af18d 100644 --- a/node_modules/eslint/lib/rules/id-match.js +++ b/node_modules/eslint/lib/rules/id-match.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require identifiers to match a specified regular expression", - category: "Stylistic Issues", + description: "Require identifiers to match a specified regular expression", recommended: false, url: "https://eslint.org/docs/rules/id-match" }, @@ -31,6 +31,10 @@ module.exports = { type: "boolean", default: false }, + classFields: { + type: "boolean", + default: false + }, onlyDeclarations: { type: "boolean", default: false @@ -44,7 +48,8 @@ module.exports = { } ], messages: { - notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'." + notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'.", + notMatchPrivate: "Identifier '#{{name}}' does not match the pattern '{{pattern}}'." } }, @@ -57,20 +62,36 @@ module.exports = { regexp = new RegExp(pattern, "u"); const options = context.options[1] || {}, - properties = !!options.properties, + checkProperties = !!options.properties, + checkClassFields = !!options.classFields, onlyDeclarations = !!options.onlyDeclarations, ignoreDestructuring = !!options.ignoreDestructuring; + let globalScope; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- // contains reported nodes to avoid reporting twice on destructuring with shorthand notation - const reported = new Map(); + const reportedNodes = new Set(); const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]); const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]); + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + /** * Checks if a string matches the provided pattern * @param {string} name The string to check. @@ -120,29 +141,51 @@ module.exports = { * @private */ function report(node) { - if (!reported.has(node)) { + + /* + * We used the range instead of the node because it's possible + * for the same identifier to be represented by two different + * nodes, with the most clear example being shorthand properties: + * { foo } + * In this case, "foo" is represented by one node for the name + * and one for the value. The only way to know they are the same + * is to look at the range. + */ + if (!reportedNodes.has(node.range.toString())) { + + const messageId = (node.type === "PrivateIdentifier") + ? "notMatchPrivate" : "notMatch"; + context.report({ node, - messageId: "notMatch", + messageId, data: { name: node.name, pattern } }); - reported.set(node, true); + reportedNodes.add(node.range.toString()); } } return { + Program() { + globalScope = context.getScope(); + }, + Identifier(node) { const name = node.name, parent = node.parent, effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent; + if (isReferenceToGlobalVariable(node)) { + return; + } + if (parent.type === "MemberExpression") { - if (!properties) { + if (!checkProperties) { return; } @@ -168,6 +211,17 @@ module.exports = { } } + // For https://github.com/eslint/eslint/issues/15123 + } else if ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.key === node && + !parent.computed + ) { + if (checkProperties && isInvalid(name)) { + report(node); + } + /* * Properties have their own rules, and * AssignmentPattern nodes can be treated like Properties: @@ -176,8 +230,7 @@ module.exports = { } else if (parent.type === "Property" || parent.type === "AssignmentPattern") { if (parent.parent && parent.parent.type === "ObjectPattern") { - if (parent.shorthand && parent.value.left && isInvalid(name)) { - + if (!ignoreDestructuring && parent.shorthand && parent.value.left && isInvalid(name)) { report(node); } @@ -197,7 +250,7 @@ module.exports = { } // never check properties or always ignore destructuring - if (!properties || (ignoreDestructuring && isInsideObjectPattern(node))) { + if ((!checkProperties && !parent.computed) || (ignoreDestructuring && isInsideObjectPattern(node))) { return; } @@ -214,10 +267,29 @@ module.exports = { report(node); } + } else if (parent.type === "PropertyDefinition") { + + if (checkClassFields && isInvalid(name)) { + report(node); + } + // Report anything that is invalid that isn't a CallExpression } else if (shouldReport(effectiveParent, name)) { report(node); } + }, + + "PrivateIdentifier"(node) { + + const isClassField = node.parent.type === "PropertyDefinition"; + + if (isClassField && !checkClassFields) { + return; + } + + if (isInvalid(node.name)) { + report(node); + } } }; diff --git a/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js index 409145e7d..c76596026 100644 --- a/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +++ b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -9,13 +9,13 @@ const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce the location of arrow function bodies", - category: "Stylistic Issues", + description: "Enforce the location of arrow function bodies", recommended: false, url: "https://eslint.org/docs/rules/implicit-arrow-linebreak" }, diff --git a/node_modules/eslint/lib/rules/indent-legacy.js b/node_modules/eslint/lib/rules/indent-legacy.js index a26ee87b1..d4793bd63 100644 --- a/node_modules/eslint/lib/rules/indent-legacy.js +++ b/node_modules/eslint/lib/rules/indent-legacy.js @@ -4,6 +4,7 @@ * This rule has been ported and modified from nodeca. * @author Vitaly Puzrin * @author Gyandeep Singh + * @deprecated in ESLint v4.0.0 */ "use strict"; @@ -17,15 +18,15 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - -/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */ +// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. +/* c8 ignore next */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent indentation", - category: "Stylistic Issues", + description: "Enforce consistent indentation", recommended: false, url: "https://eslint.org/docs/rules/indent-legacy" }, @@ -211,10 +212,10 @@ module.exports = { if (context.options[0] === "tab") { indentSize = 1; indentType = "tab"; - } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { + } else /* c8 ignore start */ if (typeof context.options[0] === "number") { indentSize = context.options[0]; indentType = "space"; - } + }/* c8 ignore stop */ if (context.options[1]) { const opts = context.options[1]; @@ -752,7 +753,7 @@ module.exports = { if (typeof options.CallExpression.arguments === "number") { nodeIndent += options.CallExpression.arguments * indentSize; } else if (options.CallExpression.arguments === "first") { - if (parent.arguments.indexOf(node) !== -1) { + if (parent.arguments.includes(node)) { nodeIndent = parent.arguments[0].loc.start.column; } } else { @@ -839,7 +840,7 @@ module.exports = { "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration", "TryStatement" ]; - if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { + if (node.parent && statementsWithProperties.includes(node.parent.type) && isNodeBodyBlock(node)) { indent = getNodeIndent(node.parent).goodChar; } else if (node.parent && node.parent.type === "CatchClause") { indent = getNodeIndent(node.parent.parent).goodChar; diff --git a/node_modules/eslint/lib/rules/indent.js b/node_modules/eslint/lib/rules/indent.js index 8f4079d31..cda02035a 100644 --- a/node_modules/eslint/lib/rules/indent.js +++ b/node_modules/eslint/lib/rules/indent.js @@ -12,9 +12,9 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); +const { OrderedMap } = require("js-sdsl"); + const astUtils = require("./utils/ast-utils"); -const createTree = require("functional-red-black-tree"); //------------------------------------------------------------------------------ // Rule Definition @@ -60,12 +60,15 @@ const KNOWN_NODES = new Set([ "NewExpression", "ObjectExpression", "ObjectPattern", + "PrivateIdentifier", "Program", "Property", + "PropertyDefinition", "RestElement", "ReturnStatement", "SequenceExpression", "SpreadElement", + "StaticBlock", "Super", "SwitchCase", "SwitchStatement", @@ -132,23 +135,18 @@ class BinarySearchTree { * Creates an empty tree */ constructor() { - this._rbTree = createTree(); + this._orderedMap = new OrderedMap(); + this._orderedMapEnd = this._orderedMap.end(); } /** * Inserts an entry into the tree. * @param {number} key The entry's key - * @param {*} value The entry's value + * @param {any} value The entry's value * @returns {void} */ insert(key, value) { - const iterator = this._rbTree.find(key); - - if (iterator.valid) { - this._rbTree = iterator.update(value); - } else { - this._rbTree = this._rbTree.insert(key, value); - } + this._orderedMap.setElement(key, value); } /** @@ -157,9 +155,13 @@ class BinarySearchTree { * @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists. */ findLe(key) { - const iterator = this._rbTree.le(key); + const iterator = this._orderedMap.reverseLowerBound(key); - return iterator && { key: iterator.key, value: iterator.value }; + if (iterator.equals(this._orderedMapEnd)) { + return {}; + } + + return { key: iterator.pointer[0], value: iterator.pointer[1] }; } /** @@ -174,11 +176,20 @@ class BinarySearchTree { if (start === end) { return; } - const iterator = this._rbTree.ge(start); + const iterator = this._orderedMap.lowerBound(start); + + if (iterator.equals(this._orderedMapEnd)) { + return; + } - while (iterator.valid && iterator.key < end) { - this._rbTree = this._rbTree.remove(iterator.key); - iterator.next(); + if (end > this._orderedMap.back()[0]) { + while (!iterator.equals(this._orderedMapEnd)) { + this._orderedMap.eraseElementByIterator(iterator); + } + } else { + while (iterator.pointer[0] < end) { + this._orderedMap.eraseElementByIterator(iterator); + } } } } @@ -188,7 +199,6 @@ class BinarySearchTree { */ class TokenInfo { - // eslint-disable-next-line jsdoc/require-description /** * @param {SourceCode} sourceCode A SourceCode object */ @@ -238,7 +248,6 @@ class TokenInfo { */ class OffsetStorage { - // eslint-disable-next-line jsdoc/require-description /** * @param {TokenInfo} tokenInfo a TokenInfo instance * @param {number} indentSize The desired size of each indentation level @@ -263,7 +272,7 @@ class OffsetStorage { /** * Sets the offset column of token B to match the offset column of token A. - * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In + * - **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In * most cases, `setDesiredOffset` should be used instead. * @param {Token} baseToken The first token * @param {Token} offsetToken The second token, whose offset should be matched to the first token @@ -352,11 +361,11 @@ class OffsetStorage { * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following * list could represent the state of the offset tree at a given point: * - * * Tokens starting in the interval [0, 15) are aligned with the beginning of the file - * * Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token - * * Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token - * * Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token - * * Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token + * - Tokens starting in the interval [0, 15) are aligned with the beginning of the file + * - Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token + * - Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token + * - Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token + * - Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token * * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: * `setDesiredOffsets([30, 43], fooToken, 1);` @@ -493,13 +502,13 @@ const ELEMENT_LIST_SCHEMA = { ] }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent indentation", - category: "Stylistic Issues", + description: "Enforce consistent indentation", recommended: false, url: "https://eslint.org/docs/rules/indent" }, @@ -584,6 +593,16 @@ module.exports = { }, additionalProperties: false }, + StaticBlock: { + type: "object", + properties: { + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, CallExpression: { type: "object", properties: { @@ -647,6 +666,9 @@ module.exports = { parameters: DEFAULT_PARAMETER_INDENT, body: DEFAULT_FUNCTION_BODY_INDENT }, + StaticBlock: { + body: DEFAULT_FUNCTION_BODY_INDENT + }, CallExpression: { arguments: DEFAULT_PARAMETER_INDENT }, @@ -782,7 +804,7 @@ module.exports = { let statement = node.parent && node.parent.parent; while ( - statement.type === "UnaryExpression" && ["!", "~", "+", "-"].indexOf(statement.operator) > -1 || + statement.type === "UnaryExpression" && ["!", "~", "+", "-"].includes(statement.operator) || statement.type === "AssignmentExpression" || statement.type === "LogicalExpression" || statement.type === "SequenceExpression" || @@ -902,18 +924,6 @@ module.exports = { } offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1); - - /* - * For blockless nodes with semicolon-first style, don't indent the semicolon. - * e.g. - * if (foo) bar() - * ; [1, 2, 3].map(foo) - */ - const lastToken = sourceCode.getLastToken(node); - - if (node.type !== "EmptyStatement" && astUtils.isSemicolonToken(lastToken)) { - offsets.setDesiredOffset(lastToken, lastParentToken, 0); - } } } @@ -1068,7 +1078,7 @@ module.exports = { const baseOffsetListeners = { "ArrayExpression, ArrayPattern"(node) { const openingBracket = sourceCode.getFirstToken(node); - const closingBracket = sourceCode.getTokenAfter(lodash.findLast(node.elements) || openingBracket, astUtils.isClosingBracketToken); + const closingBracket = sourceCode.getTokenAfter([...node.elements].reverse().find(_ => _) || openingBracket, astUtils.isClosingBracketToken); addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression); }, @@ -1177,8 +1187,7 @@ module.exports = { offsets.setDesiredOffset(questionMarkToken, firstToken, 1); offsets.setDesiredOffset(colonToken, firstToken, 1); - offsets.setDesiredOffset(firstConsequentToken, firstToken, - firstConsequentToken.type === "Punctuator" && + offsets.setDesiredOffset(firstConsequentToken, firstToken, firstConsequentToken.type === "Punctuator" && options.offsetTernaryExpressions ? 2 : 1); /* @@ -1204,14 +1213,13 @@ module.exports = { * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up * having no expected indentation. */ - offsets.setDesiredOffset(firstAlternateToken, firstToken, - firstAlternateToken.type === "Punctuator" && + offsets.setDesiredOffset(firstAlternateToken, firstToken, firstAlternateToken.type === "Punctuator" && options.offsetTernaryExpressions ? 2 : 1); } } }, - "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body), + "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement": node => addBlocklessNodeIndent(node.body), ExportNamedDeclaration(node) { if (node.declaration === null) { @@ -1259,6 +1267,50 @@ module.exports = { } }, + /* + * For blockless nodes with semicolon-first style, don't indent the semicolon. + * e.g. + * if (foo) + * bar() + * ; [1, 2, 3].map(foo) + * + * Traversal into the node sets indentation of the semicolon, so we need to override it on exit. + */ + ":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(node) { + let nodesToCheck; + + if (node.type === "IfStatement") { + nodesToCheck = [node.consequent]; + if (node.alternate) { + nodesToCheck.push(node.alternate); + } + } else { + nodesToCheck = [node.body]; + } + + for (const nodeToCheck of nodesToCheck) { + const lastToken = sourceCode.getLastToken(nodeToCheck); + + if (astUtils.isSemicolonToken(lastToken)) { + const tokenBeforeLast = sourceCode.getTokenBefore(lastToken); + const tokenAfterLast = sourceCode.getTokenAfter(lastToken); + + // override indentation of `;` only if its line looks like a semicolon-first style line + if ( + !astUtils.isTokenOnSameLine(tokenBeforeLast, lastToken) && + tokenAfterLast && + astUtils.isTokenOnSameLine(lastToken, tokenAfterLast) + ) { + offsets.setDesiredOffset( + lastToken, + sourceCode.getFirstToken(node), + 0 + ); + } + } + } + }, + ImportDeclaration(node) { if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) { const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken); @@ -1361,6 +1413,52 @@ module.exports = { } }, + PropertyDefinition(node) { + const firstToken = sourceCode.getFirstToken(node); + const maybeSemicolonToken = sourceCode.getLastToken(node); + let keyLastToken = null; + + // Indent key. + if (node.computed) { + const bracketTokenL = sourceCode.getTokenBefore(node.key, astUtils.isOpeningBracketToken); + const bracketTokenR = keyLastToken = sourceCode.getTokenAfter(node.key, astUtils.isClosingBracketToken); + const keyRange = [bracketTokenL.range[1], bracketTokenR.range[0]]; + + if (bracketTokenL !== firstToken) { + offsets.setDesiredOffset(bracketTokenL, firstToken, 0); + } + offsets.setDesiredOffsets(keyRange, bracketTokenL, 1); + offsets.setDesiredOffset(bracketTokenR, bracketTokenL, 0); + } else { + const idToken = keyLastToken = sourceCode.getFirstToken(node.key); + + if (idToken !== firstToken) { + offsets.setDesiredOffset(idToken, firstToken, 1); + } + } + + // Indent initializer. + if (node.value) { + const eqToken = sourceCode.getTokenBefore(node.value, astUtils.isEqToken); + const valueToken = sourceCode.getTokenAfter(eqToken); + + offsets.setDesiredOffset(eqToken, keyLastToken, 1); + offsets.setDesiredOffset(valueToken, eqToken, 1); + if (astUtils.isSemicolonToken(maybeSemicolonToken)) { + offsets.setDesiredOffset(maybeSemicolonToken, eqToken, 1); + } + } else if (astUtils.isSemicolonToken(maybeSemicolonToken)) { + offsets.setDesiredOffset(maybeSemicolonToken, keyLastToken, 1); + } + }, + + StaticBlock(node) { + const openingCurly = sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + const closingCurly = sourceCode.getLastToken(node); + + addElementListIndent(node.body, openingCurly, closingCurly, options.StaticBlock.body); + }, + SwitchStatement(node) { const openingCurly = sourceCode.getTokenAfter(node.discriminant, astUtils.isOpeningBraceToken); const closingCurly = sourceCode.getLastToken(node); @@ -1560,8 +1658,9 @@ module.exports = { * 2. Don't set any offsets against the first token of the node. * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. */ - const offsetListeners = lodash.mapValues( - baseOffsetListeners, + const offsetListeners = {}; + + for (const [selector, listener] of Object.entries(baseOffsetListeners)) { /* * Offset listener calls are deferred until traversal is finished, and are called as @@ -1579,10 +1678,8 @@ module.exports = { * To avoid this, the `Identifier` listener isn't called until traversal finishes and all * ignored nodes are known. */ - listener => - node => - listenerCallQueue.push({ listener, node }) - ); + offsetListeners[selector] = node => listenerCallQueue.push({ listener, node }); + } // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. const ignoredNodes = new Set(); diff --git a/node_modules/eslint/lib/rules/index.js b/node_modules/eslint/lib/rules/index.js index 35af38fd1..e42639656 100644 --- a/node_modules/eslint/lib/rules/index.js +++ b/node_modules/eslint/lib/rules/index.js @@ -6,7 +6,7 @@ "use strict"; -/* eslint sort-keys: ["error", "asc"] */ +/* eslint sort-keys: ["error", "asc"] -- More readable for long list */ const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map"); @@ -72,6 +72,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "lines-around-comment": () => require("./lines-around-comment"), "lines-around-directive": () => require("./lines-around-directive"), "lines-between-class-members": () => require("./lines-between-class-members"), + "logical-assignment-operators": () => require("./logical-assignment-operators"), "max-classes-per-file": () => require("./max-classes-per-file"), "max-depth": () => require("./max-depth"), "max-len": () => require("./max-len"), @@ -103,6 +104,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "no-confusing-arrow": () => require("./no-confusing-arrow"), "no-console": () => require("./no-console"), "no-const-assign": () => require("./no-const-assign"), + "no-constant-binary-expression": () => require("./no-constant-binary-expression"), "no-constant-condition": () => require("./no-constant-condition"), "no-constructor-return": () => require("./no-constructor-return"), "no-continue": () => require("./no-continue"), @@ -121,6 +123,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "no-empty-character-class": () => require("./no-empty-character-class"), "no-empty-function": () => require("./no-empty-function"), "no-empty-pattern": () => require("./no-empty-pattern"), + "no-empty-static-block": () => require("./no-empty-static-block"), "no-eq-null": () => require("./no-eq-null"), "no-eval": () => require("./no-eval"), "no-ex-assign": () => require("./no-ex-assign"), @@ -165,6 +168,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "no-nested-ternary": () => require("./no-nested-ternary"), "no-new": () => require("./no-new"), "no-new-func": () => require("./no-new-func"), + "no-new-native-nonconstructor": () => require("./no-new-native-nonconstructor"), "no-new-object": () => require("./no-new-object"), "no-new-require": () => require("./no-new-require"), "no-new-symbol": () => require("./no-new-symbol"), @@ -221,6 +225,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "no-unsafe-optional-chaining": () => require("./no-unsafe-optional-chaining"), "no-unused-expressions": () => require("./no-unused-expressions"), "no-unused-labels": () => require("./no-unused-labels"), + "no-unused-private-class-members": () => require("./no-unused-private-class-members"), "no-unused-vars": () => require("./no-unused-vars"), "no-use-before-define": () => require("./no-use-before-define"), "no-useless-backreference": () => require("./no-useless-backreference"), @@ -254,6 +259,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"), "prefer-named-capture-group": () => require("./prefer-named-capture-group"), "prefer-numeric-literals": () => require("./prefer-numeric-literals"), + "prefer-object-has-own": () => require("./prefer-object-has-own"), "prefer-object-spread": () => require("./prefer-object-spread"), "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"), "prefer-reflect": () => require("./prefer-reflect"), diff --git a/node_modules/eslint/lib/rules/init-declarations.js b/node_modules/eslint/lib/rules/init-declarations.js index 6cfdf92c9..b2ddf64fb 100644 --- a/node_modules/eslint/lib/rules/init-declarations.js +++ b/node_modules/eslint/lib/rules/init-declarations.js @@ -42,13 +42,13 @@ function isInitialized(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require or disallow initialization in variable declarations", - category: "Variables", + description: "Require or disallow initialization in variable declarations", recommended: false, url: "https://eslint.org/docs/rules/init-declarations" }, diff --git a/node_modules/eslint/lib/rules/jsx-quotes.js b/node_modules/eslint/lib/rules/jsx-quotes.js index 3b282df2f..6745bb64b 100644 --- a/node_modules/eslint/lib/rules/jsx-quotes.js +++ b/node_modules/eslint/lib/rules/jsx-quotes.js @@ -36,13 +36,13 @@ const QUOTE_SETTINGS = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce the consistent use of either double or single quotes in JSX attributes", - category: "Stylistic Issues", + description: "Enforce the consistent use of either double or single quotes in JSX attributes", recommended: false, url: "https://eslint.org/docs/rules/jsx-quotes" }, @@ -70,7 +70,7 @@ module.exports = { * @public */ function usesExpectedQuotes(node) { - return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote); + return node.value.includes(setting.quote) || astUtils.isSurroundedBy(node.raw, setting.quote); } return { diff --git a/node_modules/eslint/lib/rules/key-spacing.js b/node_modules/eslint/lib/rules/key-spacing.js index fc885a117..b0491b95f 100644 --- a/node_modules/eslint/lib/rules/key-spacing.js +++ b/node_modules/eslint/lib/rules/key-spacing.js @@ -9,6 +9,9 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); +const GraphemeSplitter = require("grapheme-splitter"); + +const splitter = new GraphemeSplitter(); //------------------------------------------------------------------------------ // Helpers @@ -133,13 +136,13 @@ function initOptions(toOptions, fromOptions) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing between keys and values in object literal properties", - category: "Stylistic Issues", + description: "Enforce consistent spacing between keys and values in object literal properties", recommended: false, url: "https://eslint.org/docs/rules/key-spacing" }, @@ -331,6 +334,53 @@ module.exports = { const sourceCode = context.getSourceCode(); + /** + * Determines if the given property is key-value property. + * @param {ASTNode} property Property node to check. + * @returns {boolean} Whether the property is a key-value property. + */ + function isKeyValueProperty(property) { + return !( + (property.method || + property.shorthand || + property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadElement" + ); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The colon punctuator. + */ + function getNextColon(node) { + return sourceCode.getTokenAfter(node, astUtils.isColonToken); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The last token before a colon punctuator. + */ + function getLastTokenBeforeColon(node) { + const colonToken = getNextColon(node); + + return sourceCode.getTokenBefore(colonToken); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the first token after a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The first token after a colon punctuator. + */ + function getFirstTokenAfterColon(node) { + const colonToken = getNextColon(node); + + return sourceCode.getTokenAfter(colonToken); + } + /** * Checks whether a property is a member of the property group it follows. * @param {ASTNode} lastMember The last Property known to be in the group. @@ -339,9 +389,9 @@ module.exports = { */ function continuesPropertyGroup(lastMember, candidate) { const groupEndLine = lastMember.loc.start.line, - candidateStartLine = candidate.loc.start.line; + candidateValueStartLine = (isKeyValueProperty(candidate) ? getFirstTokenAfterColon(candidate.key) : candidate).loc.start.line; - if (candidateStartLine - groupEndLine <= 1) { + if (candidateValueStartLine - groupEndLine <= 1) { return true; } @@ -355,7 +405,7 @@ module.exports = { if ( leadingComments.length && leadingComments[0].loc.start.line - groupEndLine <= 1 && - candidateStartLine - last(leadingComments).loc.end.line <= 1 + candidateValueStartLine - last(leadingComments).loc.end.line <= 1 ) { for (let i = 1; i < leadingComments.length; i++) { if (leadingComments[i].loc.start.line - leadingComments[i - 1].loc.end.line > 1) { @@ -368,41 +418,6 @@ module.exports = { return false; } - /** - * Determines if the given property is key-value property. - * @param {ASTNode} property Property node to check. - * @returns {boolean} Whether the property is a key-value property. - */ - function isKeyValueProperty(property) { - return !( - (property.method || - property.shorthand || - property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadElement" - ); - } - - /** - * Starting from the given a node (a property.key node here) looks forward - * until it finds the last token before a colon punctuator and returns it. - * @param {ASTNode} node The node to start looking from. - * @returns {ASTNode} The last token before a colon punctuator. - */ - function getLastTokenBeforeColon(node) { - const colonToken = sourceCode.getTokenAfter(node, astUtils.isColonToken); - - return sourceCode.getTokenBefore(colonToken); - } - - /** - * Starting from the given a node (a property.key node here) looks forward - * until it finds the colon punctuator and returns it. - * @param {ASTNode} node The node to start looking from. - * @returns {ASTNode} The colon punctuator. - */ - function getNextColon(node) { - return sourceCode.getTokenAfter(node, astUtils.isColonToken); - } - /** * Gets an object literal property's key as the identifier name or string value. * @param {ASTNode} property Property node whose key to retrieve. @@ -428,19 +443,7 @@ module.exports = { * @returns {void} */ function report(property, side, whitespace, expected, mode) { - const diff = whitespace.length - expected, - nextColon = getNextColon(property.key), - tokenBeforeColon = sourceCode.getTokenBefore(nextColon, { includeComments: true }), - tokenAfterColon = sourceCode.getTokenAfter(nextColon, { includeComments: true }), - isKeySide = side === "key", - isExtra = diff > 0, - diffAbs = Math.abs(diff), - spaces = Array(diffAbs + 1).join(" "); - - const locStart = isKeySide ? tokenBeforeColon.loc.end : nextColon.loc.start; - const locEnd = isKeySide ? nextColon.loc.start : tokenAfterColon.loc.start; - const missingLoc = isKeySide ? tokenBeforeColon.loc : tokenAfterColon.loc; - const loc = isExtra ? { start: locStart, end: locEnd } : missingLoc; + const diff = whitespace.length - expected; if (( diff && mode === "strict" || @@ -448,6 +451,19 @@ module.exports = { diff > 0 && !expected && mode === "minimum") && !(expected && containsLineTerminator(whitespace)) ) { + const nextColon = getNextColon(property.key), + tokenBeforeColon = sourceCode.getTokenBefore(nextColon, { includeComments: true }), + tokenAfterColon = sourceCode.getTokenAfter(nextColon, { includeComments: true }), + isKeySide = side === "key", + isExtra = diff > 0, + diffAbs = Math.abs(diff), + spaces = Array(diffAbs + 1).join(" "); + + const locStart = isKeySide ? tokenBeforeColon.loc.end : nextColon.loc.start; + const locEnd = isKeySide ? nextColon.loc.start : tokenAfterColon.loc.start; + const missingLoc = isKeySide ? tokenBeforeColon.loc : tokenAfterColon.loc; + const loc = isExtra ? { start: locStart, end: locEnd } : missingLoc; + let fix; if (isExtra) { @@ -507,7 +523,7 @@ module.exports = { const startToken = sourceCode.getFirstToken(property); const endToken = getLastTokenBeforeColon(property.key); - return endToken.range[1] - startToken.range[0]; + return splitter.countGraphemes(sourceCode.getText().slice(startToken.range[0], endToken.range[1])); } /** @@ -531,8 +547,8 @@ module.exports = { /** * Creates groups of properties. - * @param {ASTNode} node ObjectExpression node being evaluated. - * @returns {Array.} Groups of property AST node lists. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {Array} Groups of property AST node lists. */ function createGroups(node) { if (node.properties.length === 1) { @@ -600,7 +616,7 @@ module.exports = { /** * Verifies spacing of property conforms to specified options. - * @param {ASTNode} node Property node being evaluated. + * @param {ASTNode} node Property node being evaluated. * @param {Object} lineOptions Configured singleLine or multiLine options * @returns {void} */ @@ -629,7 +645,7 @@ module.exports = { /** * Verifies vertical alignment, taking into account groups of properties. - * @param {ASTNode} node ObjectExpression node being evaluated. + * @param {ASTNode} node ObjectExpression node being evaluated. * @returns {void} */ function verifyAlignment(node) { diff --git a/node_modules/eslint/lib/rules/keyword-spacing.js b/node_modules/eslint/lib/rules/keyword-spacing.js index 913cf4682..59a500f5b 100644 --- a/node_modules/eslint/lib/rules/keyword-spacing.js +++ b/node_modules/eslint/lib/rules/keyword-spacing.js @@ -22,7 +22,7 @@ const PREV_TOKEN_M = /^[)\]}>*]$/u; const NEXT_TOKEN_M = /^[{*]$/u; const TEMPLATE_OPEN_PAREN = /\$\{$/u; const TEMPLATE_CLOSE_PAREN = /^\}/u; -const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template)$/u; +const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u; const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]); // check duplications. @@ -61,13 +61,13 @@ function isCloseParenOfTemplate(token) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before and after keywords", - category: "Stylistic Issues", + description: "Enforce consistent spacing before and after keywords", recommended: false, url: "https://eslint.org/docs/rules/keyword-spacing" }, @@ -110,6 +110,8 @@ module.exports = { create(context) { const sourceCode = context.getSourceCode(); + const tokensToIgnore = new WeakSet(); + /** * Reports a given token if there are not space(s) before the token. * @param {Token} token A token to report. @@ -122,6 +124,7 @@ module.exports = { if (prevToken && (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && !isOpenParenOfTemplate(prevToken) && + !tokensToIgnore.has(prevToken) && astUtils.isTokenOnSameLine(prevToken, token) && !sourceCode.isSpaceBetweenTokens(prevToken, token) ) { @@ -148,6 +151,7 @@ module.exports = { if (prevToken && (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && !isOpenParenOfTemplate(prevToken) && + !tokensToIgnore.has(prevToken) && astUtils.isTokenOnSameLine(prevToken, token) && sourceCode.isSpaceBetweenTokens(prevToken, token) ) { @@ -174,6 +178,7 @@ module.exports = { if (nextToken && (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && !isCloseParenOfTemplate(nextToken) && + !tokensToIgnore.has(nextToken) && astUtils.isTokenOnSameLine(token, nextToken) && !sourceCode.isSpaceBetweenTokens(token, nextToken) ) { @@ -200,6 +205,7 @@ module.exports = { if (nextToken && (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && !isCloseParenOfTemplate(nextToken) && + !tokensToIgnore.has(nextToken) && astUtils.isTokenOnSameLine(token, nextToken) && sourceCode.isSpaceBetweenTokens(token, nextToken) ) { @@ -403,7 +409,15 @@ module.exports = { */ function checkSpacingForForInStatement(node) { checkSpacingAroundFirstToken(node); - checkSpacingAroundTokenBefore(node.right); + + const inToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); + const previousToken = sourceCode.getTokenBefore(inToken); + + if (previousToken.type !== "PrivateIdentifier") { + checkSpacingBefore(inToken); + } + + checkSpacingAfter(inToken); } /** @@ -419,7 +433,15 @@ module.exports = { } else { checkSpacingAroundFirstToken(node); } - checkSpacingAround(sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken)); + + const ofToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); + const previousToken = sourceCode.getTokenBefore(ofToken); + + if (previousToken.type !== "PrivateIdentifier") { + checkSpacingBefore(ofToken); + } + + checkSpacingAfter(ofToken); } /** @@ -447,6 +469,7 @@ module.exports = { const asToken = sourceCode.getTokenBefore(node.exported); checkSpacingBefore(asToken, PREV_TOKEN_M); + checkSpacingAfter(asToken, NEXT_TOKEN_M); } if (node.source) { @@ -457,6 +480,35 @@ module.exports = { } } + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node An `ImportSpecifier` node to check. + * @returns {void} + */ + function checkSpacingForImportSpecifier(node) { + if (node.imported.range[0] !== node.local.range[0]) { + const asToken = sourceCode.getTokenBefore(node.local); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node An `ExportSpecifier` node to check. + * @returns {void} + */ + function checkSpacingForExportSpecifier(node) { + if (node.local.range[0] !== node.exported.range[0]) { + const asToken = sourceCode.getTokenBefore(node.exported); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + checkSpacingAfter(asToken, NEXT_TOKEN_M); + } + } + /** * Reports `as` keyword of a given node if usage of spacing around this * keyword is invalid. @@ -473,6 +525,7 @@ module.exports = { * Reports `static`, `get`, and `set` keywords of a given node if usage of * spacing around those keywords is invalid. * @param {ASTNode} node A node to report. + * @throws {Error} If unable to find token get, set, or async beside method name. * @returns {void} */ function checkSpacingForProperty(node) { @@ -565,9 +618,20 @@ module.exports = { YieldExpression: checkSpacingBeforeFirstToken, // Others + ImportSpecifier: checkSpacingForImportSpecifier, + ExportSpecifier: checkSpacingForExportSpecifier, ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier, MethodDefinition: checkSpacingForProperty, - Property: checkSpacingForProperty + PropertyDefinition: checkSpacingForProperty, + StaticBlock: checkSpacingAroundFirstToken, + Property: checkSpacingForProperty, + + // To avoid conflicts with `space-infix-ops`, e.g. `a > this.b` + "BinaryExpression[operator='>']"(node) { + const operatorToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); + + tokensToIgnore.add(operatorToken); + } }; } }; diff --git a/node_modules/eslint/lib/rules/line-comment-position.js b/node_modules/eslint/lib/rules/line-comment-position.js index 77ee147cb..0631ebe6f 100644 --- a/node_modules/eslint/lib/rules/line-comment-position.js +++ b/node_modules/eslint/lib/rules/line-comment-position.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce position of line comments", - category: "Stylistic Issues", + description: "Enforce position of line comments", recommended: false, url: "https://eslint.org/docs/rules/line-comment-position" }, diff --git a/node_modules/eslint/lib/rules/linebreak-style.js b/node_modules/eslint/lib/rules/linebreak-style.js index b3b393ead..a5dc39d79 100644 --- a/node_modules/eslint/lib/rules/linebreak-style.js +++ b/node_modules/eslint/lib/rules/linebreak-style.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent linebreak style", - category: "Stylistic Issues", + description: "Enforce consistent linebreak style", recommended: false, url: "https://eslint.org/docs/rules/linebreak-style" }, diff --git a/node_modules/eslint/lib/rules/lines-around-comment.js b/node_modules/eslint/lib/rules/lines-around-comment.js index 6806e793c..ece43b141 100644 --- a/node_modules/eslint/lib/rules/lines-around-comment.js +++ b/node_modules/eslint/lib/rules/lines-around-comment.js @@ -15,7 +15,7 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ /** - * Return an array with with any line numbers that are empty. + * Return an array with any line numbers that are empty. * @param {Array} lines An array of each line of the file. * @returns {Array} An array of line numbers. */ @@ -29,7 +29,7 @@ function getEmptyLineNums(lines) { } /** - * Return an array with with any line numbers that contain comments. + * Return an array with any line numbers that contain comments. * @param {Array} comments An array of comment tokens. * @returns {Array} An array of line numbers. */ @@ -49,13 +49,13 @@ function getCommentLineNums(comments) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require empty lines around comments", - category: "Stylistic Issues", + description: "Require empty lines around comments", recommended: false, url: "https://eslint.org/docs/rules/lines-around-comment" }, @@ -113,6 +113,10 @@ module.exports = { }, applyDefaultIgnorePatterns: { type: "boolean" + }, + afterHashbangComment: { + type: "boolean", + default: false } }, additionalProperties: false @@ -141,7 +145,7 @@ module.exports = { comments = sourceCode.getAllComments(), commentLines = getCommentLineNums(comments), emptyLines = getEmptyLineNums(lines), - commentAndEmptyLines = commentLines.concat(emptyLines); + commentAndEmptyLines = new Set(commentLines.concat(emptyLines)); /** * Returns whether or not comments are on lines starting with or ending with code @@ -186,10 +190,39 @@ module.exports = { /** * Returns the parent node that contains the given token. * @param {token} token The token to check. - * @returns {ASTNode} The parent node that contains the given token. + * @returns {ASTNode|null} The parent node that contains the given token. */ function getParentNodeOfToken(token) { - return sourceCode.getNodeByRangeIndex(token.range[0]); + const node = sourceCode.getNodeByRangeIndex(token.range[0]); + + /* + * For the purpose of this rule, the comment token is in a `StaticBlock` node only + * if it's inside the braces of that `StaticBlock` node. + * + * Example where this function returns `null`: + * + * static + * // comment + * { + * } + * + * Example where this function returns `StaticBlock` node: + * + * static + * { + * // comment + * } + * + */ + if (node && node.type === "StaticBlock") { + const openingBrace = sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + + return token.range[0] >= openingBrace.range[0] + ? node + : null; + } + + return node; } /** @@ -201,8 +234,21 @@ module.exports = { function isCommentAtParentStart(token, nodeType) { const parent = getParentNodeOfToken(token); - return parent && isParentNodeType(parent, nodeType) && - token.loc.start.line - parent.loc.start.line === 1; + if (parent && isParentNodeType(parent, nodeType)) { + let parentStartNodeOrToken = parent; + + if (parent.type === "StaticBlock") { + parentStartNodeOrToken = sourceCode.getFirstToken(parent, { skip: 1 }); // opening brace of the static block + } else if (parent.type === "SwitchStatement") { + parentStartNodeOrToken = sourceCode.getTokenAfter(parent.discriminant, { + filter: astUtils.isOpeningBraceToken + }); // opening brace of the switch statement + } + + return token.loc.start.line - parentStartNodeOrToken.loc.start.line === 1; + } + + return false; } /** @@ -214,7 +260,7 @@ module.exports = { function isCommentAtParentEnd(token, nodeType) { const parent = getParentNodeOfToken(token); - return parent && isParentNodeType(parent, nodeType) && + return !!parent && isParentNodeType(parent, nodeType) && parent.loc.end.line - token.loc.end.line === 1; } @@ -224,7 +270,13 @@ module.exports = { * @returns {boolean} True if the comment is at block start. */ function isCommentAtBlockStart(token) { - return isCommentAtParentStart(token, "ClassBody") || isCommentAtParentStart(token, "BlockStatement") || isCommentAtParentStart(token, "SwitchCase"); + return ( + isCommentAtParentStart(token, "ClassBody") || + isCommentAtParentStart(token, "BlockStatement") || + isCommentAtParentStart(token, "StaticBlock") || + isCommentAtParentStart(token, "SwitchCase") || + isCommentAtParentStart(token, "SwitchStatement") + ); } /** @@ -233,7 +285,13 @@ module.exports = { * @returns {boolean} True if the comment is at block end. */ function isCommentAtBlockEnd(token) { - return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement"); + return ( + isCommentAtParentEnd(token, "ClassBody") || + isCommentAtParentEnd(token, "BlockStatement") || + isCommentAtParentEnd(token, "StaticBlock") || + isCommentAtParentEnd(token, "SwitchCase") || + isCommentAtParentEnd(token, "SwitchStatement") + ); } /** @@ -346,7 +404,7 @@ module.exports = { const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true }); // check for newline before - if (!exceptionStartAllowed && before && !commentAndEmptyLines.includes(prevLineNum) && + if (!exceptionStartAllowed && before && !commentAndEmptyLines.has(prevLineNum) && !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) { const lineStart = token.range[0] - token.loc.start.column; const range = [lineStart, lineStart]; @@ -361,7 +419,7 @@ module.exports = { } // check for newline after - if (!exceptionEndAllowed && after && !commentAndEmptyLines.includes(nextLineNum) && + if (!exceptionEndAllowed && after && !commentAndEmptyLines.has(nextLineNum) && !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { context.report({ node: token, @@ -395,6 +453,13 @@ module.exports = { before: options.beforeBlockComment }); } + } else if (token.type === "Shebang") { + if (options.afterHashbangComment) { + checkForEmptyLine(token, { + after: options.afterHashbangComment, + before: false + }); + } } }); } diff --git a/node_modules/eslint/lib/rules/lines-around-directive.js b/node_modules/eslint/lib/rules/lines-around-directive.js index fb439dad6..816efc979 100644 --- a/node_modules/eslint/lib/rules/lines-around-directive.js +++ b/node_modules/eslint/lib/rules/lines-around-directive.js @@ -1,7 +1,7 @@ /** * @fileoverview Require or disallow newlines around directives. * @author Kai Cataldo - * @deprecated + * @deprecated in ESLint v4.0.0 */ "use strict"; @@ -12,13 +12,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow newlines around directives", - category: "Stylistic Issues", + description: "Require or disallow newlines around directives", recommended: false, url: "https://eslint.org/docs/rules/lines-around-directive" }, diff --git a/node_modules/eslint/lib/rules/lines-between-class-members.js b/node_modules/eslint/lib/rules/lines-between-class-members.js index 972353036..26357aa3d 100644 --- a/node_modules/eslint/lib/rules/lines-between-class-members.js +++ b/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -4,19 +4,23 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow an empty line between class members", - category: "Stylistic Issues", + description: "Require or disallow an empty line between class members", recommended: false, url: "https://eslint.org/docs/rules/lines-between-class-members" }, @@ -53,6 +57,51 @@ module.exports = { const sourceCode = context.getSourceCode(); + /** + * Gets a pair of tokens that should be used to check lines between two class member nodes. + * + * In most cases, this returns the very last token of the current node and + * the very first token of the next node. + * For example: + * + * class C { + * x = 1; // curLast: `;` nextFirst: `in` + * in = 2 + * } + * + * There is only one exception. If the given node ends with a semicolon, and it looks like + * a semicolon-less style's semicolon - one that is not on the same line as the preceding + * token, but is on the line where the next class member starts - this returns the preceding + * token and the semicolon as boundary tokens. + * For example: + * + * class C { + * x = 1 // curLast: `1` nextFirst: `;` + * ;in = 2 + * } + * When determining the desired layout of the code, we should treat this semicolon as + * a part of the next class member node instead of the one it technically belongs to. + * @param {ASTNode} curNode Current class member node. + * @param {ASTNode} nextNode Next class member node. + * @returns {Token} The actual last token of `node`. + * @private + */ + function getBoundaryTokens(curNode, nextNode) { + const lastToken = sourceCode.getLastToken(curNode); + const prevToken = sourceCode.getTokenBefore(lastToken); + const nextToken = sourceCode.getFirstToken(nextNode); // skip possible lone `;` between nodes + + const isSemicolonLessStyle = ( + astUtils.isSemicolonToken(lastToken) && + !astUtils.isTokenOnSameLine(prevToken, lastToken) && + astUtils.isTokenOnSameLine(lastToken, nextToken) + ); + + return isSemicolonLessStyle + ? { curLast: prevToken, nextFirst: lastToken } + : { curLast: lastToken, nextFirst: nextToken }; + } + /** * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member. * @param {Token} prevLastToken The last token in the previous member node. @@ -101,8 +150,7 @@ module.exports = { for (let i = 0; i < body.length - 1; i++) { const curFirst = sourceCode.getFirstToken(body[i]); - const curLast = sourceCode.getLastToken(body[i]); - const nextFirst = sourceCode.getFirstToken(body[i + 1]); + const { curLast, nextFirst } = getBoundaryTokens(body[i], body[i + 1]); const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast); const skip = !isMulti && options[1].exceptAfterSingleLine; const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1); diff --git a/node_modules/eslint/lib/rules/logical-assignment-operators.js b/node_modules/eslint/lib/rules/logical-assignment-operators.js new file mode 100644 index 000000000..cd533e63a --- /dev/null +++ b/node_modules/eslint/lib/rules/logical-assignment-operators.js @@ -0,0 +1,474 @@ +/** + * @fileoverview Rule to replace assignment expressions with logical operator assignment + * @author Daniel Martens + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const baseTypes = new Set(["Identifier", "Super", "ThisExpression"]); + +/** + * Returns true iff either "undefined" or a void expression (eg. "void 0") + * @param {ASTNode} expression Expression to check + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff "undefined" or "void ..." + */ +function isUndefined(expression, scope) { + if (expression.type === "Identifier" && expression.name === "undefined") { + return astUtils.isReferenceToGlobalVariable(scope, expression); + } + + return expression.type === "UnaryExpression" && + expression.operator === "void" && + expression.argument.type === "Literal" && + expression.argument.value === 0; +} + +/** + * Returns true iff the reference is either an identifier or member expression + * @param {ASTNode} expression Expression to check + * @returns {boolean} True for identifiers and member expressions + */ +function isReference(expression) { + return (expression.type === "Identifier" && expression.name !== "undefined") || + expression.type === "MemberExpression"; +} + +/** + * Returns true iff the expression checks for nullish with loose equals. + * Examples: value == null, value == void 0 + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff implicit nullish comparison + */ +function isImplicitNullishComparison(expression, scope) { + if (expression.type !== "BinaryExpression" || expression.operator !== "==") { + return false; + } + + const reference = isReference(expression.left) ? "left" : "right"; + const nullish = reference === "left" ? "right" : "left"; + + return isReference(expression[reference]) && + (astUtils.isNullLiteral(expression[nullish]) || isUndefined(expression[nullish], scope)); +} + +/** + * Condition with two equal comparisons. + * @param {ASTNode} expression Condition + * @returns {boolean} True iff matches ? === ? || ? === ? + */ +function isDoubleComparison(expression) { + return expression.type === "LogicalExpression" && + expression.operator === "||" && + expression.left.type === "BinaryExpression" && + expression.left.operator === "===" && + expression.right.type === "BinaryExpression" && + expression.right.operator === "==="; +} + +/** + * Returns true iff the expression checks for undefined and null. + * Example: value === null || value === undefined + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff explicit nullish comparison + */ +function isExplicitNullishComparison(expression, scope) { + if (!isDoubleComparison(expression)) { + return false; + } + const leftReference = isReference(expression.left.left) ? "left" : "right"; + const leftNullish = leftReference === "left" ? "right" : "left"; + const rightReference = isReference(expression.right.left) ? "left" : "right"; + const rightNullish = rightReference === "left" ? "right" : "left"; + + return astUtils.isSameReference(expression.left[leftReference], expression.right[rightReference]) && + ((astUtils.isNullLiteral(expression.left[leftNullish]) && isUndefined(expression.right[rightNullish], scope)) || + (isUndefined(expression.left[leftNullish], scope) && astUtils.isNullLiteral(expression.right[rightNullish]))); +} + +/** + * Returns true for Boolean(arg) calls + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} Whether the expression is a boolean cast + */ +function isBooleanCast(expression, scope) { + return expression.type === "CallExpression" && + expression.callee.name === "Boolean" && + expression.arguments.length === 1 && + astUtils.isReferenceToGlobalVariable(scope, expression.callee); +} + +/** + * Returns true for: + * truthiness checks: value, Boolean(value), !!value + * falsiness checks: !value, !Boolean(value) + * nullish checks: value == null, value === undefined || value === null + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {?{ reference: ASTNode, operator: '??'|'||'|'&&'}} Null if not a known existence + */ +function getExistence(expression, scope) { + const isNegated = expression.type === "UnaryExpression" && expression.operator === "!"; + const base = isNegated ? expression.argument : expression; + + switch (true) { + case isReference(base): + return { reference: base, operator: isNegated ? "||" : "&&" }; + case base.type === "UnaryExpression" && base.operator === "!" && isReference(base.argument): + return { reference: base.argument, operator: "&&" }; + case isBooleanCast(base, scope) && isReference(base.arguments[0]): + return { reference: base.arguments[0], operator: isNegated ? "||" : "&&" }; + case isImplicitNullishComparison(expression, scope): + return { reference: isReference(expression.left) ? expression.left : expression.right, operator: "??" }; + case isExplicitNullishComparison(expression, scope): + return { reference: isReference(expression.left.left) ? expression.left.left : expression.left.right, operator: "??" }; + default: return null; + } +} + +/** + * Returns true iff the node is inside a with block + * @param {ASTNode} node Node to check + * @returns {boolean} True iff passed node is inside a with block + */ +function isInsideWithBlock(node) { + if (node.type === "Program") { + return false; + } + + return node.parent.type === "WithStatement" && node.parent.body === node ? true : isInsideWithBlock(node.parent); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Require or disallow logical assignment logical operator shorthand", + recommended: false, + url: "https://eslint.org/docs/rules/logical-assignment-operators" + }, + + schema: { + type: "array", + oneOf: [{ + items: [ + { const: "always" }, + { + type: "object", + properties: { + enforceForIfStatements: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, // 0 for allowing passing no options + maxItems: 2 + }, { + items: [{ const: "never" }], + minItems: 1, + maxItems: 1 + }] + }, + fixable: "code", + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- Does not detect conditional suggestions + hasSuggestions: true, + messages: { + assignment: "Assignment (=) can be replaced with operator assignment ({{operator}}).", + useLogicalOperator: "Convert this assignment to use the operator {{ operator }}.", + logical: "Logical expression can be replaced with an assignment ({{ operator }}).", + convertLogical: "Replace this logical expression with an assignment with the operator {{ operator }}.", + if: "'if' statement can be replaced with a logical operator assignment with operator {{ operator }}.", + convertIf: "Replace this 'if' statement with a logical assignment with operator {{ operator }}.", + unexpected: "Unexpected logical operator assignment ({{operator}}) shorthand.", + separate: "Separate the logical assignment into an assignment with a logical operator." + } + }, + + create(context) { + const mode = context.options[0] === "never" ? "never" : "always"; + const checkIf = mode === "always" && context.options.length > 1 && context.options[1].enforceForIfStatements; + const sourceCode = context.getSourceCode(); + const isStrict = context.getScope().isStrict; + + /** + * Returns false if the access could be a getter + * @param {ASTNode} node Assignment expression + * @returns {boolean} True iff the fix is safe + */ + function cannotBeGetter(node) { + return node.type === "Identifier" && + (isStrict || !isInsideWithBlock(node)); + } + + /** + * Check whether only a single property is accessed + * @param {ASTNode} node reference + * @returns {boolean} True iff a single property is accessed + */ + function accessesSingleProperty(node) { + if (!isStrict && isInsideWithBlock(node)) { + return node.type === "Identifier"; + } + + return node.type === "MemberExpression" && + baseTypes.has(node.object.type) && + (!node.computed || (node.property.type !== "MemberExpression" && node.property.type !== "ChainExpression")); + } + + /** + * Adds a fixer or suggestion whether on the fix is safe. + * @param {{ messageId: string, node: ASTNode }} descriptor Report descriptor without fix or suggest + * @param {{ messageId: string, fix: Function }} suggestion Adds the fix or the whole suggestion as only element in "suggest" to suggestion + * @param {boolean} shouldBeFixed Fix iff the condition is true + * @returns {Object} Descriptor with either an added fix or suggestion + */ + function createConditionalFixer(descriptor, suggestion, shouldBeFixed) { + if (shouldBeFixed) { + return { + ...descriptor, + fix: suggestion.fix + }; + } + + return { + ...descriptor, + suggest: [suggestion] + }; + } + + + /** + * Returns the operator token for assignments and binary expressions + * @param {ASTNode} node AssignmentExpression or BinaryExpression + * @returns {import('eslint').AST.Token} Operator token between the left and right expression + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + + if (mode === "never") { + return { + + // foo ||= bar + "AssignmentExpression"(assignment) { + if (!astUtils.isLogicalAssignmentOperator(assignment.operator)) { + return; + } + + const descriptor = { + messageId: "unexpected", + node: assignment, + data: { operator: assignment.operator } + }; + const suggestion = { + messageId: "separate", + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(assignment).length > 0) { + return; + } + + const operatorToken = getOperatorToken(assignment); + + // -> foo = bar + yield ruleFixer.replaceText(operatorToken, "="); + + const assignmentText = sourceCode.getText(assignment.left); + const operator = assignment.operator.slice(0, -1); + + // -> foo = foo || bar + yield ruleFixer.insertTextAfter(operatorToken, ` ${assignmentText} ${operator}`); + + const precedence = astUtils.getPrecedence(assignment.right) <= astUtils.getPrecedence({ type: "LogicalExpression", operator }); + + // ?? and || / && cannot be mixed but have same precedence + const mixed = assignment.operator === "??=" && astUtils.isLogicalExpression(assignment.right); + + if (!astUtils.isParenthesised(sourceCode, assignment.right) && (precedence || mixed)) { + + // -> foo = foo || (bar) + yield ruleFixer.insertTextBefore(assignment.right, "("); + yield ruleFixer.insertTextAfter(assignment.right, ")"); + } + } + }; + + context.report(createConditionalFixer(descriptor, suggestion, cannotBeGetter(assignment.left))); + } + }; + } + + return { + + // foo = foo || bar + "AssignmentExpression[operator='='][right.type='LogicalExpression']"(assignment) { + if (!astUtils.isSameReference(assignment.left, assignment.right.left)) { + return; + } + + const descriptor = { + messageId: "assignment", + node: assignment, + data: { operator: `${assignment.right.operator}=` } + }; + const suggestion = { + messageId: "useLogicalOperator", + data: { operator: `${assignment.right.operator}=` }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(assignment).length > 0) { + return; + } + + // No need for parenthesis around the assignment based on precedence as the precedence stays the same even with changed operator + const assignmentOperatorToken = getOperatorToken(assignment); + + // -> foo ||= foo || bar + yield ruleFixer.insertTextBefore(assignmentOperatorToken, assignment.right.operator); + + // -> foo ||= bar + const logicalOperatorToken = getOperatorToken(assignment.right); + const firstRightOperandToken = sourceCode.getTokenAfter(logicalOperatorToken); + + yield ruleFixer.removeRange([assignment.right.range[0], firstRightOperandToken.range[0]]); + } + }; + + context.report(createConditionalFixer(descriptor, suggestion, cannotBeGetter(assignment.left))); + }, + + // foo || (foo = bar) + 'LogicalExpression[right.type="AssignmentExpression"][right.operator="="]'(logical) { + + // Right side has to be parenthesized, otherwise would be parsed as (foo || foo) = bar which is illegal + if (isReference(logical.left) && astUtils.isSameReference(logical.left, logical.right.left)) { + const descriptor = { + messageId: "logical", + node: logical, + data: { operator: `${logical.operator}=` } + }; + const suggestion = { + messageId: "convertLogical", + data: { operator: `${logical.operator}=` }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(logical).length > 0) { + return; + } + + const requiresOuterParenthesis = logical.parent.type !== "ExpressionStatement" && + (astUtils.getPrecedence({ type: "AssignmentExpression" }) < astUtils.getPrecedence(logical.parent)); + + if (!astUtils.isParenthesised(sourceCode, logical) && requiresOuterParenthesis) { + yield ruleFixer.insertTextBefore(logical, "("); + yield ruleFixer.insertTextAfter(logical, ")"); + } + + // Also removes all opening parenthesis + yield ruleFixer.removeRange([logical.range[0], logical.right.range[0]]); // -> foo = bar) + + // Also removes all ending parenthesis + yield ruleFixer.removeRange([logical.right.range[1], logical.range[1]]); // -> foo = bar + + const operatorToken = getOperatorToken(logical.right); + + yield ruleFixer.insertTextBefore(operatorToken, logical.operator); // -> foo ||= bar + } + }; + const fix = cannotBeGetter(logical.left) || accessesSingleProperty(logical.left); + + context.report(createConditionalFixer(descriptor, suggestion, fix)); + } + }, + + // if (foo) foo = bar + "IfStatement[alternate=null]"(ifNode) { + if (!checkIf) { + return; + } + + const hasBody = ifNode.consequent.type === "BlockStatement"; + + if (hasBody && ifNode.consequent.body.length !== 1) { + return; + } + + const body = hasBody ? ifNode.consequent.body[0] : ifNode.consequent; + const scope = context.getScope(); + const existence = getExistence(ifNode.test, scope); + + if ( + body.type === "ExpressionStatement" && + body.expression.type === "AssignmentExpression" && + body.expression.operator === "=" && + existence !== null && + astUtils.isSameReference(existence.reference, body.expression.left) + ) { + const descriptor = { + messageId: "if", + node: ifNode, + data: { operator: `${existence.operator}=` } + }; + const suggestion = { + messageId: "convertIf", + data: { operator: `${existence.operator}=` }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(ifNode).length > 0) { + return; + } + + const firstBodyToken = sourceCode.getFirstToken(body); + const prevToken = sourceCode.getTokenBefore(ifNode); + + if ( + prevToken !== null && + prevToken.value !== ";" && + prevToken.value !== "{" && + firstBodyToken.type !== "Identifier" && + firstBodyToken.type !== "Keyword" + ) { + + // Do not fix if the fixed statement could be part of the previous statement (eg. fn() if (a == null) (a) = b --> fn()(a) ??= b) + return; + } + + + const operatorToken = getOperatorToken(body.expression); + + yield ruleFixer.insertTextBefore(operatorToken, existence.operator); // -> if (foo) foo ||= bar + + yield ruleFixer.removeRange([ifNode.range[0], body.range[0]]); // -> foo ||= bar + + yield ruleFixer.removeRange([body.range[1], ifNode.range[1]]); // -> foo ||= bar, only present if "if" had a body + + const nextToken = sourceCode.getTokenAfter(body.expression); + + if (hasBody && (nextToken !== null && nextToken.value !== ";")) { + yield ruleFixer.insertTextAfter(ifNode, ";"); + } + } + }; + const shouldBeFixed = cannotBeGetter(existence.reference) || + (ifNode.test.type !== "LogicalExpression" && accessesSingleProperty(existence.reference)); + + context.report(createConditionalFixer(descriptor, suggestion, shouldBeFixed)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-classes-per-file.js b/node_modules/eslint/lib/rules/max-classes-per-file.js index bb48a546e..0bd626fe6 100644 --- a/node_modules/eslint/lib/rules/max-classes-per-file.js +++ b/node_modules/eslint/lib/rules/max-classes-per-file.js @@ -13,21 +13,38 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum number of classes per file", - category: "Best Practices", + description: "Enforce a maximum number of classes per file", recommended: false, url: "https://eslint.org/docs/rules/max-classes-per-file" }, schema: [ { - type: "integer", - minimum: 1 + oneOf: [ + { + type: "integer", + minimum: 1 + }, + { + type: "object", + properties: { + ignoreExpressions: { + type: "boolean" + }, + max: { + type: "integer", + minimum: 1 + } + }, + additionalProperties: false + } + ] } ], @@ -36,8 +53,10 @@ module.exports = { } }, create(context) { - - const maxClasses = context.options[0] || 1; + const [option = {}] = context.options; + const [ignoreExpressions, max] = typeof option === "number" + ? [false, option || 1] + : [option.ignoreExpressions, option.max || 1]; let classCount = 0; @@ -46,19 +65,24 @@ module.exports = { classCount = 0; }, "Program:exit"(node) { - if (classCount > maxClasses) { + if (classCount > max) { context.report({ node, messageId: "maximumExceeded", data: { classCount, - max: maxClasses + max } }); } }, - "ClassDeclaration, ClassExpression"() { + "ClassDeclaration"() { classCount++; + }, + "ClassExpression"() { + if (!ignoreExpressions) { + classCount++; + } } }; } diff --git a/node_modules/eslint/lib/rules/max-depth.js b/node_modules/eslint/lib/rules/max-depth.js index 5c5296bec..6b428ced7 100644 --- a/node_modules/eslint/lib/rules/max-depth.js +++ b/node_modules/eslint/lib/rules/max-depth.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum depth that blocks can be nested", - category: "Stylistic Issues", + description: "Enforce a maximum depth that blocks can be nested", recommended: false, url: "https://eslint.org/docs/rules/max-depth" }, @@ -119,6 +119,7 @@ module.exports = { FunctionDeclaration: startFunction, FunctionExpression: startFunction, ArrowFunctionExpression: startFunction, + StaticBlock: startFunction, IfStatement(node) { if (node.parent.type !== "IfStatement") { @@ -147,6 +148,7 @@ module.exports = { "FunctionDeclaration:exit": endFunction, "FunctionExpression:exit": endFunction, "ArrowFunctionExpression:exit": endFunction, + "StaticBlock:exit": endFunction, "Program:exit": endFunction }; diff --git a/node_modules/eslint/lib/rules/max-len.js b/node_modules/eslint/lib/rules/max-len.js index dd76760c5..0d3b2af70 100644 --- a/node_modules/eslint/lib/rules/max-len.js +++ b/node_modules/eslint/lib/rules/max-len.js @@ -63,13 +63,13 @@ const OPTIONS_OR_INTEGER_SCHEMA = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce a maximum line length", - category: "Stylistic Issues", + description: "Enforce a maximum line length", recommended: false, url: "https://eslint.org/docs/rules/max-len" }, @@ -215,7 +215,7 @@ module.exports = { * Ensure that an array exists at [key] on `object`, and add `value` to it. * @param {Object} object the object to mutate * @param {string} key the object's key - * @param {*} value the value to add + * @param {any} value the value to add * @returns {void} * @private */ diff --git a/node_modules/eslint/lib/rules/max-lines-per-function.js b/node_modules/eslint/lib/rules/max-lines-per-function.js index de70cecb4..fad646cc0 100644 --- a/node_modules/eslint/lib/rules/max-lines-per-function.js +++ b/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -9,8 +9,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); - -const lodash = require("lodash"); +const { upperCaseFirst } = require("../shared/string-utils"); //------------------------------------------------------------------------------ // Constants @@ -49,7 +48,7 @@ const OPTIONS_OR_INTEGER_SCHEMA = { /** * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values. * @param {Array} comments An array of comment nodes. - * @returns {Map.} A map with numeric keys (source code line numbers) and comment token values. + * @returns {Map} A map with numeric keys (source code line numbers) and comment token values. */ function getCommentLineNumbers(comments) { const map = new Map(); @@ -66,13 +65,13 @@ function getCommentLineNumbers(comments) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum number of lines of code in a function", - category: "Stylistic Issues", + description: "Enforce a maximum number of lines of code in a function", recommended: false, url: "https://eslint.org/docs/rules/max-lines-per-function" }, @@ -191,7 +190,7 @@ module.exports = { } if (lineCount > maxLines) { - const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(funcNode)); + const name = upperCaseFirst(astUtils.getFunctionNameWithKind(funcNode)); context.report({ node, diff --git a/node_modules/eslint/lib/rules/max-lines.js b/node_modules/eslint/lib/rules/max-lines.js index ceb014aff..d0e5bad3b 100644 --- a/node_modules/eslint/lib/rules/max-lines.js +++ b/node_modules/eslint/lib/rules/max-lines.js @@ -8,20 +8,33 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates an array of numbers from `start` up to, but not including, `end` + * @param {number} start The start of the range + * @param {number} end The end of the range + * @returns {number[]} The range of numbers + */ +function range(start, end) { + return [...Array(end - start).keys()].map(x => x + start); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum number of lines per file", - category: "Stylistic Issues", + description: "Enforce a maximum number of lines per file", recommended: false, url: "https://eslint.org/docs/rules/max-lines" }, @@ -119,7 +132,7 @@ module.exports = { } if (start <= end) { - return lodash.range(start, end + 1); + return range(start, end + 1); } return []; } @@ -135,7 +148,7 @@ module.exports = { * If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end. * That isn't a real line, so we shouldn't count it. */ - if (lines.length > 1 && lodash.last(lines).text === "") { + if (lines.length > 1 && lines[lines.length - 1].text === "") { lines.pop(); } @@ -146,12 +159,10 @@ module.exports = { if (skipComments) { const comments = sourceCode.getAllComments(); - const commentLines = lodash.flatten( - comments.map(comment => getLinesWithoutCode(comment)) - ); + const commentLines = new Set(comments.flatMap(getLinesWithoutCode)); lines = lines.filter( - l => !commentLines.includes(l.lineNumber) + l => !commentLines.has(l.lineNumber) ); } @@ -163,7 +174,7 @@ module.exports = { }, end: { line: sourceCode.lines.length, - column: lodash.last(sourceCode.lines).length + column: sourceCode.lines[sourceCode.lines.length - 1].length } }; diff --git a/node_modules/eslint/lib/rules/max-nested-callbacks.js b/node_modules/eslint/lib/rules/max-nested-callbacks.js index df1baceeb..3764d5dee 100644 --- a/node_modules/eslint/lib/rules/max-nested-callbacks.js +++ b/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum depth that callbacks can be nested", - category: "Stylistic Issues", + description: "Enforce a maximum depth that callbacks can be nested", recommended: false, url: "https://eslint.org/docs/rules/max-nested-callbacks" }, diff --git a/node_modules/eslint/lib/rules/max-params.js b/node_modules/eslint/lib/rules/max-params.js index 4eebe2d95..8de1ab44b 100644 --- a/node_modules/eslint/lib/rules/max-params.js +++ b/node_modules/eslint/lib/rules/max-params.js @@ -9,21 +9,20 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); - const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum number of parameters in function definitions", - category: "Stylistic Issues", + description: "Enforce a maximum number of parameters in function definitions", recommended: false, url: "https://eslint.org/docs/rules/max-params" }, @@ -85,7 +84,7 @@ module.exports = { node, messageId: "exceed", data: { - name: lodash.upperFirst(astUtils.getFunctionNameWithKind(node)), + name: upperCaseFirst(astUtils.getFunctionNameWithKind(node)), count: node.params.length, max: numParams } diff --git a/node_modules/eslint/lib/rules/max-statements-per-line.js b/node_modules/eslint/lib/rules/max-statements-per-line.js index 5407cff3c..ada9cf0fe 100644 --- a/node_modules/eslint/lib/rules/max-statements-per-line.js +++ b/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce a maximum number of statements allowed per line", - category: "Stylistic Issues", + description: "Enforce a maximum number of statements allowed per line", recommended: false, url: "https://eslint.org/docs/rules/max-statements-per-line" }, diff --git a/node_modules/eslint/lib/rules/max-statements.js b/node_modules/eslint/lib/rules/max-statements.js index 437b393a5..c598b1059 100644 --- a/node_modules/eslint/lib/rules/max-statements.js +++ b/node_modules/eslint/lib/rules/max-statements.js @@ -9,21 +9,20 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); - const astUtils = require("./utils/ast-utils"); +const { upperCaseFirst } = require("../shared/string-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a maximum number of statements allowed in function blocks", - category: "Stylistic Issues", + description: "Enforce a maximum number of statements allowed in function blocks", recommended: false, url: "https://eslint.org/docs/rules/max-statements" }, @@ -97,7 +96,7 @@ module.exports = { */ function reportIfTooManyStatements(node, count, max) { if (count > max) { - const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + const name = upperCaseFirst(astUtils.getFunctionNameWithKind(node)); context.report({ node, @@ -125,6 +124,14 @@ module.exports = { function endFunction(node) { const count = functionStack.pop(); + /* + * This rule does not apply to class static blocks, but we have to track them so + * that statements in them do not count as statements in the enclosing function. + */ + if (node.type === "StaticBlock") { + return; + } + if (ignoreTopLevelFunctions && functionStack.length === 0) { topLevelFunctions.push({ node, count }); } else { @@ -150,12 +157,14 @@ module.exports = { FunctionDeclaration: startFunction, FunctionExpression: startFunction, ArrowFunctionExpression: startFunction, + StaticBlock: startFunction, BlockStatement: countStatements, "FunctionDeclaration:exit": endFunction, "FunctionExpression:exit": endFunction, "ArrowFunctionExpression:exit": endFunction, + "StaticBlock:exit": endFunction, "Program:exit"() { if (topLevelFunctions.length === 1) { diff --git a/node_modules/eslint/lib/rules/multiline-comment-style.js b/node_modules/eslint/lib/rules/multiline-comment-style.js index 9524818b8..9cb7f3473 100644 --- a/node_modules/eslint/lib/rules/multiline-comment-style.js +++ b/node_modules/eslint/lib/rules/multiline-comment-style.js @@ -10,19 +10,49 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce a particular style for multiline comments", - category: "Stylistic Issues", + description: "Enforce a particular style for multiline comments", recommended: false, url: "https://eslint.org/docs/rules/multiline-comment-style" }, fixable: "whitespace", - schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["starred-block", "bare-block"] + } + ], + additionalItems: false + }, + { + type: "array", + items: [ + { + enum: ["separate-lines"] + }, + { + type: "object", + properties: { + checkJSDoc: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + additionalItems: false + } + ] + }, messages: { expectedBlock: "Expected a block comment instead of consecutive line comments.", expectedBareBlock: "Expected a block comment without padding stars.", @@ -37,6 +67,8 @@ module.exports = { create(context) { const sourceCode = context.getSourceCode(); const option = context.options[0] || "starred-block"; + const params = context.options[1] || {}; + const checkJSDoc = !!params.checkJSDoc; //---------------------------------------------------------------------- // Helpers @@ -333,11 +365,18 @@ module.exports = { "separate-lines"(commentGroup) { const [firstComment] = commentGroup; - if (firstComment.type !== "Block" || isJSDocComment(commentGroup)) { + const isJSDoc = isJSDocComment(commentGroup); + + if (firstComment.type !== "Block" || (!checkJSDoc && isJSDoc)) { return; } - const commentLines = getCommentLines(commentGroup); + let commentLines = getCommentLines(commentGroup); + + if (isJSDoc) { + commentLines = commentLines.slice(1, commentLines.length - 1); + } + const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); if (tokenAfter && firstComment.loc.end.line === tokenAfter.loc.start.line) { diff --git a/node_modules/eslint/lib/rules/multiline-ternary.js b/node_modules/eslint/lib/rules/multiline-ternary.js index 98360b9ca..d8fe0b161 100644 --- a/node_modules/eslint/lib/rules/multiline-ternary.js +++ b/node_modules/eslint/lib/rules/multiline-ternary.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce newlines between operands of ternary expressions", - category: "Stylistic Issues", + description: "Enforce newlines between operands of ternary expressions", recommended: false, url: "https://eslint.org/docs/rules/multiline-ternary" }, @@ -73,7 +73,7 @@ module.exports = { end: lastTokenOfTest.loc.end }, messageId: "unexpectedTestCons", - fix: fixer => { + fix(fixer) { if (hasComments) { return null; } @@ -101,7 +101,7 @@ module.exports = { end: lastTokenOfConsequent.loc.end }, messageId: "unexpectedConsAlt", - fix: fixer => { + fix(fixer) { if (hasComments) { return null; } diff --git a/node_modules/eslint/lib/rules/new-cap.js b/node_modules/eslint/lib/rules/new-cap.js index 4249a5428..7e0b21eaf 100644 --- a/node_modules/eslint/lib/rules/new-cap.js +++ b/node_modules/eslint/lib/rules/new-cap.js @@ -33,15 +33,16 @@ const CAPS_ALLOWED = [ * Ensure that if the key is provided, it must be an array. * @param {Object} obj Object to check with `key`. * @param {string} key Object key to check on `obj`. - * @param {*} fallback If obj[key] is not present, this will be returned. + * @param {any} fallback If obj[key] is not present, this will be returned. + * @throws {TypeError} If key is not an own array type property of `obj`. * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` */ function checkArray(obj, key, fallback) { - /* istanbul ignore if */ + /* c8 ignore start */ if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { throw new TypeError(`${key}, if provided, must be an Array`); - } + }/* c8 ignore stop */ return obj[key] || fallback; } @@ -75,13 +76,13 @@ function calculateCapIsNewExceptions(config) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require constructor names to begin with a capital letter", - category: "Stylistic Issues", + description: "Require constructor names to begin with a capital letter", recommended: false, url: "https://eslint.org/docs/rules/new-cap" }, diff --git a/node_modules/eslint/lib/rules/new-parens.js b/node_modules/eslint/lib/rules/new-parens.js index 405ec1b51..f5a98a45d 100644 --- a/node_modules/eslint/lib/rules/new-parens.js +++ b/node_modules/eslint/lib/rules/new-parens.js @@ -19,13 +19,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce or disallow parentheses when invoking a constructor with no arguments", - category: "Stylistic Issues", + description: "Enforce or disallow parentheses when invoking a constructor with no arguments", recommended: false, url: "https://eslint.org/docs/rules/new-parens" }, diff --git a/node_modules/eslint/lib/rules/newline-after-var.js b/node_modules/eslint/lib/rules/newline-after-var.js index 4809d9bfc..2b4d85846 100644 --- a/node_modules/eslint/lib/rules/newline-after-var.js +++ b/node_modules/eslint/lib/rules/newline-after-var.js @@ -1,7 +1,7 @@ /** * @fileoverview Rule to check empty newline after "var" statement * @author Gopal Venkatesan - * @deprecated + * @deprecated in ESLint v4.0.0 */ "use strict"; @@ -16,13 +16,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow an empty line after variable declarations", - category: "Stylistic Issues", + description: "Require or disallow an empty line after variable declarations", recommended: false, url: "https://eslint.org/docs/rules/newline-after-var" }, @@ -145,9 +145,9 @@ module.exports = { /** * Determine if a token starts more than one line after a comment ends - * @param {token} token The token being checked - * @param {integer} commentStartLine The line number on which the comment starts - * @returns {boolean} True if `token` does not start immediately after a comment + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment */ function hasBlankLineAfterComment(token, commentStartLine) { return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1; diff --git a/node_modules/eslint/lib/rules/newline-before-return.js b/node_modules/eslint/lib/rules/newline-before-return.js index 65ca32321..007d94273 100644 --- a/node_modules/eslint/lib/rules/newline-before-return.js +++ b/node_modules/eslint/lib/rules/newline-before-return.js @@ -1,7 +1,7 @@ /** * @fileoverview Rule to require newlines before `return` statement * @author Kai Cataldo - * @deprecated + * @deprecated in ESLint v4.0.0 */ "use strict"; @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require an empty line before `return` statements", - category: "Stylistic Issues", + description: "Require an empty line before `return` statements", recommended: false, url: "https://eslint.org/docs/rules/newline-before-return" }, @@ -47,7 +47,7 @@ module.exports = { function isPrecededByTokens(node, testTokens) { const tokenBefore = sourceCode.getTokenBefore(node); - return testTokens.some(token => tokenBefore.value === token); + return testTokens.includes(tokenBefore.value); } /** diff --git a/node_modules/eslint/lib/rules/newline-per-chained-call.js b/node_modules/eslint/lib/rules/newline-per-chained-call.js index 46c9d6c10..83844a52b 100644 --- a/node_modules/eslint/lib/rules/newline-per-chained-call.js +++ b/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -12,13 +12,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require a newline after each call in a method chain", - category: "Stylistic Issues", + description: "Require a newline after each call in a method chain", recommended: false, url: "https://eslint.org/docs/rules/newline-per-chained-call" }, @@ -53,7 +53,7 @@ module.exports = { * Get the prefix of a given MemberExpression node. * If the MemberExpression node is a computed value it returns a * left bracket. If not it returns a period. - * @param {ASTNode} node A MemberExpression node to get + * @param {ASTNode} node A MemberExpression node to get * @returns {string} The prefix of the node. */ function getPrefix(node) { diff --git a/node_modules/eslint/lib/rules/no-alert.js b/node_modules/eslint/lib/rules/no-alert.js index 702b4d2ba..ba0125c87 100644 --- a/node_modules/eslint/lib/rules/no-alert.js +++ b/node_modules/eslint/lib/rules/no-alert.js @@ -82,13 +82,13 @@ function isGlobalThisReferenceOrGlobalWindow(scope, node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `alert`, `confirm`, and `prompt`", - category: "Best Practices", + description: "Disallow the use of `alert`, `confirm`, and `prompt`", recommended: false, url: "https://eslint.org/docs/rules/no-alert" }, diff --git a/node_modules/eslint/lib/rules/no-array-constructor.js b/node_modules/eslint/lib/rules/no-array-constructor.js index 90c6d6bbd..93b79abfd 100644 --- a/node_modules/eslint/lib/rules/no-array-constructor.js +++ b/node_modules/eslint/lib/rules/no-array-constructor.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `Array` constructors", - category: "Stylistic Issues", + description: "Disallow `Array` constructors", recommended: false, url: "https://eslint.org/docs/rules/no-array-constructor" }, diff --git a/node_modules/eslint/lib/rules/no-async-promise-executor.js b/node_modules/eslint/lib/rules/no-async-promise-executor.js index 553311e58..52c51862f 100644 --- a/node_modules/eslint/lib/rules/no-async-promise-executor.js +++ b/node_modules/eslint/lib/rules/no-async-promise-executor.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow using an async function as a Promise executor", - category: "Possible Errors", + description: "Disallow using an async function as a Promise executor", recommended: true, url: "https://eslint.org/docs/rules/no-async-promise-executor" }, diff --git a/node_modules/eslint/lib/rules/no-await-in-loop.js b/node_modules/eslint/lib/rules/no-await-in-loop.js index 9ca89866a..905a793c8 100644 --- a/node_modules/eslint/lib/rules/no-await-in-loop.js +++ b/node_modules/eslint/lib/rules/no-await-in-loop.js @@ -53,13 +53,13 @@ function isLooped(node, parent) { } } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow `await` inside of loops", - category: "Possible Errors", + description: "Disallow `await` inside of loops", recommended: false, url: "https://eslint.org/docs/rules/no-await-in-loop" }, diff --git a/node_modules/eslint/lib/rules/no-bitwise.js b/node_modules/eslint/lib/rules/no-bitwise.js index a9c3360a7..172ea046b 100644 --- a/node_modules/eslint/lib/rules/no-bitwise.js +++ b/node_modules/eslint/lib/rules/no-bitwise.js @@ -20,13 +20,13 @@ const BITWISE_OPERATORS = [ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow bitwise operators", - category: "Stylistic Issues", + description: "Disallow bitwise operators", recommended: false, url: "https://eslint.org/docs/rules/no-bitwise" }, @@ -63,7 +63,7 @@ module.exports = { /** * Reports an unexpected use of a bitwise operator. - * @param {ASTNode} node Node which contains the bitwise operator. + * @param {ASTNode} node Node which contains the bitwise operator. * @returns {void} */ function report(node) { @@ -72,25 +72,25 @@ module.exports = { /** * Checks if the given node has a bitwise operator. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} Whether or not the node has a bitwise operator. */ function hasBitwiseOperator(node) { - return BITWISE_OPERATORS.indexOf(node.operator) !== -1; + return BITWISE_OPERATORS.includes(node.operator); } /** * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} Whether or not the node has a bitwise operator. */ function allowedOperator(node) { - return allowed.indexOf(node.operator) !== -1; + return allowed.includes(node.operator); } /** * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} whether the node is used in integer typecasting. */ function isInt32Hint(node) { @@ -100,7 +100,7 @@ module.exports = { /** * Report if the given node contains a bitwise operator. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {void} */ function checkNodeForBitwiseOperator(node) { diff --git a/node_modules/eslint/lib/rules/no-buffer-constructor.js b/node_modules/eslint/lib/rules/no-buffer-constructor.js index 152dda0ce..930039288 100644 --- a/node_modules/eslint/lib/rules/no-buffer-constructor.js +++ b/node_modules/eslint/lib/rules/no-buffer-constructor.js @@ -1,6 +1,7 @@ /** * @fileoverview disallow use of the Buffer() constructor * @author Teddy Katz + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -8,6 +9,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -17,8 +19,7 @@ module.exports = { type: "problem", docs: { - description: "disallow use of the `Buffer()` constructor", - category: "Node.js and CommonJS", + description: "Disallow use of the `Buffer()` constructor", recommended: false, url: "https://eslint.org/docs/rules/no-buffer-constructor" }, diff --git a/node_modules/eslint/lib/rules/no-caller.js b/node_modules/eslint/lib/rules/no-caller.js index 5fe1bd449..884a02bdc 100644 --- a/node_modules/eslint/lib/rules/no-caller.js +++ b/node_modules/eslint/lib/rules/no-caller.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `arguments.caller` or `arguments.callee`", - category: "Best Practices", + description: "Disallow the use of `arguments.caller` or `arguments.callee`", recommended: false, url: "https://eslint.org/docs/rules/no-caller" }, diff --git a/node_modules/eslint/lib/rules/no-case-declarations.js b/node_modules/eslint/lib/rules/no-case-declarations.js index 1d54e2216..6557ba3a0 100644 --- a/node_modules/eslint/lib/rules/no-case-declarations.js +++ b/node_modules/eslint/lib/rules/no-case-declarations.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow lexical declarations in case clauses", - category: "Best Practices", + description: "Disallow lexical declarations in case clauses", recommended: true, url: "https://eslint.org/docs/rules/no-case-declarations" }, diff --git a/node_modules/eslint/lib/rules/no-catch-shadow.js b/node_modules/eslint/lib/rules/no-catch-shadow.js index 4917af84e..49f1ba964 100644 --- a/node_modules/eslint/lib/rules/no-catch-shadow.js +++ b/node_modules/eslint/lib/rules/no-catch-shadow.js @@ -16,13 +16,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `catch` clause parameters from shadowing variables in the outer scope", - category: "Variables", + description: "Disallow `catch` clause parameters from shadowing variables in the outer scope", recommended: false, url: "https://eslint.org/docs/rules/no-catch-shadow" }, diff --git a/node_modules/eslint/lib/rules/no-class-assign.js b/node_modules/eslint/lib/rules/no-class-assign.js index 887058ba0..32e48e211 100644 --- a/node_modules/eslint/lib/rules/no-class-assign.js +++ b/node_modules/eslint/lib/rules/no-class-assign.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow reassigning class members", - category: "ECMAScript 6", + description: "Disallow reassigning class members", recommended: true, url: "https://eslint.org/docs/rules/no-class-assign" }, diff --git a/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/node_modules/eslint/lib/rules/no-compare-neg-zero.js index 0c6865ad5..9715c2f0f 100644 --- a/node_modules/eslint/lib/rules/no-compare-neg-zero.js +++ b/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow comparing against -0", - category: "Possible Errors", + description: "Disallow comparing against -0", recommended: true, url: "https://eslint.org/docs/rules/no-compare-neg-zero" }, diff --git a/node_modules/eslint/lib/rules/no-cond-assign.js b/node_modules/eslint/lib/rules/no-cond-assign.js index 3843a7ac2..59efb341f 100644 --- a/node_modules/eslint/lib/rules/no-cond-assign.js +++ b/node_modules/eslint/lib/rules/no-cond-assign.js @@ -28,13 +28,13 @@ const NODE_DESCRIPTIONS = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow assignment operators in conditional expressions", - category: "Possible Errors", + description: "Disallow assignment operators in conditional expressions", recommended: true, url: "https://eslint.org/docs/rules/no-cond-assign" }, diff --git a/node_modules/eslint/lib/rules/no-confusing-arrow.js b/node_modules/eslint/lib/rules/no-confusing-arrow.js index 9009b64fa..d2b6641b7 100644 --- a/node_modules/eslint/lib/rules/no-confusing-arrow.js +++ b/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -25,13 +25,13 @@ function isConditional(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow arrow functions where they could be confused with comparisons", - category: "ECMAScript 6", + description: "Disallow arrow functions where they could be confused with comparisons", recommended: false, url: "https://eslint.org/docs/rules/no-confusing-arrow" }, @@ -41,7 +41,8 @@ module.exports = { schema: [{ type: "object", properties: { - allowParens: { type: "boolean", default: true } + allowParens: { type: "boolean", default: true }, + onlyOneSimpleParam: { type: "boolean", default: false } }, additionalProperties: false }], @@ -54,6 +55,7 @@ module.exports = { create(context) { const config = context.options[0] || {}; const allowParens = config.allowParens || (config.allowParens === void 0); + const onlyOneSimpleParam = config.onlyOneSimpleParam; const sourceCode = context.getSourceCode(); @@ -65,7 +67,9 @@ module.exports = { function checkArrowFunc(node) { const body = node.body; - if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) { + if (isConditional(body) && + !(allowParens && astUtils.isParenthesised(sourceCode, body)) && + !(onlyOneSimpleParam && !(node.params.length === 1 && node.params[0].type === "Identifier"))) { context.report({ node, messageId: "confusing", diff --git a/node_modules/eslint/lib/rules/no-console.js b/node_modules/eslint/lib/rules/no-console.js index 56dbbc3a9..bad6b6f4e 100644 --- a/node_modules/eslint/lib/rules/no-console.js +++ b/node_modules/eslint/lib/rules/no-console.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `console`", - category: "Possible Errors", + description: "Disallow the use of `console`", recommended: false, url: "https://eslint.org/docs/rules/no-console" }, @@ -72,7 +72,7 @@ module.exports = { function isAllowed(node) { const propertyName = astUtils.getStaticPropertyName(node); - return propertyName && allowed.indexOf(propertyName) !== -1; + return propertyName && allowed.includes(propertyName); } /** diff --git a/node_modules/eslint/lib/rules/no-const-assign.js b/node_modules/eslint/lib/rules/no-const-assign.js index e4ae89170..55e40c884 100644 --- a/node_modules/eslint/lib/rules/no-const-assign.js +++ b/node_modules/eslint/lib/rules/no-const-assign.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow reassigning `const` variables", - category: "ECMAScript 6", + description: "Disallow reassigning `const` variables", recommended: true, url: "https://eslint.org/docs/rules/no-const-assign" }, diff --git a/node_modules/eslint/lib/rules/no-constant-binary-expression.js b/node_modules/eslint/lib/rules/no-constant-binary-expression.js new file mode 100644 index 000000000..2cd8928eb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constant-binary-expression.js @@ -0,0 +1,507 @@ +/** + * @fileoverview Rule to flag constant comparisons and logical expressions that always/never short circuit + * @author Jordan Eldredge + */ + +"use strict"; + +const globals = require("globals"); +const { isNullLiteral, isConstant, isReferenceToGlobalVariable, isLogicalAssignmentOperator } = require("./utils/ast-utils"); + +const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set(["+", "-", "*", "/", "%", "|", "^", "&", "**", "<<", ">>", ">>>"]); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is `null` or `undefined`. Similar to the one + * found in ast-utils.js, but this one correctly handles the edge case that + * `undefined` has been redefined. + * @param {Scope} scope Scope in which the expression was found. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(scope, node) { + return ( + isNullLiteral(node) || + (node.type === "Identifier" && node.name === "undefined" && isReferenceToGlobalVariable(scope, node)) || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Test if an AST node has a statically knowable constant nullishness. Meaning, + * it will always resolve to a constant value of either: `null`, `undefined` + * or not `null` _or_ `undefined`. An expression that can vary between those + * three states at runtime would return `false`. + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The AST node being tested. + * @param {boolean} nonNullish if `true` then nullish values are not considered constant. + * @returns {boolean} Does `node` have constant nullishness? + */ +function hasConstantNullishness(scope, node, nonNullish) { + if (nonNullish && isNullOrUndefined(scope, node)) { + return false; + } + + switch (node.type) { + case "ObjectExpression": // Objects are never nullish + case "ArrayExpression": // Arrays are never nullish + case "ArrowFunctionExpression": // Functions never nullish + case "FunctionExpression": // Functions are never nullish + case "ClassExpression": // Classes are never nullish + case "NewExpression": // Objects are never nullish + case "Literal": // Nullish, or non-nullish, literals never change + case "TemplateLiteral": // A string is never nullish + case "UpdateExpression": // Numbers are never nullish + case "BinaryExpression": // Numbers, strings, or booleans are never nullish + return true; + case "CallExpression": { + if (node.callee.type !== "Identifier") { + return false; + } + const functionName = node.callee.name; + + return (functionName === "Boolean" || functionName === "String" || functionName === "Number") && + isReferenceToGlobalVariable(scope, node.callee); + } + case "LogicalExpression": { + return node.operator === "??" && hasConstantNullishness(scope, node.right, true); + } + case "AssignmentExpression": + if (node.operator === "=") { + return hasConstantNullishness(scope, node.right, nonNullish); + } + + /* + * Handling short-circuiting assignment operators would require + * walking the scope. We won't attempt that (for now...) / + */ + if (isLogicalAssignmentOperator(node.operator)) { + return false; + } + + /* + * The remaining assignment expressions all result in a numeric or + * string (non-nullish) value: + * "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=" + */ + + return true; + case "UnaryExpression": + + /* + * "void" Always returns `undefined` + * "typeof" All types are strings, and thus non-nullish + * "!" Boolean is never nullish + * "delete" Returns a boolean, which is never nullish + * Math operators always return numbers or strings, neither of which + * are non-nullish "+", "-", "~" + */ + + return true; + case "SequenceExpression": { + const last = node.expressions[node.expressions.length - 1]; + + return hasConstantNullishness(scope, last, nonNullish); + } + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + +/** + * Test if an AST node is a boolean value that never changes. Specifically we + * test for: + * 1. Literal booleans (`true` or `false`) + * 2. Unary `!` expressions with a constant value + * 3. Constant booleans created via the `Boolean` global function + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The node to test + * @returns {boolean} Is `node` guaranteed to be a boolean? + */ +function isStaticBoolean(scope, node) { + switch (node.type) { + case "Literal": + return typeof node.value === "boolean"; + case "CallExpression": + return node.callee.type === "Identifier" && node.callee.name === "Boolean" && + isReferenceToGlobalVariable(scope, node.callee) && + (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)); + case "UnaryExpression": + return node.operator === "!" && isConstant(scope, node.argument, true); + default: + return false; + } +} + + +/** + * Test if an AST node will always give the same result when compared to a + * boolean value. Note that comparison to boolean values is different than + * truthiness. + * https://262.ecma-international.org/5.1/#sec-11.9.3 + * + * Javascript `==` operator works by converting the boolean to `1` (true) or + * `+0` (false) and then checks the values `==` equality to that number. + * @param {Scope} scope The scope in which node was found. + * @param {ASTNode} node The node to test. + * @returns {boolean} Will `node` always coerce to the same boolean value? + */ +function hasConstantLooseBooleanComparison(scope, node) { + switch (node.type) { + case "ObjectExpression": + case "ClassExpression": + + /** + * In theory objects like: + * + * `{toString: () => a}` + * `{valueOf: () => a}` + * + * Or a classes like: + * + * `class { static toString() { return a } }` + * `class { static valueOf() { return a } }` + * + * Are not constant verifiably when `inBooleanPosition` is + * false, but it's an edge case we've opted not to handle. + */ + return true; + case "ArrayExpression": { + const nonSpreadElements = node.elements.filter(e => + + // Elements can be `null` in sparse arrays: `[,,]`; + e !== null && e.type !== "SpreadElement"); + + + /* + * Possible future direction if needed: We could check if the + * single value would result in variable boolean comparison. + * For now we will err on the side of caution since `[x]` could + * evaluate to `[0]` or `[1]`. + */ + return node.elements.length === 0 || nonSpreadElements.length > 1; + } + case "ArrowFunctionExpression": + case "FunctionExpression": + return true; + case "UnaryExpression": + if (node.operator === "void" || // Always returns `undefined` + node.operator === "typeof" // All `typeof` strings, when coerced to number, are not 0 or 1. + ) { + return true; + } + if (node.operator === "!") { + return isConstant(scope, node.argument, true); + } + + /* + * We won't try to reason about +, -, ~, or delete + * In theory, for the mathematical operators, we could look at the + * argument and try to determine if it coerces to a constant numeric + * value. + */ + return false; + case "NewExpression": // Objects might have custom `.valueOf` or `.toString`. + return false; + case "CallExpression": { + if (node.callee.type === "Identifier" && + node.callee.name === "Boolean" && + isReferenceToGlobalVariable(scope, node.callee) + ) { + return node.arguments.length === 0 || isConstant(scope, node.arguments[0], true); + } + return false; + } + case "Literal": // True or false, literals never change + return true; + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + case "TemplateLiteral": + + /* + * In theory we could try to check if the quasi are sufficient to + * prove that the expression will always be true, but it would be + * tricky to get right. For example: `000.${foo}000` + */ + return node.expressions.length === 0; + case "AssignmentExpression": + if (node.operator === "=") { + return hasConstantLooseBooleanComparison(scope, node.right); + } + + /* + * Handling short-circuiting assignment operators would require + * walking the scope. We won't attempt that (for now...) + * + * The remaining assignment expressions all result in a numeric or + * string (non-nullish) values which could be truthy or falsy: + * "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=" + */ + return false; + case "SequenceExpression": { + const last = node.expressions[node.expressions.length - 1]; + + return hasConstantLooseBooleanComparison(scope, last); + } + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + + +/** + * Test if an AST node will always give the same result when _strictly_ compared + * to a boolean value. This can happen if the expression can never be boolean, or + * if it is always the same boolean value. + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The node to test + * @returns {boolean} Will `node` always give the same result when compared to a + * static boolean value? + */ +function hasConstantStrictBooleanComparison(scope, node) { + switch (node.type) { + case "ObjectExpression": // Objects are not booleans + case "ArrayExpression": // Arrays are not booleans + case "ArrowFunctionExpression": // Functions are not booleans + case "FunctionExpression": + case "ClassExpression": // Classes are not booleans + case "NewExpression": // Objects are not booleans + case "TemplateLiteral": // Strings are not booleans + case "Literal": // True, false, or not boolean, literals never change. + case "UpdateExpression": // Numbers are not booleans + return true; + case "BinaryExpression": + return NUMERIC_OR_STRING_BINARY_OPERATORS.has(node.operator); + case "UnaryExpression": { + if (node.operator === "delete") { + return false; + } + if (node.operator === "!") { + return isConstant(scope, node.argument, true); + } + + /* + * The remaining operators return either strings or numbers, neither + * of which are boolean. + */ + return true; + } + case "SequenceExpression": { + const last = node.expressions[node.expressions.length - 1]; + + return hasConstantStrictBooleanComparison(scope, last); + } + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + case "AssignmentExpression": + if (node.operator === "=") { + return hasConstantStrictBooleanComparison(scope, node.right); + } + + /* + * Handling short-circuiting assignment operators would require + * walking the scope. We won't attempt that (for now...) + */ + if (isLogicalAssignmentOperator(node.operator)) { + return false; + } + + /* + * The remaining assignment expressions all result in either a number + * or a string, neither of which can ever be boolean. + */ + return true; + case "CallExpression": { + if (node.callee.type !== "Identifier") { + return false; + } + const functionName = node.callee.name; + + if ( + (functionName === "String" || functionName === "Number") && + isReferenceToGlobalVariable(scope, node.callee) + ) { + return true; + } + if (functionName === "Boolean" && isReferenceToGlobalVariable(scope, node.callee)) { + return ( + node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)); + } + return false; + } + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + +/** + * Test if an AST node will always result in a newly constructed object + * @param {Scope} scope The scope in which the node was found. + * @param {ASTNode} node The node to test + * @returns {boolean} Will `node` always be new? + */ +function isAlwaysNew(scope, node) { + switch (node.type) { + case "ObjectExpression": + case "ArrayExpression": + case "ArrowFunctionExpression": + case "FunctionExpression": + case "ClassExpression": + return true; + case "NewExpression": { + if (node.callee.type !== "Identifier") { + return false; + } + + /* + * All the built-in constructors are always new, but + * user-defined constructors could return a sentinel + * object. + * + * Catching these is especially useful for primitive constructors + * which return boxed values, a surprising gotcha' in JavaScript. + */ + return Object.hasOwnProperty.call(globals.builtin, node.callee.name) && + isReferenceToGlobalVariable(scope, node.callee); + } + case "Literal": + + // Regular expressions are objects, and thus always new + return typeof node.regex === "object"; + case "SequenceExpression": { + const last = node.expressions[node.expressions.length - 1]; + + return isAlwaysNew(scope, last); + } + case "AssignmentExpression": + if (node.operator === "=") { + return isAlwaysNew(scope, node.right); + } + return false; + case "ConditionalExpression": + return isAlwaysNew(scope, node.consequent) && isAlwaysNew(scope, node.alternate); + case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. + case "JSXFragment": + return false; + default: + return false; + } +} + +/** + * Checks if one operand will cause the result to be constant. + * @param {Scope} scope Scope in which the expression was found. + * @param {ASTNode} a One side of the expression + * @param {ASTNode} b The other side of the expression + * @param {string} operator The binary expression operator + * @returns {ASTNode | null} The node which will cause the expression to have a constant result. + */ +function findBinaryExpressionConstantOperand(scope, a, b, operator) { + if (operator === "==" || operator === "!=") { + if ( + (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b, false)) || + (isStaticBoolean(scope, a) && hasConstantLooseBooleanComparison(scope, b)) + ) { + return b; + } + } else if (operator === "===" || operator === "!==") { + if ( + (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b, false)) || + (isStaticBoolean(scope, a) && hasConstantStrictBooleanComparison(scope, b)) + ) { + return b; + } + } + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + docs: { + description: "Disallow expressions where the operation doesn't affect the value", + recommended: false, + url: "https://eslint.org/docs/rules/no-constant-binary-expression" + }, + schema: [], + messages: { + constantBinaryOperand: "Unexpected constant binary expression. Compares constantly with the {{otherSide}}-hand side of the `{{operator}}`.", + constantShortCircuit: "Unexpected constant {{property}} on the left-hand side of a `{{operator}}` expression.", + alwaysNew: "Unexpected comparison to newly constructed object. These two values can never be equal.", + bothAlwaysNew: "Unexpected comparison of two newly constructed objects. These two values can never be equal." + } + }, + + create(context) { + return { + LogicalExpression(node) { + const { operator, left } = node; + const scope = context.getScope(); + + if ((operator === "&&" || operator === "||") && isConstant(scope, left, true)) { + context.report({ node: left, messageId: "constantShortCircuit", data: { property: "truthiness", operator } }); + } else if (operator === "??" && hasConstantNullishness(scope, left, false)) { + context.report({ node: left, messageId: "constantShortCircuit", data: { property: "nullishness", operator } }); + } + }, + BinaryExpression(node) { + const scope = context.getScope(); + const { right, left, operator } = node; + const rightConstantOperand = findBinaryExpressionConstantOperand(scope, left, right, operator); + const leftConstantOperand = findBinaryExpressionConstantOperand(scope, right, left, operator); + + if (rightConstantOperand) { + context.report({ node: rightConstantOperand, messageId: "constantBinaryOperand", data: { operator, otherSide: "left" } }); + } else if (leftConstantOperand) { + context.report({ node: leftConstantOperand, messageId: "constantBinaryOperand", data: { operator, otherSide: "right" } }); + } else if (operator === "===" || operator === "!==") { + if (isAlwaysNew(scope, left)) { + context.report({ node: left, messageId: "alwaysNew" }); + } else if (isAlwaysNew(scope, right)) { + context.report({ node: right, messageId: "alwaysNew" }); + } + } else if (operator === "==" || operator === "!=") { + + /* + * If both sides are "new", then both sides are objects and + * therefore they will be compared by reference even with `==` + * equality. + */ + if (isAlwaysNew(scope, left) && isAlwaysNew(scope, right)) { + context.report({ node: left, messageId: "bothAlwaysNew" }); + } + } + + } + + /* + * In theory we could handle short-circuiting assignment operators, + * for some constant values, but that would require walking the + * scope to find the value of the variable being assigned. This is + * dependant on https://github.com/eslint/eslint/issues/13776 + * + * AssignmentExpression() {}, + */ + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-constant-condition.js b/node_modules/eslint/lib/rules/no-constant-condition.js index 3c2d68cbf..2ef687f6d 100644 --- a/node_modules/eslint/lib/rules/no-constant-condition.js +++ b/node_modules/eslint/lib/rules/no-constant-condition.js @@ -5,6 +5,8 @@ "use strict"; +const { isConstant } = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -13,13 +15,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow constant expressions in conditions", - category: "Possible Errors", + description: "Disallow constant expressions in conditions", recommended: true, url: "https://eslint.org/docs/rules/no-constant-condition" }, @@ -53,153 +55,6 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- - /** - * Returns literal's value converted to the Boolean type - * @param {ASTNode} node any `Literal` node - * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy, - * `null` when it cannot be determined. - */ - function getBooleanValue(node) { - if (node.value === null) { - - /* - * it might be a null literal or bigint/regex literal in unsupported environments . - * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral - * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral - */ - - if (node.raw === "null") { - return false; - } - - // regex is always truthy - if (typeof node.regex === "object") { - return true; - } - - return null; - } - - return !!node.value; - } - - /** - * Checks if a branch node of LogicalExpression short circuits the whole condition - * @param {ASTNode} node The branch of main condition which needs to be checked - * @param {string} operator The operator of the main LogicalExpression. - * @returns {boolean} true when condition short circuits whole condition - */ - function isLogicalIdentity(node, operator) { - switch (node.type) { - case "Literal": - return (operator === "||" && getBooleanValue(node) === true) || - (operator === "&&" && getBooleanValue(node) === false); - - case "UnaryExpression": - return (operator === "&&" && node.operator === "void"); - - case "LogicalExpression": - - /* - * handles `a && false || b` - * `false` is an identity element of `&&` but not `||` - */ - return operator === node.operator && - ( - isLogicalIdentity(node.left, operator) || - isLogicalIdentity(node.right, operator) - ); - - case "AssignmentExpression": - return ["||=", "&&="].includes(node.operator) && - operator === node.operator.slice(0, -1) && - isLogicalIdentity(node.right, operator); - - // no default - } - return false; - } - - /** - * Checks if a node has a constant truthiness value. - * @param {ASTNode} node The AST node to check. - * @param {boolean} inBooleanPosition `false` if checking branch of a condition. - * `true` in all other cases - * @returns {Bool} true when node's truthiness is constant - * @private - */ - function isConstant(node, inBooleanPosition) { - - // node.elements can return null values in the case of sparse arrays ex. [,] - if (!node) { - return true; - } - switch (node.type) { - case "Literal": - case "ArrowFunctionExpression": - case "FunctionExpression": - case "ObjectExpression": - return true; - case "TemplateLiteral": - return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) || - node.expressions.every(exp => isConstant(exp, inBooleanPosition)); - - case "ArrayExpression": { - if (node.parent.type === "BinaryExpression" && node.parent.operator === "+") { - return node.elements.every(element => isConstant(element, false)); - } - return true; - } - - case "UnaryExpression": - if ( - node.operator === "void" || - node.operator === "typeof" && inBooleanPosition - ) { - return true; - } - - if (node.operator === "!") { - return isConstant(node.argument, true); - } - - return isConstant(node.argument, false); - - case "BinaryExpression": - return isConstant(node.left, false) && - isConstant(node.right, false) && - node.operator !== "in"; - - case "LogicalExpression": { - const isLeftConstant = isConstant(node.left, inBooleanPosition); - const isRightConstant = isConstant(node.right, inBooleanPosition); - const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); - const isRightShortCircuit = (inBooleanPosition && isRightConstant && isLogicalIdentity(node.right, node.operator)); - - return (isLeftConstant && isRightConstant) || - isLeftShortCircuit || - isRightShortCircuit; - } - - case "AssignmentExpression": - if (node.operator === "=") { - return isConstant(node.right, inBooleanPosition); - } - - if (["||=", "&&="].includes(node.operator) && inBooleanPosition) { - return isLogicalIdentity(node.right, node.operator.slice(0, -1)); - } - - return false; - - case "SequenceExpression": - return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition); - - // no default - } - return false; - } - /** * Tracks when the given node contains a constant condition. * @param {ASTNode} node The AST node to check. @@ -207,7 +62,7 @@ module.exports = { * @private */ function trackConstantConditionLoop(node) { - if (node.test && isConstant(node.test, true)) { + if (node.test && isConstant(context.getScope(), node.test, true)) { loopsInCurrentScope.add(node); } } @@ -232,7 +87,7 @@ module.exports = { * @private */ function reportIfConstant(node) { - if (node.test && isConstant(node.test, true)) { + if (node.test && isConstant(context.getScope(), node.test, true)) { context.report({ node: node.test, messageId: "unexpected" }); } } diff --git a/node_modules/eslint/lib/rules/no-constructor-return.js b/node_modules/eslint/lib/rules/no-constructor-return.js index 4757770b7..911a32abc 100644 --- a/node_modules/eslint/lib/rules/no-constructor-return.js +++ b/node_modules/eslint/lib/rules/no-constructor-return.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow returning value from constructor", - category: "Best Practices", + description: "Disallow returning value from constructor", recommended: false, url: "https://eslint.org/docs/rules/no-constructor-return" }, diff --git a/node_modules/eslint/lib/rules/no-continue.js b/node_modules/eslint/lib/rules/no-continue.js index 96718d17a..80381fc3f 100644 --- a/node_modules/eslint/lib/rules/no-continue.js +++ b/node_modules/eslint/lib/rules/no-continue.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `continue` statements", - category: "Stylistic Issues", + description: "Disallow `continue` statements", recommended: false, url: "https://eslint.org/docs/rules/no-continue" }, diff --git a/node_modules/eslint/lib/rules/no-control-regex.js b/node_modules/eslint/lib/rules/no-control-regex.js index 6feeb6419..c42f86d12 100644 --- a/node_modules/eslint/lib/rules/no-control-regex.js +++ b/node_modules/eslint/lib/rules/no-control-regex.js @@ -5,7 +5,7 @@ "use strict"; -const RegExpValidator = require("regexpp").RegExpValidator; +const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; const collector = new (class { constructor() { this._source = ""; @@ -30,10 +30,12 @@ const collector = new (class { } } - collectControlChars(regexpStr) { + collectControlChars(regexpStr, flags) { + const uFlag = typeof flags === "string" && flags.includes("u"); + try { this._source = regexpStr; - this._validator.validatePattern(regexpStr); // Call onCharacter hook + this._validator.validatePattern(regexpStr, void 0, void 0, uFlag); // Call onCharacter hook } catch { // Ignore syntax errors in RegExp. @@ -46,13 +48,13 @@ const collector = new (class { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow control characters in regular expressions", - category: "Possible Errors", + description: "Disallow control characters in regular expressions", recommended: true, url: "https://eslint.org/docs/rules/no-control-regex" }, @@ -68,13 +70,15 @@ module.exports = { /** * Get the regex expression - * @param {ASTNode} node node to evaluate - * @returns {RegExp|null} Regex if found else null + * @param {ASTNode} node `Literal` node to evaluate + * @returns {{ pattern: string, flags: string | null } | null} Regex if found (the given node is either a regex literal + * or a string literal that is the pattern argument of a RegExp constructor call). Otherwise `null`. If flags cannot be determined, + * the `flags` property will be `null`. * @private */ - function getRegExpPattern(node) { + function getRegExp(node) { if (node.regex) { - return node.regex.pattern; + return node.regex; } if (typeof node.value === "string" && (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") && @@ -82,7 +86,15 @@ module.exports = { node.parent.callee.name === "RegExp" && node.parent.arguments[0] === node ) { - return node.value; + const pattern = node.value; + const flags = + node.parent.arguments.length > 1 && + node.parent.arguments[1].type === "Literal" && + typeof node.parent.arguments[1].value === "string" + ? node.parent.arguments[1].value + : null; + + return { pattern, flags }; } return null; @@ -90,10 +102,11 @@ module.exports = { return { Literal(node) { - const pattern = getRegExpPattern(node); + const regExp = getRegExp(node); - if (pattern) { - const controlCharacters = collector.collectControlChars(pattern); + if (regExp) { + const { pattern, flags } = regExp; + const controlCharacters = collector.collectControlChars(pattern, flags); if (controlCharacters.length > 0) { context.report({ diff --git a/node_modules/eslint/lib/rules/no-debugger.js b/node_modules/eslint/lib/rules/no-debugger.js index 95a28a862..3b88079a0 100644 --- a/node_modules/eslint/lib/rules/no-debugger.js +++ b/node_modules/eslint/lib/rules/no-debugger.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow the use of `debugger`", - category: "Possible Errors", + description: "Disallow the use of `debugger`", recommended: true, url: "https://eslint.org/docs/rules/no-debugger" }, diff --git a/node_modules/eslint/lib/rules/no-delete-var.js b/node_modules/eslint/lib/rules/no-delete-var.js index aeab951d7..41021bd46 100644 --- a/node_modules/eslint/lib/rules/no-delete-var.js +++ b/node_modules/eslint/lib/rules/no-delete-var.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow deleting variables", - category: "Variables", + description: "Disallow deleting variables", recommended: true, url: "https://eslint.org/docs/rules/no-delete-var" }, diff --git a/node_modules/eslint/lib/rules/no-div-regex.js b/node_modules/eslint/lib/rules/no-div-regex.js index 0ccabdcc6..dd1c5782a 100644 --- a/node_modules/eslint/lib/rules/no-div-regex.js +++ b/node_modules/eslint/lib/rules/no-div-regex.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow division operators explicitly at the beginning of regular expressions", - category: "Best Practices", + description: "Disallow division operators explicitly at the beginning of regular expressions", recommended: false, url: "https://eslint.org/docs/rules/no-div-regex" }, diff --git a/node_modules/eslint/lib/rules/no-dupe-args.js b/node_modules/eslint/lib/rules/no-dupe-args.js index 817277f52..faf253793 100644 --- a/node_modules/eslint/lib/rules/no-dupe-args.js +++ b/node_modules/eslint/lib/rules/no-dupe-args.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow duplicate arguments in `function` definitions", - category: "Possible Errors", + description: "Disallow duplicate arguments in `function` definitions", recommended: true, url: "https://eslint.org/docs/rules/no-dupe-args" }, diff --git a/node_modules/eslint/lib/rules/no-dupe-class-members.js b/node_modules/eslint/lib/rules/no-dupe-class-members.js index b12939d57..8eca7878a 100644 --- a/node_modules/eslint/lib/rules/no-dupe-class-members.js +++ b/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow duplicate class members", - category: "ECMAScript 6", + description: "Disallow duplicate class members", recommended: true, url: "https://eslint.org/docs/rules/no-dupe-class-members" }, @@ -73,20 +73,21 @@ module.exports = { }, // Reports the node if its name has been declared already. - MethodDefinition(node) { + "MethodDefinition, PropertyDefinition"(node) { const name = astUtils.getStaticPropertyName(node); + const kind = node.type === "MethodDefinition" ? node.kind : "field"; - if (name === null || node.kind === "constructor") { + if (name === null || kind === "constructor") { return; } const state = getState(name, node.static); let isDuplicate = false; - if (node.kind === "get") { + if (kind === "get") { isDuplicate = (state.init || state.get); state.get = true; - } else if (node.kind === "set") { + } else if (kind === "set") { isDuplicate = (state.init || state.set); state.set = true; } else { diff --git a/node_modules/eslint/lib/rules/no-dupe-else-if.js b/node_modules/eslint/lib/rules/no-dupe-else-if.js index cbeb437da..49db5ec7c 100644 --- a/node_modules/eslint/lib/rules/no-dupe-else-if.js +++ b/node_modules/eslint/lib/rules/no-dupe-else-if.js @@ -46,13 +46,13 @@ const splitByAnd = splitByLogicalOperator.bind(null, "&&"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow duplicate conditions in if-else-if chains", - category: "Possible Errors", + description: "Disallow duplicate conditions in if-else-if chains", recommended: true, url: "https://eslint.org/docs/rules/no-dupe-else-if" }, diff --git a/node_modules/eslint/lib/rules/no-dupe-keys.js b/node_modules/eslint/lib/rules/no-dupe-keys.js index 89e1f2de6..65c34bc5f 100644 --- a/node_modules/eslint/lib/rules/no-dupe-keys.js +++ b/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -23,7 +23,6 @@ const SET_KIND = /^(?:init|set)$/u; */ class ObjectInfo { - // eslint-disable-next-line jsdoc/require-description /** * @param {ObjectInfo|null} upper The information of the outer object. * @param {ASTNode} node The ObjectExpression node of this information. @@ -83,13 +82,13 @@ class ObjectInfo { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow duplicate keys in object literals", - category: "Possible Errors", + description: "Disallow duplicate keys in object literals", recommended: true, url: "https://eslint.org/docs/rules/no-dupe-keys" }, diff --git a/node_modules/eslint/lib/rules/no-duplicate-case.js b/node_modules/eslint/lib/rules/no-duplicate-case.js index e2d9665e7..d436afdd0 100644 --- a/node_modules/eslint/lib/rules/no-duplicate-case.js +++ b/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -16,13 +16,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow duplicate case labels", - category: "Possible Errors", + description: "Disallow duplicate case labels", recommended: true, url: "https://eslint.org/docs/rules/no-duplicate-case" }, diff --git a/node_modules/eslint/lib/rules/no-duplicate-imports.js b/node_modules/eslint/lib/rules/no-duplicate-imports.js index 7218dc64a..619e2588e 100644 --- a/node_modules/eslint/lib/rules/no-duplicate-imports.js +++ b/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -4,117 +4,253 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const NAMED_TYPES = ["ImportSpecifier", "ExportSpecifier"]; +const NAMESPACE_TYPES = [ + "ImportNamespaceSpecifier", + "ExportNamespaceSpecifier" +]; + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** - * Returns the name of the module imported or re-exported. + * Check if an import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier). + * @param {string} importExportType An import/export type to check. + * @param {string} type Can be "named" or "namespace" + * @returns {boolean} True if import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier) and false if it doesn't. + */ +function isImportExportSpecifier(importExportType, type) { + const arrayToCheck = type === "named" ? NAMED_TYPES : NAMESPACE_TYPES; + + return arrayToCheck.includes(importExportType); +} + +/** + * Return the type of (import|export). * @param {ASTNode} node A node to get. - * @returns {string} the name of the module, or empty string if no name. + * @returns {string} The type of the (import|export). */ -function getValue(node) { - if (node && node.source && node.source.value) { - return node.source.value.trim(); +function getImportExportType(node) { + if (node.specifiers && node.specifiers.length > 0) { + const nodeSpecifiers = node.specifiers; + const index = nodeSpecifiers.findIndex( + ({ type }) => + isImportExportSpecifier(type, "named") || + isImportExportSpecifier(type, "namespace") + ); + const i = index > -1 ? index : 0; + + return nodeSpecifiers[i].type; } + if (node.type === "ExportAllDeclaration") { + if (node.exported) { + return "ExportNamespaceSpecifier"; + } + return "ExportAll"; + } + return "SideEffectImport"; +} - return ""; +/** + * Returns a boolean indicates if two (import|export) can be merged + * @param {ASTNode} node1 A node to check. + * @param {ASTNode} node2 A node to check. + * @returns {boolean} True if two (import|export) can be merged, false if they can't. + */ +function isImportExportCanBeMerged(node1, node2) { + const importExportType1 = getImportExportType(node1); + const importExportType2 = getImportExportType(node2); + + if ( + (importExportType1 === "ExportAll" && + importExportType2 !== "ExportAll" && + importExportType2 !== "SideEffectImport") || + (importExportType1 !== "ExportAll" && + importExportType1 !== "SideEffectImport" && + importExportType2 === "ExportAll") + ) { + return false; + } + if ( + (isImportExportSpecifier(importExportType1, "namespace") && + isImportExportSpecifier(importExportType2, "named")) || + (isImportExportSpecifier(importExportType2, "namespace") && + isImportExportSpecifier(importExportType1, "named")) + ) { + return false; + } + return true; } /** - * Checks if the name of the import or export exists in the given array, and reports if so. - * @param {RuleContext} context The ESLint rule context object. - * @param {ASTNode} node A node to get. - * @param {string} value The name of the imported or exported module. - * @param {string[]} array The array containing other imports or exports in the file. - * @param {string} messageId A messageId to be reported after the name of the module - * - * @returns {void} No return value + * Returns a boolean if we should report (import|export). + * @param {ASTNode} node A node to be reported or not. + * @param {[ASTNode]} previousNodes An array contains previous nodes of the module imported or exported. + * @returns {boolean} True if the (import|export) should be reported. */ -function checkAndReport(context, node, value, array, messageId) { - if (array.indexOf(value) !== -1) { - context.report({ - node, - messageId, - data: { - module: value - } - }); +function shouldReportImportExport(node, previousNodes) { + let i = 0; + + while (i < previousNodes.length) { + if (isImportExportCanBeMerged(node, previousNodes[i])) { + return true; + } + i++; } + return false; } /** - * @callback nodeCallback - * @param {ASTNode} node A node to handle. + * Returns array contains only nodes with declarations types equal to type. + * @param {[{node: ASTNode, declarationType: string}]} nodes An array contains objects, each object contains a node and a declaration type. + * @param {string} type Declaration type. + * @returns {[ASTNode]} An array contains only nodes with declarations types equal to type. + */ +function getNodesByDeclarationType(nodes, type) { + return nodes + .filter(({ declarationType }) => declarationType === type) + .map(({ node }) => node); +} + +/** + * Returns the name of the module imported or re-exported. + * @param {ASTNode} node A node to get. + * @returns {string} The name of the module, or empty string if no name. */ +function getModule(node) { + if (node && node.source && node.source.value) { + return node.source.value.trim(); + } + return ""; +} /** - * Returns a function handling the imports of a given file + * Checks if the (import|export) can be merged with at least one import or one export, and reports if so. * @param {RuleContext} context The ESLint rule context object. + * @param {ASTNode} node A node to get. + * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type. + * @param {string} declarationType A declaration type can be an import or export. * @param {boolean} includeExports Whether or not to check for exports in addition to imports. - * @param {string[]} importsInFile The array containing other imports in the file. - * @param {string[]} exportsInFile The array containing other exports in the file. - * - * @returns {nodeCallback} A function passed to ESLint to handle the statement. + * @returns {void} No return value. */ -function handleImports(context, includeExports, importsInFile, exportsInFile) { - return function(node) { - const value = getValue(node); +function checkAndReport( + context, + node, + modules, + declarationType, + includeExports +) { + const module = getModule(node); - if (value) { - checkAndReport(context, node, value, importsInFile, "import"); + if (modules.has(module)) { + const previousNodes = modules.get(module); + const messagesIds = []; + const importNodes = getNodesByDeclarationType(previousNodes, "import"); + let exportNodes; + if (includeExports) { + exportNodes = getNodesByDeclarationType(previousNodes, "export"); + } + if (declarationType === "import") { + if (shouldReportImportExport(node, importNodes)) { + messagesIds.push("import"); + } if (includeExports) { - checkAndReport(context, node, value, exportsInFile, "importAs"); + if (shouldReportImportExport(node, exportNodes)) { + messagesIds.push("importAs"); + } + } + } else if (declarationType === "export") { + if (shouldReportImportExport(node, exportNodes)) { + messagesIds.push("export"); + } + if (shouldReportImportExport(node, importNodes)) { + messagesIds.push("exportAs"); } - - importsInFile.push(value); } - }; + messagesIds.forEach(messageId => + context.report({ + node, + messageId, + data: { + module + } + })); + } } /** - * Returns a function handling the exports of a given file + * @callback nodeCallback + * @param {ASTNode} node A node to handle. + */ + +/** + * Returns a function handling the (imports|exports) of a given file * @param {RuleContext} context The ESLint rule context object. - * @param {string[]} importsInFile The array containing other imports in the file. - * @param {string[]} exportsInFile The array containing other exports in the file. - * + * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type. + * @param {string} declarationType A declaration type can be an import or export. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. * @returns {nodeCallback} A function passed to ESLint to handle the statement. */ -function handleExports(context, importsInFile, exportsInFile) { +function handleImportsExports( + context, + modules, + declarationType, + includeExports +) { return function(node) { - const value = getValue(node); + const module = getModule(node); + + if (module) { + checkAndReport( + context, + node, + modules, + declarationType, + includeExports + ); + const currentNode = { node, declarationType }; + let nodes = [currentNode]; - if (value) { - checkAndReport(context, node, value, exportsInFile, "export"); - checkAndReport(context, node, value, importsInFile, "exportAs"); + if (modules.has(module)) { + const previousNodes = modules.get(module); - exportsInFile.push(value); + nodes = [...previousNodes, currentNode]; + } + modules.set(module, nodes); } }; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow duplicate module imports", - category: "ECMAScript 6", + description: "Disallow duplicate module imports", recommended: false, url: "https://eslint.org/docs/rules/no-duplicate-imports" }, - schema: [{ - type: "object", - properties: { - includeExports: { - type: "boolean", - default: false - } - }, - additionalProperties: false - }], + schema: [ + { + type: "object", + properties: { + includeExports: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { import: "'{{module}}' import is duplicated.", importAs: "'{{module}}' import is duplicated as export.", @@ -125,18 +261,30 @@ module.exports = { create(context) { const includeExports = (context.options[0] || {}).includeExports, - importsInFile = [], - exportsInFile = []; - + modules = new Map(); const handlers = { - ImportDeclaration: handleImports(context, includeExports, importsInFile, exportsInFile) + ImportDeclaration: handleImportsExports( + context, + modules, + "import", + includeExports + ) }; if (includeExports) { - handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile); - handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile); + handlers.ExportNamedDeclaration = handleImportsExports( + context, + modules, + "export", + includeExports + ); + handlers.ExportAllDeclaration = handleImportsExports( + context, + modules, + "export", + includeExports + ); } - return handlers; } }; diff --git a/node_modules/eslint/lib/rules/no-else-return.js b/node_modules/eslint/lib/rules/no-else-return.js index 84409fac8..f3ceedb4c 100644 --- a/node_modules/eslint/lib/rules/no-else-return.js +++ b/node_modules/eslint/lib/rules/no-else-return.js @@ -16,13 +16,13 @@ const FixTracker = require("./utils/fix-tracker"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `else` blocks after `return` statements in `if` statements", - category: "Best Practices", + description: "Disallow `else` blocks after `return` statements in `if` statements", recommended: false, url: "https://eslint.org/docs/rules/no-else-return" }, @@ -178,7 +178,7 @@ module.exports = { context.report({ node, messageId: "unexpected", - fix: fixer => { + fix(fixer) { if (!isSafeFromNameCollisions(node, currentScope)) { return null; diff --git a/node_modules/eslint/lib/rules/no-empty-character-class.js b/node_modules/eslint/lib/rules/no-empty-character-class.js index 7dc219fe1..2d294f4bd 100644 --- a/node_modules/eslint/lib/rules/no-empty-character-class.js +++ b/node_modules/eslint/lib/rules/no-empty-character-class.js @@ -12,28 +12,25 @@ /* * plain-English description of the following regexp: * 0. `^` fix the match at the beginning of the string - * 1. `\/`: the `/` that begins the regexp - * 2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following - * 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) - * 2.1. `\\.`: an escape sequence - * 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty - * 3. `\/` the `/` that ends the regexp - * 4. `[gimuy]*`: optional regexp flags - * 5. `$`: fix the match at the end of the string + * 1. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following + * 1.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) + * 1.1. `\\.`: an escape sequence + * 1.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty + * 2. `$`: fix the match at the end of the string */ -const regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u; +const regex = /^([^\\[]|\\.|\[([^\\\]]|\\.)+\])*$/u; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow empty character classes in regular expressions", - category: "Possible Errors", + description: "Disallow empty character classes in regular expressions", recommended: true, url: "https://eslint.org/docs/rules/no-empty-character-class" }, @@ -46,18 +43,12 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); - return { - - Literal(node) { - const token = sourceCode.getFirstToken(node); - - if (token.type === "RegularExpression" && !regex.test(token.value)) { + "Literal[regex]"(node) { + if (!regex.test(node.regex.pattern)) { context.report({ node, messageId: "unexpected" }); } } - }; } diff --git a/node_modules/eslint/lib/rules/no-empty-function.js b/node_modules/eslint/lib/rules/no-empty-function.js index c512f8cd5..4c9daa931 100644 --- a/node_modules/eslint/lib/rules/no-empty-function.js +++ b/node_modules/eslint/lib/rules/no-empty-function.js @@ -89,13 +89,13 @@ function getKind(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow empty functions", - category: "Best Practices", + description: "Disallow empty functions", recommended: false, url: "https://eslint.org/docs/rules/no-empty-function" }, @@ -144,7 +144,7 @@ module.exports = { filter: astUtils.isCommentToken }); - if (allowed.indexOf(kind) === -1 && + if (!allowed.includes(kind) && node.body.type === "BlockStatement" && node.body.body.length === 0 && innerComments.length === 0 diff --git a/node_modules/eslint/lib/rules/no-empty-pattern.js b/node_modules/eslint/lib/rules/no-empty-pattern.js index 9f34bfde9..5a497f039 100644 --- a/node_modules/eslint/lib/rules/no-empty-pattern.js +++ b/node_modules/eslint/lib/rules/no-empty-pattern.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow empty destructuring patterns", - category: "Best Practices", + description: "Disallow empty destructuring patterns", recommended: true, url: "https://eslint.org/docs/rules/no-empty-pattern" }, diff --git a/node_modules/eslint/lib/rules/no-empty-static-block.js b/node_modules/eslint/lib/rules/no-empty-static-block.js new file mode 100644 index 000000000..ab7106288 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-static-block.js @@ -0,0 +1,47 @@ +/** + * @fileoverview Rule to disallow empty static blocks. + * @author Sosuke Suzuki + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "Disallow empty static blocks", + recommended: false, + url: "https://eslint.org/docs/rules/no-empty-static-block" + }, + + schema: [], + + messages: { + unexpected: "Unexpected empty static block." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + StaticBlock(node) { + if (node.body.length === 0) { + const closingBrace = sourceCode.getLastToken(node); + + if (sourceCode.getCommentsBefore(closingBrace).length === 0) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty.js b/node_modules/eslint/lib/rules/no-empty.js index 45bf03c13..242e50efe 100644 --- a/node_modules/eslint/lib/rules/no-empty.js +++ b/node_modules/eslint/lib/rules/no-empty.js @@ -14,13 +14,14 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + hasSuggestions: true, type: "suggestion", docs: { - description: "disallow empty block statements", - category: "Possible Errors", + description: "Disallow empty block statements", recommended: true, url: "https://eslint.org/docs/rules/no-empty" }, @@ -39,7 +40,8 @@ module.exports = { ], messages: { - unexpected: "Empty {{type}} statement." + unexpected: "Empty {{type}} statement.", + suggestComment: "Add comment inside empty {{type}} statement." } }, @@ -71,7 +73,22 @@ module.exports = { return; } - context.report({ node, messageId: "unexpected", data: { type: "block" } }); + context.report({ + node, + messageId: "unexpected", + data: { type: "block" }, + suggest: [ + { + messageId: "suggestComment", + data: { type: "block" }, + fix(fixer) { + const range = [node.range[0] + 1, node.range[1] - 1]; + + return fixer.replaceTextRange(range, " /* empty */ "); + } + } + ] + }); }, SwitchStatement(node) { diff --git a/node_modules/eslint/lib/rules/no-eq-null.js b/node_modules/eslint/lib/rules/no-eq-null.js index b8dead96d..9a886803d 100644 --- a/node_modules/eslint/lib/rules/no-eq-null.js +++ b/node_modules/eslint/lib/rules/no-eq-null.js @@ -10,13 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `null` comparisons without type-checking operators", - category: "Best Practices", + description: "Disallow `null` comparisons without type-checking operators", recommended: false, url: "https://eslint.org/docs/rules/no-eq-null" }, diff --git a/node_modules/eslint/lib/rules/no-eval.js b/node_modules/eslint/lib/rules/no-eval.js index a020fdee0..a1b32cc30 100644 --- a/node_modules/eslint/lib/rules/no-eval.js +++ b/node_modules/eslint/lib/rules/no-eval.js @@ -37,13 +37,13 @@ function isMember(node, name) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `eval()`", - category: "Best Practices", + description: "Disallow the use of `eval()`", recommended: false, url: "https://eslint.org/docs/rules/no-eval" }, @@ -72,21 +72,25 @@ module.exports = { let funcInfo = null; /** - * Pushs a variable scope (Program or Function) information to the stack. + * Pushes a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack. + * Top-level scopes are handled separately. * * This is used in order to check whether or not `this` binding is a * reference to the global object. - * @param {ASTNode} node A node of the scope. This is one of Program, - * FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. + * @param {ASTNode} node A node of the scope. + * For functions, this is one of FunctionDeclaration, FunctionExpression. + * For class static blocks, this is StaticBlock. + * For class field initializers, this can be any node that is PropertyDefinition#value. * @returns {void} */ - function enterVarScope(node) { + function enterThisScope(node) { const strict = context.getScope().isStrict; funcInfo = { upper: funcInfo, node, strict, + isTopLevelOfScript: false, defaultThis: false, initialized: strict }; @@ -96,7 +100,7 @@ module.exports = { * Pops a variable scope from the stack. * @returns {void} */ - function exitVarScope() { + function exitThisScope() { funcInfo = funcInfo.upper; } @@ -222,12 +226,14 @@ module.exports = { strict = scope.isStrict || node.sourceType === "module" || - (features.globalReturn && scope.childScopes[0].isStrict); + (features.globalReturn && scope.childScopes[0].isStrict), + isTopLevelOfScript = node.sourceType !== "module" && !features.globalReturn; funcInfo = { upper: null, node, strict, + isTopLevelOfScript, defaultThis: true, initialized: true }; @@ -236,17 +242,19 @@ module.exports = { "Program:exit"() { const globalScope = context.getScope(); - exitVarScope(); + exitThisScope(); reportAccessingEval(globalScope); reportAccessingEvalViaGlobalObject(globalScope); }, - FunctionDeclaration: enterVarScope, - "FunctionDeclaration:exit": exitVarScope, - FunctionExpression: enterVarScope, - "FunctionExpression:exit": exitVarScope, - ArrowFunctionExpression: enterVarScope, - "ArrowFunctionExpression:exit": exitVarScope, + FunctionDeclaration: enterThisScope, + "FunctionDeclaration:exit": exitThisScope, + FunctionExpression: enterThisScope, + "FunctionExpression:exit": exitThisScope, + "PropertyDefinition > *.value": enterThisScope, + "PropertyDefinition > *.value:exit": exitThisScope, + StaticBlock: enterThisScope, + "StaticBlock:exit": exitThisScope, ThisExpression(node) { if (!isMember(node.parent, "eval")) { @@ -265,7 +273,8 @@ module.exports = { ); } - if (!funcInfo.strict && funcInfo.defaultThis) { + // `this` at the top level of scripts always refers to the global object + if (funcInfo.isTopLevelOfScript || (!funcInfo.strict && funcInfo.defaultThis)) { // `this.eval` is possible built-in `eval`. report(node.parent); diff --git a/node_modules/eslint/lib/rules/no-ex-assign.js b/node_modules/eslint/lib/rules/no-ex-assign.js index 116392036..4c77b1128 100644 --- a/node_modules/eslint/lib/rules/no-ex-assign.js +++ b/node_modules/eslint/lib/rules/no-ex-assign.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow reassigning exceptions in `catch` clauses", - category: "Possible Errors", + description: "Disallow reassigning exceptions in `catch` clauses", recommended: true, url: "https://eslint.org/docs/rules/no-ex-assign" }, diff --git a/node_modules/eslint/lib/rules/no-extend-native.js b/node_modules/eslint/lib/rules/no-extend-native.js index 2a804b563..52c6bd311 100644 --- a/node_modules/eslint/lib/rules/no-extend-native.js +++ b/node_modules/eslint/lib/rules/no-extend-native.js @@ -16,13 +16,13 @@ const globals = require("globals"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow extending native types", - category: "Best Practices", + description: "Disallow extending native types", recommended: false, url: "https://eslint.org/docs/rules/no-extend-native" }, diff --git a/node_modules/eslint/lib/rules/no-extra-bind.js b/node_modules/eslint/lib/rules/no-extra-bind.js index 2db440dc1..caf6d8b1f 100644 --- a/node_modules/eslint/lib/rules/no-extra-bind.js +++ b/node_modules/eslint/lib/rules/no-extra-bind.js @@ -20,13 +20,13 @@ const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpre // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary calls to `.bind()`", - category: "Best Practices", + description: "Disallow unnecessary calls to `.bind()`", recommended: false, url: "https://eslint.org/docs/rules/no-extra-bind" }, diff --git a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js index 6ae3ea62c..5f9411b46 100644 --- a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +++ b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const eslintUtils = require("eslint-utils"); +const eslintUtils = require("@eslint-community/eslint-utils"); const precedence = astUtils.getPrecedence; @@ -18,13 +18,13 @@ const precedence = astUtils.getPrecedence; // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary boolean casts", - category: "Possible Errors", + description: "Disallow unnecessary boolean casts", recommended: true, url: "https://eslint.org/docs/rules/no-extra-boolean-cast" }, @@ -51,13 +51,13 @@ module.exports = { const sourceCode = context.getSourceCode(); // Node types which have a test which will coerce values to booleans. - const BOOLEAN_NODE_TYPES = [ + const BOOLEAN_NODE_TYPES = new Set([ "IfStatement", "DoWhileStatement", "WhileStatement", "ConditionalExpression", "ForStatement" - ]; + ]); /** * Check if a node is a Boolean function or constructor. @@ -95,7 +95,7 @@ module.exports = { (isBooleanFunctionOrConstructorCall(node.parent) && node === node.parent.arguments[0]) || - (BOOLEAN_NODE_TYPES.indexOf(node.parent.type) !== -1 && + (BOOLEAN_NODE_TYPES.has(node.parent.type) && node === node.parent.test) || // ! @@ -150,6 +150,7 @@ module.exports = { * For example, if the parent is `ConditionalExpression`, `previousNode` must be its `test` child. * @param {ASTNode} previousNode Previous node. * @param {ASTNode} node The node to check. + * @throws {Error} (Unreachable.) * @returns {boolean} `true` if the node needs to be parenthesized. */ function needsParens(previousNode, node) { @@ -187,7 +188,7 @@ module.exports = { } return precedence(node) <= precedence(parent); - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error(`Unexpected parent type: ${parent.type}`); } diff --git a/node_modules/eslint/lib/rules/no-extra-label.js b/node_modules/eslint/lib/rules/no-extra-label.js index 81406e760..bda3dd0ef 100644 --- a/node_modules/eslint/lib/rules/no-extra-label.js +++ b/node_modules/eslint/lib/rules/no-extra-label.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary labels", - category: "Best Practices", + description: "Disallow unnecessary labels", recommended: false, url: "https://eslint.org/docs/rules/no-extra-label" }, diff --git a/node_modules/eslint/lib/rules/no-extra-parens.js b/node_modules/eslint/lib/rules/no-extra-parens.js index 307e340c9..efb01a337 100644 --- a/node_modules/eslint/lib/rules/no-extra-parens.js +++ b/node_modules/eslint/lib/rules/no-extra-parens.js @@ -8,16 +8,16 @@ // Rule Definition //------------------------------------------------------------------------------ -const { isParenthesized: isParenthesizedRaw } = require("eslint-utils"); +const { isParenthesized: isParenthesizedRaw } = require("@eslint-community/eslint-utils"); const astUtils = require("./utils/ast-utils.js"); +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow unnecessary parentheses", - category: "Possible Errors", + description: "Disallow unnecessary parentheses", recommended: false, url: "https://eslint.org/docs/rules/no-extra-parens" }, @@ -52,7 +52,8 @@ module.exports = { enforceForArrowConditionals: { type: "boolean" }, enforceForSequenceExpressions: { type: "boolean" }, enforceForNewInMemberExpressions: { type: "boolean" }, - enforceForFunctionPrototypeMethods: { type: "boolean" } + enforceForFunctionPrototypeMethods: { type: "boolean" }, + allowParensAfterCommentPattern: { type: "string" } }, additionalProperties: false } @@ -86,6 +87,7 @@ module.exports = { context.options[1].enforceForNewInMemberExpressions === false; const IGNORE_FUNCTION_PROTOTYPE_METHODS = ALL_NODES && context.options[1] && context.options[1].enforceForFunctionPrototypeMethods === false; + const ALLOW_PARENS_AFTER_COMMENT_PATTERN = ALL_NODES && context.options[1] && context.options[1].allowParensAfterCommentPattern; const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); const PRECEDENCE_OF_UPDATE_EXPR = precedence({ type: "UpdateExpression" }); @@ -402,6 +404,19 @@ module.exports = { if (isIIFE(node) && !isParenthesised(node.callee)) { return; } + + if (ALLOW_PARENS_AFTER_COMMENT_PATTERN) { + const commentsBeforeLeftParenToken = sourceCode.getCommentsBefore(leftParenToken); + const totalCommentsBeforeLeftParenTokenCount = commentsBeforeLeftParenToken.length; + const ignorePattern = new RegExp(ALLOW_PARENS_AFTER_COMMENT_PATTERN, "u"); + + if ( + totalCommentsBeforeLeftParenTokenCount > 0 && + ignorePattern.test(commentsBeforeLeftParenToken[totalCommentsBeforeLeftParenTokenCount - 1].value) + ) { + return; + } + } } /** @@ -634,10 +649,10 @@ module.exports = { currentNode = currentNode.parent; - /* istanbul ignore if */ + /* c8 ignore start */ if (currentNode === null) { throw new Error("Nodes are not in the ancestor-descendant relationship."); - } + }/* c8 ignore stop */ path.push(currentNode); } @@ -751,6 +766,38 @@ module.exports = { return false; } + /** + * Checks if the left-hand side of an assignment is an identifier, the operator is one of + * `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous class or function. + * + * As per https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation, an + * assignment involving one of the operators `=`, `&&=`, `||=` or `??=` where the right-hand + * side is an anonymous class or function and the left-hand side is an *unparenthesized* + * identifier has different semantics than other assignments. + * Specifically, when an expression like `foo = function () {}` is evaluated, `foo.name` + * will be set to the string "foo", i.e. the identifier name. The same thing does not happen + * when evaluating `(foo) = function () {}`. + * Since the parenthesizing of the identifier in the left-hand side is significant in this + * special case, the parentheses, if present, should not be flagged as unnecessary. + * @param {ASTNode} node an AssignmentExpression node. + * @returns {boolean} `true` if the left-hand side of the assignment is an identifier, the + * operator is one of `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous + * class or function; otherwise, `false`. + */ + function isAnonymousFunctionAssignmentException({ left, operator, right }) { + if (left.type === "Identifier" && ["=", "&&=", "||=", "??="].includes(operator)) { + const rhsType = right.type; + + if (rhsType === "ArrowFunctionExpression") { + return true; + } + if ((rhsType === "FunctionExpression" || rhsType === "ClassExpression") && !right.id) { + return true; + } + } + return false; + } + return { ArrayExpression(node) { node.elements @@ -789,7 +836,8 @@ module.exports = { }, AssignmentExpression(node) { - if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left)) { + if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left) && + (!isAnonymousFunctionAssignmentException(node) || isParenthesisedTwice(node.left))) { report(node.left); } @@ -808,13 +856,6 @@ module.exports = { CallExpression: checkCallNew, - ClassBody(node) { - node.body - .filter(member => member.type === "MethodDefinition" && member.computed && member.key) - .filter(member => hasExcessParensWithPrecedence(member.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) - .forEach(member => report(member.key)); - }, - ConditionalExpression(node) { if (isReturnAssignException(node)) { return; @@ -1063,6 +1104,12 @@ module.exports = { } }, + "MethodDefinition[computed=true]"(node) { + if (hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.key); + } + }, + NewExpression: checkCallNew, ObjectExpression(node) { @@ -1090,6 +1137,16 @@ module.exports = { } }, + PropertyDefinition(node) { + if (node.computed && hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.key); + } + + if (node.value && hasExcessParensWithPrecedence(node.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.value); + } + }, + RestElement(node) { const argument = node.argument; diff --git a/node_modules/eslint/lib/rules/no-extra-semi.js b/node_modules/eslint/lib/rules/no-extra-semi.js index e0a8df056..c61ad37dc 100644 --- a/node_modules/eslint/lib/rules/no-extra-semi.js +++ b/node_modules/eslint/lib/rules/no-extra-semi.js @@ -16,13 +16,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary semicolons", - category: "Possible Errors", + description: "Disallow unnecessary semicolons", recommended: true, url: "https://eslint.org/docs/rules/no-extra-semi" }, @@ -98,7 +98,7 @@ module.exports = { "WithStatement" ]; - if (allowedParentTypes.indexOf(parent.type) === -1) { + if (!allowedParentTypes.includes(parent.type)) { report(node); } }, @@ -117,7 +117,7 @@ module.exports = { * @param {Node} node A MethodDefinition node of the start point. * @returns {void} */ - MethodDefinition(node) { + "MethodDefinition, PropertyDefinition, StaticBlock"(node) { checkForPartOfClassBody(sourceCode.getTokenAfter(node)); } }; diff --git a/node_modules/eslint/lib/rules/no-fallthrough.js b/node_modules/eslint/lib/rules/no-fallthrough.js index dd1f3ed9d..4c911eaf4 100644 --- a/node_modules/eslint/lib/rules/no-fallthrough.js +++ b/node_modules/eslint/lib/rules/no-fallthrough.js @@ -8,7 +8,7 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); +const { directivesPattern } = require("../shared/directives"); //------------------------------------------------------------------------------ // Helpers @@ -17,17 +17,38 @@ const lodash = require("lodash"); const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; /** - * Checks whether or not a given node has a fallthrough comment. - * @param {ASTNode} node A SwitchCase node to get comments. + * Checks whether or not a given comment string is really a fallthrough comment and not an ESLint directive. + * @param {string} comment The comment string to check. + * @param {RegExp} fallthroughCommentPattern The regular expression used for checking for fallthrough comments. + * @returns {boolean} `true` if the comment string is truly a fallthrough comment. + */ +function isFallThroughComment(comment, fallthroughCommentPattern) { + return fallthroughCommentPattern.test(comment) && !directivesPattern.test(comment.trim()); +} + +/** + * Checks whether or not a given case has a fallthrough comment. + * @param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through. + * @param {ASTNode} subsequentCase The case after caseWhichFallsThrough. * @param {RuleContext} context A rule context which stores comments. * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. - * @returns {boolean} `true` if the node has a valid fallthrough comment. + * @returns {boolean} `true` if the case has a valid fallthrough comment. */ -function hasFallthroughComment(node, context, fallthroughCommentPattern) { +function hasFallthroughComment(caseWhichFallsThrough, subsequentCase, context, fallthroughCommentPattern) { const sourceCode = context.getSourceCode(); - const comment = lodash.last(sourceCode.getCommentsBefore(node)); - return Boolean(comment && fallthroughCommentPattern.test(comment.value)); + if (caseWhichFallsThrough.consequent.length === 1 && caseWhichFallsThrough.consequent[0].type === "BlockStatement") { + const trailingCloseBrace = sourceCode.getLastToken(caseWhichFallsThrough.consequent[0]); + const commentInBlock = sourceCode.getCommentsBefore(trailingCloseBrace).pop(); + + if (commentInBlock && isFallThroughComment(commentInBlock.value, fallthroughCommentPattern)) { + return true; + } + } + + const comment = sourceCode.getCommentsBefore(subsequentCase).pop(); + + return Boolean(comment && isFallThroughComment(comment.value, fallthroughCommentPattern)); } /** @@ -53,13 +74,13 @@ function hasBlankLinesBetween(node, token) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow fallthrough of `case` statements", - category: "Best Practices", + description: "Disallow fallthrough of `case` statements", recommended: true, url: "https://eslint.org/docs/rules/no-fallthrough" }, @@ -71,6 +92,10 @@ module.exports = { commentPattern: { type: "string", default: "" + }, + allowEmptyCase: { + type: "boolean", + default: false } }, additionalProperties: false @@ -86,6 +111,7 @@ module.exports = { const options = context.options[0] || {}; let currentCodePath = null; const sourceCode = context.getSourceCode(); + const allowEmptyCase = options.allowEmptyCase || false; /* * We need to use leading comments of the next SwitchCase node because @@ -99,7 +125,6 @@ module.exports = { } else { fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT; } - return { onCodePathStart(codePath) { currentCodePath = codePath; @@ -114,7 +139,8 @@ module.exports = { * Checks whether or not there is a fallthrough comment. * And reports the previous fallthrough node if that does not exist. */ - if (fallthroughCase && !hasFallthroughComment(node, context, fallthroughCommentPattern)) { + + if (fallthroughCase && (!hasFallthroughComment(fallthroughCase, node, context, fallthroughCommentPattern))) { context.report({ messageId: node.test ? "case" : "default", node @@ -132,8 +158,8 @@ module.exports = { * And allows empty cases and the last case. */ if (currentCodePath.currentSegments.some(isReachable) && - (node.consequent.length > 0 || hasBlankLinesBetween(node, nextToken)) && - lodash.last(node.parent.cases) !== node) { + (node.consequent.length > 0 || (!allowEmptyCase && hasBlankLinesBetween(node, nextToken))) && + node.parent.cases[node.parent.cases.length - 1] !== node) { fallthroughCase = node; } } diff --git a/node_modules/eslint/lib/rules/no-floating-decimal.js b/node_modules/eslint/lib/rules/no-floating-decimal.js index b1d883212..cce50bf9d 100644 --- a/node_modules/eslint/lib/rules/no-floating-decimal.js +++ b/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow leading or trailing decimal points in numeric literals", - category: "Best Practices", + description: "Disallow leading or trailing decimal points in numeric literals", recommended: false, url: "https://eslint.org/docs/rules/no-floating-decimal" }, diff --git a/node_modules/eslint/lib/rules/no-func-assign.js b/node_modules/eslint/lib/rules/no-func-assign.js index 33d0ad9ec..2c8fa6a8e 100644 --- a/node_modules/eslint/lib/rules/no-func-assign.js +++ b/node_modules/eslint/lib/rules/no-func-assign.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow reassigning `function` declarations", - category: "Possible Errors", + description: "Disallow reassigning `function` declarations", recommended: true, url: "https://eslint.org/docs/rules/no-func-assign" }, diff --git a/node_modules/eslint/lib/rules/no-global-assign.js b/node_modules/eslint/lib/rules/no-global-assign.js index ea854c4aa..9f2f0ee36 100644 --- a/node_modules/eslint/lib/rules/no-global-assign.js +++ b/node_modules/eslint/lib/rules/no-global-assign.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow assignments to native objects or read-only global variables", - category: "Best Practices", + description: "Disallow assignments to native objects or read-only global variables", recommended: true, url: "https://eslint.org/docs/rules/no-global-assign" }, @@ -78,7 +78,7 @@ module.exports = { * @returns {void} */ function checkVariable(variable) { - if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + if (variable.writeable === false && !exceptions.includes(variable.name)) { variable.references.forEach(checkReference); } } diff --git a/node_modules/eslint/lib/rules/no-implicit-coercion.js b/node_modules/eslint/lib/rules/no-implicit-coercion.js index a639711ec..d41261125 100644 --- a/node_modules/eslint/lib/rules/no-implicit-coercion.js +++ b/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -24,14 +24,15 @@ function parseOptions(options) { boolean: "boolean" in options ? options.boolean : true, number: "number" in options ? options.number : true, string: "string" in options ? options.string : true, + disallowTemplateShorthand: "disallowTemplateShorthand" in options ? options.disallowTemplateShorthand : false, allow: options.allow || [] }; } /** - * Checks whether or not a node is a double logical nigating. + * Checks whether or not a node is a double logical negating. * @param {ASTNode} node An UnaryExpression node to check. - * @returns {boolean} Whether or not the node is a double logical nigating. + * @returns {boolean} Whether or not the node is a double logical negating. */ function isDoubleLogicalNegating(node) { return ( @@ -70,6 +71,24 @@ function isMultiplyByOne(node) { ); } +/** + * Checks whether the given node logically represents multiplication by a fraction of `1`. + * For example, `a * 1` in `a * 1 / b` is technically multiplication by `1`, but the + * whole expression can be logically interpreted as `a * (1 / b)` rather than `(a * 1) / b`. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @param {SourceCode} sourceCode The source code object. + * @returns {boolean} Whether or not the node is a multiplying by a fraction of `1`. + */ +function isMultiplyByFractionOfOne(node, sourceCode) { + return node.type === "BinaryExpression" && + node.operator === "*" && + (node.right.type === "Literal" && node.right.value === 1) && + node.parent.type === "BinaryExpression" && + node.parent.operator === "/" && + node.parent.left === node && + !astUtils.isParenthesised(sourceCode, node); +} + /** * Checks whether the result of a node is numeric or not * @param {ASTNode} node The node to test @@ -108,6 +127,20 @@ function getNonNumericOperand(node) { return null; } +/** + * Checks whether an expression evaluates to a string. + * @param {ASTNode} node node that represents the expression to check. + * @returns {boolean} Whether or not the expression evaluates to a string. + */ +function isStringType(node) { + return astUtils.isStringLiteral(node) || + ( + node.type === "CallExpression" && + node.callee.type === "Identifier" && + node.callee.name === "String" + ); +} + /** * Checks whether a node is an empty string literal or not. * @param {ASTNode} node The node to check. @@ -125,8 +158,8 @@ function isEmptyString(node) { */ function isConcatWithEmptyString(node) { return node.operator === "+" && ( - (isEmptyString(node.left) && !astUtils.isStringLiteral(node.right)) || - (isEmptyString(node.right) && !astUtils.isStringLiteral(node.left)) + (isEmptyString(node.left) && !isStringType(node.right)) || + (isEmptyString(node.right) && !isStringType(node.left)) ); } @@ -152,13 +185,13 @@ function getNonEmptyOperand(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow shorthand type conversions", - category: "Best Practices", + description: "Disallow shorthand type conversions", recommended: false, url: "https://eslint.org/docs/rules/no-implicit-coercion" }, @@ -180,6 +213,10 @@ module.exports = { type: "boolean", default: true }, + disallowTemplateShorthand: { + type: "boolean", + default: false + }, allow: { type: "array", items: { @@ -238,7 +275,7 @@ module.exports = { let operatorAllowed; // !!foo - operatorAllowed = options.allow.indexOf("!!") >= 0; + operatorAllowed = options.allow.includes("!!"); if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`; @@ -246,7 +283,7 @@ module.exports = { } // ~foo.indexOf(bar) - operatorAllowed = options.allow.indexOf("~") >= 0; + operatorAllowed = options.allow.includes("~"); if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) { // `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case. @@ -257,7 +294,7 @@ module.exports = { } // +foo - operatorAllowed = options.allow.indexOf("+") >= 0; + operatorAllowed = options.allow.includes("+"); if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) { const recommendation = `Number(${sourceCode.getText(node.argument)})`; @@ -270,8 +307,9 @@ module.exports = { let operatorAllowed; // 1 * foo - operatorAllowed = options.allow.indexOf("*") >= 0; - const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node); + operatorAllowed = options.allow.includes("*"); + const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && !isMultiplyByFractionOfOne(node, sourceCode) && + getNonNumericOperand(node); if (nonNumericOperand) { const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`; @@ -280,7 +318,7 @@ module.exports = { } // "" + foo - operatorAllowed = options.allow.indexOf("+") >= 0; + operatorAllowed = options.allow.includes("+"); if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`; @@ -291,7 +329,7 @@ module.exports = { AssignmentExpression(node) { // foo += "" - const operatorAllowed = options.allow.indexOf("+") >= 0; + const operatorAllowed = options.allow.includes("+"); if (!operatorAllowed && options.string && isAppendEmptyString(node)) { const code = sourceCode.getText(getNonEmptyOperand(node)); @@ -299,6 +337,43 @@ module.exports = { report(node, recommendation, true); } + }, + + TemplateLiteral(node) { + if (!options.disallowTemplateShorthand) { + return; + } + + // tag`${foo}` + if (node.parent.type === "TaggedTemplateExpression") { + return; + } + + // `` or `${foo}${bar}` + if (node.expressions.length !== 1) { + return; + } + + + // `prefix${foo}` + if (node.quasis[0].value.cooked !== "") { + return; + } + + // `${foo}postfix` + if (node.quasis[1].value.cooked !== "") { + return; + } + + // if the expression is already a string, then this isn't a coercion + if (isStringType(node.expressions[0])) { + return; + } + + const code = sourceCode.getText(node.expressions[0]); + const recommendation = `String(${code})`; + + report(node, recommendation, true); } }; } diff --git a/node_modules/eslint/lib/rules/no-implicit-globals.js b/node_modules/eslint/lib/rules/no-implicit-globals.js index d4bfa3af8..c2cdd03f2 100644 --- a/node_modules/eslint/lib/rules/no-implicit-globals.js +++ b/node_modules/eslint/lib/rules/no-implicit-globals.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow declarations in the global scope", - category: "Best Practices", + description: "Disallow declarations in the global scope", recommended: false, url: "https://eslint.org/docs/rules/no-implicit-globals" }, @@ -77,6 +77,11 @@ module.exports = { return; } + // Variables exported by "exported" block comments + if (variable.eslintExported) { + return; + } + variable.defs.forEach(def => { const defNode = def.node; diff --git a/node_modules/eslint/lib/rules/no-implied-eval.js b/node_modules/eslint/lib/rules/no-implied-eval.js index b8120a648..c33b05d46 100644 --- a/node_modules/eslint/lib/rules/no-implied-eval.js +++ b/node_modules/eslint/lib/rules/no-implied-eval.js @@ -10,19 +10,19 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const { getStaticValue } = require("eslint-utils"); +const { getStaticValue } = require("@eslint-community/eslint-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `eval()`-like methods", - category: "Best Practices", + description: "Disallow the use of `eval()`-like methods", recommended: false, url: "https://eslint.org/docs/rules/no-implied-eval" }, diff --git a/node_modules/eslint/lib/rules/no-import-assign.js b/node_modules/eslint/lib/rules/no-import-assign.js index 41060d8ac..6cf2e5198 100644 --- a/node_modules/eslint/lib/rules/no-import-assign.js +++ b/node_modules/eslint/lib/rules/no-import-assign.js @@ -9,7 +9,7 @@ // Helpers //------------------------------------------------------------------------------ -const { findVariable } = require("eslint-utils"); +const { findVariable } = require("@eslint-community/eslint-utils"); const astUtils = require("./utils/ast-utils"); const WellKnownMutationFunctions = { @@ -174,13 +174,13 @@ function getWriteNode(id) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow assigning to imported bindings", - category: "Possible Errors", + description: "Disallow assigning to imported bindings", recommended: true, url: "https://eslint.org/docs/rules/no-import-assign" }, diff --git a/node_modules/eslint/lib/rules/no-inline-comments.js b/node_modules/eslint/lib/rules/no-inline-comments.js index dec278615..366f567f6 100644 --- a/node_modules/eslint/lib/rules/no-inline-comments.js +++ b/node_modules/eslint/lib/rules/no-inline-comments.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow inline comments after code", - category: "Stylistic Issues", + description: "Disallow inline comments after code", recommended: false, url: "https://eslint.org/docs/rules/no-inline-comments" }, diff --git a/node_modules/eslint/lib/rules/no-inner-declarations.js b/node_modules/eslint/lib/rules/no-inner-declarations.js index 0768bc611..932816641 100644 --- a/node_modules/eslint/lib/rules/no-inner-declarations.js +++ b/node_modules/eslint/lib/rules/no-inner-declarations.js @@ -15,16 +15,40 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ -const validParent = new Set(["Program", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); +const validParent = new Set(["Program", "StaticBlock", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]); +/** + * Finds the nearest enclosing context where this rule allows declarations and returns its description. + * @param {ASTNode} node Node to search from. + * @returns {string} Description. One of "program", "function body", "class static block body". + */ +function getAllowedBodyDescription(node) { + let { parent } = node; + + while (parent) { + + if (parent.type === "StaticBlock") { + return "class static block body"; + } + + if (astUtils.isFunction(parent)) { + return "function body"; + } + + ({ parent } = parent); + } + + return "program"; +} + +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow variable or `function` declarations in nested blocks", - category: "Possible Errors", + description: "Disallow variable or `function` declarations in nested blocks", recommended: true, url: "https://eslint.org/docs/rules/no-inner-declarations" }, @@ -60,14 +84,12 @@ module.exports = { return; } - const upperFunction = astUtils.getUpperFunction(parent); - context.report({ node, messageId: "moveDeclToRoot", data: { type: (node.type === "FunctionDeclaration" ? "function" : "variable"), - body: (upperFunction === null ? "program" : "function body") + body: getAllowedBodyDescription(node) } }); } diff --git a/node_modules/eslint/lib/rules/no-invalid-regexp.js b/node_modules/eslint/lib/rules/no-invalid-regexp.js index 94ad5ba6d..b2e11a008 100644 --- a/node_modules/eslint/lib/rules/no-invalid-regexp.js +++ b/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -8,22 +8,22 @@ // Requirements //------------------------------------------------------------------------------ -const RegExpValidator = require("regexpp").RegExpValidator; +const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; const validator = new RegExpValidator(); -const validFlags = /[gimuys]/gu; +const validFlags = /[dgimsuy]/gu; const undefined1 = void 0; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow invalid regular expression strings in `RegExp` constructors", - category: "Possible Errors", + description: "Disallow invalid regular expression strings in `RegExp` constructors", recommended: true, url: "https://eslint.org/docs/rules/no-invalid-regexp" }, @@ -59,6 +59,20 @@ module.exports = { } } + /** + * Reports error with the provided message. + * @param {ASTNode} node The node holding the invalid RegExp + * @param {string} message The message to report. + * @returns {void} + */ + function report(node, message) { + context.report({ + node, + messageId: "regexMessage", + data: { message } + }); + } + /** * Check if node is a string * @param {ASTNode} node node to evaluate @@ -108,10 +122,13 @@ module.exports = { /** * Check syntax error in a given flags. - * @param {string} flags The RegExp flags to validate. + * @param {string|null} flags The RegExp flags to validate. * @returns {string|null} The syntax error. */ function validateRegExpFlags(flags) { + if (!flags) { + return null; + } try { validator.validateFlags(flags); return null; @@ -122,34 +139,39 @@ module.exports = { return { "CallExpression, NewExpression"(node) { - if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp" || !isString(node.arguments[0])) { + if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp") { return; } - const pattern = node.arguments[0].value; + let flags = getFlags(node); if (flags && allowedFlags) { flags = flags.replace(allowedFlags, ""); } - const message = - ( - flags && validateRegExpFlags(flags) - ) || - ( + let message = validateRegExpFlags(flags); + + if (message) { + report(node, message); + return; + } + + if (!isString(node.arguments[0])) { + return; + } + + const pattern = node.arguments[0].value; + + message = ( - // If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag - flags === null - ? validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) - : validateRegExpPattern(pattern, flags.includes("u")) - ); + // If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag + flags === null + ? validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) + : validateRegExpPattern(pattern, flags.includes("u")) + ); if (message) { - context.report({ - node, - messageId: "regexMessage", - data: { message } - }); + report(node, message); } } }; diff --git a/node_modules/eslint/lib/rules/no-invalid-this.js b/node_modules/eslint/lib/rules/no-invalid-this.js index a79c586d7..b9cb43af5 100644 --- a/node_modules/eslint/lib/rules/no-invalid-this.js +++ b/node_modules/eslint/lib/rules/no-invalid-this.js @@ -1,5 +1,5 @@ /** - * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. + * @fileoverview A rule to disallow `this` keywords in contexts where the value of `this` is `undefined`. * @author Toru Nagashima */ @@ -11,17 +11,32 @@ const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given code path is a code path with lexical `this` binding. + * That is, if `this` within the code path refers to `this` of surrounding code path. + * @param {CodePath} codePath Code path. + * @param {ASTNode} node Node that started the code path. + * @returns {boolean} `true` if it is a code path with lexical `this` binding. + */ +function isCodePathWithLexicalThis(codePath, node) { + return codePath.origin === "function" && node.type === "ArrowFunctionExpression"; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `this` keywords outside of classes or class-like objects", - category: "Best Practices", + description: "Disallow use of `this` in contexts where the value of `this` is `undefined`", recommended: false, url: "https://eslint.org/docs/rules/no-invalid-this" }, @@ -72,63 +87,53 @@ module.exports = { return current; }; - /** - * Pushs new checking context into the stack. - * - * The checking context is not initialized yet. - * Because most functions don't have `this` keyword. - * When `this` keyword was found, the checking context is initialized. - * @param {ASTNode} node A function node that was entered. - * @returns {void} - */ - function enterFunction(node) { - - // `this` can be invalid only under strict mode. - stack.push({ - init: !context.getScope().isStrict, - node, - valid: true - }); - } + return { - /** - * Pops the current checking context from the stack. - * @returns {void} - */ - function exitFunction() { - stack.pop(); - } + onCodePathStart(codePath, node) { + if (isCodePathWithLexicalThis(codePath, node)) { + return; + } - return { + if (codePath.origin === "program") { + const scope = context.getScope(); + const features = context.parserOptions.ecmaFeatures || {}; - /* - * `this` is invalid only under strict mode. - * Modules is always strict mode. - */ - Program(node) { - const scope = context.getScope(), - features = context.parserOptions.ecmaFeatures || {}; + // `this` at the top level of scripts always refers to the global object + stack.push({ + init: true, + node, + valid: !( + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + return; + } + + /* + * `init: false` means that `valid` isn't determined yet. + * Most functions don't use `this`, and the calculation for `valid` + * is relatively costly, so we'll calculate it lazily when the first + * `this` within the function is traversed. A special case are non-strict + * functions, because `this` refers to the global object and therefore is + * always valid, so we can set `init: true` right away. + */ stack.push({ - init: true, + init: !context.getScope().isStrict, node, - valid: !( - scope.isStrict || - node.sourceType === "module" || - (features.globalReturn && scope.childScopes[0].isStrict) - ) + valid: true }); }, - "Program:exit"() { + onCodePathEnd(codePath, node) { + if (isCodePathWithLexicalThis(codePath, node)) { + return; + } + stack.pop(); }, - FunctionDeclaration: enterFunction, - "FunctionDeclaration:exit": exitFunction, - FunctionExpression: enterFunction, - "FunctionExpression:exit": exitFunction, - // Reports if `this` of the current context is invalid. ThisExpression(node) { const current = stack.getCurrent(); diff --git a/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/node_modules/eslint/lib/rules/no-irregular-whitespace.js index 15711c615..d1646c7b8 100644 --- a/node_modules/eslint/lib/rules/no-irregular-whitespace.js +++ b/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -25,13 +25,13 @@ const LINE_BREAK = astUtils.createGlobalLinebreakMatcher(); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow irregular whitespace", - category: "Possible Errors", + description: "Disallow irregular whitespace", recommended: true, url: "https://eslint.org/docs/rules/no-irregular-whitespace" }, diff --git a/node_modules/eslint/lib/rules/no-iterator.js b/node_modules/eslint/lib/rules/no-iterator.js index 9ba1e7aef..3550c7b11 100644 --- a/node_modules/eslint/lib/rules/no-iterator.js +++ b/node_modules/eslint/lib/rules/no-iterator.js @@ -15,13 +15,13 @@ const { getStaticPropertyName } = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of the `__iterator__` property", - category: "Best Practices", + description: "Disallow the use of the `__iterator__` property", recommended: false, url: "https://eslint.org/docs/rules/no-iterator" }, diff --git a/node_modules/eslint/lib/rules/no-label-var.js b/node_modules/eslint/lib/rules/no-label-var.js index 570db0328..a07d283f5 100644 --- a/node_modules/eslint/lib/rules/no-label-var.js +++ b/node_modules/eslint/lib/rules/no-label-var.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow labels that share a name with a variable", - category: "Variables", + description: "Disallow labels that share a name with a variable", recommended: false, url: "https://eslint.org/docs/rules/no-label-var" }, diff --git a/node_modules/eslint/lib/rules/no-labels.js b/node_modules/eslint/lib/rules/no-labels.js index 85760d80d..7257307f0 100644 --- a/node_modules/eslint/lib/rules/no-labels.js +++ b/node_modules/eslint/lib/rules/no-labels.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow labeled statements", - category: "Best Practices", + description: "Disallow labeled statements", recommended: false, url: "https://eslint.org/docs/rules/no-labels" }, @@ -98,7 +98,7 @@ module.exports = { info = info.upper; } - /* istanbul ignore next: syntax error */ + /* c8 ignore next */ return "other"; } diff --git a/node_modules/eslint/lib/rules/no-lone-blocks.js b/node_modules/eslint/lib/rules/no-lone-blocks.js index 290784b82..eb97f958c 100644 --- a/node_modules/eslint/lib/rules/no-lone-blocks.js +++ b/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary nested blocks", - category: "Best Practices", + description: "Disallow unnecessary nested blocks", recommended: false, url: "https://eslint.org/docs/rules/no-lone-blocks" }, @@ -40,7 +40,9 @@ module.exports = { * @returns {void} */ function report(node) { - const messageId = node.parent.type === "BlockStatement" ? "redundantNestedBlock" : "redundantBlock"; + const messageId = node.parent.type === "BlockStatement" || node.parent.type === "StaticBlock" + ? "redundantNestedBlock" + : "redundantBlock"; context.report({ node, @@ -55,6 +57,7 @@ module.exports = { */ function isLoneBlock(node) { return node.parent.type === "BlockStatement" || + node.parent.type === "StaticBlock" || node.parent.type === "Program" || // Don't report blocks in switch cases if the block is the only statement of the case. @@ -88,7 +91,7 @@ module.exports = { }; // ES6: report blocks without block-level bindings, or that's only child of another block - if (context.parserOptions.ecmaVersion >= 6) { + if (context.languageOptions.ecmaVersion >= 2015) { ruleDef = { BlockStatement(node) { if (isLoneBlock(node)) { @@ -100,7 +103,10 @@ module.exports = { loneBlocks.pop(); report(node); } else if ( - node.parent.type === "BlockStatement" && + ( + node.parent.type === "BlockStatement" || + node.parent.type === "StaticBlock" + ) && node.parent.body.length === 1 ) { report(node); diff --git a/node_modules/eslint/lib/rules/no-lonely-if.js b/node_modules/eslint/lib/rules/no-lonely-if.js index 6552adc57..0774b9fa3 100644 --- a/node_modules/eslint/lib/rules/no-lonely-if.js +++ b/node_modules/eslint/lib/rules/no-lonely-if.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `if` statements as the only statement in `else` blocks", - category: "Stylistic Issues", + description: "Disallow `if` statements as the only statement in `else` blocks", recommended: false, url: "https://eslint.org/docs/rules/no-lonely-if" }, diff --git a/node_modules/eslint/lib/rules/no-loop-func.js b/node_modules/eslint/lib/rules/no-loop-func.js index 13ebd3ee2..f81a71336 100644 --- a/node_modules/eslint/lib/rules/no-loop-func.js +++ b/node_modules/eslint/lib/rules/no-loop-func.js @@ -125,7 +125,7 @@ function isSafe(loopNode, reference) { * The reference is every reference of the upper scope's variable we are * looking now. * - * It's safeafe if the reference matches one of the following condition. + * It's safe if the reference matches one of the following condition. * - is readonly. * - doesn't exist inside a local function and after the border. * @param {eslint-scope.Reference} upperRef A reference to check. @@ -148,13 +148,13 @@ function isSafe(loopNode, reference) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow function declarations that contain unsafe references inside loop statements", - category: "Best Practices", + description: "Disallow function declarations that contain unsafe references inside loop statements", recommended: false, url: "https://eslint.org/docs/rules/no-loop-func" }, @@ -174,7 +174,7 @@ module.exports = { * - has a loop node in ancestors. * - has any references which refers to an unsafe variable. * @param {ASTNode} node The AST node to check. - * @returns {boolean} Whether or not the node is within a loop. + * @returns {void} */ function checkForLoops(node) { const loopNode = getContainingLoopNode(node); diff --git a/node_modules/eslint/lib/rules/no-loss-of-precision.js b/node_modules/eslint/lib/rules/no-loss-of-precision.js index 2d0c61842..3b2ab9c2f 100644 --- a/node_modules/eslint/lib/rules/no-loss-of-precision.js +++ b/node_modules/eslint/lib/rules/no-loss-of-precision.js @@ -9,14 +9,14 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow literal numbers that lose precision", - category: "Possible Errors", - recommended: false, + description: "Disallow literal numbers that lose precision", + recommended: true, url: "https://eslint.org/docs/rules/no-loss-of-precision" }, schema: [], @@ -105,7 +105,7 @@ module.exports = { } /** - * Converts an integer to to an object containing the integer's coefficient and order of magnitude + * Converts an integer to an object containing the integer's coefficient and order of magnitude * @param {string} stringInteger the string representation of the integer being converted * @returns {Object} the object containing the integer's coefficient and order of magnitude */ @@ -120,7 +120,7 @@ module.exports = { /** * - * Converts a float to to an object containing the floats's coefficient and order of magnitude + * Converts a float to an object containing the floats's coefficient and order of magnitude * @param {string} stringFloat the string representation of the float being converted * @returns {Object} the object containing the integer's coefficient and order of magnitude */ diff --git a/node_modules/eslint/lib/rules/no-magic-numbers.js b/node_modules/eslint/lib/rules/no-magic-numbers.js index 510b3f9b2..786e59522 100644 --- a/node_modules/eslint/lib/rules/no-magic-numbers.js +++ b/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -26,13 +26,13 @@ function normalizeIgnoreValue(x) { return x; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow magic numbers", - category: "Best Practices", + description: "Disallow magic numbers", recommended: false, url: "https://eslint.org/docs/rules/no-magic-numbers" }, @@ -65,6 +65,10 @@ module.exports = { ignoreDefaultValues: { type: "boolean", default: false + }, + ignoreClassFieldInitialValues: { + type: "boolean", + default: false } }, additionalProperties: false @@ -80,9 +84,10 @@ module.exports = { const config = context.options[0] || {}, detectObjects = !!config.detectObjects, enforceConst = !!config.enforceConst, - ignore = (config.ignore || []).map(normalizeIgnoreValue), + ignore = new Set((config.ignore || []).map(normalizeIgnoreValue)), ignoreArrayIndexes = !!config.ignoreArrayIndexes, - ignoreDefaultValues = !!config.ignoreDefaultValues; + ignoreDefaultValues = !!config.ignoreDefaultValues, + ignoreClassFieldInitialValues = !!config.ignoreClassFieldInitialValues; const okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; @@ -92,7 +97,7 @@ module.exports = { * @returns {boolean} true if the value is ignored */ function isIgnoredValue(value) { - return ignore.indexOf(value) !== -1; + return ignore.has(value); } /** @@ -106,6 +111,17 @@ module.exports = { return parent.type === "AssignmentPattern" && parent.right === fullNumberNode; } + /** + * Returns whether the number is the initial value of a class field. + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the number is the initial value of a class field. + */ + function isClassFieldInitialValue(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "PropertyDefinition" && parent.value === fullNumberNode; + } + /** * Returns whether the given node is used as a radix within parseInt() or Number.parseInt() * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node @@ -194,6 +210,7 @@ module.exports = { if ( isIgnoredValue(value) || (ignoreDefaultValues && isDefaultValue(fullNumberNode)) || + (ignoreClassFieldInitialValues && isClassFieldInitialValue(fullNumberNode)) || isParseIntRadix(fullNumberNode) || isJSXNumber(fullNumberNode) || (ignoreArrayIndexes && isArrayIndex(fullNumberNode, value)) @@ -209,7 +226,7 @@ module.exports = { }); } } else if ( - okTypes.indexOf(parent.type) === -1 || + !okTypes.includes(parent.type) || (parent.type === "AssignmentExpression" && parent.left.type === "Identifier") ) { context.report({ diff --git a/node_modules/eslint/lib/rules/no-misleading-character-class.js b/node_modules/eslint/lib/rules/no-misleading-character-class.js index 3d004615c..9aa7079e5 100644 --- a/node_modules/eslint/lib/rules/no-misleading-character-class.js +++ b/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -3,14 +3,17 @@ */ "use strict"; -const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); -const { RegExpParser, visitRegExpAST } = require("regexpp"); +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("@eslint-community/eslint-utils"); +const { RegExpValidator, RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); +const astUtils = require("./utils/ast-utils.js"); //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const REGEXPP_LATEST_ECMA_VERSION = 2022; + /** * Iterate character sequences of a given nodes. * @@ -98,17 +101,19 @@ const kinds = Object.keys(hasCharacterSequence); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow characters which are made with multiple code points in character class syntax", - category: "Possible Errors", + description: "Disallow characters which are made with multiple code points in character class syntax", recommended: true, url: "https://eslint.org/docs/rules/no-misleading-character-class" }, + hasSuggestions: true, + schema: [], messages: { @@ -116,10 +121,12 @@ module.exports = { combiningClass: "Unexpected combined character in character class.", emojiModifier: "Unexpected modified Emoji in character class.", regionalIndicatorSymbol: "Unexpected national flag in character class.", - zwj: "Unexpected joined character sequence in character class." + zwj: "Unexpected joined character sequence in character class.", + suggestUnicodeFlag: "Add unicode 'u' flag to regex." } }, create(context) { + const sourceCode = context.getSourceCode(); const parser = new RegExpParser(); /** @@ -127,17 +134,10 @@ module.exports = { * @param {Node} node The node to report. * @param {string} pattern The regular expression pattern to verify. * @param {string} flags The flags of the regular expression. + * @param {Function} unicodeFixer Fixer for missing "u" flag. * @returns {void} */ - function verify(node, pattern, flags) { - const has = { - surrogatePairWithoutUFlag: false, - combiningClass: false, - variationSelector: false, - emojiModifier: false, - regionalIndicatorSymbol: false, - zwj: false - }; + function verify(node, pattern, flags, unicodeFixer) { let patternNode; try { @@ -153,26 +153,75 @@ module.exports = { return; } + const foundKinds = new Set(); + visitRegExpAST(patternNode, { onCharacterClassEnter(ccNode) { for (const chars of iterateCharacterSequence(ccNode.elements)) { for (const kind of kinds) { - has[kind] = has[kind] || hasCharacterSequence[kind](chars); + if (hasCharacterSequence[kind](chars)) { + foundKinds.add(kind); + } } } } }); - for (const kind of kinds) { - if (has[kind]) { - context.report({ node, messageId: kind }); + for (const kind of foundKinds) { + let suggest; + + if (kind === "surrogatePairWithoutUFlag") { + suggest = [{ + messageId: "suggestUnicodeFlag", + fix: unicodeFixer + }]; } + + context.report({ + node, + messageId: kind, + suggest + }); } } + /** + * Checks if the given regular expression pattern would be valid with the `u` flag. + * @param {string} pattern The regular expression pattern to verify. + * @returns {boolean} `true` if the pattern would be valid with the `u` flag. + * `false` if the pattern would be invalid with the `u` flag or the configured + * ecmaVersion doesn't support the `u` flag. + */ + function isValidWithUnicodeFlag(pattern) { + const { ecmaVersion } = context.languageOptions; + + // ecmaVersion <= 5 doesn't support the 'u' flag + if (ecmaVersion <= 5) { + return false; + } + + const validator = new RegExpValidator({ + ecmaVersion: Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION) + }); + + try { + validator.validatePattern(pattern, void 0, void 0, /* uFlag = */ true); + } catch { + return false; + } + + return true; + } + return { "Literal[regex]"(node) { - verify(node, node.regex.pattern, node.regex.flags); + verify(node, node.regex.pattern, node.regex.flags, fixer => { + if (!isValidWithUnicodeFlag(node.regex.pattern)) { + return null; + } + + return fixer.insertTextAfter(node, "u"); + }); }, "Program"() { const scope = context.getScope(); @@ -191,7 +240,31 @@ module.exports = { const flags = getStringIfConstant(flagsNode, scope); if (typeof pattern === "string") { - verify(node, pattern, flags || ""); + verify(node, pattern, flags || "", fixer => { + + if (!isValidWithUnicodeFlag(pattern)) { + return null; + } + + if (node.arguments.length === 1) { + const penultimateToken = sourceCode.getLastToken(node, { skip: 1 }); // skip closing parenthesis + + return fixer.insertTextAfter( + penultimateToken, + astUtils.isCommaToken(penultimateToken) + ? ' "u",' + : ', "u"' + ); + } + + if ((flagsNode.type === "Literal" && typeof flagsNode.value === "string") || flagsNode.type === "TemplateLiteral") { + const range = [flagsNode.range[0], flagsNode.range[1] - 1]; + + return fixer.insertTextAfterRange(range, "u"); + } + + return null; + }); } } } diff --git a/node_modules/eslint/lib/rules/no-mixed-operators.js b/node_modules/eslint/lib/rules/no-mixed-operators.js index f0290e93e..cb6e9363c 100644 --- a/node_modules/eslint/lib/rules/no-mixed-operators.js +++ b/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -58,13 +58,13 @@ function normalizeOptions(options = {}) { /** * Checks whether any group which includes both given operator exists or not. - * @param {Array.} groups A list of groups to check. + * @param {Array} groups A list of groups to check. * @param {string} left An operator. * @param {string} right Another operator. * @returns {boolean} `true` if such group existed. */ function includesBothInAGroup(groups, left, right) { - return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); + return groups.some(group => group.includes(left) && group.includes(right)); } /** @@ -82,13 +82,13 @@ function getChildNode(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow mixed binary operators", - category: "Stylistic Issues", + description: "Disallow mixed binary operators", recommended: false, url: "https://eslint.org/docs/rules/no-mixed-operators" }, @@ -117,7 +117,7 @@ module.exports = { ], messages: { - unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'." + unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'. Use parentheses to clarify the intended order of operations." } }, @@ -161,17 +161,6 @@ module.exports = { ); } - /** - * Checks whether the operator of a given node is mixed with a - * conditional expression. - * @param {ASTNode} node A node to check. This is a conditional - * expression node - * @returns {boolean} `true` if the node was mixed. - */ - function isMixedWithConditionalParent(node) { - return !astUtils.isParenthesised(sourceCode, node) && !astUtils.isParenthesised(sourceCode, node.test); - } - /** * Gets the operator token of a given node. * @param {ASTNode} node A node to check. This is a BinaryExpression @@ -220,19 +209,13 @@ module.exports = { * @returns {void} */ function check(node) { - if (TARGET_NODE_TYPE.test(node.parent.type)) { - if (node.parent.type === "ConditionalExpression" && !shouldIgnore(node) && isMixedWithConditionalParent(node.parent)) { - reportBothOperators(node); - } else { - if (TARGET_NODE_TYPE.test(node.parent.type) && - isMixedWithParent(node) && - !shouldIgnore(node) - ) { - reportBothOperators(node); - } - } + if ( + TARGET_NODE_TYPE.test(node.parent.type) && + isMixedWithParent(node) && + !shouldIgnore(node) + ) { + reportBothOperators(node); } - } return { diff --git a/node_modules/eslint/lib/rules/no-mixed-requires.js b/node_modules/eslint/lib/rules/no-mixed-requires.js index a02de9104..4e9705744 100644 --- a/node_modules/eslint/lib/rules/no-mixed-requires.js +++ b/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce grouped require statements for Node.JS * @author Raphael Pigulla + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -9,6 +10,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -18,8 +20,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow `require` calls to be mixed with regular variable declarations", - category: "Node.js and CommonJS", + description: "Disallow `require` calls to be mixed with regular variable declarations", recommended: false, url: "https://eslint.org/docs/rules/no-mixed-requires" }, @@ -159,7 +160,7 @@ module.exports = { return REQ_COMPUTED; } - if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { + if (BUILTIN_MODULES.includes(arg.value)) { // "var fs = require('fs');" return REQ_CORE; diff --git a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js index 287cbda03..b2d5a040b 100644 --- a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +++ b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow mixed spaces and tabs for indentation", - category: "Stylistic Issues", + description: "Disallow mixed spaces and tabs for indentation", recommended: true, url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs" }, diff --git a/node_modules/eslint/lib/rules/no-multi-assign.js b/node_modules/eslint/lib/rules/no-multi-assign.js index ab6430c19..392b33ffd 100644 --- a/node_modules/eslint/lib/rules/no-multi-assign.js +++ b/node_modules/eslint/lib/rules/no-multi-assign.js @@ -10,18 +10,27 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow use of chained assignment expressions", - category: "Stylistic Issues", + description: "Disallow use of chained assignment expressions", recommended: false, url: "https://eslint.org/docs/rules/no-multi-assign" }, - schema: [], + schema: [{ + type: "object", + properties: { + ignoreNonDeclaration: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], messages: { unexpectedChain: "Unexpected chained assignment." @@ -33,15 +42,24 @@ module.exports = { //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- + const options = context.options[0] || { + ignoreNonDeclaration: false + }; + const selectors = [ + "VariableDeclarator > AssignmentExpression.init", + "PropertyDefinition > AssignmentExpression.value" + ]; + + if (!options.ignoreNonDeclaration) { + selectors.push("AssignmentExpression > AssignmentExpression.right"); + } return { - AssignmentExpression(node) { - if (["AssignmentExpression", "VariableDeclarator"].indexOf(node.parent.type) !== -1) { - context.report({ - node, - messageId: "unexpectedChain" - }); - } + [selectors](node) { + context.report({ + node, + messageId: "unexpectedChain" + }); } }; diff --git a/node_modules/eslint/lib/rules/no-multi-spaces.js b/node_modules/eslint/lib/rules/no-multi-spaces.js index d43ed7363..d8d3c6509 100644 --- a/node_modules/eslint/lib/rules/no-multi-spaces.js +++ b/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow multiple spaces", - category: "Best Practices", + description: "Disallow multiple spaces", recommended: false, url: "https://eslint.org/docs/rules/no-multi-spaces" }, @@ -56,7 +56,7 @@ module.exports = { const options = context.options[0] || {}; const ignoreEOLComments = options.ignoreEOLComments; const exceptions = Object.assign({ Property: true }, options.exceptions); - const hasExceptions = Object.keys(exceptions).filter(key => exceptions[key]).length > 0; + const hasExceptions = Object.keys(exceptions).some(key => exceptions[key]); /** * Formats value of given comment token for error message by truncating its length. diff --git a/node_modules/eslint/lib/rules/no-multi-str.js b/node_modules/eslint/lib/rules/no-multi-str.js index 7cf1ae367..c4400f45e 100644 --- a/node_modules/eslint/lib/rules/no-multi-str.js +++ b/node_modules/eslint/lib/rules/no-multi-str.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow multiline strings", - category: "Best Practices", + description: "Disallow multiline strings", recommended: false, url: "https://eslint.org/docs/rules/no-multi-str" }, diff --git a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js index 9cccef308..e8b0f9859 100644 --- a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +++ b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow multiple empty lines", - category: "Stylistic Issues", + description: "Disallow multiple empty lines", recommended: false, url: "https://eslint.org/docs/rules/no-multiple-empty-lines" }, diff --git a/node_modules/eslint/lib/rules/no-native-reassign.js b/node_modules/eslint/lib/rules/no-native-reassign.js index 833e3b7ce..634fea933 100644 --- a/node_modules/eslint/lib/rules/no-native-reassign.js +++ b/node_modules/eslint/lib/rules/no-native-reassign.js @@ -10,13 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow assignments to native objects or read-only global variables", - category: "Best Practices", + description: "Disallow assignments to native objects or read-only global variables", recommended: false, url: "https://eslint.org/docs/rules/no-native-reassign" }, @@ -81,7 +81,7 @@ module.exports = { * @returns {void} */ function checkVariable(variable) { - if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + if (variable.writeable === false && !exceptions.includes(variable.name)) { variable.references.forEach(checkReference); } } diff --git a/node_modules/eslint/lib/rules/no-negated-condition.js b/node_modules/eslint/lib/rules/no-negated-condition.js index 8a9eba881..387617767 100644 --- a/node_modules/eslint/lib/rules/no-negated-condition.js +++ b/node_modules/eslint/lib/rules/no-negated-condition.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow negated conditions", - category: "Stylistic Issues", + description: "Disallow negated conditions", recommended: false, url: "https://eslint.org/docs/rules/no-negated-condition" }, diff --git a/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/node_modules/eslint/lib/rules/no-negated-in-lhs.js index 1229cedd1..975a8d75c 100644 --- a/node_modules/eslint/lib/rules/no-negated-in-lhs.js +++ b/node_modules/eslint/lib/rules/no-negated-in-lhs.js @@ -10,13 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow negating the left operand in `in` expressions", - category: "Possible Errors", + description: "Disallow negating the left operand in `in` expressions", recommended: false, url: "https://eslint.org/docs/rules/no-negated-in-lhs" }, diff --git a/node_modules/eslint/lib/rules/no-nested-ternary.js b/node_modules/eslint/lib/rules/no-nested-ternary.js index 383bb2388..fe9782341 100644 --- a/node_modules/eslint/lib/rules/no-nested-ternary.js +++ b/node_modules/eslint/lib/rules/no-nested-ternary.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow nested ternary expressions", - category: "Stylistic Issues", + description: "Disallow nested ternary expressions", recommended: false, url: "https://eslint.org/docs/rules/no-nested-ternary" }, diff --git a/node_modules/eslint/lib/rules/no-new-func.js b/node_modules/eslint/lib/rules/no-new-func.js index 9af4e31ca..4759f380b 100644 --- a/node_modules/eslint/lib/rules/no-new-func.js +++ b/node_modules/eslint/lib/rules/no-new-func.js @@ -5,17 +5,29 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const callMethods = new Set(["apply", "bind", "call"]); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `new` operators with the `Function` object", - category: "Best Practices", + description: "Disallow `new` operators with the `Function` object", recommended: false, url: "https://eslint.org/docs/rules/no-new-func" }, @@ -38,14 +50,30 @@ module.exports = { variable.references.forEach(ref => { const node = ref.identifier; const { parent } = node; + let evalNode; + + if (parent) { + if (node === parent.callee && ( + parent.type === "NewExpression" || + parent.type === "CallExpression" + )) { + evalNode = parent; + } else if ( + parent.type === "MemberExpression" && + node === parent.object && + callMethods.has(astUtils.getStaticPropertyName(parent)) + ) { + const maybeCallee = parent.parent.type === "ChainExpression" ? parent.parent : parent; + + if (maybeCallee.parent.type === "CallExpression" && maybeCallee.parent.callee === maybeCallee) { + evalNode = maybeCallee.parent; + } + } + } - if ( - parent && - (parent.type === "NewExpression" || parent.type === "CallExpression") && - node === parent.callee - ) { + if (evalNode) { context.report({ - node: parent, + node: evalNode, messageId: "noFunctionConstructor" }); } diff --git a/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js b/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js new file mode 100644 index 000000000..a8405002b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to disallow use of the new operator with global non-constructor functions + * @author Sosuke Suzuki + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const nonConstructorGlobalFunctionNames = ["Symbol", "BigInt"]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow `new` operators with global non-constructor functions", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-native-nonconstructor" + }, + + schema: [], + + messages: { + noNewNonconstructor: "`{{name}}` cannot be called as a constructor." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + + for (const nonConstructorName of nonConstructorGlobalFunctionNames) { + const variable = globalScope.set.get(nonConstructorName); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const parent = node.parent; + + if (parent && parent.type === "NewExpression" && parent.callee === node) { + context.report({ + node, + messageId: "noNewNonconstructor", + data: { name: nonConstructorName } + }); + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-object.js b/node_modules/eslint/lib/rules/no-new-object.js index e9f915db5..4dbe8db73 100644 --- a/node_modules/eslint/lib/rules/no-new-object.js +++ b/node_modules/eslint/lib/rules/no-new-object.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `Object` constructors", - category: "Stylistic Issues", + description: "Disallow `Object` constructors", recommended: false, url: "https://eslint.org/docs/rules/no-new-object" }, @@ -29,7 +29,7 @@ module.exports = { schema: [], messages: { - preferLiteral: "The object literal notation {} is preferrable." + preferLiteral: "The object literal notation {} is preferable." } }, diff --git a/node_modules/eslint/lib/rules/no-new-require.js b/node_modules/eslint/lib/rules/no-new-require.js index 063f783e7..63ca057b7 100644 --- a/node_modules/eslint/lib/rules/no-new-require.js +++ b/node_modules/eslint/lib/rules/no-new-require.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to disallow use of new operator with the `require` function * @author Wil Moore III + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -9,6 +10,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -18,8 +20,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow `new` operators with calls to `require`", - category: "Node.js and CommonJS", + description: "Disallow `new` operators with calls to `require`", recommended: false, url: "https://eslint.org/docs/rules/no-new-require" }, diff --git a/node_modules/eslint/lib/rules/no-new-symbol.js b/node_modules/eslint/lib/rules/no-new-symbol.js index aeb509c0d..534201c0b 100644 --- a/node_modules/eslint/lib/rules/no-new-symbol.js +++ b/node_modules/eslint/lib/rules/no-new-symbol.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow `new` operators with the `Symbol` object", - category: "ECMAScript 6", + description: "Disallow `new` operators with the `Symbol` object", recommended: true, url: "https://eslint.org/docs/rules/no-new-symbol" }, diff --git a/node_modules/eslint/lib/rules/no-new-wrappers.js b/node_modules/eslint/lib/rules/no-new-wrappers.js index d276c48d2..ff44efc59 100644 --- a/node_modules/eslint/lib/rules/no-new-wrappers.js +++ b/node_modules/eslint/lib/rules/no-new-wrappers.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects", - category: "Best Practices", + description: "Disallow `new` operators with the `String`, `Number`, and `Boolean` objects", recommended: false, url: "https://eslint.org/docs/rules/no-new-wrappers" }, @@ -34,7 +34,7 @@ module.exports = { NewExpression(node) { const wrapperObjects = ["String", "Number", "Boolean"]; - if (wrapperObjects.indexOf(node.callee.name) > -1) { + if (wrapperObjects.includes(node.callee.name)) { context.report({ node, messageId: "noConstructor", diff --git a/node_modules/eslint/lib/rules/no-new.js b/node_modules/eslint/lib/rules/no-new.js index aa8a4e268..c43450575 100644 --- a/node_modules/eslint/lib/rules/no-new.js +++ b/node_modules/eslint/lib/rules/no-new.js @@ -10,13 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `new` operators outside of assignments or comparisons", - category: "Best Practices", + description: "Disallow `new` operators outside of assignments or comparisons", recommended: false, url: "https://eslint.org/docs/rules/no-new" }, diff --git a/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js b/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js index a4b46d959..63e2264b3 100644 --- a/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +++ b/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js @@ -24,18 +24,19 @@ function getUnicodeEscape(character) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `\\8` and `\\9` escape sequences in string literals", - category: "Best Practices", - recommended: false, - url: "https://eslint.org/docs/rules/no-nonoctal-decimal-escape", - suggestion: true + description: "Disallow `\\8` and `\\9` escape sequences in string literals", + recommended: true, + url: "https://eslint.org/docs/rules/no-nonoctal-decimal-escape" }, + hasSuggestions: true, + schema: [], messages: { diff --git a/node_modules/eslint/lib/rules/no-obj-calls.js b/node_modules/eslint/lib/rules/no-obj-calls.js index 6eb200c9b..2e2cb5b24 100644 --- a/node_modules/eslint/lib/rules/no-obj-calls.js +++ b/node_modules/eslint/lib/rules/no-obj-calls.js @@ -9,14 +9,14 @@ // Requirements //------------------------------------------------------------------------------ -const { CALL, CONSTRUCT, ReferenceTracker } = require("eslint-utils"); +const { CALL, CONSTRUCT, ReferenceTracker } = require("@eslint-community/eslint-utils"); const getPropertyName = require("./utils/ast-utils").getStaticPropertyName; //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ -const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect"]; +const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect", "Intl"]; /** * Returns the name of the node to report @@ -37,13 +37,13 @@ function getReportNodeName(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow calling global object properties as functions", - category: "Possible Errors", + description: "Disallow calling global object properties as functions", recommended: true, url: "https://eslint.org/docs/rules/no-obj-calls" }, diff --git a/node_modules/eslint/lib/rules/no-octal-escape.js b/node_modules/eslint/lib/rules/no-octal-escape.js index 5b4c7b2eb..81a8a74cd 100644 --- a/node_modules/eslint/lib/rules/no-octal-escape.js +++ b/node_modules/eslint/lib/rules/no-octal-escape.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow octal escape sequences in string literals", - category: "Best Practices", + description: "Disallow octal escape sequences in string literals", recommended: false, url: "https://eslint.org/docs/rules/no-octal-escape" }, diff --git a/node_modules/eslint/lib/rules/no-octal.js b/node_modules/eslint/lib/rules/no-octal.js index e9940befa..eec56919f 100644 --- a/node_modules/eslint/lib/rules/no-octal.js +++ b/node_modules/eslint/lib/rules/no-octal.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow octal literals", - category: "Best Practices", + description: "Disallow octal literals", recommended: true, url: "https://eslint.org/docs/rules/no-octal" }, @@ -23,7 +23,7 @@ module.exports = { schema: [], messages: { - noOcatal: "Octal literals should not be used." + noOctal: "Octal literals should not be used." } }, @@ -35,7 +35,7 @@ module.exports = { if (typeof node.value === "number" && /^0[0-9]/u.test(node.raw)) { context.report({ node, - messageId: "noOcatal" + messageId: "noOctal" }); } } diff --git a/node_modules/eslint/lib/rules/no-param-reassign.js b/node_modules/eslint/lib/rules/no-param-reassign.js index 6874af44f..f89435c86 100644 --- a/node_modules/eslint/lib/rules/no-param-reassign.js +++ b/node_modules/eslint/lib/rules/no-param-reassign.js @@ -10,13 +10,13 @@ const stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/u; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow reassigning `function` parameters", - category: "Best Practices", + description: "Disallow reassigning `function` parameters", recommended: false, url: "https://eslint.org/docs/rules/no-param-reassign" }, diff --git a/node_modules/eslint/lib/rules/no-path-concat.js b/node_modules/eslint/lib/rules/no-path-concat.js index fc1f894f8..8502c511e 100644 --- a/node_modules/eslint/lib/rules/no-path-concat.js +++ b/node_modules/eslint/lib/rules/no-path-concat.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow string concatenation when using __dirname and __filename * @author Nicholas C. Zakas + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -8,6 +9,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -17,8 +19,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow string concatenation with `__dirname` and `__filename`", - category: "Node.js and CommonJS", + description: "Disallow string concatenation with `__dirname` and `__filename`", recommended: false, url: "https://eslint.org/docs/rules/no-path-concat" }, diff --git a/node_modules/eslint/lib/rules/no-plusplus.js b/node_modules/eslint/lib/rules/no-plusplus.js index 84d6c3e1f..cda6b05bf 100644 --- a/node_modules/eslint/lib/rules/no-plusplus.js +++ b/node_modules/eslint/lib/rules/no-plusplus.js @@ -45,13 +45,13 @@ function isForLoopAfterthought(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the unary operators `++` and `--`", - category: "Stylistic Issues", + description: "Disallow the unary operators `++` and `--`", recommended: false, url: "https://eslint.org/docs/rules/no-plusplus" }, diff --git a/node_modules/eslint/lib/rules/no-process-env.js b/node_modules/eslint/lib/rules/no-process-env.js index 49d173490..5db7c94b1 100644 --- a/node_modules/eslint/lib/rules/no-process-env.js +++ b/node_modules/eslint/lib/rules/no-process-env.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow the use of process.env() * @author Vignesh Anand + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -8,6 +9,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -17,8 +19,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow the use of `process.env`", - category: "Node.js and CommonJS", + description: "Disallow the use of `process.env`", recommended: false, url: "https://eslint.org/docs/rules/no-process-env" }, diff --git a/node_modules/eslint/lib/rules/no-process-exit.js b/node_modules/eslint/lib/rules/no-process-exit.js index 77c9cfd7c..ca3ecfe6f 100644 --- a/node_modules/eslint/lib/rules/no-process-exit.js +++ b/node_modules/eslint/lib/rules/no-process-exit.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow the use of process.exit() * @author Nicholas C. Zakas + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -8,6 +9,7 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -17,8 +19,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow the use of `process.exit()`", - category: "Node.js and CommonJS", + description: "Disallow the use of `process.exit()`", recommended: false, url: "https://eslint.org/docs/rules/no-process-exit" }, diff --git a/node_modules/eslint/lib/rules/no-promise-executor-return.js b/node_modules/eslint/lib/rules/no-promise-executor-return.js index 32ee6e151..e81ed1d04 100644 --- a/node_modules/eslint/lib/rules/no-promise-executor-return.js +++ b/node_modules/eslint/lib/rules/no-promise-executor-return.js @@ -9,7 +9,7 @@ // Requirements //------------------------------------------------------------------------------ -const { findVariable } = require("eslint-utils"); +const { findVariable } = require("@eslint-community/eslint-utils"); //------------------------------------------------------------------------------ // Helpers @@ -63,13 +63,13 @@ function isPromiseExecutor(node, scope) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow returning values from Promise executor functions", - category: "Possible Errors", + description: "Disallow returning values from Promise executor functions", recommended: false, url: "https://eslint.org/docs/rules/no-promise-executor-return" }, diff --git a/node_modules/eslint/lib/rules/no-proto.js b/node_modules/eslint/lib/rules/no-proto.js index 82ce02fa4..771d206a8 100644 --- a/node_modules/eslint/lib/rules/no-proto.js +++ b/node_modules/eslint/lib/rules/no-proto.js @@ -15,13 +15,13 @@ const { getStaticPropertyName } = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of the `__proto__` property", - category: "Best Practices", + description: "Disallow the use of the `__proto__` property", recommended: false, url: "https://eslint.org/docs/rules/no-proto" }, diff --git a/node_modules/eslint/lib/rules/no-prototype-builtins.js b/node_modules/eslint/lib/rules/no-prototype-builtins.js index c5e4d4925..ea2763396 100644 --- a/node_modules/eslint/lib/rules/no-prototype-builtins.js +++ b/node_modules/eslint/lib/rules/no-prototype-builtins.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow calling some `Object.prototype` methods directly on objects", - category: "Possible Errors", + description: "Disallow calling some `Object.prototype` methods directly on objects", recommended: true, url: "https://eslint.org/docs/rules/no-prototype-builtins" }, @@ -33,11 +33,11 @@ module.exports = { }, create(context) { - const DISALLOWED_PROPS = [ + const DISALLOWED_PROPS = new Set([ "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable" - ]; + ]); /** * Reports if a disallowed property is used in a CallExpression @@ -54,7 +54,7 @@ module.exports = { const propName = astUtils.getStaticPropertyName(callee); - if (propName !== null && DISALLOWED_PROPS.indexOf(propName) > -1) { + if (propName !== null && DISALLOWED_PROPS.has(propName)) { context.report({ messageId: "prototypeBuildIn", loc: callee.property.loc, diff --git a/node_modules/eslint/lib/rules/no-redeclare.js b/node_modules/eslint/lib/rules/no-redeclare.js index 6ddb21c9e..59749cb66 100644 --- a/node_modules/eslint/lib/rules/no-redeclare.js +++ b/node_modules/eslint/lib/rules/no-redeclare.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow variable redeclaration", - category: "Best Practices", + description: "Disallow variable redeclaration", recommended: true, url: "https://eslint.org/docs/rules/no-redeclare" }, @@ -162,6 +162,8 @@ module.exports = { FunctionExpression: checkForBlock, ArrowFunctionExpression: checkForBlock, + StaticBlock: checkForBlock, + BlockStatement: checkForBlock, ForStatement: checkForBlock, ForInStatement: checkForBlock, diff --git a/node_modules/eslint/lib/rules/no-regex-spaces.js b/node_modules/eslint/lib/rules/no-regex-spaces.js index e6d4c9efb..e6564bc45 100644 --- a/node_modules/eslint/lib/rules/no-regex-spaces.js +++ b/node_modules/eslint/lib/rules/no-regex-spaces.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const regexpp = require("regexpp"); +const regexpp = require("@eslint-community/regexpp"); //------------------------------------------------------------------------------ // Helpers @@ -33,13 +33,13 @@ function isString(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow multiple spaces in regular expressions", - category: "Possible Errors", + description: "Disallow multiple spaces in regular expressions", recommended: true, url: "https://eslint.org/docs/rules/no-regex-spaces" }, diff --git a/node_modules/eslint/lib/rules/no-restricted-exports.js b/node_modules/eslint/lib/rules/no-restricted-exports.js index f0df0ffae..d201e3b03 100644 --- a/node_modules/eslint/lib/rules/no-restricted-exports.js +++ b/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -5,51 +5,108 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow specified names in exports", - category: "ECMAScript 6", + description: "Disallow specified names in exports", recommended: false, url: "https://eslint.org/docs/rules/no-restricted-exports" }, schema: [{ - type: "object", - properties: { - restrictedNamedExports: { - type: "array", - items: { - type: "string" + anyOf: [ + { + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string", + pattern: "^(?!default$)" + }, + uniqueItems: true + }, + restrictDefaultExports: { + type: "object", + properties: { + + // Allow/Disallow `export default foo; export default 42; export default function foo() {}` format + direct: { + type: "boolean" + }, + + // Allow/Disallow `export { foo as default };` declarations + named: { + type: "boolean" + }, + + // Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations + defaultFrom: { + type: "boolean" + }, + + // Allow/Disallow `export { foo as default } from "mod";` declarations + namedFrom: { + type: "boolean" + }, + + // Allow/Disallow `export * as default from "mod"`; declarations + namespaceFrom: { + type: "boolean" + } + }, + additionalProperties: false + } }, - uniqueItems: true + additionalProperties: false } - }, - additionalProperties: false + ] }], messages: { - restrictedNamed: "'{{name}}' is restricted from being used as an exported name." + restrictedNamed: "'{{name}}' is restricted from being used as an exported name.", + restrictedDefault: "Exporting 'default' is restricted." } }, create(context) { const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports); + const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports; /** - * Checks and reports given exported identifier. - * @param {ASTNode} node exported `Identifier` node to check. + * Checks and reports given exported name. + * @param {ASTNode} node exported `Identifier` or string `Literal` node to check. * @returns {void} */ function checkExportedName(node) { - const name = node.name; + const name = astUtils.getModuleExportName(node); if (restrictedNames.has(name)) { context.report({ @@ -57,6 +114,42 @@ module.exports = { messageId: "restrictedNamed", data: { name } }); + return; + } + + if (name === "default") { + if (node.parent.type === "ExportAllDeclaration") { + if (restrictDefaultExports && restrictDefaultExports.namespaceFrom) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + + } else { // ExportSpecifier + const isSourceSpecified = !!node.parent.parent.source; + const specifierLocalName = astUtils.getModuleExportName(node.parent.local); + + if (!isSourceSpecified && restrictDefaultExports && restrictDefaultExports.named) { + context.report({ + node, + messageId: "restrictedDefault" + }); + return; + } + + if (isSourceSpecified && restrictDefaultExports) { + if ( + (specifierLocalName === "default" && restrictDefaultExports.defaultFrom) || + (specifierLocalName !== "default" && restrictDefaultExports.namedFrom) + ) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + } + } } } @@ -67,6 +160,15 @@ module.exports = { } }, + ExportDefaultDeclaration(node) { + if (restrictDefaultExports && restrictDefaultExports.direct) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + }, + ExportNamedDeclaration(node) { const declaration = node.declaration; diff --git a/node_modules/eslint/lib/rules/no-restricted-globals.js b/node_modules/eslint/lib/rules/no-restricted-globals.js index 2c932a730..b66623838 100644 --- a/node_modules/eslint/lib/rules/no-restricted-globals.js +++ b/node_modules/eslint/lib/rules/no-restricted-globals.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow specified global variables", - category: "Variables", + description: "Disallow specified global variables", recommended: false, url: "https://eslint.org/docs/rules/no-restricted-globals" }, @@ -43,7 +43,7 @@ module.exports = { messages: { defaultMessage: "Unexpected use of '{{name}}'.", - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period customMessage: "Unexpected use of '{{name}}'. {{customMessage}}" } }, diff --git a/node_modules/eslint/lib/rules/no-restricted-imports.js b/node_modules/eslint/lib/rules/no-restricted-imports.js index c205dad8b..f4838679e 100644 --- a/node_modules/eslint/lib/rules/no-restricted-imports.js +++ b/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -4,18 +4,18 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ const ignore = require("ignore"); -const arrayOfStrings = { - type: "array", - items: { type: "string" }, - uniqueItems: true -}; - const arrayOfStringsOrObjects = { type: "array", items: { @@ -44,30 +44,86 @@ const arrayOfStringsOrObjects = { uniqueItems: true }; +const arrayOfStringsOrObjectPatterns = { + anyOf: [ + { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + { + type: "array", + items: { + type: "object", + properties: { + importNames: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + group: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + message: { + type: "string", + minLength: 1 + }, + caseSensitive: { + type: "boolean" + } + }, + additionalProperties: false, + required: ["group"] + }, + uniqueItems: true + } + ] +}; + +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow specified modules when loaded by `import`", - category: "ECMAScript 6", + description: "Disallow specified modules when loaded by `import`", recommended: false, url: "https://eslint.org/docs/rules/no-restricted-imports" }, messages: { path: "'{{importSource}}' import is restricted from being used.", - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period pathWithCustomMessage: "'{{importSource}}' import is restricted from being used. {{customMessage}}", patterns: "'{{importSource}}' import is restricted from being used by a pattern.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternWithCustomMessage: "'{{importSource}}' import is restricted from being used by a pattern. {{customMessage}}", + + patternAndImportName: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndImportNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}", + + patternAndEverything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern.", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndEverythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}", everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.", - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period everythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}", importName: "'{{importName}}' import from '{{importSource}}' is restricted.", - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period importNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}" }, @@ -80,7 +136,7 @@ module.exports = { type: "object", properties: { paths: arrayOfStringsOrObjects, - patterns: arrayOfStrings + patterns: arrayOfStringsOrObjectPatterns }, additionalProperties: false }], @@ -98,13 +154,6 @@ module.exports = { (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; - const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; - - // if no imports are restricted we don"t need to check - if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { - return {}; - } - const restrictedPathMessages = restrictedPaths.reduce((memo, importSource) => { if (typeof importSource === "string") { memo[importSource] = { message: null }; @@ -117,7 +166,25 @@ module.exports = { return memo; }, {}); - const restrictedPatternsMatcher = ignore().add(restrictedPatterns); + // Handle patterns too, either as strings or groups + let restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + // standardize to array of objects if we have an array of strings + if (restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string") { + restrictedPatterns = [{ group: restrictedPatterns }]; + } + + // relative paths are supported for this rule + const restrictedPatternGroups = restrictedPatterns.map(({ group, message, caseSensitive, importNames }) => ({ + matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group), + customMessage: message, + importNames + })); + + // if no imports are restricted we don't need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatternGroups.length === 0) { + return {}; + } /** * Report a restricted path. @@ -184,29 +251,80 @@ module.exports = { /** * Report a restricted path specifically for patterns. * @param {node} node representing the restricted path reference + * @param {Object} group contains an Ignore instance for paths, the customMessage to show on failure, + * and any restricted import names that have been specified in the config + * @param {Map} importNames Map of import names that are being imported * @returns {void} * @private */ - function reportPathForPatterns(node) { + function reportPathForPatterns(node, group, importNames) { const importSource = node.source.value.trim(); - context.report({ - node, - messageId: "patterns", - data: { - importSource + const customMessage = group.customMessage; + const restrictedImportNames = group.importNames; + + /* + * If we are not restricting to any specific import names and just the pattern itself, + * report the error and move on + */ + if (!restrictedImportNames) { + context.report({ + node, + messageId: customMessage ? "patternWithCustomMessage" : "patterns", + data: { + importSource, + customMessage + } + }); + return; + } + + if (importNames.has("*")) { + const specifierData = importNames.get("*")[0]; + + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithCustomMessage" : "patternAndEverything", + loc: specifierData.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } + + restrictedImportNames.forEach(importName => { + if (!importNames.has(importName)) { + return; } + + const specifiers = importNames.get(importName); + + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "patternAndImportNameWithCustomMessage" : "patternAndImportName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); }); } /** * Check if the given importSource is restricted by a pattern. * @param {string} importSource path of the import + * @param {Object} group contains a Ignore instance for paths, and the customMessage to show if it fails * @returns {boolean} whether the variable is a restricted pattern or not * @private */ - function isRestrictedPattern(importSource) { - return restrictedPatterns.length > 0 && restrictedPatternsMatcher.ignores(importSource); + function isRestrictedPattern(importSource, group) { + return group.matcher.ignores(importSource); } /** @@ -233,12 +351,12 @@ module.exports = { } else if (specifier.type === "ImportNamespaceSpecifier") { name = "*"; } else if (specifier.imported) { - name = specifier.imported.name; + name = astUtils.getModuleExportName(specifier.imported); } else if (specifier.local) { - name = specifier.local.name; + name = astUtils.getModuleExportName(specifier.local); } - if (name) { + if (typeof name === "string") { if (importNames.has(name)) { importNames.get(name).push(specifierData); } else { @@ -249,10 +367,11 @@ module.exports = { } checkRestrictedPathAndReport(importSource, importNames, node); - - if (isRestrictedPattern(importSource)) { - reportPathForPatterns(node); - } + restrictedPatternGroups.forEach(group => { + if (isRestrictedPattern(importSource, group)) { + reportPathForPatterns(node, group, importNames); + } + }); } return { diff --git a/node_modules/eslint/lib/rules/no-restricted-modules.js b/node_modules/eslint/lib/rules/no-restricted-modules.js index d0b8a78a5..c37694f90 100644 --- a/node_modules/eslint/lib/rules/no-restricted-modules.js +++ b/node_modules/eslint/lib/rules/no-restricted-modules.js @@ -1,6 +1,7 @@ /** * @fileoverview Restrict usage of specified node modules. * @author Christian Schulz + * @deprecated in ESLint v7.0.0 */ "use strict"; @@ -38,6 +39,7 @@ const arrayOfStringsOrObjects = { uniqueItems: true }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -47,8 +49,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow specified modules when loaded by `require`", - category: "Node.js and CommonJS", + description: "Disallow specified modules when loaded by `require`", recommended: false, url: "https://eslint.org/docs/rules/no-restricted-modules" }, @@ -73,7 +74,7 @@ module.exports = { messages: { defaultMessage: "'{{name}}' module is restricted from being used.", - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period customMessage: "'{{name}}' module is restricted from being used. {{customMessage}}", patternMessage: "'{{name}}' module is restricted from being used by a pattern." } @@ -97,12 +98,13 @@ module.exports = { return memo; }, {}); - // if no imports are restricted we don"t need to check + // if no imports are restricted we don't need to check if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { return {}; } - const ig = ignore().add(restrictedPatterns); + // relative paths are supported for this rule + const ig = ignore({ allowRelativePaths: true }).add(restrictedPatterns); /** diff --git a/node_modules/eslint/lib/rules/no-restricted-properties.js b/node_modules/eslint/lib/rules/no-restricted-properties.js index 7ab83995a..7c0349856 100644 --- a/node_modules/eslint/lib/rules/no-restricted-properties.js +++ b/node_modules/eslint/lib/rules/no-restricted-properties.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow certain properties on certain objects", - category: "Best Practices", + description: "Disallow certain properties on certain objects", recommended: false, url: "https://eslint.org/docs/rules/no-restricted-properties" }, @@ -64,9 +64,9 @@ module.exports = { }, messages: { - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period restrictedObjectProperty: "'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}", - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period restrictedProperty: "'{{propertyName}}' is restricted from being used.{{message}}" } }, diff --git a/node_modules/eslint/lib/rules/no-restricted-syntax.js b/node_modules/eslint/lib/rules/no-restricted-syntax.js index 9572603a8..76369cfd5 100644 --- a/node_modules/eslint/lib/rules/no-restricted-syntax.js +++ b/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow specified syntax", - category: "Stylistic Issues", + description: "Disallow specified syntax", recommended: false, url: "https://eslint.org/docs/rules/no-restricted-syntax" }, @@ -42,7 +42,7 @@ module.exports = { }, messages: { - // eslint-disable-next-line eslint-plugin/report-message-format + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period restrictedSyntax: "{{message}}" } }, diff --git a/node_modules/eslint/lib/rules/no-return-assign.js b/node_modules/eslint/lib/rules/no-return-assign.js index 4b57d42eb..ccaf2c1c1 100644 --- a/node_modules/eslint/lib/rules/no-return-assign.js +++ b/node_modules/eslint/lib/rules/no-return-assign.js @@ -20,13 +20,13 @@ const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionE // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow assignment operators in `return` statements", - category: "Best Practices", + description: "Disallow assignment operators in `return` statements", recommended: false, url: "https://eslint.org/docs/rules/no-return-assign" }, diff --git a/node_modules/eslint/lib/rules/no-return-await.js b/node_modules/eslint/lib/rules/no-return-await.js index d1d898268..ecfd6697a 100644 --- a/node_modules/eslint/lib/rules/no-return-await.js +++ b/node_modules/eslint/lib/rules/no-return-await.js @@ -10,13 +10,14 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + hasSuggestions: true, type: "suggestion", docs: { - description: "disallow unnecessary `return await`", - category: "Best Practices", + description: "Disallow unnecessary `return await`", recommended: false, @@ -29,6 +30,7 @@ module.exports = { ], messages: { + removeAwait: "Remove redundant `await`.", redundantUseOfAwait: "Redundant use of `await` on a return value." } }, @@ -44,7 +46,32 @@ module.exports = { context.report({ node: context.getSourceCode().getFirstToken(node), loc: node.loc, - messageId: "redundantUseOfAwait" + messageId: "redundantUseOfAwait", + suggest: [ + { + messageId: "removeAwait", + fix(fixer) { + const sourceCode = context.getSourceCode(); + const [awaitToken, tokenAfterAwait] = sourceCode.getFirstTokens(node, 2); + + const areAwaitAndAwaitedExpressionOnTheSameLine = awaitToken.loc.start.line === tokenAfterAwait.loc.start.line; + + if (!areAwaitAndAwaitedExpressionOnTheSameLine) { + return null; + } + + const [startOfAwait, endOfAwait] = awaitToken.range; + + const characterAfterAwait = sourceCode.text[endOfAwait]; + const trimLength = characterAfterAwait === " " ? 1 : 0; + + const range = [startOfAwait, endOfAwait + trimLength]; + + return fixer.removeRange(range); + } + } + ] + }); } diff --git a/node_modules/eslint/lib/rules/no-script-url.js b/node_modules/eslint/lib/rules/no-script-url.js index 0c8205244..41479006e 100644 --- a/node_modules/eslint/lib/rules/no-script-url.js +++ b/node_modules/eslint/lib/rules/no-script-url.js @@ -2,8 +2,7 @@ * @fileoverview Rule to flag when using javascript: urls * @author Ilya Volodin */ -/* jshint scripturl: true */ -/* eslint no-script-url: 0 */ +/* eslint no-script-url: 0 -- Code is checking to report such URLs */ "use strict"; @@ -13,13 +12,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `javascript:` urls", - category: "Best Practices", + description: "Disallow `javascript:` urls", recommended: false, url: "https://eslint.org/docs/rules/no-script-url" }, diff --git a/node_modules/eslint/lib/rules/no-self-assign.js b/node_modules/eslint/lib/rules/no-self-assign.js index 705be324c..348ee8dfc 100644 --- a/node_modules/eslint/lib/rules/no-self-assign.js +++ b/node_modules/eslint/lib/rules/no-self-assign.js @@ -124,13 +124,13 @@ function eachSelfAssignment(left, right, props, report) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow assignments where both sides are exactly the same", - category: "Best Practices", + description: "Disallow assignments where both sides are exactly the same", recommended: true, url: "https://eslint.org/docs/rules/no-self-assign" }, @@ -174,7 +174,7 @@ module.exports = { return { AssignmentExpression(node) { - if (node.operator === "=") { + if (["=", "&&=", "||=", "??="].includes(node.operator)) { eachSelfAssignment(node.left, node.right, props, report); } } diff --git a/node_modules/eslint/lib/rules/no-self-compare.js b/node_modules/eslint/lib/rules/no-self-compare.js index 79b6ac7ea..dab0db4b9 100644 --- a/node_modules/eslint/lib/rules/no-self-compare.js +++ b/node_modules/eslint/lib/rules/no-self-compare.js @@ -10,13 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow comparisons where both sides are exactly the same", - category: "Best Practices", + description: "Disallow comparisons where both sides are exactly the same", recommended: false, url: "https://eslint.org/docs/rules/no-self-compare" }, diff --git a/node_modules/eslint/lib/rules/no-sequences.js b/node_modules/eslint/lib/rules/no-sequences.js index d67635d11..2c0c27c3f 100644 --- a/node_modules/eslint/lib/rules/no-sequences.js +++ b/node_modules/eslint/lib/rules/no-sequences.js @@ -11,22 +11,38 @@ const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_OPTIONS = { + allowInParentheses: true +}; + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow comma operators", - category: "Best Practices", + description: "Disallow comma operators", recommended: false, url: "https://eslint.org/docs/rules/no-sequences" }, - schema: [], + schema: [{ + properties: { + allowInParentheses: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], messages: { unexpectedCommaExpression: "Unexpected use of comma operator." @@ -34,6 +50,7 @@ module.exports = { }, create(context) { + const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0]); const sourceCode = context.getSourceCode(); /** @@ -99,13 +116,15 @@ module.exports = { } // Wrapping a sequence in extra parens indicates intent - if (requiresExtraParens(node)) { - if (isParenthesisedTwice(node)) { - return; - } - } else { - if (isParenthesised(node)) { - return; + if (options.allowInParentheses) { + if (requiresExtraParens(node)) { + if (isParenthesisedTwice(node)) { + return; + } + } else { + if (isParenthesised(node)) { + return; + } } } diff --git a/node_modules/eslint/lib/rules/no-setter-return.js b/node_modules/eslint/lib/rules/no-setter-return.js index 9c79240dd..a43637e7b 100644 --- a/node_modules/eslint/lib/rules/no-setter-return.js +++ b/node_modules/eslint/lib/rules/no-setter-return.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const { findVariable } = require("eslint-utils"); +const { findVariable } = require("@eslint-community/eslint-utils"); //------------------------------------------------------------------------------ // Helpers @@ -93,6 +93,7 @@ function isSetter(node, scope) { const parent = node.parent; if ( + (parent.type === "Property" || parent.type === "MethodDefinition") && parent.kind === "set" && parent.value === node ) { @@ -135,13 +136,13 @@ function getOuterScope(scope) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow returning values from setters", - category: "Possible Errors", + description: "Disallow returning values from setters", recommended: true, url: "https://eslint.org/docs/rules/no-setter-return" }, diff --git a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js index 9647e9a1b..a7d6d00f1 100644 --- a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +++ b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -21,13 +21,13 @@ function safelyShadowsUndefined(variable) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow identifiers from shadowing restricted names", - category: "Variables", + description: "Disallow identifiers from shadowing restricted names", recommended: true, url: "https://eslint.org/docs/rules/no-shadow-restricted-names" }, diff --git a/node_modules/eslint/lib/rules/no-shadow.js b/node_modules/eslint/lib/rules/no-shadow.js index a0b1db50c..3af9354eb 100644 --- a/node_modules/eslint/lib/rules/no-shadow.js +++ b/node_modules/eslint/lib/rules/no-shadow.js @@ -11,17 +11,26 @@ const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const FUNC_EXPR_NODE_TYPES = new Set(["ArrowFunctionExpression", "FunctionExpression"]); +const CALL_EXPR_NODE_TYPE = new Set(["CallExpression"]); +const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow variable declarations from shadowing variables declared in the outer scope", - category: "Variables", + description: "Disallow variable declarations from shadowing variables declared in the outer scope", recommended: false, url: "https://eslint.org/docs/rules/no-shadow" }, @@ -37,7 +46,8 @@ module.exports = { items: { type: "string" } - } + }, + ignoreOnInitialization: { type: "boolean", default: false } }, additionalProperties: false } @@ -54,16 +64,116 @@ module.exports = { const options = { builtinGlobals: context.options[0] && context.options[0].builtinGlobals, hoist: (context.options[0] && context.options[0].hoist) || "functions", - allow: (context.options[0] && context.options[0].allow) || [] + allow: (context.options[0] && context.options[0].allow) || [], + ignoreOnInitialization: context.options[0] && context.options[0].ignoreOnInitialization }; + /** + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ + function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; + } + + /** + * Searches from the current node through its ancestry to find a matching node. + * @param {ASTNode} node a node to get. + * @param {(node: ASTNode) => boolean} match a callback that checks whether or not the node verifies its condition or not. + * @returns {ASTNode|null} the matching node. + */ + function findSelfOrAncestor(node, match) { + let currentNode = node; + + while (currentNode && !match(currentNode)) { + currentNode = currentNode.parent; + } + return currentNode; + } + + /** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ + function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + return upper; + } + + /** + * Checks if a variable and a shadowedVariable have the same init pattern ancestor. + * @param {Object} variable a variable to check. + * @param {Object} shadowedVariable a shadowedVariable to check. + * @returns {boolean} Whether or not the variable and the shadowedVariable have the same init pattern ancestor. + */ + function isInitPatternNode(variable, shadowedVariable) { + const outerDef = shadowedVariable.defs[0]; + + if (!outerDef) { + return false; + } + + const { variableScope } = variable.scope; + + + if (!(FUNC_EXPR_NODE_TYPES.has(variableScope.block.type) && getOuterScope(variableScope) === shadowedVariable.scope)) { + return false; + } + + const fun = variableScope.block; + const { parent } = fun; + + const callExpression = findSelfOrAncestor( + parent, + node => CALL_EXPR_NODE_TYPE.has(node.type) + ); + + if (!callExpression) { + return false; + } + + let node = outerDef.name; + const location = callExpression.range[1]; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + if (FOR_IN_OF_TYPE.test(node.parent.parent.type) && + isInRange(node.parent.parent.right, location) + ) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; + } + /** * Check if variable name is allowed. - * @param {ASTNode} variable The variable to check. + * @param {ASTNode} variable The variable to check. * @returns {boolean} Whether or not the variable name is allowed. */ function isAllowed(variable) { - return options.allow.indexOf(variable.name) !== -1; + return options.allow.includes(variable.name); } /** @@ -99,11 +209,11 @@ module.exports = { return ( outer && - inner && - outer[0] < inner[0] && - inner[1] < outer[1] && - ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && - outerScope === innerScope.upper + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && + outerScope === innerScope.upper ); } @@ -154,11 +264,11 @@ module.exports = { return ( inner && - outer && - inner[1] < outer[0] && + outer && + inner[1] < outer[0] && - // Excepts FunctionDeclaration if is {"hoist":"function"}. - (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") ); } @@ -175,8 +285,8 @@ module.exports = { // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. if (variable.identifiers.length === 0 || - isDuplicatedClassNameVariable(variable) || - isAllowed(variable) + isDuplicatedClassNameVariable(variable) || + isAllowed(variable) ) { continue; } @@ -185,9 +295,10 @@ module.exports = { const shadowed = astUtils.getVariableByName(scope.upper, variable.name); if (shadowed && - (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && - !isOnInitializer(variable, shadowed) && - !(options.hoist !== "all" && isInTdz(variable, shadowed)) + (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && + !isOnInitializer(variable, shadowed) && + !(options.ignoreOnInitialization && isInitPatternNode(variable, shadowed)) && + !(options.hoist !== "all" && isInTdz(variable, shadowed)) ) { const location = getDeclaredLocation(shadowed); const messageId = location.global ? "noShadowGlobal" : "noShadow"; diff --git a/node_modules/eslint/lib/rules/no-spaced-func.js b/node_modules/eslint/lib/rules/no-spaced-func.js index 961bc681f..97e2da06b 100644 --- a/node_modules/eslint/lib/rules/no-spaced-func.js +++ b/node_modules/eslint/lib/rules/no-spaced-func.js @@ -10,13 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow spacing between function identifiers and their applications (deprecated)", - category: "Stylistic Issues", + description: "Disallow spacing between function identifiers and their applications (deprecated)", recommended: false, url: "https://eslint.org/docs/rules/no-spaced-func" }, diff --git a/node_modules/eslint/lib/rules/no-sparse-arrays.js b/node_modules/eslint/lib/rules/no-sparse-arrays.js index e8407c3fa..0e95fe4af 100644 --- a/node_modules/eslint/lib/rules/no-sparse-arrays.js +++ b/node_modules/eslint/lib/rules/no-sparse-arrays.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow sparse arrays", - category: "Possible Errors", + description: "Disallow sparse arrays", recommended: true, url: "https://eslint.org/docs/rules/no-sparse-arrays" }, @@ -37,7 +37,7 @@ module.exports = { ArrayExpression(node) { - const emptySpot = node.elements.indexOf(null) > -1; + const emptySpot = node.elements.includes(null); if (emptySpot) { context.report({ node, messageId: "unexpectedSparseArray" }); diff --git a/node_modules/eslint/lib/rules/no-sync.js b/node_modules/eslint/lib/rules/no-sync.js index 06424e0b3..71360c6bd 100644 --- a/node_modules/eslint/lib/rules/no-sync.js +++ b/node_modules/eslint/lib/rules/no-sync.js @@ -1,16 +1,16 @@ /** * @fileoverview Rule to check for properties whose identifier ends with the string Sync * @author Matt DuVall + * @deprecated in ESLint v7.0.0 */ -/* jshint node:true */ - "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -20,8 +20,7 @@ module.exports = { type: "suggestion", docs: { - description: "disallow synchronous methods", - category: "Node.js and CommonJS", + description: "Disallow synchronous methods", recommended: false, url: "https://eslint.org/docs/rules/no-sync" }, diff --git a/node_modules/eslint/lib/rules/no-tabs.js b/node_modules/eslint/lib/rules/no-tabs.js index ca7be2616..1b4834e09 100644 --- a/node_modules/eslint/lib/rules/no-tabs.js +++ b/node_modules/eslint/lib/rules/no-tabs.js @@ -16,13 +16,13 @@ const anyNonWhitespaceRegex = /\S/u; // Public Interface //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow all tabs", - category: "Stylistic Issues", + description: "Disallow all tabs", recommended: false, url: "https://eslint.org/docs/rules/no-tabs" }, diff --git a/node_modules/eslint/lib/rules/no-template-curly-in-string.js b/node_modules/eslint/lib/rules/no-template-curly-in-string.js index 539cd5be5..4f4e9ee17 100644 --- a/node_modules/eslint/lib/rules/no-template-curly-in-string.js +++ b/node_modules/eslint/lib/rules/no-template-curly-in-string.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow template literal placeholder syntax in regular strings", - category: "Possible Errors", + description: "Disallow template literal placeholder syntax in regular strings", recommended: false, url: "https://eslint.org/docs/rules/no-template-curly-in-string" }, diff --git a/node_modules/eslint/lib/rules/no-ternary.js b/node_modules/eslint/lib/rules/no-ternary.js index b3ced8605..a185808a6 100644 --- a/node_modules/eslint/lib/rules/no-ternary.js +++ b/node_modules/eslint/lib/rules/no-ternary.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow ternary operators", - category: "Stylistic Issues", + description: "Disallow ternary operators", recommended: false, url: "https://eslint.org/docs/rules/no-ternary" }, diff --git a/node_modules/eslint/lib/rules/no-this-before-super.js b/node_modules/eslint/lib/rules/no-this-before-super.js index 5bfba66fc..b4e48e862 100644 --- a/node_modules/eslint/lib/rules/no-this-before-super.js +++ b/node_modules/eslint/lib/rules/no-this-before-super.js @@ -34,13 +34,13 @@ function isConstructorFunction(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow `this`/`super` before calling `super()` in constructors", - category: "ECMAScript 6", + description: "Disallow `this`/`super` before calling `super()` in constructors", recommended: true, url: "https://eslint.org/docs/rules/no-this-before-super" }, diff --git a/node_modules/eslint/lib/rules/no-throw-literal.js b/node_modules/eslint/lib/rules/no-throw-literal.js index 29fb3718b..3656c83a3 100644 --- a/node_modules/eslint/lib/rules/no-throw-literal.js +++ b/node_modules/eslint/lib/rules/no-throw-literal.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow throwing literals as exceptions", - category: "Best Practices", + description: "Disallow throwing literals as exceptions", recommended: false, url: "https://eslint.org/docs/rules/no-throw-literal" }, diff --git a/node_modules/eslint/lib/rules/no-trailing-spaces.js b/node_modules/eslint/lib/rules/no-trailing-spaces.js index 98ae62c89..a02a880e1 100644 --- a/node_modules/eslint/lib/rules/no-trailing-spaces.js +++ b/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow trailing whitespace at the end of lines", - category: "Stylistic Issues", + description: "Disallow trailing whitespace at the end of lines", recommended: false, url: "https://eslint.org/docs/rules/no-trailing-spaces" }, diff --git a/node_modules/eslint/lib/rules/no-undef-init.js b/node_modules/eslint/lib/rules/no-undef-init.js index 5c240fef7..2cb1c3f37 100644 --- a/node_modules/eslint/lib/rules/no-undef-init.js +++ b/node_modules/eslint/lib/rules/no-undef-init.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow initializing variables to `undefined`", - category: "Variables", + description: "Disallow initializing variables to `undefined`", recommended: false, url: "https://eslint.org/docs/rules/no-undef-init" }, diff --git a/node_modules/eslint/lib/rules/no-undef.js b/node_modules/eslint/lib/rules/no-undef.js index 6b5140819..e920ce6c2 100644 --- a/node_modules/eslint/lib/rules/no-undef.js +++ b/node_modules/eslint/lib/rules/no-undef.js @@ -23,13 +23,13 @@ function hasTypeOfOperator(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments", - category: "Variables", + description: "Disallow the use of undeclared variables unless mentioned in `/*global */` comments", recommended: true, url: "https://eslint.org/docs/rules/no-undef" }, diff --git a/node_modules/eslint/lib/rules/no-undefined.js b/node_modules/eslint/lib/rules/no-undefined.js index a075d903e..e006320b5 100644 --- a/node_modules/eslint/lib/rules/no-undefined.js +++ b/node_modules/eslint/lib/rules/no-undefined.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `undefined` as an identifier", - category: "Variables", + description: "Disallow the use of `undefined` as an identifier", recommended: false, url: "https://eslint.org/docs/rules/no-undefined" }, diff --git a/node_modules/eslint/lib/rules/no-underscore-dangle.js b/node_modules/eslint/lib/rules/no-underscore-dangle.js index 87d2336fa..692637920 100644 --- a/node_modules/eslint/lib/rules/no-underscore-dangle.js +++ b/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow dangling underscores in identifiers", - category: "Stylistic Issues", + description: "Disallow dangling underscores in identifiers", recommended: false, url: "https://eslint.org/docs/rules/no-underscore-dangle" }, @@ -49,6 +49,18 @@ module.exports = { allowFunctionParams: { type: "boolean", default: true + }, + enforceInClassFields: { + type: "boolean", + default: false + }, + allowInArrayDestructuring: { + type: "boolean", + default: true + }, + allowInObjectDestructuring: { + type: "boolean", + default: true } }, additionalProperties: false @@ -68,7 +80,10 @@ module.exports = { const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false; const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false; const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false; + const enforceInClassFields = typeof options.enforceInClassFields !== "undefined" ? options.enforceInClassFields : false; const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true; + const allowInArrayDestructuring = typeof options.allowInArrayDestructuring !== "undefined" ? options.allowInArrayDestructuring : true; + const allowInObjectDestructuring = typeof options.allowInObjectDestructuring !== "undefined" ? options.allowInObjectDestructuring : true; //------------------------------------------------------------------------- // Helpers @@ -81,7 +96,7 @@ module.exports = { * @private */ function isAllowed(identifier) { - return ALLOWED_VARIABLES.some(ident => ident === identifier); + return ALLOWED_VARIABLES.includes(identifier); } /** @@ -190,6 +205,7 @@ module.exports = { checkForDanglingUnderscoreInFunctionParameters(node); } + /** * Check if variable expression has a dangling underscore * @param {ASTNode} node node to evaluate @@ -197,18 +213,32 @@ module.exports = { * @private */ function checkForDanglingUnderscoreInVariableExpression(node) { - const identifier = node.id.name; + context.getDeclaredVariables(node).forEach(variable => { + const definition = variable.defs.find(def => def.node === node); + const identifierNode = definition.name; + const identifier = identifierNode.name; + let parent = identifierNode.parent; - if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && - !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) { - context.report({ - node, - messageId: "unexpectedUnderscore", - data: { - identifier - } - }); - } + while (!["VariableDeclarator", "ArrayPattern", "ObjectPattern"].includes(parent.type)) { + parent = parent.parent; + } + + if ( + hasDanglingUnderscore(identifier) && + !isSpecialCaseIdentifierInVariableExpression(identifier) && + !isAllowed(identifier) && + !(allowInArrayDestructuring && parent.type === "ArrayPattern") && + !(allowInObjectDestructuring && parent.type === "ObjectPattern") + ) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + }); } /** @@ -253,7 +283,33 @@ module.exports = { node, messageId: "unexpectedUnderscore", data: { - identifier + identifier: node.key.type === "PrivateIdentifier" + ? `#${identifier}` + : identifier + } + }); + } + } + + /** + * Check if a class field has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInClassField(node) { + const identifier = node.key.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + enforceInClassFields && + !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier: node.key.type === "PrivateIdentifier" + ? `#${identifier}` + : identifier } }); } @@ -268,6 +324,7 @@ module.exports = { VariableDeclarator: checkForDanglingUnderscoreInVariableExpression, MemberExpression: checkForDanglingUnderscoreInMemberExpression, MethodDefinition: checkForDanglingUnderscoreInMethod, + PropertyDefinition: checkForDanglingUnderscoreInClassField, Property: checkForDanglingUnderscoreInMethod, FunctionExpression: checkForDanglingUnderscoreInFunction, ArrowFunctionExpression: checkForDanglingUnderscoreInFunction diff --git a/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/node_modules/eslint/lib/rules/no-unexpected-multiline.js index 7af3fe670..2ca6731bc 100644 --- a/node_modules/eslint/lib/rules/no-unexpected-multiline.js +++ b/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow confusing multiline expressions", - category: "Possible Errors", + description: "Disallow confusing multiline expressions", recommended: true, url: "https://eslint.org/docs/rules/no-unexpected-multiline" }, diff --git a/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js index 7031a4dd8..12f61e98e 100644 --- a/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +++ b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -156,13 +156,13 @@ function updateModifiedFlag(conditions, modifiers) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow unmodified loop conditions", - category: "Best Practices", + description: "Disallow unmodified loop conditions", recommended: false, url: "https://eslint.org/docs/rules/no-unmodified-loop-condition" }, diff --git a/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/node_modules/eslint/lib/rules/no-unneeded-ternary.js index 06c615f38..80b83ac9d 100644 --- a/node_modules/eslint/lib/rules/no-unneeded-ternary.js +++ b/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -23,13 +23,13 @@ const OR_PRECEDENCE = astUtils.getPrecedence({ type: "LogicalExpression", operat // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow ternary operators when simpler alternatives exist", - category: "Stylistic Issues", + description: "Disallow ternary operators when simpler alternatives exist", recommended: false, url: "https://eslint.org/docs/rules/no-unneeded-ternary" }, @@ -144,7 +144,7 @@ module.exports = { context.report({ node, messageId: "unnecessaryConditionalAssignment", - fix: fixer => { + fix(fixer) { const shouldParenthesizeAlternate = ( astUtils.getPrecedence(node.alternate) < OR_PRECEDENCE || diff --git a/node_modules/eslint/lib/rules/no-unreachable-loop.js b/node_modules/eslint/lib/rules/no-unreachable-loop.js index 868a6ff98..c42c922e0 100644 --- a/node_modules/eslint/lib/rules/no-unreachable-loop.js +++ b/node_modules/eslint/lib/rules/no-unreachable-loop.js @@ -53,13 +53,13 @@ function getDifference(arrA, arrB) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow loops with a body that allows only one iteration", - category: "Possible Errors", + description: "Disallow loops with a body that allows only one iteration", recommended: false, url: "https://eslint.org/docs/rules/no-unreachable-loop" }, diff --git a/node_modules/eslint/lib/rules/no-unreachable.js b/node_modules/eslint/lib/rules/no-unreachable.js index 415631a6f..dea86815a 100644 --- a/node_modules/eslint/lib/rules/no-unreachable.js +++ b/node_modules/eslint/lib/rules/no-unreachable.js @@ -8,6 +8,12 @@ // Helpers //------------------------------------------------------------------------------ +/** + * @typedef {Object} ConstructorInfo + * @property {ConstructorInfo | null} upper Info about the constructor that encloses this constructor. + * @property {boolean} hasSuperCall The flag about having `super()` expressions. + */ + /** * Checks whether or not a given variable declarator has the initializer. * @param {ASTNode} node A VariableDeclarator node to check. @@ -99,13 +105,13 @@ class ConsecutiveRange { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", - category: "Possible Errors", + description: "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", recommended: true, url: "https://eslint.org/docs/rules/no-unreachable" }, @@ -120,6 +126,10 @@ module.exports = { create(context) { let currentCodePath = null; + /** @type {ConstructorInfo | null} */ + let constructorInfo = null; + + /** @type {ConsecutiveRange} */ const range = new ConsecutiveRange(context.getSourceCode()); /** @@ -130,7 +140,7 @@ module.exports = { function reportIfUnreachable(node) { let nextNode = null; - if (node && currentCodePath.currentSegments.every(isUnreachable)) { + if (node && (node.type === "PropertyDefinition" || currentCodePath.currentSegments.every(isUnreachable))) { // Store this statement to distinguish consecutive statements. if (range.isEmpty) { @@ -212,6 +222,42 @@ module.exports = { "Program:exit"() { reportIfUnreachable(); + }, + + /* + * Instance fields defined in a subclass are never created if the constructor of the subclass + * doesn't call `super()`, so their definitions are unreachable code. + */ + "MethodDefinition[kind='constructor']"() { + constructorInfo = { + upper: constructorInfo, + hasSuperCall: false + }; + }, + "MethodDefinition[kind='constructor']:exit"(node) { + const { hasSuperCall } = constructorInfo; + + constructorInfo = constructorInfo.upper; + + // skip typescript constructors without the body + if (!node.value.body) { + return; + } + + const classDefinition = node.parent.parent; + + if (classDefinition.superClass && !hasSuperCall) { + for (const element of classDefinition.body.body) { + if (element.type === "PropertyDefinition" && !element.static) { + reportIfUnreachable(element); + } + } + } + }, + "CallExpression > Super.callee"() { + if (constructorInfo) { + constructorInfo.hasSuperCall = true; + } } }; } diff --git a/node_modules/eslint/lib/rules/no-unsafe-finally.js b/node_modules/eslint/lib/rules/no-unsafe-finally.js index 11bf06e87..80adb0fea 100644 --- a/node_modules/eslint/lib/rules/no-unsafe-finally.js +++ b/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -18,13 +18,13 @@ const SENTINEL_NODE_TYPE_CONTINUE = /^(?:Program|(?:Function|Class)(?:Declaratio // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow control flow statements in `finally` blocks", - category: "Possible Errors", + description: "Disallow control flow statements in `finally` blocks", recommended: true, url: "https://eslint.org/docs/rules/no-unsafe-finally" }, diff --git a/node_modules/eslint/lib/rules/no-unsafe-negation.js b/node_modules/eslint/lib/rules/no-unsafe-negation.js index a9c2ee74f..5dd150f87 100644 --- a/node_modules/eslint/lib/rules/no-unsafe-negation.js +++ b/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -46,18 +46,19 @@ function isNegation(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow negating the left operand of relational operators", - category: "Possible Errors", + description: "Disallow negating the left operand of relational operators", recommended: true, - url: "https://eslint.org/docs/rules/no-unsafe-negation", - suggestion: true + url: "https://eslint.org/docs/rules/no-unsafe-negation" }, + hasSuggestions: true, + schema: [ { type: "object", diff --git a/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js b/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js index 2eafc1ad8..991390781 100644 --- a/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +++ b/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js @@ -18,14 +18,14 @@ function isDestructuringPattern(node) { return node.type === "ObjectPattern" || node.type === "ArrayPattern"; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow use of optional chaining in contexts where the `undefined` value is not allowed", - category: "Possible Errors", - recommended: false, + description: "Disallow use of optional chaining in contexts where the `undefined` value is not allowed", + recommended: true, url: "https://eslint.org/docs/rules/no-unsafe-optional-chaining" }, schema: [{ diff --git a/node_modules/eslint/lib/rules/no-unused-expressions.js b/node_modules/eslint/lib/rules/no-unused-expressions.js index 58c9b3341..d34d5844d 100644 --- a/node_modules/eslint/lib/rules/no-unused-expressions.js +++ b/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -24,13 +24,13 @@ function alwaysFalse() { return false; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unused expressions", - category: "Best Practices", + description: "Disallow unused expressions", recommended: false, url: "https://eslint.org/docs/rules/no-unused-expressions" }, @@ -72,8 +72,8 @@ module.exports = { allowTaggedTemplates = config.allowTaggedTemplates || false, enforceForJSX = config.enforceForJSX || false; - // eslint-disable-next-line jsdoc/require-description /** + * Has AST suggesting a directive. * @param {ASTNode} node any node * @returns {boolean} whether the given node structurally represents a directive */ @@ -82,8 +82,8 @@ module.exports = { node.expression.type === "Literal" && typeof node.expression.value === "string"; } - // eslint-disable-next-line jsdoc/require-description /** + * Gets the leading sequence of members in a list that pass the predicate. * @param {Function} predicate ([a] -> Boolean) the function used to make the determination * @param {a[]} list the input list * @returns {a[]} the leading sequence of members in the given list that pass the given predicate @@ -97,8 +97,8 @@ module.exports = { return list.slice(); } - // eslint-disable-next-line jsdoc/require-description /** + * Gets leading directives nodes in a Node body. * @param {ASTNode} node a Program or BlockStatement node * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body */ @@ -106,8 +106,8 @@ module.exports = { return takeWhile(looksLikeDirective, node.body); } - // eslint-disable-next-line jsdoc/require-description /** + * Detect if a Node is a directive. * @param {ASTNode} node any node * @param {ASTNode[]} ancestors the given node's ancestors * @returns {boolean} whether the given node is considered a directive in its current position @@ -116,9 +116,15 @@ module.exports = { const parent = ancestors[ancestors.length - 1], grandparent = ancestors[ancestors.length - 2]; + /** + * https://tc39.es/ecma262/#directive-prologue + * + * Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue. + * Class static blocks do not have directive prologue. + */ return (parent.type === "Program" || parent.type === "BlockStatement" && (/Function/u.test(grandparent.type))) && - directives(parent).indexOf(node) >= 0; + directives(parent).includes(node); } /** diff --git a/node_modules/eslint/lib/rules/no-unused-labels.js b/node_modules/eslint/lib/rules/no-unused-labels.js index b33fcb786..305226a4d 100644 --- a/node_modules/eslint/lib/rules/no-unused-labels.js +++ b/node_modules/eslint/lib/rules/no-unused-labels.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unused labels", - category: "Best Practices", + description: "Disallow unused labels", recommended: true, url: "https://eslint.org/docs/rules/no-unused-labels" }, diff --git a/node_modules/eslint/lib/rules/no-unused-private-class-members.js b/node_modules/eslint/lib/rules/no-unused-private-class-members.js new file mode 100644 index 000000000..e62a9ed59 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-private-class-members.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Rule to flag declared but unused private class members + * @author Tim van der Lippe + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + + docs: { + description: "Disallow unused private class members", + recommended: false, + url: "https://eslint.org/docs/rules/no-unused-private-class-members" + }, + + schema: [], + + messages: { + unusedPrivateClassMember: "'{{classMemberName}}' is defined but never used." + } + }, + + create(context) { + const trackedClasses = []; + + /** + * Check whether the current node is in a write only assignment. + * @param {ASTNode} privateIdentifierNode Node referring to a private identifier + * @returns {boolean} Whether the node is in a write only assignment + * @private + */ + function isWriteOnlyAssignment(privateIdentifierNode) { + const parentStatement = privateIdentifierNode.parent.parent; + const isAssignmentExpression = parentStatement.type === "AssignmentExpression"; + + if (!isAssignmentExpression && + parentStatement.type !== "ForInStatement" && + parentStatement.type !== "ForOfStatement" && + parentStatement.type !== "AssignmentPattern") { + return false; + } + + // It is a write-only usage, since we still allow usages on the right for reads + if (parentStatement.left !== privateIdentifierNode.parent) { + return false; + } + + // For any other operator (such as '+=') we still consider it a read operation + if (isAssignmentExpression && parentStatement.operator !== "=") { + + /* + * However, if the read operation is "discarded" in an empty statement, then + * we consider it write only. + */ + return parentStatement.parent.type === "ExpressionStatement"; + } + + return true; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // Collect all declared members up front and assume they are all unused + ClassBody(classBodyNode) { + const privateMembers = new Map(); + + trackedClasses.unshift(privateMembers); + for (const bodyMember of classBodyNode.body) { + if (bodyMember.type === "PropertyDefinition" || bodyMember.type === "MethodDefinition") { + if (bodyMember.key.type === "PrivateIdentifier") { + privateMembers.set(bodyMember.key.name, { + declaredNode: bodyMember, + isAccessor: bodyMember.type === "MethodDefinition" && + (bodyMember.kind === "set" || bodyMember.kind === "get") + }); + } + } + } + }, + + /* + * Process all usages of the private identifier and remove a member from + * `declaredAndUnusedPrivateMembers` if we deem it used. + */ + PrivateIdentifier(privateIdentifierNode) { + const classBody = trackedClasses.find(classProperties => classProperties.has(privateIdentifierNode.name)); + + // Can't happen, as it is a parser to have a missing class body, but let's code defensively here. + if (!classBody) { + return; + } + + // In case any other usage was already detected, we can short circuit the logic here. + const memberDefinition = classBody.get(privateIdentifierNode.name); + + if (memberDefinition.isUsed) { + return; + } + + // The definition of the class member itself + if (privateIdentifierNode.parent.type === "PropertyDefinition" || + privateIdentifierNode.parent.type === "MethodDefinition") { + return; + } + + /* + * Any usage of an accessor is considered a read, as the getter/setter can have + * side-effects in its definition. + */ + if (memberDefinition.isAccessor) { + memberDefinition.isUsed = true; + return; + } + + // Any assignments to this member, except for assignments that also read + if (isWriteOnlyAssignment(privateIdentifierNode)) { + return; + } + + const wrappingExpressionType = privateIdentifierNode.parent.parent.type; + const parentOfWrappingExpressionType = privateIdentifierNode.parent.parent.parent.type; + + // A statement which only increments (`this.#x++;`) + if (wrappingExpressionType === "UpdateExpression" && + parentOfWrappingExpressionType === "ExpressionStatement") { + return; + } + + /* + * ({ x: this.#usedInDestructuring } = bar); + * + * But should treat the following as a read: + * ({ [this.#x]: a } = foo); + */ + if (wrappingExpressionType === "Property" && + parentOfWrappingExpressionType === "ObjectPattern" && + privateIdentifierNode.parent.parent.value === privateIdentifierNode.parent) { + return; + } + + // [...this.#unusedInRestPattern] = bar; + if (wrappingExpressionType === "RestElement") { + return; + } + + // [this.#unusedInAssignmentPattern] = bar; + if (wrappingExpressionType === "ArrayPattern") { + return; + } + + /* + * We can't delete the memberDefinition, as we need to keep track of which member we are marking as used. + * In the case of nested classes, we only mark the first member we encounter as used. If you were to delete + * the member, then any subsequent usage could incorrectly mark the member of an encapsulating parent class + * as used, which is incorrect. + */ + memberDefinition.isUsed = true; + }, + + /* + * Post-process the class members and report any remaining members. + * Since private members can only be accessed in the current class context, + * we can safely assume that all usages are within the current class body. + */ + "ClassBody:exit"() { + const unusedPrivateMembers = trackedClasses.shift(); + + for (const [classMemberName, { declaredNode, isUsed }] of unusedPrivateMembers.entries()) { + if (isUsed) { + continue; + } + context.report({ + node: declaredNode, + loc: declaredNode.key.loc, + messageId: "unusedPrivateClassMember", + data: { + classMemberName: `#${classMemberName}` + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-vars.js b/node_modules/eslint/lib/rules/no-unused-vars.js index 4dc6dc2ba..778889a76 100644 --- a/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/node_modules/eslint/lib/rules/no-unused-vars.js @@ -27,13 +27,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow unused variables", - category: "Variables", + description: "Disallow unused variables", recommended: true, url: "https://eslint.org/docs/rules/no-unused-vars" }, @@ -67,6 +67,9 @@ module.exports = { }, caughtErrorsIgnorePattern: { type: "string" + }, + destructuredArrayIgnorePattern: { + type: "string" } }, additionalProperties: false @@ -114,6 +117,10 @@ module.exports = { if (firstOption.caughtErrorsIgnorePattern) { config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, "u"); } + + if (firstOption.destructuredArrayIgnorePattern) { + config.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, "u"); + } } } @@ -155,7 +162,14 @@ module.exports = { * @returns {UnusedVarMessageData} The message data to be used with this unused variable. */ function getAssignedMessageData(unusedVar) { - const additional = config.varsIgnorePattern ? `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}` : ""; + const def = unusedVar.defs[0]; + let additional = ""; + + if (config.destructuredArrayIgnorePattern && def && def.name.parent.type === "ArrayPattern") { + additional = `. Allowed unused elements of array destructuring patterns must match ${config.destructuredArrayIgnorePattern.toString()}`; + } else if (config.varsIgnorePattern) { + additional = `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}`; + } return { varName: unusedVar.name, @@ -196,6 +210,17 @@ module.exports = { } + /** + * Checks whether a node is a sibling of the rest property or not. + * @param {ASTNode} node a node to check + * @returns {boolean} True if the node is a sibling of the rest property, otherwise false. + */ + function hasRestSibling(node) { + return node.type === "Property" && + node.parent.type === "ObjectPattern" && + REST_PROPERTY_TYPE.test(node.parent.properties[node.parent.properties.length - 1].type); + } + /** * Determines if a variable has a sibling rest property * @param {Variable} variable eslint-scope variable object. @@ -204,16 +229,10 @@ module.exports = { */ function hasRestSpreadSibling(variable) { if (config.ignoreRestSiblings) { - return variable.defs.some(def => { - const propertyNode = def.name.parent; - const patternNode = propertyNode.parent; - - return ( - propertyNode.type === "Property" && - patternNode.type === "ObjectPattern" && - REST_PROPERTY_TYPE.test(patternNode.properties[patternNode.properties.length - 1].type) - ); - }); + const hasRestSiblingDefinition = variable.defs.some(def => hasRestSibling(def.name.parent)); + const hasRestSiblingReference = variable.references.some(ref => hasRestSibling(ref.identifier.parent)); + + return hasRestSiblingDefinition || hasRestSiblingReference; } return false; @@ -240,7 +259,7 @@ module.exports = { let scope = ref.from; while (scope) { - if (nodes.indexOf(scope.block) >= 0) { + if (nodes.includes(scope.block)) { return true; } @@ -290,6 +309,31 @@ module.exports = { ); } + /** + * Checks whether a given node is unused expression or not. + * @param {ASTNode} node The node itself + * @returns {boolean} The node is an unused expression. + * @private + */ + function isUnusedExpression(node) { + const parent = node.parent; + + if (parent.type === "ExpressionStatement") { + return true; + } + + if (parent.type === "SequenceExpression") { + const isLastExpression = parent.expressions[parent.expressions.length - 1] === node; + + if (!isLastExpression) { + return true; + } + return isUnusedExpression(parent); + } + + return false; + } + /** * If a given reference is left-hand side of an assignment, this gets * the right-hand side node of the assignment. @@ -308,7 +352,6 @@ module.exports = { function getRhsNode(ref, prevRhsNode) { const id = ref.identifier; const parent = id.parent; - const grandparent = parent.parent; const refScope = ref.from.variableScope; const varScope = ref.resolved.scope.variableScope; const canBeUsedLater = refScope !== varScope || astUtils.isInLoop(id); @@ -322,7 +365,7 @@ module.exports = { } if (parent.type === "AssignmentExpression" && - grandparent.type === "ExpressionStatement" && + isUnusedExpression(parent) && id === parent.left && !canBeUsedLater ) { @@ -415,33 +458,38 @@ module.exports = { function isReadForItself(ref, rhsNode) { const id = ref.identifier; const parent = id.parent; - const grandparent = parent.parent; return ref.isRead() && ( // self update. e.g. `a += 1`, `a++` - (// in RHS of an assignment for itself. e.g. `a = a + 1` - (( + ( + ( parent.type === "AssignmentExpression" && - grandparent.type === "ExpressionStatement" && - parent.left === id + parent.left === id && + isUnusedExpression(parent) ) || + ( + parent.type === "UpdateExpression" && + isUnusedExpression(parent) + ) + ) || + + // in RHS of an assignment for itself. e.g. `a = a + 1` ( - parent.type === "UpdateExpression" && - grandparent.type === "ExpressionStatement" - ) || rhsNode && - isInside(id, rhsNode) && - !isInsideOfStorableFunction(id, rhsNode))) + rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode) + ) ); } /** - * Determine if an identifier is used either in for-in loops. + * Determine if an identifier is used either in for-in or for-of loops. * @param {Reference} ref The reference to check. * @returns {boolean} whether reference is used in the for-in loops * @private */ - function isForInRef(ref) { + function isForInOfRef(ref) { let target = ref.identifier.parent; @@ -450,7 +498,7 @@ module.exports = { target = target.parent.parent; } - if (target.type !== "ForInStatement") { + if (target.type !== "ForInStatement" && target.type !== "ForOfStatement") { return false; } @@ -483,7 +531,7 @@ module.exports = { let rhsNode = null; return variable.references.some(ref => { - if (isForInRef(ref)) { + if (isForInOfRef(ref)) { return true; } @@ -550,6 +598,19 @@ module.exports = { if (def) { const type = def.type; + const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === "ArrayPattern"); + + // skip elements of array destructuring patterns + if ( + ( + def.name.parent.type === "ArrayPattern" || + refUsedInArrayPatterns + ) && + config.destructuredArrayIgnorePattern && + config.destructuredArrayIgnorePattern.test(def.name.name) + ) { + continue; + } // skip catch variables if (type === "CatchClause") { @@ -619,10 +680,18 @@ module.exports = { // Report the first declaration. if (unusedVar.defs.length > 0) { + + // report last write reference, https://github.com/eslint/eslint/issues/14324 + const writeReferences = unusedVar.references.filter(ref => ref.isWrite() && ref.from.variableScope === unusedVar.scope.variableScope); + + let referenceToReport; + + if (writeReferences.length > 0) { + referenceToReport = writeReferences[writeReferences.length - 1]; + } + context.report({ - node: unusedVar.references.length ? unusedVar.references[ - unusedVar.references.length - 1 - ].identifier : unusedVar.identifiers[0], + node: referenceToReport ? referenceToReport.identifier : unusedVar.identifiers[0], messageId: "unusedVar", data: unusedVar.references.some(ref => ref.isWrite()) ? getAssignedMessageData(unusedVar) diff --git a/node_modules/eslint/lib/rules/no-use-before-define.js b/node_modules/eslint/lib/rules/no-use-before-define.js index c7300567e..5fd259401 100644 --- a/node_modules/eslint/lib/rules/no-use-before-define.js +++ b/node_modules/eslint/lib/rules/no-use-before-define.js @@ -21,6 +21,7 @@ function parseOptions(options) { let functions = true; let classes = true; let variables = true; + let allowNamedExports = false; if (typeof options === "string") { functions = (options !== "nofunc"); @@ -28,58 +29,120 @@ function parseOptions(options) { functions = options.functions !== false; classes = options.classes !== false; variables = options.variables !== false; + allowNamedExports = !!options.allowNamedExports; } - return { functions, classes, variables }; + return { functions, classes, variables, allowNamedExports }; } /** - * Checks whether or not a given variable is a function declaration. - * @param {eslint-scope.Variable} variable A variable to check. - * @returns {boolean} `true` if the variable is a function declaration. + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. */ -function isFunction(variable) { - return variable.defs[0].type === "FunctionName"; +function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; } /** - * Checks whether or not a given variable is a class declaration in an upper function scope. - * @param {eslint-scope.Variable} variable A variable to check. - * @param {eslint-scope.Reference} reference A reference to check. - * @returns {boolean} `true` if the variable is a class declaration. + * Checks whether or not a given location is inside of the range of a class static initializer. + * Static initializers are static blocks and initializers of static fields. + * @param {ASTNode} node `ClassBody` node to check static initializers. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of a class static initializer. */ -function isOuterClass(variable, reference) { - return ( - variable.defs[0].type === "ClassName" && - variable.scope.variableScope !== reference.from.variableScope - ); +function isInClassStaticInitializerRange(node, location) { + return node.body.some(classMember => ( + ( + classMember.type === "StaticBlock" && + isInRange(classMember, location) + ) || + ( + classMember.type === "PropertyDefinition" && + classMember.static && + classMember.value && + isInRange(classMember.value, location) + ) + )); } /** - * Checks whether or not a given variable is a variable declaration in an upper function scope. - * @param {eslint-scope.Variable} variable A variable to check. - * @param {eslint-scope.Reference} reference A reference to check. - * @returns {boolean} `true` if the variable is a variable declaration. + * Checks whether a given scope is the scope of a class static initializer. + * Static initializers are static blocks and initializers of static fields. + * @param {eslint-scope.Scope} scope A scope to check. + * @returns {boolean} `true` if the scope is a class static initializer scope. */ -function isOuterVariable(variable, reference) { - return ( - variable.defs[0].type === "Variable" && - variable.scope.variableScope !== reference.from.variableScope - ); +function isClassStaticInitializerScope(scope) { + if (scope.type === "class-static-block") { + return true; + } + + if (scope.type === "class-field-initializer") { + + // `scope.block` is PropertyDefinition#value node + const propertyDefinition = scope.block.parent; + + return propertyDefinition.static; + } + + return false; } /** - * Checks whether or not a given location is inside of the range of a given node. - * @param {ASTNode} node An node to check. - * @param {number} location A location to check. - * @returns {boolean} `true` if the location is inside of the range of the node. + * Checks whether a given reference is evaluated in an execution context + * that isn't the one where the variable it refers to is defined. + * Execution contexts are: + * - top-level + * - functions + * - class field initializers (implicit functions) + * - class static blocks (implicit functions) + * Static class field initializers and class static blocks are automatically run during the class definition evaluation, + * and therefore we'll consider them as a part of the parent execution context. + * Example: + * + * const x = 1; + * + * x; // returns `false` + * () => x; // returns `true` + * + * class C { + * field = x; // returns `true` + * static field = x; // returns `false` + * + * method() { + * x; // returns `true` + * } + * + * static method() { + * x; // returns `true` + * } + * + * static { + * x; // returns `false` + * } + * } + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is from a separate execution context. */ -function isInRange(node, location) { - return node && node.range[0] <= location && location <= node.range[1]; +function isFromSeparateExecutionContext(reference) { + const variable = reference.resolved; + let scope = reference.from; + + // Scope#variableScope represents execution context + while (variable.scope.variableScope !== scope.variableScope) { + if (isClassStaticInitializerScope(scope.variableScope)) { + scope = scope.variableScope.upper; + } else { + return true; + } + } + + return false; } /** - * Checks whether or not a given reference is inside of the initializers of a given variable. + * Checks whether or not a given reference is evaluated during the initialization of its variable. * * This returns `true` in the following cases: * @@ -88,17 +151,45 @@ function isInRange(node, location) { * var {a = a} = obj * for (var a in a) {} * for (var a of a) {} - * @param {Variable} variable A variable to check. + * var C = class { [C]; }; + * var C = class { static foo = C; }; + * var C = class { static { foo = C; } }; + * class C extends C {} + * class C extends (class { static foo = C; }) {} + * class C { [C]; } * @param {Reference} reference A reference to check. - * @returns {boolean} `true` if the reference is inside of the initializers. + * @returns {boolean} `true` if the reference is evaluated during the initialization. */ -function isInInitializer(variable, reference) { - if (variable.scope !== reference.from) { +function isEvaluatedDuringInitialization(reference) { + if (isFromSeparateExecutionContext(reference)) { + + /* + * Even if the reference appears in the initializer, it isn't evaluated during the initialization. + * For example, `const x = () => x;` is valid. + */ return false; } - let node = variable.identifiers[0].parent; const location = reference.identifier.range[1]; + const definition = reference.resolved.defs[0]; + + if (definition.type === "ClassName") { + + // `ClassDeclaration` or `ClassExpression` + const classDefinition = definition.node; + + return ( + isInRange(classDefinition, location) && + + /* + * Class binding is initialized before running static initializers. + * For example, `class C { static foo = C; static { bar = C; } }` is valid. + */ + !isInClassStaticInitializerRange(classDefinition.body, location) + ); + } + + let node = definition.name.parent; while (node) { if (node.type === "VariableDeclarator") { @@ -129,13 +220,13 @@ function isInInitializer(variable, reference) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow the use of variables before they are defined", - category: "Variables", + description: "Disallow the use of variables before they are defined", recommended: false, url: "https://eslint.org/docs/rules/no-use-before-define" }, @@ -151,7 +242,8 @@ module.exports = { properties: { functions: { type: "boolean" }, classes: { type: "boolean" }, - variables: { type: "boolean" } + variables: { type: "boolean" }, + allowNamedExports: { type: "boolean" } }, additionalProperties: false } @@ -168,65 +260,87 @@ module.exports = { const options = parseOptions(context.options[0]); /** - * Determines whether a given use-before-define case should be reported according to the options. - * @param {eslint-scope.Variable} variable The variable that gets used before being defined - * @param {eslint-scope.Reference} reference The reference to the variable - * @returns {boolean} `true` if the usage should be reported + * Determines whether a given reference should be checked. + * + * Returns `false` if the reference is: + * - initialization's (e.g., `let a = 1`). + * - referring to an undefined variable (i.e., if it's an unresolved reference). + * - referring to a variable that is defined, but not in the given source code + * (e.g., global environment variable or `arguments` in functions). + * - allowed by options. + * @param {eslint-scope.Reference} reference The reference + * @returns {boolean} `true` if the reference should be checked */ - function isForbidden(variable, reference) { - if (isFunction(variable)) { - return options.functions; + function shouldCheck(reference) { + if (reference.init) { + return false; } - if (isOuterClass(variable, reference)) { - return options.classes; + + const { identifier } = reference; + + if ( + options.allowNamedExports && + identifier.parent.type === "ExportSpecifier" && + identifier.parent.local === identifier + ) { + return false; + } + + const variable = reference.resolved; + + if (!variable || variable.defs.length === 0) { + return false; + } + + const definitionType = variable.defs[0].type; + + if (!options.functions && definitionType === "FunctionName") { + return false; } - if (isOuterVariable(variable, reference)) { - return options.variables; + + if ( + ( + !options.variables && definitionType === "Variable" || + !options.classes && definitionType === "ClassName" + ) && + + // don't skip checking the reference if it's in the same execution context, because of TDZ + isFromSeparateExecutionContext(reference) + ) { + return false; } + return true; } /** - * Finds and validates all variables in a given scope. - * @param {Scope} scope The scope object. + * Finds and validates all references in a given scope and its child scopes. + * @param {eslint-scope.Scope} scope The scope object. * @returns {void} - * @private */ - function findVariablesInScope(scope) { - scope.references.forEach(reference => { + function checkReferencesInScope(scope) { + scope.references.filter(shouldCheck).forEach(reference => { const variable = reference.resolved; + const definitionIdentifier = variable.defs[0].name; - /* - * Skips when the reference is: - * - initialization's. - * - referring to an undefined variable. - * - referring to a global environment variable (there're no identifiers). - * - located preceded by the variable (except in initializers). - * - allowed by options. - */ - if (reference.init || - !variable || - variable.identifiers.length === 0 || - (variable.identifiers[0].range[1] < reference.identifier.range[1] && !isInInitializer(variable, reference)) || - !isForbidden(variable, reference) + if ( + reference.identifier.range[1] < definitionIdentifier.range[1] || + isEvaluatedDuringInitialization(reference) ) { - return; + context.report({ + node: reference.identifier, + messageId: "usedBeforeDefined", + data: reference.identifier + }); } - - // Reports. - context.report({ - node: reference.identifier, - messageId: "usedBeforeDefined", - data: reference.identifier - }); }); - scope.childScopes.forEach(findVariablesInScope); + scope.childScopes.forEach(checkReferencesInScope); } return { Program() { - findVariablesInScope(context.getScope()); + checkReferencesInScope(context.getScope()); } }; } diff --git a/node_modules/eslint/lib/rules/no-useless-backreference.js b/node_modules/eslint/lib/rules/no-useless-backreference.js index 958e3d5dd..5103e098b 100644 --- a/node_modules/eslint/lib/rules/no-useless-backreference.js +++ b/node_modules/eslint/lib/rules/no-useless-backreference.js @@ -9,9 +9,8 @@ // Requirements //------------------------------------------------------------------------------ -const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); -const { RegExpParser, visitRegExpAST } = require("regexpp"); -const lodash = require("lodash"); +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("@eslint-community/eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); //------------------------------------------------------------------------------ // Helpers @@ -59,14 +58,14 @@ function isNegativeLookaround(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow useless backreferences in regular expressions", - category: "Possible Errors", - recommended: false, + description: "Disallow useless backreferences in regular expressions", + recommended: true, url: "https://eslint.org/docs/rules/no-useless-backreference" }, @@ -137,7 +136,7 @@ module.exports = { // the opposite of the previous when the regex is matching backward in a lookbehind context. messageId = "backward"; - } else if (lodash.last(groupCut).type === "Alternative") { + } else if (groupCut[groupCut.length - 1].type === "Alternative") { // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive. messageId = "disjunctive"; diff --git a/node_modules/eslint/lib/rules/no-useless-call.js b/node_modules/eslint/lib/rules/no-useless-call.js index b1382a2fa..2d3ae4e84 100644 --- a/node_modules/eslint/lib/rules/no-useless-call.js +++ b/node_modules/eslint/lib/rules/no-useless-call.js @@ -49,13 +49,13 @@ function isValidThisArg(expectedThis, thisArg, sourceCode) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary calls to `.call()` and `.apply()`", - category: "Best Practices", + description: "Disallow unnecessary calls to `.call()` and `.apply()`", recommended: false, url: "https://eslint.org/docs/rules/no-useless-call" }, diff --git a/node_modules/eslint/lib/rules/no-useless-catch.js b/node_modules/eslint/lib/rules/no-useless-catch.js index f303c2729..36c356ecb 100644 --- a/node_modules/eslint/lib/rules/no-useless-catch.js +++ b/node_modules/eslint/lib/rules/no-useless-catch.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary `catch` clauses", - category: "Best Practices", + description: "Disallow unnecessary `catch` clauses", recommended: true, url: "https://eslint.org/docs/rules/no-useless-catch" }, diff --git a/node_modules/eslint/lib/rules/no-useless-computed-key.js b/node_modules/eslint/lib/rules/no-useless-computed-key.js index e0505a318..f7f12179b 100644 --- a/node_modules/eslint/lib/rules/no-useless-computed-key.js +++ b/node_modules/eslint/lib/rules/no-useless-computed-key.js @@ -8,20 +8,90 @@ // Requirements //------------------------------------------------------------------------------ -const lodash = require("lodash"); const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the computed key syntax is unnecessarily used for the given node. + * In particular, it determines whether removing the square brackets and using the content between them + * directly as the key (e.g. ['foo'] -> 'foo') would produce valid syntax and preserve the same behavior. + * Valid non-computed keys are only: identifiers, number literals and string literals. + * Only literals can preserve the same behavior, with a few exceptions for specific node types: + * Property + * - { ["__proto__"]: foo } defines a property named "__proto__" + * { "__proto__": foo } defines object's prototype + * PropertyDefinition + * - class C { ["constructor"]; } defines an instance field named "constructor" + * class C { "constructor"; } produces a parsing error + * - class C { static ["constructor"]; } defines a static field named "constructor" + * class C { static "constructor"; } produces a parsing error + * - class C { static ["prototype"]; } produces a runtime error (doesn't break the whole script) + * class C { static "prototype"; } produces a parsing error (breaks the whole script) + * MethodDefinition + * - class C { ["constructor"]() {} } defines a prototype method named "constructor" + * class C { "constructor"() {} } defines the constructor + * - class C { static ["prototype"]() {} } produces a runtime error (doesn't break the whole script) + * class C { static "prototype"() {} } produces a parsing error (breaks the whole script) + * @param {ASTNode} node The node to check. It can be `Property`, `PropertyDefinition` or `MethodDefinition`. + * @throws {Error} (Unreachable.) + * @returns {void} `true` if the node has useless computed key. + */ +function hasUselessComputedKey(node) { + if (!node.computed) { + return false; + } + + const { key } = node; + + if (key.type !== "Literal") { + return false; + } + + const { value } = key; + + if (typeof value !== "number" && typeof value !== "string") { + return false; + } + + switch (node.type) { + case "Property": + return value !== "__proto__"; + + case "PropertyDefinition": + if (node.static) { + return value !== "constructor" && value !== "prototype"; + } + + return value !== "constructor"; + + case "MethodDefinition": + if (node.static) { + return value !== "prototype"; + } + + return value !== "constructor"; + + /* c8 ignore next */ + default: + throw new Error(`Unexpected node type: ${node.type}`); + } + +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary computed property keys in objects and classes", - category: "ECMAScript 6", + description: "Disallow unnecessary computed property keys in objects and classes", recommended: false, url: "https://eslint.org/docs/rules/no-useless-computed-key" }, @@ -52,22 +122,9 @@ module.exports = { * @returns {void} */ function check(node) { - if (!node.computed) { - return; - } + if (hasUselessComputedKey(node)) { + const { key } = node; - const key = node.key, - nodeType = typeof key.value; - - let allowedKey; - - if (node.type === "MethodDefinition") { - allowedKey = node.static ? "prototype" : "constructor"; - } else { - allowedKey = "__proto__"; - } - - if (key.type === "Literal" && (nodeType === "string" || nodeType === "number") && key.value !== allowedKey) { context.report({ node, messageId: "unnecessarilyComputedProperty", @@ -95,9 +152,17 @@ module.exports = { } } + /** + * A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`. + * @returns {void} + * @private + */ + function noop() {} + return { Property: check, - MethodDefinition: enforceForClassMembers ? check : lodash.noop + MethodDefinition: enforceForClassMembers ? check : noop, + PropertyDefinition: enforceForClassMembers ? check : noop }; } }; diff --git a/node_modules/eslint/lib/rules/no-useless-concat.js b/node_modules/eslint/lib/rules/no-useless-concat.js index cfc60c8fb..26c5206df 100644 --- a/node_modules/eslint/lib/rules/no-useless-concat.js +++ b/node_modules/eslint/lib/rules/no-useless-concat.js @@ -64,13 +64,13 @@ function getRight(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary concatenation of literals or template literals", - category: "Best Practices", + description: "Disallow unnecessary concatenation of literals or template literals", recommended: false, url: "https://eslint.org/docs/rules/no-useless-concat" }, diff --git a/node_modules/eslint/lib/rules/no-useless-constructor.js b/node_modules/eslint/lib/rules/no-useless-constructor.js index baabe7ec8..38c3bc3a0 100644 --- a/node_modules/eslint/lib/rules/no-useless-constructor.js +++ b/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -132,13 +132,13 @@ function isRedundantSuperCall(body, ctorParams) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary constructors", - category: "ECMAScript 6", + description: "Disallow unnecessary constructors", recommended: false, url: "https://eslint.org/docs/rules/no-useless-constructor" }, diff --git a/node_modules/eslint/lib/rules/no-useless-escape.js b/node_modules/eslint/lib/rules/no-useless-escape.js index 512c93a8b..2046a148a 100644 --- a/node_modules/eslint/lib/rules/no-useless-escape.js +++ b/node_modules/eslint/lib/rules/no-useless-escape.js @@ -34,16 +34,17 @@ const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+ * @returns {Object[]} A list of characters, each with info on escaping and whether they're in a character class. * @example * - * parseRegExp('a\\b[cd-]') + * parseRegExp("a\\b[cd-]"); * - * returns: + * // returns: * [ - * {text: 'a', index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false}, - * {text: 'b', index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false}, - * {text: 'c', index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false}, - * {text: 'd', index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false}, - * {text: '-', index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false} - * ] + * { text: "a", index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false }, + * { text: "b", index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false }, + * { text: "c", index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false }, + * { text: "d", index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false }, + * { text: "-", index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false } + * ]; + * */ function parseRegExp(regExpText) { const charList = []; @@ -77,18 +78,19 @@ function parseRegExp(regExpText) { return charList; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow unnecessary escape characters", - category: "Best Practices", + description: "Disallow unnecessary escape characters", recommended: true, - url: "https://eslint.org/docs/rules/no-useless-escape", - suggestion: true + url: "https://eslint.org/docs/rules/no-useless-escape" }, + hasSuggestions: true, + messages: { unnecessaryEscape: "Unnecessary escape character: \\{{character}}.", removeEscape: "Remove the `\\`. This maintains the current functionality.", diff --git a/node_modules/eslint/lib/rules/no-useless-rename.js b/node_modules/eslint/lib/rules/no-useless-rename.js index a7cec025d..908605f74 100644 --- a/node_modules/eslint/lib/rules/no-useless-rename.js +++ b/node_modules/eslint/lib/rules/no-useless-rename.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow renaming import, export, and destructured assignments to the same name", - category: "ECMAScript 6", + description: "Disallow renaming import, export, and destructured assignments to the same name", recommended: false, url: "https://eslint.org/docs/rules/no-useless-rename" }, @@ -132,8 +132,10 @@ module.exports = { return; } - if (node.imported.name === node.local.name && - node.imported.range[0] !== node.local.range[0]) { + if ( + node.imported.range[0] !== node.local.range[0] && + astUtils.getModuleExportName(node.imported) === node.local.name + ) { reportError(node, node.imported, "Import"); } } @@ -148,8 +150,10 @@ module.exports = { return; } - if (node.local.name === node.exported.name && - node.local.range[0] !== node.exported.range[0]) { + if ( + node.local.range[0] !== node.exported.range[0] && + astUtils.getModuleExportName(node.local) === astUtils.getModuleExportName(node.exported) + ) { reportError(node, node.local, "Export"); } diff --git a/node_modules/eslint/lib/rules/no-useless-return.js b/node_modules/eslint/lib/rules/no-useless-return.js index 111cb2101..55e34b3ab 100644 --- a/node_modules/eslint/lib/rules/no-useless-return.js +++ b/node_modules/eslint/lib/rules/no-useless-return.js @@ -61,13 +61,13 @@ function isInFinally(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow redundant return statements", - category: "Best Practices", + description: "Disallow redundant return statements", recommended: false, url: "https://eslint.org/docs/rules/no-useless-return" }, @@ -197,7 +197,7 @@ module.exports = { return { - // Makes and pushs a new scope information. + // Makes and pushes a new scope information. onCodePathStart(codePath) { scopeInfo = { upper: scopeInfo, diff --git a/node_modules/eslint/lib/rules/no-var.js b/node_modules/eslint/lib/rules/no-var.js index f2cb96b1f..80ff8f1a0 100644 --- a/node_modules/eslint/lib/rules/no-var.js +++ b/node_modules/eslint/lib/rules/no-var.js @@ -90,7 +90,7 @@ function getScopeNode(node) { } } - /* istanbul ignore next : unreachable */ + /* c8 ignore next */ return null; } @@ -159,7 +159,7 @@ function hasReferenceInTDZ(node) { return !reference.init && ( start < idStart || (defaultValue !== null && start >= defaultStart && end <= defaultEnd) || - (start >= initStart && end <= initEnd) + (!astUtils.isFunction(node) && start >= initStart && end <= initEnd) ); }); }; @@ -179,13 +179,13 @@ function hasNameDisallowedForLetDeclarations(variable) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `let` or `const` instead of `var`", - category: "ECMAScript 6", + description: "Require `let` or `const` instead of `var`", recommended: false, url: "https://eslint.org/docs/rules/no-var" }, diff --git a/node_modules/eslint/lib/rules/no-void.js b/node_modules/eslint/lib/rules/no-void.js index 99c837855..15c473061 100644 --- a/node_modules/eslint/lib/rules/no-void.js +++ b/node_modules/eslint/lib/rules/no-void.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `void` operators", - category: "Best Practices", + description: "Disallow `void` operators", recommended: false, url: "https://eslint.org/docs/rules/no-void" }, diff --git a/node_modules/eslint/lib/rules/no-warning-comments.js b/node_modules/eslint/lib/rules/no-warning-comments.js index 0691a31f7..9754f5088 100644 --- a/node_modules/eslint/lib/rules/no-warning-comments.js +++ b/node_modules/eslint/lib/rules/no-warning-comments.js @@ -5,7 +5,7 @@ "use strict"; -const { escapeRegExp } = require("lodash"); +const escapeRegExp = require("escape-string-regexp"); const astUtils = require("./utils/ast-utils"); const CHAR_LIMIT = 40; @@ -14,13 +14,13 @@ const CHAR_LIMIT = 40; // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow specified warning terms in comments", - category: "Best Practices", + description: "Disallow specified warning terms in comments", recommended: false, url: "https://eslint.org/docs/rules/no-warning-comments" }, @@ -37,6 +37,15 @@ module.exports = { }, location: { enum: ["start", "anywhere"] + }, + decoration: { + type: "array", + items: { + type: "string", + pattern: "^\\S$" + }, + minItems: 1, + uniqueItems: true } }, additionalProperties: false @@ -53,6 +62,7 @@ module.exports = { configuration = context.options[0] || {}, warningTerms = configuration.terms || ["todo", "fixme", "xxx"], location = configuration.location || "start", + decoration = [...configuration.decoration || []].join(""), selfConfigRegEx = /\bno-warning-comments\b/u; /** @@ -64,59 +74,54 @@ module.exports = { */ function convertToRegExp(term) { const escaped = escapeRegExp(term); - const wordBoundary = "\\b"; - const eitherOrWordBoundary = `|${wordBoundary}`; - let prefix; + const escapedDecoration = escapeRegExp(decoration); /* - * If the term ends in a word character (a-z0-9_), ensure a word - * boundary at the end, so that substrings do not get falsely - * matched. eg "todo" in a string such as "mastodon". - * If the term ends in a non-word character, then \b won't match on - * the boundary to the next non-word character, which would likely - * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. - * In these cases, use no bounding match. Same applies for the - * prefix, handled below. + * When matching at the start, ignore leading whitespace, and + * there's no need to worry about word boundaries. + * + * These expressions for the prefix and suffix are designed as follows: + * ^ handles any terms at the beginning of a comment. + * e.g. terms ["TODO"] matches `//TODO something` + * $ handles any terms at the end of a comment + * e.g. terms ["TODO"] matches `// something TODO` + * \b handles terms preceded/followed by word boundary + * e.g. terms: ["!FIX", "FIX!"] matches `// FIX!something` or `// something!FIX` + * terms: ["FIX"] matches `// FIX!` or `// !FIX`, but not `// fixed or affix` + * + * For location start: + * [\s]* handles optional leading spaces + * e.g. terms ["TODO"] matches `// TODO something` + * [\s\*]* (where "\*" is the escaped string of decoration) + * handles optional leading spaces or decoration characters (for "start" location only) + * e.g. terms ["TODO"] matches `/**** TODO something ... ` */ - const suffix = /\w$/u.test(term) ? "\\b" : ""; + const wordBoundary = "\\b"; - if (location === "start") { + let prefix = ""; - /* - * When matching at the start, ignore leading whitespace, and - * there's no need to worry about word boundaries. - */ - prefix = "^\\s*"; + if (location === "start") { + prefix = `^[\\s${escapedDecoration}]*`; } else if (/^\w/u.test(term)) { prefix = wordBoundary; - } else { - prefix = ""; } - if (location === "start") { - - /* - * For location "start" the regex should be - * ^\s*TERM\b. This checks the word boundary - * at the beginning of the comment. - */ - return new RegExp(prefix + escaped + suffix, "iu"); - } + const suffix = /\w$/u.test(term) ? wordBoundary : ""; + const flags = "iu"; // Case-insensitive with Unicode case folding. /* - * For location "anywhere" the regex should be - * \bTERM\b|\bTERM\b, this checks the entire comment - * for the term. + * For location "start", the typical regex is: + * /^[\s]*ESCAPED_TERM\b/iu. + * Or if decoration characters are specified (e.g. "*"), then any of + * those characters may appear in any order at the start: + * /^[\s\*]*ESCAPED_TERM\b/iu. + * + * For location "anywhere" the typical regex is + * /\bESCAPED_TERM\b/iu + * + * If it starts or ends with non-word character, the prefix and suffix are empty, respectively. */ - return new RegExp( - prefix + - escaped + - suffix + - eitherOrWordBoundary + - term + - wordBoundary, - "iu" - ); + return new RegExp(`${prefix}${escaped}${suffix}`, flags); } const warningRegExps = warningTerms.map(convertToRegExp); diff --git a/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/node_modules/eslint/lib/rules/no-whitespace-before-property.js index 226f873c5..67323816f 100644 --- a/node_modules/eslint/lib/rules/no-whitespace-before-property.js +++ b/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "disallow whitespace before properties", - category: "Stylistic Issues", + description: "Disallow whitespace before properties", recommended: false, url: "https://eslint.org/docs/rules/no-whitespace-before-property" }, diff --git a/node_modules/eslint/lib/rules/no-with.js b/node_modules/eslint/lib/rules/no-with.js index d3e52e02f..33de68d9c 100644 --- a/node_modules/eslint/lib/rules/no-with.js +++ b/node_modules/eslint/lib/rules/no-with.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `with` statements", - category: "Best Practices", + description: "Disallow `with` statements", recommended: true, url: "https://eslint.org/docs/rules/no-with" }, diff --git a/node_modules/eslint/lib/rules/nonblock-statement-body-position.js b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js index 34e6eeac3..cefecf302 100644 --- a/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +++ b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js @@ -10,13 +10,13 @@ const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce the location of single-line statements", - category: "Stylistic Issues", + description: "Enforce the location of single-line statements", recommended: false, url: "https://eslint.org/docs/rules/nonblock-statement-body-position" }, diff --git a/node_modules/eslint/lib/rules/object-curly-newline.js b/node_modules/eslint/lib/rules/object-curly-newline.js index c5c098e13..2f8004918 100644 --- a/node_modules/eslint/lib/rules/object-curly-newline.js +++ b/node_modules/eslint/lib/rules/object-curly-newline.js @@ -10,7 +10,6 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const lodash = require("lodash"); //------------------------------------------------------------------------------ // Helpers @@ -69,6 +68,24 @@ function normalizeOptionValue(value) { return { multiline, minProperties, consistent }; } +/** + * Checks if a value is an object. + * @param {any} value The value to check + * @returns {boolean} `true` if the value is an object, otherwise `false` + */ +function isObject(value) { + return typeof value === "object" && value !== null; +} + +/** + * Checks if an option is a node-specific option + * @param {any} option The option to check + * @returns {boolean} `true` if the option is node-specific, otherwise `false` + */ +function isNodeSpecificOption(option) { + return isObject(option) || typeof option === "string"; +} + /** * Normalizes a given option value. * @param {string|Object|undefined} options An option value to parse. @@ -80,9 +97,7 @@ function normalizeOptionValue(value) { * }} Normalized option object. */ function normalizeOptions(options) { - const isNodeSpecificOption = lodash.overSome([lodash.isPlainObject, lodash.isString]); - - if (lodash.isPlainObject(options) && Object.values(options).some(isNodeSpecificOption)) { + if (isObject(options) && Object.values(options).some(isNodeSpecificOption)) { return { ObjectExpression: normalizeOptionValue(options.ObjectExpression), ObjectPattern: normalizeOptionValue(options.ObjectPattern), @@ -129,13 +144,13 @@ function areLineBreaksRequired(node, options, first, last) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent line breaks inside braces", - category: "Stylistic Issues", + description: "Enforce consistent line breaks after opening and before closing braces", recommended: false, url: "https://eslint.org/docs/rules/object-curly-newline" }, diff --git a/node_modules/eslint/lib/rules/object-curly-spacing.js b/node_modules/eslint/lib/rules/object-curly-spacing.js index c0044f503..d6a8e5956 100644 --- a/node_modules/eslint/lib/rules/object-curly-spacing.js +++ b/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing inside braces", - category: "Stylistic Issues", + description: "Enforce consistent spacing inside braces", recommended: false, url: "https://eslint.org/docs/rules/object-curly-spacing" }, diff --git a/node_modules/eslint/lib/rules/object-property-newline.js b/node_modules/eslint/lib/rules/object-property-newline.js index 0c7f80028..bc079a16f 100644 --- a/node_modules/eslint/lib/rules/object-property-newline.js +++ b/node_modules/eslint/lib/rules/object-property-newline.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce placing object properties on separate lines", - category: "Stylistic Issues", + description: "Enforce placing object properties on separate lines", recommended: false, url: "https://eslint.org/docs/rules/object-property-newline" }, diff --git a/node_modules/eslint/lib/rules/object-shorthand.js b/node_modules/eslint/lib/rules/object-shorthand.js index 3999ff8b9..b755aea3f 100644 --- a/node_modules/eslint/lib/rules/object-shorthand.js +++ b/node_modules/eslint/lib/rules/object-shorthand.js @@ -22,13 +22,13 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require or disallow method and property shorthand syntax for object literals", - category: "ECMAScript 6", + description: "Require or disallow method and property shorthand syntax for object literals", recommended: false, url: "https://eslint.org/docs/rules/object-shorthand" }, @@ -78,6 +78,9 @@ module.exports = { ignoreConstructors: { type: "boolean" }, + methodsIgnorePattern: { + type: "string" + }, avoidQuotes: { type: "boolean" }, @@ -115,6 +118,9 @@ module.exports = { const PARAMS = context.options[1] || {}; const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors; + const METHODS_IGNORE_PATTERN = PARAMS.methodsIgnorePattern + ? new RegExp(PARAMS.methodsIgnorePattern, "u") + : null; const AVOID_QUOTES = PARAMS.avoidQuotes; const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows; const sourceCode = context.getSourceCode(); @@ -149,7 +155,6 @@ module.exports = { * @param {ASTNode} property Property AST node * @returns {boolean} True if the property can have a shorthand form * @private - * */ function canHaveShorthand(property) { return (property.kind !== "set" && property.kind !== "get" && property.type !== "SpreadElement" && property.type !== "SpreadProperty" && property.type !== "ExperimentalSpreadProperty"); @@ -157,7 +162,7 @@ module.exports = { /** * Checks whether a node is a string literal. - * @param {ASTNode} node Any AST node. + * @param {ASTNode} node Any AST node. * @returns {boolean} `true` if it is a string literal. */ function isStringLiteral(node) { @@ -169,7 +174,6 @@ module.exports = { * @param {ASTNode} property Property AST node * @returns {boolean} True if the property is considered shorthand, false if not. * @private - * */ function isShorthand(property) { @@ -182,7 +186,6 @@ module.exports = { * @param {ASTNode} property Property AST node * @returns {boolean} True if the key and value are named equally, false if not. * @private - * */ function isRedundant(property) { const value = property.value; @@ -199,10 +202,9 @@ module.exports = { /** * Ensures that an object's properties are consistently shorthand, or not shorthand at all. - * @param {ASTNode} node Property AST node - * @param {boolean} checkRedundancy Whether to check longform redundancy + * @param {ASTNode} node Property AST node + * @param {boolean} checkRedundancy Whether to check longform redundancy * @returns {void} - * */ function checkConsistency(node, checkRedundancy) { @@ -461,6 +463,15 @@ module.exports = { if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) { return; } + + if (METHODS_IGNORE_PATTERN) { + const propertyName = astUtils.getStaticPropertyName(node); + + if (propertyName !== null && METHODS_IGNORE_PATTERN.test(propertyName)) { + return; + } + } + if (AVOID_QUOTES && isStringLiteral(node.key)) { return; } diff --git a/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js index db4674760..65be0929e 100644 --- a/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +++ b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require or disallow newlines around variable declarations", - category: "Stylistic Issues", + description: "Require or disallow newlines around variable declarations", recommended: false, url: "https://eslint.org/docs/rules/one-var-declaration-per-line" }, diff --git a/node_modules/eslint/lib/rules/one-var.js b/node_modules/eslint/lib/rules/one-var.js index e3df8320f..a8e2a1de0 100644 --- a/node_modules/eslint/lib/rules/one-var.js +++ b/node_modules/eslint/lib/rules/one-var.js @@ -28,13 +28,13 @@ function isInStatementList(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce variables to be declared either together or separately in functions", - category: "Stylistic Issues", + description: "Enforce variables to be declared either together or separately in functions", recommended: false, url: "https://eslint.org/docs/rules/one-var" }, @@ -209,7 +209,7 @@ module.exports = { /** * Determines the current scope (function or block) - * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {string} statementType node.kind, one of: "var", "let", or "const" * @returns {Object} The scope associated with statementType */ function getCurrentScope(statementType) { @@ -542,6 +542,8 @@ module.exports = { FunctionDeclaration: startFunction, FunctionExpression: startFunction, ArrowFunctionExpression: startFunction, + StaticBlock: startFunction, // StaticBlock creates a new scope for `var` variables + BlockStatement: startBlock, ForStatement: startBlock, ForInStatement: startBlock, @@ -553,10 +555,12 @@ module.exports = { "ForInStatement:exit": endBlock, "SwitchStatement:exit": endBlock, "BlockStatement:exit": endBlock, + "Program:exit": endFunction, "FunctionDeclaration:exit": endFunction, "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction + "ArrowFunctionExpression:exit": endFunction, + "StaticBlock:exit": endFunction }; } diff --git a/node_modules/eslint/lib/rules/operator-assignment.js b/node_modules/eslint/lib/rules/operator-assignment.js index fdb088492..ed9cb963b 100644 --- a/node_modules/eslint/lib/rules/operator-assignment.js +++ b/node_modules/eslint/lib/rules/operator-assignment.js @@ -17,23 +17,23 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether an operator is commutative and has an operator assignment * shorthand form. - * @param {string} operator Operator to check. - * @returns {boolean} True if the operator is commutative and has a + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is commutative and has a * shorthand form. */ function isCommutativeOperatorWithShorthand(operator) { - return ["*", "&", "^", "|"].indexOf(operator) >= 0; + return ["*", "&", "^", "|"].includes(operator); } /** * Checks whether an operator is not commutative and has an operator assignment * shorthand form. - * @param {string} operator Operator to check. - * @returns {boolean} True if the operator is not commutative and has + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is not commutative and has * a shorthand form. */ function isNonCommutativeOperatorWithShorthand(operator) { - return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].indexOf(operator) >= 0; + return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator); } //------------------------------------------------------------------------------ @@ -57,13 +57,13 @@ function canBeFixed(node) { ); } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require or disallow assignment operator shorthand where possible", - category: "Stylistic Issues", + description: "Require or disallow assignment operator shorthand where possible", recommended: false, url: "https://eslint.org/docs/rules/operator-assignment" }, @@ -76,8 +76,8 @@ module.exports = { fixable: "code", messages: { - replaced: "Assignment can be replaced with operator assignment.", - unexpected: "Unexpected operator assignment shorthand." + replaced: "Assignment (=) can be replaced with operator assignment ({{operator}}).", + unexpected: "Unexpected operator assignment ({{operator}}) shorthand." } }, @@ -96,7 +96,7 @@ module.exports = { /** * Ensures that an assignment uses the shorthand form where possible. - * @param {ASTNode} node An AssignmentExpression node. + * @param {ASTNode} node An AssignmentExpression node. * @returns {void} */ function verify(node) { @@ -109,10 +109,13 @@ module.exports = { const operator = expr.operator; if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) { + const replacementOperator = `${operator}=`; + if (astUtils.isSameReference(left, expr.left, true)) { context.report({ node, messageId: "replaced", + data: { operator: replacementOperator }, fix(fixer) { if (canBeFixed(left) && canBeFixed(expr.left)) { const equalsToken = getOperatorToken(node); @@ -125,7 +128,7 @@ module.exports = { return null; } - return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`); + return fixer.replaceText(node, `${leftText}${replacementOperator}${rightText}`); } return null; } @@ -139,7 +142,8 @@ module.exports = { */ context.report({ node, - messageId: "replaced" + messageId: "replaced", + data: { operator: replacementOperator } }); } } @@ -147,7 +151,7 @@ module.exports = { /** * Warns if an assignment expression uses operator assignment shorthand. - * @param {ASTNode} node An AssignmentExpression node. + * @param {ASTNode} node An AssignmentExpression node. * @returns {void} */ function prohibit(node) { @@ -155,6 +159,7 @@ module.exports = { context.report({ node, messageId: "unexpected", + data: { operator: node.operator }, fix(fixer) { if (canBeFixed(node.left)) { const firstToken = sourceCode.getFirstToken(node); diff --git a/node_modules/eslint/lib/rules/operator-linebreak.js b/node_modules/eslint/lib/rules/operator-linebreak.js index 18da5c55b..03b603e75 100644 --- a/node_modules/eslint/lib/rules/operator-linebreak.js +++ b/node_modules/eslint/lib/rules/operator-linebreak.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent linebreak style for operators", - category: "Stylistic Issues", + description: "Enforce consistent linebreak style for operators", recommended: false, url: "https://eslint.org/docs/rules/operator-linebreak" }, @@ -136,23 +136,21 @@ module.exports = { /** * Checks the operator placement * @param {ASTNode} node The node to check - * @param {ASTNode} leftSide The node that comes before the operator in `node` + * @param {ASTNode} rightSide The node that comes after the operator in `node` + * @param {string} operator The operator * @private * @returns {void} */ - function validateNode(node, leftSide) { + function validateNode(node, rightSide, operator) { /* - * When the left part of a binary expression is a single expression wrapped in - * parentheses (ex: `(a) + b`), leftToken will be the last token of the expression - * and operatorToken will be the closing parenthesis. - * The leftToken should be the last closing parenthesis, and the operatorToken - * should be the token right after that. + * Find the operator token by searching from the right side, because between the left side and the operator + * there could be additional tokens from type annotations. Search specifically for the token which + * value equals the operator, in order to skip possible opening parentheses before the right side node. */ - const operatorToken = sourceCode.getTokenAfter(leftSide, astUtils.isNotClosingParenToken); + const operatorToken = sourceCode.getTokenBefore(rightSide, token => token.value === operator); const leftToken = sourceCode.getTokenBefore(operatorToken); const rightToken = sourceCode.getTokenAfter(operatorToken); - const operator = operatorToken.value; const operatorStyleOverride = styleOverrides[operator]; const style = operatorStyleOverride || globalStyle; const fix = getFixer(operatorToken, style); @@ -222,7 +220,7 @@ module.exports = { * @returns {void} */ function validateBinaryExpression(node) { - validateNode(node, node.left); + validateNode(node, node.right, node.operator); } //-------------------------------------------------------------------------- @@ -235,12 +233,17 @@ module.exports = { AssignmentExpression: validateBinaryExpression, VariableDeclarator(node) { if (node.init) { - validateNode(node, node.id); + validateNode(node, node.init, "="); + } + }, + PropertyDefinition(node) { + if (node.value) { + validateNode(node, node.value, "="); } }, ConditionalExpression(node) { - validateNode(node, node.test); - validateNode(node, node.consequent); + validateNode(node, node.consequent, "?"); + validateNode(node, node.alternate, ":"); } }; } diff --git a/node_modules/eslint/lib/rules/padded-blocks.js b/node_modules/eslint/lib/rules/padded-blocks.js index f8b5bd977..bc194283d 100644 --- a/node_modules/eslint/lib/rules/padded-blocks.js +++ b/node_modules/eslint/lib/rules/padded-blocks.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow padding within blocks", - category: "Stylistic Issues", + description: "Require or disallow padding within blocks", recommended: false, url: "https://eslint.org/docs/rules/padded-blocks" }, @@ -107,6 +107,12 @@ module.exports = { if (node.type === "SwitchStatement") { return sourceCode.getTokenBefore(node.cases[0]); } + + if (node.type === "StaticBlock") { + return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token + } + + // `BlockStatement` or `ClassBody` return sourceCode.getFirstToken(node); } @@ -167,18 +173,20 @@ module.exports = { /** * Checks if a node should be padded, according to the rule config. * @param {ASTNode} node The AST node to check. + * @throws {Error} (Unreachable) * @returns {boolean} True if the node should be padded, false otherwise. */ function requirePaddingFor(node) { switch (node.type) { case "BlockStatement": + case "StaticBlock": return options.blocks; case "SwitchStatement": return options.switches; case "ClassBody": return options.classes; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } @@ -282,6 +290,7 @@ module.exports = { } checkPadding(node); }; + rule.StaticBlock = rule.BlockStatement; } if (Object.prototype.hasOwnProperty.call(options, "classes")) { diff --git a/node_modules/eslint/lib/rules/padding-line-between-statements.js b/node_modules/eslint/lib/rules/padding-line-between-statements.js index c97b9956b..9d730bffc 100644 --- a/node_modules/eslint/lib/rules/padding-line-between-statements.js +++ b/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -425,13 +425,13 @@ const StatementTypes = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow padding lines between statements", - category: "Stylistic Issues", + description: "Require or disallow padding lines between statements", recommended: false, url: "https://eslint.org/docs/rules/padding-line-between-statements" }, @@ -450,8 +450,7 @@ module.exports = { type: "array", items: { enum: Object.keys(StatementTypes) }, minItems: 1, - uniqueItems: true, - additionalItems: false + uniqueItems: true } ] } @@ -466,8 +465,7 @@ module.exports = { }, additionalProperties: false, required: ["blankLine", "prev", "next"] - }, - additionalItems: false + } }, messages: { @@ -619,9 +617,11 @@ module.exports = { Program: enterScope, BlockStatement: enterScope, SwitchStatement: enterScope, + StaticBlock: enterScope, "Program:exit": exitScope, "BlockStatement:exit": exitScope, "SwitchStatement:exit": exitScope, + "StaticBlock:exit": exitScope, ":statement": verify, diff --git a/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/node_modules/eslint/lib/rules/prefer-arrow-callback.js index ee5cfe3c8..340e5e35a 100644 --- a/node_modules/eslint/lib/rules/prefer-arrow-callback.js +++ b/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -53,13 +53,14 @@ function getVariableOfArguments(scope) { } } - /* istanbul ignore next */ + /* c8 ignore next */ return null; } /** * Checks whether or not a given node is a callback. * @param {ASTNode} node A node to check. + * @throws {Error} (Unreachable.) * @returns {Object} * {boolean} retv.isCallback - `true` if the node is a callback. * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. @@ -125,7 +126,7 @@ function getCallbackInfo(node) { parent = parent.parent; } - /* istanbul ignore next */ + /* c8 ignore next */ throw new Error("unreachable"); } @@ -144,13 +145,13 @@ function hasDuplicateParams(paramsList) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require using arrow functions for callbacks", - category: "ECMAScript 6", + description: "Require using arrow functions for callbacks", recommended: false, url: "https://eslint.org/docs/rules/prefer-arrow-callback" }, @@ -295,7 +296,7 @@ module.exports = { * If the callback function has duplicates in its list of parameters (possible in sloppy mode), * don't replace it with an arrow function, because this is a SyntaxError with arrow functions. */ - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } // Remove `.bind(this)` if exists. @@ -307,7 +308,7 @@ module.exports = { * E.g. `(foo || function(){}).bind(this)` */ if (memberNode.type !== "MemberExpression") { - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } const callNode = memberNode.parent; @@ -320,12 +321,12 @@ module.exports = { * ^^^^^^^^^^^^ */ if (astUtils.isParenthesised(sourceCode, memberNode)) { - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } // If comments exist in the `.bind(this)`, don't remove those. if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { - return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + return; } yield fixer.removeRange([firstTokenToRemove.range[0], lastTokenToRemove.range[1]]); @@ -334,6 +335,7 @@ module.exports = { // Convert the function expression to an arrow function. const functionToken = sourceCode.getFirstToken(node, node.async ? 1 : 0); const leftParenToken = sourceCode.getTokenAfter(functionToken, astUtils.isOpeningParenToken); + const tokenBeforeBody = sourceCode.getTokenBefore(node.body); if (sourceCode.commentsExistBetween(functionToken, leftParenToken)) { @@ -347,7 +349,7 @@ module.exports = { // Remove extra tokens and spaces. yield fixer.removeRange([functionToken.range[0], leftParenToken.range[0]]); } - yield fixer.insertTextBefore(node.body, "=> "); + yield fixer.insertTextAfter(tokenBeforeBody, " =>"); // Get the node that will become the new arrow function. let replacedNode = callbackInfo.isLexicalThis ? node.parent.parent : node; diff --git a/node_modules/eslint/lib/rules/prefer-const.js b/node_modules/eslint/lib/rules/prefer-const.js index f6e79e71c..e3d2db7ae 100644 --- a/node_modules/eslint/lib/rules/prefer-const.js +++ b/node_modules/eslint/lib/rules/prefer-const.js @@ -17,7 +17,7 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ const PATTERN_TYPE = /^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u; -const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|SwitchCase)$/u; +const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|StaticBlock|SwitchCase)$/u; const DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/u; /** @@ -60,7 +60,7 @@ function canBecomeVariableDeclaration(identifier) { */ function isOuterVariableInDestructing(name, initScope) { - if (initScope.through.find(ref => ref.resolved && ref.resolved.name === name)) { + if (initScope.through.some(ref => ref.resolved && ref.resolved.name === name)) { return true; } @@ -326,13 +326,13 @@ function findUp(node, type, shouldStop) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `const` declarations for variables that are never reassigned after declared", - category: "ECMAScript 6", + description: "Require `const` declarations for variables that are never reassigned after declared", recommended: false, url: "https://eslint.org/docs/rules/prefer-const" }, @@ -446,7 +446,19 @@ module.exports = { reportCount += nodesToReport.length; - shouldFix = shouldFix && (reportCount === varDeclParent.declarations.length); + let totalDeclarationsCount = 0; + + varDeclParent.declarations.forEach(declaration => { + if (declaration.id.type === "ObjectPattern") { + totalDeclarationsCount += declaration.id.properties.length; + } else if (declaration.id.type === "ArrayPattern") { + totalDeclarationsCount += declaration.id.elements.length; + } else { + totalDeclarationsCount += 1; + } + }); + + shouldFix = shouldFix && (reportCount === totalDeclarationsCount); } } diff --git a/node_modules/eslint/lib/rules/prefer-destructuring.js b/node_modules/eslint/lib/rules/prefer-destructuring.js index f82bb75c1..fdf46f65f 100644 --- a/node_modules/eslint/lib/rules/prefer-destructuring.js +++ b/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -20,13 +20,13 @@ const PRECEDENCE_OF_ASSIGNMENT_EXPR = astUtils.getPrecedence({ type: "Assignment // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require destructuring from arrays and/or objects", - category: "ECMAScript 6", + description: "Require destructuring from arrays and/or objects", recommended: false, url: "https://eslint.org/docs/rules/prefer-destructuring" }, @@ -119,8 +119,8 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- - // eslint-disable-next-line jsdoc/require-description /** + * Checks if destructuring type should be checked. * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator" * @param {string} destructuringType "array" or "object" * @returns {boolean} `true` if the destructuring type should be checked for the given node @@ -221,7 +221,11 @@ module.exports = { * @returns {void} */ function performCheck(leftNode, rightNode, reportNode) { - if (rightNode.type !== "MemberExpression" || rightNode.object.type === "Super") { + if ( + rightNode.type !== "MemberExpression" || + rightNode.object.type === "Super" || + rightNode.property.type === "PrivateIdentifier" + ) { return; } diff --git a/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js index 6121af889..06459e258 100644 --- a/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +++ b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const { CALL, ReferenceTracker } = require("eslint-utils"); +const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); //------------------------------------------------------------------------------ // Helpers @@ -84,13 +84,13 @@ function parenthesizeIfShould(text, shouldParenthesize) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow the use of `Math.pow` in favor of the `**` operator", - category: "Stylistic Issues", + description: "Disallow the use of `Math.pow` in favor of the `**` operator", recommended: false, url: "https://eslint.org/docs/rules/prefer-exponentiation-operator" }, diff --git a/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/node_modules/eslint/lib/rules/prefer-named-capture-group.js index 7d0aa3f9d..b7055f3a4 100644 --- a/node_modules/eslint/lib/rules/prefer-named-capture-group.js +++ b/node_modules/eslint/lib/rules/prefer-named-capture-group.js @@ -14,8 +14,8 @@ const { CONSTRUCT, ReferenceTracker, getStringIfConstant -} = require("eslint-utils"); -const regexpp = require("regexpp"); +} = require("@eslint-community/eslint-utils"); +const regexpp = require("@eslint-community/regexpp"); //------------------------------------------------------------------------------ // Helpers @@ -23,38 +23,99 @@ const regexpp = require("regexpp"); const parser = new regexpp.RegExpParser(); +/** + * Creates fixer suggestions for the regex, if statically determinable. + * @param {number} groupStart Starting index of the regex group. + * @param {string} pattern The regular expression pattern to be checked. + * @param {string} rawText Source text of the regexNode. + * @param {ASTNode} regexNode AST node which contains the regular expression. + * @returns {Array} Fixer suggestions for the regex, if statically determinable. + */ +function suggestIfPossible(groupStart, pattern, rawText, regexNode) { + switch (regexNode.type) { + case "Literal": + if (typeof regexNode.value === "string" && rawText.includes("\\")) { + return null; + } + break; + case "TemplateLiteral": + if (regexNode.expressions.length || rawText.slice(1, -1) !== pattern) { + return null; + } + break; + default: + return null; + } + + const start = regexNode.range[0] + groupStart + 2; + + return [ + { + fix(fixer) { + const existingTemps = pattern.match(/temp\d+/gu) || []; + const highestTempCount = existingTemps.reduce( + (previous, next) => + Math.max(previous, Number(next.slice("temp".length))), + 0 + ); + + return fixer.insertTextBeforeRange( + [start, start], + `?` + ); + }, + messageId: "addGroupName" + }, + { + fix(fixer) { + return fixer.insertTextBeforeRange( + [start, start], + "?:" + ); + }, + messageId: "addNonCapture" + } + ]; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce using named capture group in regular expression", - category: "Best Practices", + description: "Enforce using named capture group in regular expression", recommended: false, url: "https://eslint.org/docs/rules/prefer-named-capture-group" }, + hasSuggestions: true, + schema: [], messages: { + addGroupName: "Add name to capture group.", + addNonCapture: "Convert group to non-capturing.", required: "Capture group '{{group}}' should be converted to a named or non-capturing group." } }, create(context) { + const sourceCode = context.getSourceCode(); /** * Function to check regular expression. - * @param {string} pattern The regular expression pattern to be check. - * @param {ASTNode} node AST node which contains regular expression. + * @param {string} pattern The regular expression pattern to be checked. + * @param {ASTNode} node AST node which contains the regular expression or a call/new expression. + * @param {ASTNode} regexNode AST node which contains the regular expression. * @param {boolean} uFlag Flag indicates whether unicode mode is enabled or not. * @returns {void} */ - function checkRegex(pattern, node, uFlag) { + function checkRegex(pattern, node, regexNode, uFlag) { let ast; try { @@ -68,12 +129,16 @@ module.exports = { regexpp.visitRegExpAST(ast, { onCapturingGroupEnter(group) { if (!group.name) { + const rawText = sourceCode.getText(regexNode); + const suggest = suggestIfPossible(group.start, pattern, rawText, regexNode); + context.report({ node, messageId: "required", data: { group: group.raw - } + }, + suggest }); } } @@ -83,7 +148,7 @@ module.exports = { return { Literal(node) { if (node.regex) { - checkRegex(node.regex.pattern, node, node.regex.flags.includes("u")); + checkRegex(node.regex.pattern, node, node, node.regex.flags.includes("u")); } }, Program() { @@ -101,7 +166,7 @@ module.exports = { const flags = getStringIfConstant(node.arguments[1]); if (regex) { - checkRegex(regex, node, flags && flags.includes("u")); + checkRegex(regex, node, node.arguments[0], flags && flags.includes("u")); } } } diff --git a/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/node_modules/eslint/lib/rules/prefer-numeric-literals.js index cc82e6653..5f7015812 100644 --- a/node_modules/eslint/lib/rules/prefer-numeric-literals.js +++ b/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -39,13 +39,13 @@ function isParseInt(calleeNode) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", - category: "ECMAScript 6", + description: "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", recommended: false, url: "https://eslint.org/docs/rules/prefer-numeric-literals" }, diff --git a/node_modules/eslint/lib/rules/prefer-object-has-own.js b/node_modules/eslint/lib/rules/prefer-object-has-own.js new file mode 100644 index 000000000..023d0a64f --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-object-has-own.js @@ -0,0 +1,112 @@ +/** + * @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call() + * @author Nitin Kumar + * @author Gautam Arora + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given node is considered to be an access to a property of `Object.prototype`. + * @param {ASTNode} node `MemberExpression` node to evaluate. + * @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node). + */ +function hasLeftHandObject(node) { + + /* + * ({}).hasOwnProperty.call(obj, prop) - `true` + * ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty + */ + if (node.object.type === "ObjectExpression" && node.object.properties.length === 0) { + return true; + } + + const objectNodeToCheck = node.object.type === "MemberExpression" && astUtils.getStaticPropertyName(node.object) === "prototype" ? node.object.object : node.object; + + if (objectNodeToCheck.type === "Identifier" && objectNodeToCheck.name === "Object") { + return true; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + docs: { + description: + "Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-object-has-own" + }, + schema: [], + messages: { + useHasOwn: "Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'." + }, + fixable: "code" + }, + create(context) { + return { + CallExpression(node) { + if (!(node.callee.type === "MemberExpression" && node.callee.object.type === "MemberExpression")) { + return; + } + + const calleePropertyName = astUtils.getStaticPropertyName(node.callee); + const objectPropertyName = astUtils.getStaticPropertyName(node.callee.object); + const isObject = hasLeftHandObject(node.callee.object); + + // check `Object` scope + const scope = context.getScope(); + const variable = astUtils.getVariableByName(scope, "Object"); + + if ( + calleePropertyName === "call" && + objectPropertyName === "hasOwnProperty" && + isObject && + variable && variable.scope.type === "global" + ) { + context.report({ + node, + messageId: "useHasOwn", + fix(fixer) { + const sourceCode = context.getSourceCode(); + + if (sourceCode.getCommentsInside(node.callee).length > 0) { + return null; + } + + const tokenJustBeforeNode = sourceCode.getTokenBefore(node.callee, { includeComments: true }); + + // for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335 + if ( + tokenJustBeforeNode && + tokenJustBeforeNode.range[1] === node.callee.range[0] && + !astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn") + ) { + return fixer.replaceText(node.callee, " Object.hasOwn"); + } + + return fixer.replaceText(node.callee, "Object.hasOwn"); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-object-spread.js b/node_modules/eslint/lib/rules/prefer-object-spread.js index ab252c73a..b70ef64bd 100644 --- a/node_modules/eslint/lib/rules/prefer-object-spread.js +++ b/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -6,7 +6,7 @@ "use strict"; -const { CALL, ReferenceTracker } = require("eslint-utils"); +const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); const { isCommaToken, isOpeningParenToken, @@ -240,14 +240,14 @@ function defineFixer(node, sourceCode) { }; } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: - "disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.", - category: "Stylistic Issues", + "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead", recommended: false, url: "https://eslint.org/docs/rules/prefer-object-spread" }, diff --git a/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js index ec16e4455..bd7bdcbf5 100644 --- a/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +++ b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require using Error objects as Promise rejection reasons", - category: "Best Practices", + description: "Require using Error objects as Promise rejection reasons", recommended: false, url: "https://eslint.org/docs/rules/prefer-promise-reject-errors" }, diff --git a/node_modules/eslint/lib/rules/prefer-reflect.js b/node_modules/eslint/lib/rules/prefer-reflect.js index 156d61251..68ffa88b3 100644 --- a/node_modules/eslint/lib/rules/prefer-reflect.js +++ b/node_modules/eslint/lib/rules/prefer-reflect.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `Reflect` methods where applicable", - category: "ECMAScript 6", + description: "Require `Reflect` methods where applicable", recommended: false, url: "https://eslint.org/docs/rules/prefer-reflect" }, @@ -106,7 +106,7 @@ module.exports = { const methodName = (node.callee.property || {}).name; const isReflectCall = (node.callee.object || {}).name === "Reflect"; const hasReflectSubstitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); - const userConfiguredException = exceptions.indexOf(methodName) !== -1; + const userConfiguredException = exceptions.includes(methodName); if (hasReflectSubstitute && !isReflectCall && !userConfiguredException) { report(node, existingNames[methodName], reflectSubstitutes[methodName]); @@ -115,7 +115,7 @@ module.exports = { UnaryExpression(node) { const isDeleteOperator = node.operator === "delete"; const targetsIdentifier = node.argument.type === "Identifier"; - const userConfiguredException = exceptions.indexOf("delete") !== -1; + const userConfiguredException = exceptions.includes("delete"); if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { report(node, "the delete keyword", "Reflect.deleteProperty"); diff --git a/node_modules/eslint/lib/rules/prefer-regex-literals.js b/node_modules/eslint/lib/rules/prefer-regex-literals.js index 9e8ce0235..c9948658c 100644 --- a/node_modules/eslint/lib/rules/prefer-regex-literals.js +++ b/node_modules/eslint/lib/rules/prefer-regex-literals.js @@ -10,12 +10,16 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils"); +const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("@eslint-community/eslint-utils"); +const { RegExpValidator, visitRegExpAST, RegExpParser } = require("@eslint-community/regexpp"); +const { canTokensBeAdjacent } = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const REGEXPP_LATEST_ECMA_VERSION = 2022; + /** * Determines whether the given node is a string literal. * @param {ASTNode} node Node to check. @@ -43,22 +47,89 @@ function isStaticTemplateLiteral(node) { return node.type === "TemplateLiteral" && node.expressions.length === 0; } +const validPrecedingTokens = new Set([ + "(", + ";", + "[", + ",", + "=", + "+", + "*", + "-", + "?", + "~", + "%", + "**", + "!", + "typeof", + "instanceof", + "&&", + "||", + "??", + "return", + "...", + "delete", + "void", + "in", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "<<", + ">>", + ">>>", + "&", + "|", + "^", + ":", + "{", + "=>", + "*=", + "<<=", + ">>=", + ">>>=", + "^=", + "|=", + "&=", + "??=", + "||=", + "&&=", + "**=", + "+=", + "-=", + "/=", + "%=", + "/", + "do", + "break", + "continue", + "debugger", + "case", + "throw" +]); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow use of the `RegExp` constructor in favor of regular expression literals", - category: "Best Practices", + description: "Disallow use of the `RegExp` constructor in favor of regular expression literals", recommended: false, url: "https://eslint.org/docs/rules/prefer-regex-literals" }, + hasSuggestions: true, + schema: [ { type: "object", @@ -74,6 +145,9 @@ module.exports = { messages: { unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.", + replaceWithLiteral: "Replace with an equivalent regular expression literal.", + replaceWithLiteralAndFlags: "Replace with an equivalent regular expression literal with flags '{{ flags }}'.", + replaceWithIntendedLiteralAndFlags: "Replace with a regular expression literal with flags '{{ flags }}'.", unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.", unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor." } @@ -81,6 +155,7 @@ module.exports = { create(context) { const [{ disallowRedundantWrapping = false } = {}] = context.options; + const sourceCode = context.getSourceCode(); /** * Determines whether the given identifier node is a reference to a global variable. @@ -107,6 +182,27 @@ module.exports = { isStaticTemplateLiteral(node.quasi); } + /** + * Gets the value of a string + * @param {ASTNode} node The node to get the string of. + * @returns {string|null} The value of the node. + */ + function getStringValue(node) { + if (isStringLiteral(node)) { + return node.value; + } + + if (isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked; + } + + if (isStringRawTaggedStaticTemplateLiteral(node)) { + return node.quasi.quasis[0].value.raw; + } + + return null; + } + /** * Determines whether the given node is considered to be a static string by the logic of this rule. * @param {ASTNode} node Node to check. @@ -152,6 +248,132 @@ module.exports = { return false; } + /** + * Returns a ecmaVersion compatible for regexpp. + * @param {number} ecmaVersion The ecmaVersion to convert. + * @returns {import("regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp. + */ + function getRegexppEcmaVersion(ecmaVersion) { + if (ecmaVersion <= 5) { + return 5; + } + return Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION); + } + + const regexppEcmaVersion = getRegexppEcmaVersion(context.languageOptions.ecmaVersion); + + /** + * Makes a character escaped or else returns null. + * @param {string} character The character to escape. + * @returns {string} The resulting escaped character. + */ + function resolveEscapes(character) { + switch (character) { + case "\n": + case "\\\n": + return "\\n"; + + case "\r": + case "\\\r": + return "\\r"; + + case "\t": + case "\\\t": + return "\\t"; + + case "\v": + case "\\\v": + return "\\v"; + + case "\f": + case "\\\f": + return "\\f"; + + case "/": + return "\\/"; + + default: + return null; + } + } + + /** + * Checks whether the given regex and flags are valid for the ecma version or not. + * @param {string} pattern The regex pattern to check. + * @param {string | undefined} flags The regex flags to check. + * @returns {boolean} True if the given regex pattern and flags are valid for the ecma version. + */ + function isValidRegexForEcmaVersion(pattern, flags) { + const validator = new RegExpValidator({ ecmaVersion: regexppEcmaVersion }); + + try { + validator.validatePattern(pattern, 0, pattern.length, flags ? flags.includes("u") : false); + if (flags) { + validator.validateFlags(flags); + } + return true; + } catch { + return false; + } + } + + /** + * Checks whether two given regex flags contain the same flags or not. + * @param {string} flagsA The regex flags. + * @param {string} flagsB The regex flags. + * @returns {boolean} True if two regex flags contain same flags. + */ + function areFlagsEqual(flagsA, flagsB) { + return [...flagsA].sort().join("") === [...flagsB].sort().join(""); + } + + + /** + * Merges two regex flags. + * @param {string} flagsA The regex flags. + * @param {string} flagsB The regex flags. + * @returns {string} The merged regex flags. + */ + function mergeRegexFlags(flagsA, flagsB) { + const flagsSet = new Set([ + ...flagsA, + ...flagsB + ]); + + return [...flagsSet].join(""); + } + + /** + * Checks whether a give node can be fixed to the given regex pattern and flags. + * @param {ASTNode} node The node to check. + * @param {string} pattern The regex pattern to check. + * @param {string} flags The regex flags + * @returns {boolean} True if a node can be fixed to the given regex pattern and flags. + */ + function canFixTo(node, pattern, flags) { + const tokenBefore = sourceCode.getTokenBefore(node); + + return sourceCode.getCommentsInside(node).length === 0 && + (!tokenBefore || validPrecedingTokens.has(tokenBefore.value)) && + isValidRegexForEcmaVersion(pattern, flags); + } + + /** + * Returns a safe output code considering the before and after tokens. + * @param {ASTNode} node The regex node. + * @param {string} newRegExpValue The new regex expression value. + * @returns {string} The output code. + */ + function getSafeOutput(node, newRegExpValue) { + const tokenBefore = sourceCode.getTokenBefore(node); + const tokenAfter = sourceCode.getTokenAfter(node); + + return (tokenBefore && !canTokensBeAdjacent(tokenBefore, newRegExpValue) && tokenBefore.range[1] === node.range[0] ? " " : "") + + newRegExpValue + + (tokenAfter && !canTokensBeAdjacent(newRegExpValue, tokenAfter) && node.range[1] === tokenAfter.range[0] ? " " : ""); + + } + return { Program() { const scope = context.getScope(); @@ -165,13 +387,122 @@ module.exports = { for (const { node } of tracker.iterateGlobalReferences(traceMap)) { if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(node)) { + const regexNode = node.arguments[0]; + if (node.arguments.length === 2) { - context.report({ node, messageId: "unexpectedRedundantRegExpWithFlags" }); + const suggests = []; + + const argFlags = getStringValue(node.arguments[1]) || ""; + + if (canFixTo(node, regexNode.regex.pattern, argFlags)) { + suggests.push({ + messageId: "replaceWithLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: argFlags + }); + } + + const literalFlags = regexNode.regex.flags || ""; + const mergedFlags = mergeRegexFlags(literalFlags, argFlags); + + if ( + !areFlagsEqual(mergedFlags, argFlags) && + canFixTo(node, regexNode.regex.pattern, mergedFlags) + ) { + suggests.push({ + messageId: "replaceWithIntendedLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: mergedFlags + }); + } + + context.report({ + node, + messageId: "unexpectedRedundantRegExpWithFlags", + suggest: suggests.map(({ flags, pattern, messageId }) => ({ + messageId, + data: { + flags + }, + fix(fixer) { + return fixer.replaceText(node, getSafeOutput(node, `/${pattern}/${flags}`)); + } + })) + }); } else { - context.report({ node, messageId: "unexpectedRedundantRegExp" }); + const outputs = []; + + if (canFixTo(node, regexNode.regex.pattern, regexNode.regex.flags)) { + outputs.push(sourceCode.getText(regexNode)); + } + + + context.report({ + node, + messageId: "unexpectedRedundantRegExp", + suggest: outputs.map(output => ({ + messageId: "replaceWithLiteral", + fix(fixer) { + return fixer.replaceText( + node, + getSafeOutput(node, output) + ); + } + })) + }); } } else if (hasOnlyStaticStringArguments(node)) { - context.report({ node, messageId: "unexpectedRegExp" }); + let regexContent = getStringValue(node.arguments[0]); + let noFix = false; + let flags; + + if (node.arguments[1]) { + flags = getStringValue(node.arguments[1]); + } + + if (!canFixTo(node, regexContent, flags)) { + noFix = true; + } + + if (!/^[-a-zA-Z0-9\\[\](){} \t\r\n\v\f!@#$%^&*+^_=/~`.> token.value === "+"); const textBeforePlus = getTextBetween(currentNode.left, plusSign); const textAfterPlus = getTextBetween(plusSign, currentNode.right); diff --git a/node_modules/eslint/lib/rules/quote-props.js b/node_modules/eslint/lib/rules/quote-props.js index fab7bdc9c..db9423978 100644 --- a/node_modules/eslint/lib/rules/quote-props.js +++ b/node_modules/eslint/lib/rules/quote-props.js @@ -16,13 +16,13 @@ const keywords = require("./utils/keywords"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require quotes around object literal property names", - category: "Stylistic Issues", + description: "Require quotes around object literal property names", recommended: false, url: "https://eslint.org/docs/rules/quote-props" }, @@ -91,24 +91,24 @@ module.exports = { /** * Checks whether a certain string constitutes an ES3 token - * @param {string} tokenStr The string to be checked. + * @param {string} tokenStr The string to be checked. * @returns {boolean} `true` if it is an ES3 token. */ function isKeyword(tokenStr) { - return keywords.indexOf(tokenStr) >= 0; + return keywords.includes(tokenStr); } /** * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) - * @param {string} rawKey The raw key value from the source - * @param {espreeTokens} tokens The espree-tokenized node key - * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked * @returns {boolean} Whether or not a key has redundant quotes. * @private */ function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) { return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length && - (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || + (["Identifier", "Keyword", "Null", "Boolean"].includes(tokens[0].type) || (tokens[0].type === "Numeric" && !skipNumberLiterals && String(+tokens[0].value) === tokens[0].value)); } @@ -139,7 +139,7 @@ module.exports = { /** * Ensures that a property's key is quoted only when necessary - * @param {ASTNode} node Property AST node + * @param {ASTNode} node Property AST node * @returns {void} */ function checkUnnecessaryQuotes(node) { @@ -195,7 +195,7 @@ module.exports = { /** * Ensures that a property's key is quoted - * @param {ASTNode} node Property AST node + * @param {ASTNode} node Property AST node * @returns {void} */ function checkOmittedQuotes(node) { @@ -213,8 +213,8 @@ module.exports = { /** * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes - * @param {ASTNode} node Property AST node - * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy * @returns {void} */ function checkConsistency(node, checkQuotesRedundancy) { diff --git a/node_modules/eslint/lib/rules/quotes.js b/node_modules/eslint/lib/rules/quotes.js index da7e12749..ab7b38b90 100644 --- a/node_modules/eslint/lib/rules/quotes.js +++ b/node_modules/eslint/lib/rules/quotes.js @@ -74,13 +74,13 @@ const AVOID_ESCAPE = "avoid-escape"; // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce the consistent use of either backticks, double, or single quotes", - category: "Stylistic Issues", + description: "Enforce the consistent use of either backticks, double, or single quotes", recommended: false, url: "https://eslint.org/docs/rules/quotes" }, @@ -216,15 +216,27 @@ module.exports = { // LiteralPropertyName. case "Property": + case "PropertyDefinition": case "MethodDefinition": return parent.key === node && !parent.computed; // ModuleSpecifier. case "ImportDeclaration": case "ExportNamedDeclaration": - case "ExportAllDeclaration": return parent.source === node; + // ModuleExportName or ModuleSpecifier. + case "ExportAllDeclaration": + return parent.exported === node || parent.source === node; + + // ModuleExportName. + case "ImportSpecifier": + return parent.imported === node; + + // ModuleExportName. + case "ExportSpecifier": + return parent.local === node || parent.exported === node; + // Others don't allow. default: return false; @@ -271,7 +283,7 @@ module.exports = { astUtils.isSurroundedBy(rawVal, settings.quote); if (!isValid && avoidEscape) { - isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; + isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.includes(settings.quote); } if (!isValid) { diff --git a/node_modules/eslint/lib/rules/radix.js b/node_modules/eslint/lib/rules/radix.js index e32256623..0618d9844 100644 --- a/node_modules/eslint/lib/rules/radix.js +++ b/node_modules/eslint/lib/rules/radix.js @@ -74,17 +74,19 @@ function isDefaultRadix(radix) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce the consistent use of the radix argument when using `parseInt()`", - category: "Best Practices", + description: "Enforce the consistent use of the radix argument when using `parseInt()`", recommended: false, url: "https://eslint.org/docs/rules/radix" }, + hasSuggestions: true, + schema: [ { enum: ["always", "as-needed"] @@ -95,7 +97,8 @@ module.exports = { missingParameters: "Missing parameters.", redundantRadix: "Redundant radix parameter.", missingRadix: "Missing radix parameter.", - invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36." + invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36.", + addRadixParameter10: "Add radix parameter `10` for parsing decimal numbers." } }, @@ -123,7 +126,21 @@ module.exports = { if (mode === MODE_ALWAYS) { context.report({ node, - messageId: "missingRadix" + messageId: "missingRadix", + suggest: [ + { + messageId: "addRadixParameter10", + fix(fixer) { + const sourceCode = context.getSourceCode(); + const tokens = sourceCode.getTokens(node); + const lastToken = tokens[tokens.length - 1]; // Parenthesis. + const secondToLastToken = tokens[tokens.length - 2]; // May or may not be a comma. + const hasTrailingComma = secondToLastToken.type === "Punctuator" && secondToLastToken.value === ","; + + return fixer.insertTextBefore(lastToken, hasTrailingComma ? " 10," : ", 10"); + } + } + ] }); } break; diff --git a/node_modules/eslint/lib/rules/require-atomic-updates.js b/node_modules/eslint/lib/rules/require-atomic-updates.js index c552f1bd8..7a5f822ab 100644 --- a/node_modules/eslint/lib/rules/require-atomic-updates.js +++ b/node_modules/eslint/lib/rules/require-atomic-updates.js @@ -13,6 +13,10 @@ */ function createReferenceMap(scope, outReferenceMap = new Map()) { for (const reference of scope.references) { + if (reference.resolved === null) { + continue; + } + outReferenceMap.set(reference.identifier, reference); } for (const childScope of scope.childScopes) { @@ -75,6 +79,9 @@ function isLocalVariableWithoutEscape(variable, isMemberAccess) { reference.from.variableScope === functionScope); } +/** + * Represents segment information. + */ class SegmentInfo { constructor() { this.info = new WeakMap(); @@ -86,42 +93,42 @@ class SegmentInfo { * @returns {void} */ initialize(segment) { - const outdatedReadVariableNames = new Set(); - const freshReadVariableNames = new Set(); + const outdatedReadVariables = new Set(); + const freshReadVariables = new Set(); for (const prevSegment of segment.prevSegments) { const info = this.info.get(prevSegment); if (info) { - info.outdatedReadVariableNames.forEach(Set.prototype.add, outdatedReadVariableNames); - info.freshReadVariableNames.forEach(Set.prototype.add, freshReadVariableNames); + info.outdatedReadVariables.forEach(Set.prototype.add, outdatedReadVariables); + info.freshReadVariables.forEach(Set.prototype.add, freshReadVariables); } } - this.info.set(segment, { outdatedReadVariableNames, freshReadVariableNames }); + this.info.set(segment, { outdatedReadVariables, freshReadVariables }); } /** * Mark a given variable as read on given segments. * @param {PathSegment[]} segments The segments that it read the variable on. - * @param {string} variableName The variable name to be read. + * @param {Variable} variable The variable to be read. * @returns {void} */ - markAsRead(segments, variableName) { + markAsRead(segments, variable) { for (const segment of segments) { const info = this.info.get(segment); if (info) { - info.freshReadVariableNames.add(variableName); + info.freshReadVariables.add(variable); // If a variable is freshly read again, then it's no more out-dated. - info.outdatedReadVariableNames.delete(variableName); + info.outdatedReadVariables.delete(variable); } } } /** - * Move `freshReadVariableNames` to `outdatedReadVariableNames`. + * Move `freshReadVariables` to `outdatedReadVariables`. * @param {PathSegment[]} segments The segments to process. * @returns {void} */ @@ -130,8 +137,8 @@ class SegmentInfo { const info = this.info.get(segment); if (info) { - info.freshReadVariableNames.forEach(Set.prototype.add, info.outdatedReadVariableNames); - info.freshReadVariableNames.clear(); + info.freshReadVariables.forEach(Set.prototype.add, info.outdatedReadVariables); + info.freshReadVariables.clear(); } } } @@ -139,14 +146,14 @@ class SegmentInfo { /** * Check if a given variable is outdated on the current segments. * @param {PathSegment[]} segments The current segments. - * @param {string} variableName The variable name to check. + * @param {Variable} variable The variable to check. * @returns {boolean} `true` if the variable is outdated on the segments. */ - isOutdated(segments, variableName) { + isOutdated(segments, variable) { for (const segment of segments) { const info = this.info.get(segment); - if (info && info.outdatedReadVariableNames.has(variableName)) { + if (info && info.outdatedReadVariables.has(variable)) { return true; } } @@ -158,26 +165,39 @@ class SegmentInfo { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "disallow assignments that can lead to race conditions due to usage of `await` or `yield`", - category: "Possible Errors", + description: "Disallow assignments that can lead to race conditions due to usage of `await` or `yield`", recommended: false, url: "https://eslint.org/docs/rules/require-atomic-updates" }, fixable: null, - schema: [], + + schema: [{ + type: "object", + properties: { + allowProperties: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], messages: { - nonAtomicUpdate: "Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`." + nonAtomicUpdate: "Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`.", + nonAtomicObjectUpdate: "Possible race condition: `{{value}}` might be assigned based on an outdated state of `{{object}}`." } }, create(context) { + const allowProperties = !!context.options[0] && context.options[0].allowProperties; + const sourceCode = context.getSourceCode(); const assignmentReferences = new Map(); const segmentInfo = new SegmentInfo(); @@ -214,14 +234,13 @@ module.exports = { if (!reference) { return; } - const name = reference.identifier.name; const variable = reference.resolved; const writeExpr = getWriteExpr(reference); const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; // Add a fresh read variable. if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { - segmentInfo.markAsRead(codePath.currentSegments, name); + segmentInfo.markAsRead(codePath.currentSegments, variable); } /* @@ -245,7 +264,7 @@ module.exports = { /* * Verify assignments. - * If the reference exists in `outdatedReadVariableNames` list, report it. + * If the reference exists in `outdatedReadVariables` list, report it. */ ":expression:exit"(node) { const { codePath, referenceMap } = stack; @@ -267,16 +286,28 @@ module.exports = { assignmentReferences.delete(node); for (const reference of references) { - const name = reference.identifier.name; - - if (segmentInfo.isOutdated(codePath.currentSegments, name)) { - context.report({ - node: node.parent, - messageId: "nonAtomicUpdate", - data: { - value: sourceCode.getText(node.parent.left) - } - }); + const variable = reference.resolved; + + if (segmentInfo.isOutdated(codePath.currentSegments, variable)) { + if (node.parent.left === reference.identifier) { + context.report({ + node: node.parent, + messageId: "nonAtomicUpdate", + data: { + value: variable.name + } + }); + } else if (!allowProperties) { + context.report({ + node: node.parent, + messageId: "nonAtomicObjectUpdate", + data: { + value: sourceCode.getText(node.parent.left), + object: variable.name + } + }); + } + } } } diff --git a/node_modules/eslint/lib/rules/require-await.js b/node_modules/eslint/lib/rules/require-await.js index 9b5acc78c..1add2552e 100644 --- a/node_modules/eslint/lib/rules/require-await.js +++ b/node_modules/eslint/lib/rules/require-await.js @@ -28,13 +28,13 @@ function capitalizeFirstLetter(text) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "disallow async functions which have no `await` expression", - category: "Best Practices", + description: "Disallow async functions which have no `await` expression", recommended: false, url: "https://eslint.org/docs/rules/require-await" }, diff --git a/node_modules/eslint/lib/rules/require-jsdoc.js b/node_modules/eslint/lib/rules/require-jsdoc.js index e581b2bee..755f6df5f 100644 --- a/node_modules/eslint/lib/rules/require-jsdoc.js +++ b/node_modules/eslint/lib/rules/require-jsdoc.js @@ -1,16 +1,17 @@ /** * @fileoverview Rule to check for jsdoc presence. * @author Gyandeep Singh + * @deprecated in ESLint v5.10.0 */ "use strict"; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require JSDoc comments", - category: "Stylistic Issues", + description: "Require JSDoc comments", recommended: false, url: "https://eslint.org/docs/rules/require-jsdoc" }, diff --git a/node_modules/eslint/lib/rules/require-unicode-regexp.js b/node_modules/eslint/lib/rules/require-unicode-regexp.js index 880405e9a..efac2519f 100644 --- a/node_modules/eslint/lib/rules/require-unicode-regexp.js +++ b/node_modules/eslint/lib/rules/require-unicode-regexp.js @@ -14,19 +14,19 @@ const { CONSTRUCT, ReferenceTracker, getStringIfConstant -} = require("eslint-utils"); +} = require("@eslint-community/eslint-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce the use of `u` flag on RegExp", - category: "Best Practices", + description: "Enforce the use of `u` flag on RegExp", recommended: false, url: "https://eslint.org/docs/rules/require-unicode-regexp" }, diff --git a/node_modules/eslint/lib/rules/require-yield.js b/node_modules/eslint/lib/rules/require-yield.js index af2344dfa..b3f134113 100644 --- a/node_modules/eslint/lib/rules/require-yield.js +++ b/node_modules/eslint/lib/rules/require-yield.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require generator functions to contain `yield`", - category: "ECMAScript 6", + description: "Require generator functions to contain `yield`", recommended: true, url: "https://eslint.org/docs/rules/require-yield" }, @@ -68,7 +68,6 @@ module.exports = { // Increases the count of `yield` keyword. YieldExpression() { - /* istanbul ignore else */ if (stack.length > 0) { stack[stack.length - 1] += 1; } diff --git a/node_modules/eslint/lib/rules/rest-spread-spacing.js b/node_modules/eslint/lib/rules/rest-spread-spacing.js index 8cb9814f0..17f9aa0c3 100644 --- a/node_modules/eslint/lib/rules/rest-spread-spacing.js +++ b/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce spacing between rest and spread operators and their expressions", - category: "ECMAScript 6", + description: "Enforce spacing between rest and spread operators and their expressions", recommended: false, url: "https://eslint.org/docs/rules/rest-spread-spacing" }, diff --git a/node_modules/eslint/lib/rules/semi-spacing.js b/node_modules/eslint/lib/rules/semi-spacing.js index 5c546f290..875cb6244 100644 --- a/node_modules/eslint/lib/rules/semi-spacing.js +++ b/node_modules/eslint/lib/rules/semi-spacing.js @@ -11,13 +11,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before and after semicolons", - category: "Stylistic Issues", + description: "Enforce consistent spacing before and after semicolons", recommended: false, url: "https://eslint.org/docs/rules/semi-spacing" }, @@ -238,7 +238,8 @@ module.exports = { if (node.test) { checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node); } - } + }, + PropertyDefinition: checkNode }; } }; diff --git a/node_modules/eslint/lib/rules/semi-style.js b/node_modules/eslint/lib/rules/semi-style.js index 0c9bec4c8..424858b4b 100644 --- a/node_modules/eslint/lib/rules/semi-style.js +++ b/node_modules/eslint/lib/rules/semi-style.js @@ -15,19 +15,18 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ -const SELECTOR = `:matches(${ - [ - "BreakStatement", "ContinueStatement", "DebuggerStatement", - "DoWhileStatement", "ExportAllDeclaration", - "ExportDefaultDeclaration", "ExportNamedDeclaration", - "ExpressionStatement", "ImportDeclaration", "ReturnStatement", - "ThrowStatement", "VariableDeclaration" - ].join(",") -})`; +const SELECTOR = [ + "BreakStatement", "ContinueStatement", "DebuggerStatement", + "DoWhileStatement", "ExportAllDeclaration", + "ExportDefaultDeclaration", "ExportNamedDeclaration", + "ExpressionStatement", "ImportDeclaration", "ReturnStatement", + "ThrowStatement", "VariableDeclaration", "PropertyDefinition" +].join(","); /** * Get the child node list of a given node. - * This returns `Program#body`, `BlockStatement#body`, or `SwitchCase#consequent`. + * This returns `BlockStatement#body`, `StaticBlock#body`, `Program#body`, + * `ClassBody#body`, or `SwitchCase#consequent`. * This is used to check whether a node is the first/last child. * @param {Node} node A node to get child node list. * @returns {Node[]|null} The child node list. @@ -35,7 +34,12 @@ const SELECTOR = `:matches(${ function getChildren(node) { const t = node.type; - if (t === "BlockStatement" || t === "Program") { + if ( + t === "BlockStatement" || + t === "StaticBlock" || + t === "Program" || + t === "ClassBody" + ) { return node.body; } if (t === "SwitchCase") { @@ -63,13 +67,13 @@ function isLastChild(node) { return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc. } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce location of semicolons", - category: "Stylistic Issues", + description: "Enforce location of semicolons", recommended: false, url: "https://eslint.org/docs/rules/semi-style" }, diff --git a/node_modules/eslint/lib/rules/semi.js b/node_modules/eslint/lib/rules/semi.js index d2f067042..1e49273c2 100644 --- a/node_modules/eslint/lib/rules/semi.js +++ b/node_modules/eslint/lib/rules/semi.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow semicolons instead of ASI", - category: "Stylistic Issues", + description: "Require or disallow semicolons instead of ASI", recommended: false, url: "https://eslint.org/docs/rules/semi" }, @@ -78,6 +78,8 @@ module.exports = { create(context) { const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-` + const unsafeClassFieldNames = new Set(["get", "set", "static"]); + const unsafeClassFieldFollowers = new Set(["*", "in", "instanceof"]); const options = context.options[1]; const never = context.options[0] === "never"; const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); @@ -166,6 +168,55 @@ module.exports = { ); } + /** + * Checks if a given PropertyDefinition node followed by a semicolon + * can safely remove that semicolon. It is not to safe to remove if + * the class field name is "get", "set", or "static", or if + * followed by a generator method. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node cannot have the semicolon + * removed. + */ + function maybeClassFieldAsiHazard(node) { + + if (node.type !== "PropertyDefinition") { + return false; + } + + /* + * Computed property names and non-identifiers are always safe + * as they can be distinguished from keywords easily. + */ + const needsNameCheck = !node.computed && node.key.type === "Identifier"; + + /* + * Certain names are problematic unless they also have a + * a way to distinguish between keywords and property + * names. + */ + if (needsNameCheck && unsafeClassFieldNames.has(node.key.name)) { + + /* + * Special case: If the field name is `static`, + * it is only valid if the field is marked as static, + * so "static static" is okay but "static" is not. + */ + const isStaticStatic = node.static && node.key.name === "static"; + + /* + * For other unsafe names, we only care if there is no + * initializer. No initializer = hazard. + */ + if (!isStaticStatic && !node.value) { + return true; + } + } + + const followingToken = sourceCode.getTokenAfter(node); + + return unsafeClassFieldFollowers.has(followingToken.value); + } + /** * Check whether a given node is on the same line with the next token. * @param {Node} node A statement node to check. @@ -233,10 +284,19 @@ module.exports = { if (isRedundantSemi(sourceCode.getLastToken(node))) { return true; // `;;` or `;}` } + if (maybeClassFieldAsiHazard(node)) { + return false; + } if (isOnSameLineWithNextToken(node)) { return false; // One liner. } - if (beforeStatementContinuationChars === "never" && !maybeAsiHazardAfter(node)) { + + // continuation characters should not apply to class fields + if ( + node.type !== "PropertyDefinition" && + beforeStatementContinuationChars === "never" && + !maybeAsiHazardAfter(node) + ) { return true; // ASI works. This statement doesn't connect to the next. } if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { @@ -247,22 +307,31 @@ module.exports = { } /** - * Checks a node to see if it's in a one-liner block statement. + * Checks a node to see if it's the last item in a one-liner block. + * Block is any `BlockStatement` or `StaticBlock` node. Block is a one-liner if its + * braces (and consequently everything between them) are on the same line. * @param {ASTNode} node The node to check. - * @returns {boolean} whether the node is in a one-liner block statement. + * @returns {boolean} whether the node is the last item in a one-liner block. */ - function isOneLinerBlock(node) { + function isLastInOneLinerBlock(node) { const parent = node.parent; const nextToken = sourceCode.getTokenAfter(node); if (!nextToken || nextToken.value !== "}") { return false; } - return ( - !!parent && - parent.type === "BlockStatement" && - parent.loc.start.line === parent.loc.end.line - ); + + if (parent.type === "BlockStatement") { + return parent.loc.start.line === parent.loc.end.line; + } + + if (parent.type === "StaticBlock") { + const openingBrace = sourceCode.getFirstToken(parent, { skip: 1 }); // skip the `static` token + + return openingBrace.loc.start.line === parent.loc.end.line; + } + + return false; } /** @@ -276,11 +345,15 @@ module.exports = { if (never) { if (isSemi && canRemoveSemicolon(node)) { report(node, true); - } else if (!isSemi && beforeStatementContinuationChars === "always" && maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + } else if ( + !isSemi && beforeStatementContinuationChars === "always" && + node.type !== "PropertyDefinition" && + maybeAsiHazardBefore(sourceCode.getTokenAfter(node)) + ) { report(node); } } else { - const oneLinerBlock = (exceptOneLine && isOneLinerBlock(node)); + const oneLinerBlock = (exceptOneLine && isLastInOneLinerBlock(node)); if (isSemi && oneLinerBlock) { report(node, true); @@ -329,7 +402,8 @@ module.exports = { if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) { checkForSemicolon(node); } - } + }, + PropertyDefinition: checkForSemicolon }; } diff --git a/node_modules/eslint/lib/rules/sort-imports.js b/node_modules/eslint/lib/rules/sort-imports.js index 4c3ddec76..bfb0765ba 100644 --- a/node_modules/eslint/lib/rules/sort-imports.js +++ b/node_modules/eslint/lib/rules/sort-imports.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce sorted import declarations within modules", - category: "ECMAScript 6", + description: "Enforce sorted import declarations within modules", recommended: false, url: "https://eslint.org/docs/rules/sort-imports" }, diff --git a/node_modules/eslint/lib/rules/sort-keys.js b/node_modules/eslint/lib/rules/sort-keys.js index 8a95ee25d..1523ab751 100644 --- a/node_modules/eslint/lib/rules/sort-keys.js +++ b/node_modules/eslint/lib/rules/sort-keys.js @@ -75,13 +75,13 @@ const isValidOrders = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require object keys to be sorted", - category: "Stylistic Issues", + description: "Require object keys to be sorted", recommended: false, url: "https://eslint.org/docs/rules/sort-keys" }, @@ -105,6 +105,10 @@ module.exports = { type: "integer", minimum: 2, default: 2 + }, + allowLineSeparatedGroups: { + type: "boolean", + default: false } }, additionalProperties: false @@ -124,17 +128,21 @@ module.exports = { const insensitive = options && options.caseSensitive === false; const natural = options && options.natural; const minKeys = options && options.minKeys; + const allowLineSeparatedGroups = options && options.allowLineSeparatedGroups || false; const isValidOrder = isValidOrders[ order + (insensitive ? "I" : "") + (natural ? "N" : "") ]; // The stack to save the previous property's name for each object literals. let stack = null; + const sourceCode = context.getSourceCode(); return { ObjectExpression(node) { stack = { upper: stack, + prevNode: null, + prevBlankLine: false, prevName: null, numKeys: node.properties.length }; @@ -159,10 +167,45 @@ module.exports = { const numKeys = stack.numKeys; const thisName = getPropertyName(node); + // Get tokens between current node and previous node + const tokens = stack.prevNode && sourceCode + .getTokensBetween(stack.prevNode, node, { includeComments: true }); + + let isBlankLineBetweenNodes = stack.prevBlankLine; + + if (tokens) { + + // check blank line between tokens + tokens.forEach((token, index) => { + const previousToken = tokens[index - 1]; + + if (previousToken && (token.loc.start.line - previousToken.loc.end.line > 1)) { + isBlankLineBetweenNodes = true; + } + }); + + // check blank line between the current node and the last token + if (!isBlankLineBetweenNodes && (node.loc.start.line - tokens[tokens.length - 1].loc.end.line > 1)) { + isBlankLineBetweenNodes = true; + } + + // check blank line between the first token and the previous node + if (!isBlankLineBetweenNodes && (tokens[0].loc.start.line - stack.prevNode.loc.end.line > 1)) { + isBlankLineBetweenNodes = true; + } + } + + stack.prevNode = node; + if (thisName !== null) { stack.prevName = thisName; } + if (allowLineSeparatedGroups && isBlankLineBetweenNodes) { + stack.prevBlankLine = thisName === null; + return; + } + if (prevName === null || thisName === null || numKeys < minKeys) { return; } diff --git a/node_modules/eslint/lib/rules/sort-vars.js b/node_modules/eslint/lib/rules/sort-vars.js index 7add2cf74..ec0718ee5 100644 --- a/node_modules/eslint/lib/rules/sort-vars.js +++ b/node_modules/eslint/lib/rules/sort-vars.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require variables within the same declaration block to be sorted", - category: "Stylistic Issues", + description: "Require variables within the same declaration block to be sorted", recommended: false, url: "https://eslint.org/docs/rules/sort-vars" }, diff --git a/node_modules/eslint/lib/rules/space-before-blocks.js b/node_modules/eslint/lib/rules/space-before-blocks.js index 87ef9bfd8..ffd33ddca 100644 --- a/node_modules/eslint/lib/rules/space-before-blocks.js +++ b/node_modules/eslint/lib/rules/space-before-blocks.js @@ -34,13 +34,13 @@ function isFunctionBody(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before blocks", - category: "Stylistic Issues", + description: "Enforce consistent spacing before blocks", recommended: false, url: "https://eslint.org/docs/rules/space-before-blocks" }, @@ -108,13 +108,25 @@ module.exports = { * Checks whether the spacing before the given block is already controlled by another rule: * - `arrow-spacing` checks spaces after `=>`. * - `keyword-spacing` checks spaces after keywords in certain contexts. + * - `switch-colon-spacing` checks spaces after `:` of switch cases. * @param {Token} precedingToken first token before the block. * @param {ASTNode|Token} node `BlockStatement` node or `{` token of a `SwitchStatement` node. * @returns {boolean} `true` if requiring or disallowing spaces before the given block could produce conflicts with other rules. */ function isConflicted(precedingToken, node) { - return astUtils.isArrowToken(precedingToken) || - astUtils.isKeywordToken(precedingToken) && !isFunctionBody(node); + return ( + astUtils.isArrowToken(precedingToken) || + ( + astUtils.isKeywordToken(precedingToken) && + !isFunctionBody(node) + ) || + ( + astUtils.isColonToken(precedingToken) && + node.parent && + node.parent.type === "SwitchCase" && + precedingToken === astUtils.getSwitchCaseColonToken(node.parent, sourceCode) + ) + ); } /** diff --git a/node_modules/eslint/lib/rules/space-before-function-paren.js b/node_modules/eslint/lib/rules/space-before-function-paren.js index 1021a110c..b56ac3c52 100644 --- a/node_modules/eslint/lib/rules/space-before-function-paren.js +++ b/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before `function` definition opening parenthesis", - category: "Stylistic Issues", + description: "Enforce consistent spacing before `function` definition opening parenthesis", recommended: false, url: "https://eslint.org/docs/rules/space-before-function-paren" }, diff --git a/node_modules/eslint/lib/rules/space-in-parens.js b/node_modules/eslint/lib/rules/space-in-parens.js index b0a604d95..42d9bb58e 100644 --- a/node_modules/eslint/lib/rules/space-in-parens.js +++ b/node_modules/eslint/lib/rules/space-in-parens.js @@ -10,13 +10,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing inside parentheses", - category: "Stylistic Issues", + description: "Enforce consistent spacing inside parentheses", recommended: false, url: "https://eslint.org/docs/rules/space-in-parens" }, diff --git a/node_modules/eslint/lib/rules/space-infix-ops.js b/node_modules/eslint/lib/rules/space-infix-ops.js index 3c550984f..141c269df 100644 --- a/node_modules/eslint/lib/rules/space-infix-ops.js +++ b/node_modules/eslint/lib/rules/space-infix-ops.js @@ -4,17 +4,19 @@ */ "use strict"; +const { isEqToken } = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require spacing around infix operators", - category: "Stylistic Issues", + description: "Require spacing around infix operators", recommended: false, url: "https://eslint.org/docs/rules/space-infix-ops" }, @@ -164,7 +166,29 @@ module.exports = { BinaryExpression: checkBinary, LogicalExpression: checkBinary, ConditionalExpression: checkConditional, - VariableDeclarator: checkVar + VariableDeclarator: checkVar, + + PropertyDefinition(node) { + if (!node.value) { + return; + } + + /* + * Because of computed properties and type annotations, some + * tokens may exist between `node.key` and `=`. + * Therefore, find the `=` from the right. + */ + const operatorToken = sourceCode.getTokenBefore(node.value, isEqToken); + const leftToken = sourceCode.getTokenBefore(operatorToken); + const rightToken = sourceCode.getTokenAfter(operatorToken); + + if ( + !sourceCode.isSpaceBetweenTokens(leftToken, operatorToken) || + !sourceCode.isSpaceBetweenTokens(operatorToken, rightToken) + ) { + report(node, operatorToken); + } + } }; } diff --git a/node_modules/eslint/lib/rules/space-unary-ops.js b/node_modules/eslint/lib/rules/space-unary-ops.js index 57f6e7845..1d9141d2b 100644 --- a/node_modules/eslint/lib/rules/space-unary-ops.js +++ b/node_modules/eslint/lib/rules/space-unary-ops.js @@ -14,13 +14,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce consistent spacing before or after unary operators", - category: "Stylistic Issues", + description: "Enforce consistent spacing before or after unary operators", recommended: false, url: "https://eslint.org/docs/rules/space-unary-ops" }, diff --git a/node_modules/eslint/lib/rules/spaced-comment.js b/node_modules/eslint/lib/rules/spaced-comment.js index d3221f0ea..6aedeae87 100644 --- a/node_modules/eslint/lib/rules/spaced-comment.js +++ b/node_modules/eslint/lib/rules/spaced-comment.js @@ -4,7 +4,7 @@ */ "use strict"; -const lodash = require("lodash"); +const escapeRegExp = require("escape-string-regexp"); const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ const astUtils = require("./utils/ast-utils"); * @returns {string} An escaped string. */ function escape(s) { - return `(?:${lodash.escapeRegExp(s)})`; + return `(?:${escapeRegExp(s)})`; } /** @@ -39,7 +39,7 @@ function escapeAndRepeat(s) { function parseMarkersOption(markers) { // `*` is a marker for JSDoc comments. - if (markers.indexOf("*") === -1) { + if (!markers.includes("*")) { return markers.concat("*"); } @@ -146,13 +146,13 @@ function createNeverStylePattern(markers) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce consistent spacing after the `//` or `/*` in a comment", - category: "Stylistic Issues", + description: "Enforce consistent spacing after the `//` or `/*` in a comment", recommended: false, url: "https://eslint.org/docs/rules/spaced-comment" }, diff --git a/node_modules/eslint/lib/rules/strict.js b/node_modules/eslint/lib/rules/strict.js index b0d6cf917..75bb56125 100644 --- a/node_modules/eslint/lib/rules/strict.js +++ b/node_modules/eslint/lib/rules/strict.js @@ -63,13 +63,13 @@ function isSimpleParameterList(params) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require or disallow strict mode directives", - category: "Strict Mode", + description: "Require or disallow strict mode directives", recommended: false, url: "https://eslint.org/docs/rules/strict" }, @@ -105,7 +105,7 @@ module.exports = { if (ecmaFeatures.impliedStrict) { mode = "implied"; } else if (mode === "safe") { - mode = ecmaFeatures.globalReturn ? "global" : "function"; + mode = ecmaFeatures.globalReturn || context.languageOptions.sourceType === "commonjs" ? "global" : "function"; } /** diff --git a/node_modules/eslint/lib/rules/switch-colon-spacing.js b/node_modules/eslint/lib/rules/switch-colon-spacing.js index c90641573..c1df496fd 100644 --- a/node_modules/eslint/lib/rules/switch-colon-spacing.js +++ b/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "enforce spacing around colons of switch statements", - category: "Stylistic Issues", + description: "Enforce spacing around colons of switch statements", recommended: false, url: "https://eslint.org/docs/rules/switch-colon-spacing" }, @@ -51,18 +51,6 @@ module.exports = { const beforeSpacing = options.before === true; // false by default const afterSpacing = options.after !== false; // true by default - /** - * Get the colon token of the given SwitchCase node. - * @param {ASTNode} node The SwitchCase node to get. - * @returns {Token} The colon token of the node. - */ - function getColonToken(node) { - if (node.test) { - return sourceCode.getTokenAfter(node.test, astUtils.isColonToken); - } - return sourceCode.getFirstToken(node, 1); - } - /** * Check whether the spacing between the given 2 tokens is valid or not. * @param {Token} left The left token to check. @@ -115,7 +103,7 @@ module.exports = { return { SwitchCase(node) { - const colonToken = getColonToken(node); + const colonToken = astUtils.getSwitchCaseColonToken(node, sourceCode); const beforeToken = sourceCode.getTokenBefore(colonToken); const afterToken = sourceCode.getTokenAfter(colonToken); diff --git a/node_modules/eslint/lib/rules/symbol-description.js b/node_modules/eslint/lib/rules/symbol-description.js index 155cea4dc..1c8a36498 100644 --- a/node_modules/eslint/lib/rules/symbol-description.js +++ b/node_modules/eslint/lib/rules/symbol-description.js @@ -16,13 +16,13 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require symbol descriptions", - category: "ECMAScript 6", + description: "Require symbol descriptions", recommended: false, url: "https://eslint.org/docs/rules/symbol-description" }, diff --git a/node_modules/eslint/lib/rules/template-curly-spacing.js b/node_modules/eslint/lib/rules/template-curly-spacing.js index 26043bc91..35d4bbab4 100644 --- a/node_modules/eslint/lib/rules/template-curly-spacing.js +++ b/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow spacing around embedded expressions of template strings", - category: "ECMAScript 6", + description: "Require or disallow spacing around embedded expressions of template strings", recommended: false, url: "https://eslint.org/docs/rules/template-curly-spacing" }, diff --git a/node_modules/eslint/lib/rules/template-tag-spacing.js b/node_modules/eslint/lib/rules/template-tag-spacing.js index 16f586255..3140fa0ee 100644 --- a/node_modules/eslint/lib/rules/template-tag-spacing.js +++ b/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow spacing between template tags and their literals", - category: "Stylistic Issues", + description: "Require or disallow spacing between template tags and their literals", recommended: false, url: "https://eslint.org/docs/rules/template-tag-spacing" }, diff --git a/node_modules/eslint/lib/rules/unicode-bom.js b/node_modules/eslint/lib/rules/unicode-bom.js index 39642f851..482d3bbf5 100644 --- a/node_modules/eslint/lib/rules/unicode-bom.js +++ b/node_modules/eslint/lib/rules/unicode-bom.js @@ -8,13 +8,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow Unicode byte order mark (BOM)", - category: "Stylistic Issues", + description: "Require or disallow Unicode byte order mark (BOM)", recommended: false, url: "https://eslint.org/docs/rules/unicode-bom" }, diff --git a/node_modules/eslint/lib/rules/use-isnan.js b/node_modules/eslint/lib/rules/use-isnan.js index 0c7e888c9..219d69537 100644 --- a/node_modules/eslint/lib/rules/use-isnan.js +++ b/node_modules/eslint/lib/rules/use-isnan.js @@ -21,20 +21,23 @@ const astUtils = require("./utils/ast-utils"); * @returns {boolean} `true` if the node is 'NaN' identifier. */ function isNaNIdentifier(node) { - return Boolean(node) && node.type === "Identifier" && node.name === "NaN"; + return Boolean(node) && ( + astUtils.isSpecificId(node, "NaN") || + astUtils.isSpecificMemberAccess(node, "Number", "NaN") + ); } //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "require calls to `isNaN()` when checking for `NaN`", - category: "Possible Errors", + description: "Require calls to `isNaN()` when checking for `NaN`", recommended: true, url: "https://eslint.org/docs/rules/use-isnan" }, diff --git a/node_modules/eslint/lib/rules/utils/ast-utils.js b/node_modules/eslint/lib/rules/utils/ast-utils.js index 679eebb4c..f4a18cff7 100644 --- a/node_modules/eslint/lib/rules/utils/ast-utils.js +++ b/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -11,7 +11,7 @@ const esutils = require("esutils"); const espree = require("espree"); -const lodash = require("lodash"); +const escapeRegExp = require("escape-string-regexp"); const { breakableTypePattern, createGlobalLinebreakMatcher, @@ -32,10 +32,11 @@ const thisTagPattern = /^[\s*]*@this/mu; const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u; +const ESLINT_DIRECTIVE_PATTERN = /^(?:eslint[- ]|(?:globals?|exported) )/u; const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); // A set of node types that can contain a list of statements -const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "SwitchCase"]); +const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "StaticBlock", "SwitchCase"]); const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; @@ -266,6 +267,7 @@ function getStaticPropertyName(node) { return getStaticPropertyName(node.expression); case "Property": + case "PropertyDefinition": case "MethodDefinition": prop = node.key; break; @@ -407,6 +409,7 @@ function isSameReference(left, right, disableStaticComputedKey = false) { return true; case "Identifier": + case "PrivateIdentifier": return left.name === right.name; case "Literal": return equalLiteralValue(left, right); @@ -516,6 +519,15 @@ function isParenthesised(sourceCode, node) { nextToken.value === ")" && nextToken.range[0] >= node.range[1]; } +/** + * Checks if the given token is a `=` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `=` token. + */ +function isEqToken(token) { + return token.value === "=" && token.type === "Punctuator"; +} + /** * Checks if the given token is an arrow token or not. * @param {Token} token The token to check. @@ -649,6 +661,16 @@ function isKeywordToken(token) { * @returns {Token} `(` token. */ function getOpeningParenOfParams(node, sourceCode) { + + // If the node is an arrow function and doesn't have parens, this returns the identifier of the first param. + if (node.type === "ArrowFunctionExpression" && node.params.length === 1) { + const argToken = sourceCode.getFirstToken(node.params[0]); + const maybeParenToken = sourceCode.getTokenBefore(argToken); + + return isOpeningParenToken(maybeParenToken) ? maybeParenToken : argToken; + } + + // Otherwise, returns paren. return node.id ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) : sourceCode.getFirstToken(node, isOpeningParenToken); @@ -735,6 +757,235 @@ function isLogicalAssignmentOperator(operator) { return LOGICAL_ASSIGNMENT_OPERATORS.has(operator); } +/** + * Get the colon token of the given SwitchCase node. + * @param {ASTNode} node The SwitchCase node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token} The colon token of the node. + */ +function getSwitchCaseColonToken(node, sourceCode) { + if (node.test) { + return sourceCode.getTokenAfter(node.test, isColonToken); + } + return sourceCode.getFirstToken(node, 1); +} + +/** + * Gets ESM module export name represented by the given node. + * @param {ASTNode} node `Identifier` or string `Literal` node in a position + * that represents a module export name: + * - `ImportSpecifier#imported` + * - `ExportSpecifier#local` (if it is a re-export from another module) + * - `ExportSpecifier#exported` + * - `ExportAllDeclaration#exported` + * @returns {string} The module export name. + */ +function getModuleExportName(node) { + if (node.type === "Identifier") { + return node.name; + } + + // string literal + return node.value; +} + +/** + * Returns literal's value converted to the Boolean type + * @param {ASTNode} node any `Literal` node + * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy, + * `null` when it cannot be determined. + */ +function getBooleanValue(node) { + if (node.value === null) { + + /* + * it might be a null literal or bigint/regex literal in unsupported environments . + * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral + * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral + */ + + if (node.raw === "null") { + return false; + } + + // regex is always truthy + if (typeof node.regex === "object") { + return true; + } + + return null; + } + + return !!node.value; +} + +/** + * Checks if a branch node of LogicalExpression short circuits the whole condition + * @param {ASTNode} node The branch of main condition which needs to be checked + * @param {string} operator The operator of the main LogicalExpression. + * @returns {boolean} true when condition short circuits whole condition + */ +function isLogicalIdentity(node, operator) { + switch (node.type) { + case "Literal": + return (operator === "||" && getBooleanValue(node) === true) || + (operator === "&&" && getBooleanValue(node) === false); + + case "UnaryExpression": + return (operator === "&&" && node.operator === "void"); + + case "LogicalExpression": + + /* + * handles `a && false || b` + * `false` is an identity element of `&&` but not `||` + */ + return operator === node.operator && + ( + isLogicalIdentity(node.left, operator) || + isLogicalIdentity(node.right, operator) + ); + + case "AssignmentExpression": + return ["||=", "&&="].includes(node.operator) && + operator === node.operator.slice(0, -1) && + isLogicalIdentity(node.right, operator); + + // no default + } + return false; +} + +/** + * Checks if an identifier is a reference to a global variable. + * @param {Scope} scope The scope in which the identifier is referenced. + * @param {ASTNode} node An identifier node to check. + * @returns {boolean} `true` if the identifier is a reference to a global variable. + */ +function isReferenceToGlobalVariable(scope, node) { + const reference = scope.references.find(ref => ref.identifier === node); + + return Boolean( + reference && + reference.resolved && + reference.resolved.scope.type === "global" && + reference.resolved.defs.length === 0 + ); +} + + +/** + * Checks if a node has a constant truthiness value. + * @param {Scope} scope Scope in which the node appears. + * @param {ASTNode} node The AST node to check. + * @param {boolean} inBooleanPosition `true` if checking the test of a + * condition. `false` in all other cases. When `false`, checks if -- for + * both string and number -- if coerced to that type, the value will + * be constant. + * @returns {boolean} true when node's truthiness is constant + * @private + */ +function isConstant(scope, node, inBooleanPosition) { + + // node.elements can return null values in the case of sparse arrays ex. [,] + if (!node) { + return true; + } + switch (node.type) { + case "Literal": + case "ArrowFunctionExpression": + case "FunctionExpression": + return true; + case "ClassExpression": + case "ObjectExpression": + + /** + * In theory objects like: + * + * `{toString: () => a}` + * `{valueOf: () => a}` + * + * Or a classes like: + * + * `class { static toString() { return a } }` + * `class { static valueOf() { return a } }` + * + * Are not constant verifiably when `inBooleanPosition` is + * false, but it's an edge case we've opted not to handle. + */ + return true; + case "TemplateLiteral": + return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) || + node.expressions.every(exp => isConstant(scope, exp, false)); + + case "ArrayExpression": { + if (!inBooleanPosition) { + return node.elements.every(element => isConstant(scope, element, false)); + } + return true; + } + + case "UnaryExpression": + if ( + node.operator === "void" || + node.operator === "typeof" && inBooleanPosition + ) { + return true; + } + + if (node.operator === "!") { + return isConstant(scope, node.argument, true); + } + + return isConstant(scope, node.argument, false); + + case "BinaryExpression": + return isConstant(scope, node.left, false) && + isConstant(scope, node.right, false) && + node.operator !== "in"; + + case "LogicalExpression": { + const isLeftConstant = isConstant(scope, node.left, inBooleanPosition); + const isRightConstant = isConstant(scope, node.right, inBooleanPosition); + const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); + const isRightShortCircuit = (inBooleanPosition && isRightConstant && isLogicalIdentity(node.right, node.operator)); + + return (isLeftConstant && isRightConstant) || + isLeftShortCircuit || + isRightShortCircuit; + } + case "NewExpression": + return inBooleanPosition; + case "AssignmentExpression": + if (node.operator === "=") { + return isConstant(scope, node.right, inBooleanPosition); + } + + if (["||=", "&&="].includes(node.operator) && inBooleanPosition) { + return isLogicalIdentity(node.right, node.operator.slice(0, -1)); + } + + return false; + + case "SequenceExpression": + return isConstant(scope, node.expressions[node.expressions.length - 1], inBooleanPosition); + case "SpreadElement": + return isConstant(scope, node.argument, inBooleanPosition); + case "CallExpression": + if (node.callee.type === "Identifier" && node.callee.name === "Boolean") { + if (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)) { + return isReferenceToGlobalVariable(scope, node.callee); + } + } + return false; + case "Identifier": + return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + + // no default + } + return false; +} + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -794,6 +1045,7 @@ module.exports = { isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, + isEqToken, /** * Checks whether or not a given node is a string literal. @@ -836,8 +1088,8 @@ module.exports = { /** * Validate that a string passed in is surrounded by the specified character - * @param {string} val The text to check. - * @param {string} character The character to see if it's surrounded by. + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. * @returns {boolean} True if the text is surrounded by the character, false if not. * @private */ @@ -854,12 +1106,8 @@ module.exports = { const comment = node.value.trim(); return ( - node.type === "Line" && comment.indexOf("eslint-") === 0 || - node.type === "Block" && ( - comment.indexOf("global ") === 0 || - comment.indexOf("eslint ") === 0 || - comment.indexOf("eslint-") === 0 - ) + node.type === "Line" && comment.startsWith("eslint-") || + node.type === "Block" && ESLINT_DIRECTIVE_PATTERN.test(comment) ); }, @@ -902,6 +1150,8 @@ module.exports = { * * First, this checks the node: * + * - The given node is not in `PropertyDefinition#value` position. + * - The given node is not `StaticBlock`. * - The function name does not start with uppercase. It's a convention to capitalize the names * of constructor functions. This check is not performed if `capIsConstructor` is set to `false`. * - The function does not have a JSDoc comment that has a @this tag. @@ -916,13 +1166,29 @@ module.exports = { * - The location is not on an ES2015 class. * - Its `bind`/`call`/`apply` method is not called directly. * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. - * @param {ASTNode} node A function node to check. + * @param {ASTNode} node A function node to check. It also can be an implicit function, like `StaticBlock` + * or any expression that is `PropertyDefinition#value` node. * @param {SourceCode} sourceCode A SourceCode instance to get comments. * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors. * @returns {boolean} The function node is the default `this` binding. */ isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) { + + /* + * Class field initializers are implicit functions, but ESTree doesn't have the AST node of field initializers. + * Therefore, A expression node at `PropertyDefinition#value` is a function. + * In this case, `this` is always not default binding. + */ + if (node.parent.type === "PropertyDefinition" && node.parent.value === node) { + return false; + } + + // Class static blocks are implicit functions. In this case, `this` is always not default binding. + if (node.type === "StaticBlock") { + return false; + } + if ( (capIsConstructor && isES5Constructor(node)) || hasJSDocThisTag(node, sourceCode) @@ -983,8 +1249,10 @@ module.exports = { * class A { get foo() { ... } } * class A { set foo() { ... } } * class A { static foo() { ... } } + * class A { foo = function() { ... } } */ case "Property": + case "PropertyDefinition": case "MethodDefinition": return parent.value !== currentNode; @@ -1082,7 +1350,7 @@ module.exports = { } } - /* istanbul ignore next */ + /* c8 ignore next */ return true; }, @@ -1261,7 +1529,8 @@ module.exports = { * 5e1_000 // false * 5n // false * 1_000n // false - * '5' // false + * "5" // false + * */ isDecimalInteger(node) { return node.type === "Literal" && typeof node.value === "number" && @@ -1323,6 +1592,16 @@ module.exports = { * - `class A { static async foo() {} }` .... `static async method 'foo'` * - `class A { static get foo() {} }` ...... `static getter 'foo'` * - `class A { static set foo(a) {} }` ..... `static setter 'foo'` + * - `class A { foo = () => {}; }` .......... `method 'foo'` + * - `class A { foo = function() {}; }` ..... `method 'foo'` + * - `class A { foo = function bar() {}; }` . `method 'foo'` + * - `class A { static foo = () => {}; }` ... `static method 'foo'` + * - `class A { '#foo' = () => {}; }` ....... `method '#foo'` + * - `class A { #foo = () => {}; }` ......... `private method #foo` + * - `class A { static #foo = () => {}; }` .. `static private method #foo` + * - `class A { '#foo'() {} }` .............. `method '#foo'` + * - `class A { #foo() {} }` ................ `private method #foo` + * - `class A { static #foo() {} }` ......... `static private method #foo` * @param {ASTNode} node The function node to get. * @returns {string} The name and kind of the function node. */ @@ -1330,8 +1609,15 @@ module.exports = { const parent = node.parent; const tokens = []; - if (parent.type === "MethodDefinition" && parent.static) { - tokens.push("static"); + if (parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { + + // The proposal uses `static` word consistently before visibility words: https://github.com/tc39/proposal-static-class-features + if (parent.static) { + tokens.push("static"); + } + if (!parent.computed && parent.key.type === "PrivateIdentifier") { + tokens.push("private"); + } } if (node.async) { tokens.push("async"); @@ -1340,9 +1626,7 @@ module.exports = { tokens.push("generator"); } - if (node.type === "ArrowFunctionExpression") { - tokens.push("arrow", "function"); - } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + if (parent.type === "Property" || parent.type === "MethodDefinition") { if (parent.kind === "constructor") { return "constructor"; } @@ -1353,18 +1637,29 @@ module.exports = { } else { tokens.push("method"); } + } else if (parent.type === "PropertyDefinition") { + tokens.push("method"); } else { + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow"); + } tokens.push("function"); } - if (node.id) { - tokens.push(`'${node.id.name}'`); - } else { - const name = getStaticPropertyName(parent); + if (parent.type === "Property" || parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { + if (!parent.computed && parent.key.type === "PrivateIdentifier") { + tokens.push(`#${parent.key.name}`); + } else { + const name = getStaticPropertyName(parent); - if (name !== null) { - tokens.push(`'${name}'`); + if (name !== null) { + tokens.push(`'${name}'`); + } else if (node.id) { + tokens.push(`'${node.id.name}'`); + } } + } else if (node.id) { + tokens.push(`'${node.id.name}'`); } return tokens.join(" "); @@ -1457,6 +1752,12 @@ module.exports = { * ^^^^^^^^^^^^^^ * - `class A { static set foo(a) {} }` * ^^^^^^^^^^^^^^ + * - `class A { foo = function() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static foo = function() {} }` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `class A { foo = (a, b) => {} }` + * ^^^^^^ * @param {ASTNode} node The function node to get. * @param {SourceCode} sourceCode The source code object to get tokens. * @returns {string} The location of the function node for reporting. @@ -1466,14 +1767,14 @@ module.exports = { let start = null; let end = null; - if (node.type === "ArrowFunctionExpression") { + if (parent.type === "Property" || parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else if (node.type === "ArrowFunctionExpression") { const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); start = arrowToken.loc.start; end = arrowToken.loc.end; - } else if (parent.type === "Property" || parent.type === "MethodDefinition") { - start = parent.loc.start; - end = getOpeningParenOfParams(node, sourceCode).loc.start; } else { start = node.loc.start; end = getOpeningParenOfParams(node, sourceCode).loc.start; @@ -1573,9 +1874,9 @@ module.exports = { return sourceCode.getText().slice(leftToken.range[0], rightToken.range[1]); }, - /* + /** * Determine if a node has a possibility to be an Error object - * @param {ASTNode} node ASTNode to check + * @param {ASTNode} node ASTNode to check * @returns {boolean} True if there is a chance it contains an Error obj */ couldBeError(node) { @@ -1677,7 +1978,7 @@ module.exports = { if (comments.length) { const lastComment = comments[comments.length - 1]; - if (lastComment.range[0] > leftToken.range[0]) { + if (!leftToken || lastComment.range[0] > leftToken.range[0]) { leftToken = lastComment; } } @@ -1685,7 +1986,13 @@ module.exports = { leftToken = leftValue; } - if (leftToken.type === "Shebang") { + /* + * If a hashbang comment was passed as a token object from SourceCode, + * its type will be "Shebang" because of the way ESLint itself handles hashbangs. + * If a hashbang comment was passed in a string and then tokenized in this function, + * its type will be "Hashbang" because of the way Espree tokenizes hashbangs. + */ + if (leftToken.type === "Shebang" || leftToken.type === "Hashbang") { return false; } @@ -1706,7 +2013,7 @@ module.exports = { if (comments.length) { const firstComment = comments[0]; - if (firstComment.range[0] < rightToken.range[0]) { + if (!rightToken || firstComment.range[0] < rightToken.range[0]) { rightToken = firstComment; } } @@ -1745,6 +2052,10 @@ module.exports = { return true; } + if (rightToken.type === "PrivateIdentifier") { + return true; + } + return false; }, @@ -1756,7 +2067,7 @@ module.exports = { * @returns {SourceLocation} The `loc` object. */ getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { - const namePattern = new RegExp(`[\\s,]${lodash.escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); + const namePattern = new RegExp(`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); // To ignore the first text "global". namePattern.lastIndex = comment.value.indexOf("global") + 6; @@ -1794,6 +2105,7 @@ module.exports = { return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString); }, + isReferenceToGlobalVariable, isLogicalExpression, isCoalesceExpression, isMixedLogicalAndCoalesceExpressions, @@ -1805,5 +2117,8 @@ module.exports = { isSpecificMemberAccess, equalLiteralValue, isSameReference, - isLogicalAssignmentOperator + isLogicalAssignmentOperator, + getSwitchCaseColonToken, + getModuleExportName, + isConstant }; diff --git a/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js index d426d85c5..7f116a268 100644 --- a/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +++ b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js @@ -14,10 +14,10 @@ const debug = require("debug")("eslint:rules"); * const rules = new LazyLoadingRuleMap([ * ["eqeqeq", () => require("eqeqeq")], * ["semi", () => require("semi")], - * ["no-unused-vars", () => require("no-unused-vars")], - * ]) + * ["no-unused-vars", () => require("no-unused-vars")] + * ]); * - * rules.get("semi") // call `() => require("semi")` here. + * rules.get("semi"); // call `() => require("semi")` here. * * @extends {Map Rule>} */ diff --git a/node_modules/eslint/lib/rules/valid-jsdoc.js b/node_modules/eslint/lib/rules/valid-jsdoc.js index 9ec6938e3..25be39fdd 100644 --- a/node_modules/eslint/lib/rules/valid-jsdoc.js +++ b/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -1,6 +1,7 @@ /** * @fileoverview Validates JSDoc comments are syntactically correct * @author Nicholas C. Zakas + * @deprecated in ESLint v5.10.0 */ "use strict"; @@ -14,13 +15,13 @@ const doctrine = require("doctrine"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "enforce valid JSDoc comments", - category: "Possible Errors", + description: "Enforce valid JSDoc comments", recommended: false, url: "https://eslint.org/docs/rules/valid-jsdoc" }, @@ -404,7 +405,7 @@ module.exports = { loc: getAbsoluteRange(jsdocNode, param), data: { name: param.name } }); - } else if (param.name.indexOf(".") === -1) { + } else if (!param.name.includes(".")) { paramTagsByName[param.name] = param; } }); diff --git a/node_modules/eslint/lib/rules/valid-typeof.js b/node_modules/eslint/lib/rules/valid-typeof.js index a0f20f74d..908d5725e 100644 --- a/node_modules/eslint/lib/rules/valid-typeof.js +++ b/node_modules/eslint/lib/rules/valid-typeof.js @@ -8,17 +8,19 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "problem", docs: { - description: "enforce comparing `typeof` expressions against valid strings", - category: "Possible Errors", + description: "Enforce comparing `typeof` expressions against valid strings", recommended: true, url: "https://eslint.org/docs/rules/valid-typeof" }, + hasSuggestions: true, + schema: [ { type: "object", @@ -33,17 +35,33 @@ module.exports = { ], messages: { invalidValue: "Invalid typeof comparison value.", - notString: "Typeof comparisons should be to string literals." + notString: "Typeof comparisons should be to string literals.", + suggestString: 'Use `"{{type}}"` instead of `{{type}}`.' } }, create(context) { - const VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"], - OPERATORS = ["==", "===", "!=", "!=="]; + const VALID_TYPES = new Set(["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"]), + OPERATORS = new Set(["==", "===", "!=", "!=="]); const requireStringLiterals = context.options[0] && context.options[0].requireStringLiterals; + let globalScope; + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + /** * Determines whether a node is a typeof expression. * @param {ASTNode} node The node @@ -59,19 +77,37 @@ module.exports = { return { + Program() { + globalScope = context.getScope(); + }, + UnaryExpression(node) { if (isTypeofExpression(node)) { const parent = context.getAncestors().pop(); - if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) { + if (parent.type === "BinaryExpression" && OPERATORS.has(parent.operator)) { const sibling = parent.left === node ? parent.right : parent.left; if (sibling.type === "Literal" || sibling.type === "TemplateLiteral" && !sibling.expressions.length) { const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked; - if (VALID_TYPES.indexOf(value) === -1) { + if (!VALID_TYPES.has(value)) { context.report({ node: sibling, messageId: "invalidValue" }); } + } else if (sibling.type === "Identifier" && sibling.name === "undefined" && isReferenceToGlobalVariable(sibling)) { + context.report({ + node: sibling, + messageId: requireStringLiterals ? "notString" : "invalidValue", + suggest: [ + { + messageId: "suggestString", + data: { type: "undefined" }, + fix(fixer) { + return fixer.replaceText(sibling, '"undefined"'); + } + } + ] + }); } else if (requireStringLiterals && !isTypeofExpression(sibling)) { context.report({ node: sibling, messageId: "notString" }); } diff --git a/node_modules/eslint/lib/rules/vars-on-top.js b/node_modules/eslint/lib/rules/vars-on-top.js index 28ddae442..99e2b4ac0 100644 --- a/node_modules/eslint/lib/rules/vars-on-top.js +++ b/node_modules/eslint/lib/rules/vars-on-top.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: "require `var` declarations be placed at the top of their containing scope", - category: "Best Practices", + description: "Require `var` declarations be placed at the top of their containing scope", recommended: false, url: "https://eslint.org/docs/rules/vars-on-top" }, @@ -32,8 +32,8 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- - // eslint-disable-next-line jsdoc/require-description /** + * Has AST suggesting a directive. * @param {ASTNode} node any node * @returns {boolean} whether the given node structurally represents a directive */ @@ -78,10 +78,12 @@ module.exports = { const l = statements.length; let i = 0; - // skip over directives - for (; i < l; ++i) { - if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { - break; + // Skip over directives and imports. Static blocks don't have either. + if (node.parent.type !== "StaticBlock") { + for (; i < l; ++i) { + if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { + break; + } } } @@ -112,16 +114,27 @@ module.exports = { /** * Checks whether variable is on top at functional block scope level * @param {ASTNode} node The node to check - * @param {ASTNode} parent Parent of the node - * @param {ASTNode} grandParent Parent of the node's parent * @returns {void} */ - function blockScopeVarCheck(node, parent, grandParent) { - if (!(/Function/u.test(grandParent.type) && - parent.type === "BlockStatement" && - isVarOnTop(node, parent.body))) { - context.report({ node, messageId: "top" }); + function blockScopeVarCheck(node) { + const { parent } = node; + + if ( + parent.type === "BlockStatement" && + /Function/u.test(parent.parent.type) && + isVarOnTop(node, parent.body) + ) { + return; } + + if ( + parent.type === "StaticBlock" && + isVarOnTop(node, parent.body) + ) { + return; + } + + context.report({ node, messageId: "top" }); } //-------------------------------------------------------------------------- @@ -135,7 +148,7 @@ module.exports = { } else if (node.parent.type === "Program") { globalVarCheck(node, node.parent); } else { - blockScopeVarCheck(node, node.parent, node.parent.parent); + blockScopeVarCheck(node); } } }; diff --git a/node_modules/eslint/lib/rules/wrap-iife.js b/node_modules/eslint/lib/rules/wrap-iife.js index 07e5b84a4..66ea3f8fa 100644 --- a/node_modules/eslint/lib/rules/wrap-iife.js +++ b/node_modules/eslint/lib/rules/wrap-iife.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const eslintUtils = require("eslint-utils"); +const eslintUtils = require("@eslint-community/eslint-utils"); //---------------------------------------------------------------------- // Helpers @@ -37,13 +37,13 @@ function isCalleeOfNewExpression(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require parentheses around immediate `function` invocations", - category: "Best Practices", + description: "Require parentheses around immediate `function` invocations", recommended: false, url: "https://eslint.org/docs/rules/wrap-iife" }, diff --git a/node_modules/eslint/lib/rules/wrap-regex.js b/node_modules/eslint/lib/rules/wrap-regex.js index 4ecbcecbb..b24d36025 100644 --- a/node_modules/eslint/lib/rules/wrap-regex.js +++ b/node_modules/eslint/lib/rules/wrap-regex.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require parenthesis around regex literals", - category: "Stylistic Issues", + description: "Require parenthesis around regex literals", recommended: false, url: "https://eslint.org/docs/rules/wrap-regex" }, diff --git a/node_modules/eslint/lib/rules/yield-star-spacing.js b/node_modules/eslint/lib/rules/yield-star-spacing.js index 20b8e9ea9..c2e07aaaa 100644 --- a/node_modules/eslint/lib/rules/yield-star-spacing.js +++ b/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -9,13 +9,13 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { - description: "require or disallow spacing around the `*` in `yield*` expressions", - category: "ECMAScript 6", + description: "Require or disallow spacing around the `*` in `yield*` expressions", recommended: false, url: "https://eslint.org/docs/rules/yield-star-spacing" }, diff --git a/node_modules/eslint/lib/rules/yoda.js b/node_modules/eslint/lib/rules/yoda.js index 2fca75711..eb9a32ad5 100644 --- a/node_modules/eslint/lib/rules/yoda.js +++ b/node_modules/eslint/lib/rules/yoda.js @@ -39,7 +39,7 @@ function isEqualityOperator(operator) { * @returns {boolean} Whether the operator is used in range tests. */ function isRangeTestOperator(operator) { - return ["<", "<="].indexOf(operator) >= 0; + return ["<", "<="].includes(operator); } /** @@ -115,13 +115,13 @@ function getNormalizedLiteral(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { - description: 'require or disallow "Yoda" conditions', - category: "Best Practices", + description: 'Require or disallow "Yoda" conditions', recommended: false, url: "https://eslint.org/docs/rules/yoda" }, diff --git a/node_modules/eslint/lib/shared/ajv.js b/node_modules/eslint/lib/shared/ajv.js index 3fb0fbdd3..f4f6a6218 100644 --- a/node_modules/eslint/lib/shared/ajv.js +++ b/node_modules/eslint/lib/shared/ajv.js @@ -27,7 +27,7 @@ module.exports = (additionalOptions = {}) => { }); ajv.addMetaSchema(metaSchema); - // eslint-disable-next-line no-underscore-dangle + // eslint-disable-next-line no-underscore-dangle -- Ajv's API ajv._opts.defaultMeta = metaSchema.id; return ajv; diff --git a/node_modules/eslint/lib/shared/config-validator.js b/node_modules/eslint/lib/shared/config-validator.js index 03b32f1c9..47353ac48 100644 --- a/node_modules/eslint/lib/shared/config-validator.js +++ b/node_modules/eslint/lib/shared/config-validator.js @@ -24,9 +24,13 @@ const util = require("util"), configSchema = require("../../conf/config-schema"), - BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), BuiltInRules = require("../rules"), - ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + { + Legacy: { + ConfigOps, + environments: BuiltInEnvironments + } + } = require("@eslint/eslintrc"), { emitDeprecationWarning } = require("./deprecation-warnings"); const ajv = require("./ajv")(); @@ -80,6 +84,7 @@ function getRuleOptionsSchema(rule) { /** * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. * @param {options} options The given options for the rule. + * @throws {Error} Wrong severity value. * @returns {number|string} The rule's severity value */ function validateRuleSeverity(options) { @@ -98,6 +103,7 @@ function validateRuleSeverity(options) { * Validates the non-severity options passed to a rule, based on its schema. * @param {{create: Function}} rule The rule to validate * @param {Array} localOptions The options for the rule, excluding severity + * @throws {Error} Any rule validation errors. * @returns {void} */ function validateRuleSchema(rule, localOptions) { @@ -128,6 +134,7 @@ function validateRuleSchema(rule, localOptions) { * @param {Array|number} options The given options for the rule. * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, * no source is prepended to the message. + * @throws {Error} Upon any bad rule configuration. * @returns {void} */ function validateRuleOptions(rule, ruleId, options, source = null) { @@ -152,7 +159,7 @@ function validateRuleOptions(rule, ruleId, options, source = null) { * Validates an environment object * @param {Object} environment The environment config object to validate. * @param {string} source The name of the configuration source to report in any errors. - * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments. * @returns {void} */ function validateEnvironment( @@ -181,7 +188,7 @@ function validateEnvironment( * Validates a rules config object * @param {Object} rulesConfig The rules config object to validate. * @param {string} source The name of the configuration source to report in any errors. - * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules * @returns {void} */ function validateRules( @@ -225,7 +232,8 @@ function validateGlobals(globalsConfig, source = null) { * Validate `processor` configuration. * @param {string|undefined} processorName The processor name. * @param {string} source The name of config file. - * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @param {(id:string) => Processor} getProcessor The getter of defined processors. + * @throws {Error} For invalid processor configuration. * @returns {void} */ function validateProcessor(processorName, source, getProcessor) { @@ -264,6 +272,7 @@ function formatErrors(errors) { * Validates the top level properties of the config object. * @param {Object} config The config object to validate. * @param {string} source The name of the configuration source to report in any errors. + * @throws {Error} For any config invalid per the schema. * @returns {void} */ function validateConfigSchema(config, source = null) { @@ -282,8 +291,8 @@ function validateConfigSchema(config, source = null) { * Validates an entire config object. * @param {Object} config The config object to validate. * @param {string} source The name of the configuration source to report in any errors. - * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. - * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs. * @returns {void} */ function validate(config, source, getAdditionalRule, getAdditionalEnv) { diff --git a/node_modules/eslint/lib/shared/deprecation-warnings.js b/node_modules/eslint/lib/shared/deprecation-warnings.js index 1438eaa69..d09cafb07 100644 --- a/node_modules/eslint/lib/shared/deprecation-warnings.js +++ b/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -9,7 +9,6 @@ //------------------------------------------------------------------------------ const path = require("path"); -const lodash = require("lodash"); //------------------------------------------------------------------------------ // Private @@ -18,16 +17,11 @@ const lodash = require("lodash"); // Definitions for deprecation warnings. const deprecationWarningMessages = { ESLINT_LEGACY_ECMAFEATURES: - "The 'ecmaFeatures' config file property is deprecated and has no effect.", - ESLINT_PERSONAL_CONFIG_LOAD: - "'~/.eslintrc.*' config files have been deprecated. " + - "Please use a config file per project or the '--config' option.", - ESLINT_PERSONAL_CONFIG_SUPPRESS: - "'~/.eslintrc.*' config files have been deprecated. " + - "Please remove it or add 'root:true' to the config files in your " + - "projects in order to avoid loading '~/.eslintrc.*' accidentally." + "The 'ecmaFeatures' config file property is deprecated and has no effect." }; +const sourceFileErrorCache = new Set(); + /** * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted * for each unique file path, but repeated invocations with the same file path have no effect. @@ -36,7 +30,15 @@ const deprecationWarningMessages = { * @param {string} errorCode The warning message to show. * @returns {void} */ -const emitDeprecationWarning = lodash.memoize((source, errorCode) => { +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + + sourceFileErrorCache.add(cacheKey); + const rel = path.relative(process.cwd(), source); const message = deprecationWarningMessages[errorCode]; @@ -45,7 +47,7 @@ const emitDeprecationWarning = lodash.memoize((source, errorCode) => { "DeprecationWarning", errorCode ); -}, (...args) => JSON.stringify(args)); +} //------------------------------------------------------------------------------ // Public Interface diff --git a/node_modules/eslint/lib/shared/directives.js b/node_modules/eslint/lib/shared/directives.js new file mode 100644 index 000000000..ff67b00a5 --- /dev/null +++ b/node_modules/eslint/lib/shared/directives.js @@ -0,0 +1,15 @@ +/** + * @fileoverview Common utils for directives. + * + * This file contains only shared items for directives. + * If you make a utility for rules, please see `../rules/utils/ast-utils.js`. + * + * @author gfyoung + */ +"use strict"; + +const directivesPattern = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u; + +module.exports = { + directivesPattern +}; diff --git a/node_modules/eslint/lib/shared/logging.js b/node_modules/eslint/lib/shared/logging.js index 6aa1f5a1e..fd5e8a648 100644 --- a/node_modules/eslint/lib/shared/logging.js +++ b/node_modules/eslint/lib/shared/logging.js @@ -5,9 +5,9 @@ "use strict"; -/* eslint no-console: "off" */ +/* eslint no-console: "off" -- Logging util */ -/* istanbul ignore next */ +/* c8 ignore next */ module.exports = { /** diff --git a/node_modules/eslint/lib/shared/relative-module-resolver.js b/node_modules/eslint/lib/shared/relative-module-resolver.js index cd743f379..18a694983 100644 --- a/node_modules/eslint/lib/shared/relative-module-resolver.js +++ b/node_modules/eslint/lib/shared/relative-module-resolver.js @@ -17,14 +17,7 @@ "use strict"; -const Module = require("module"); - -/* - * `Module.createRequire` is added in v12.2.0. It supports URL as well. - * We only support the case where the argument is a filepath, not a URL. - */ -// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api -const createRequire = Module.createRequire || Module.createRequireFromPath; +const { createRequire } = require("module"); module.exports = { @@ -33,6 +26,7 @@ module.exports = { * @param {string} moduleName The name of a Node module, or a path to a Node module. * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be * a file rather than a directory, but the file need not actually exist. + * @throws {Error} Any error from `module.createRequire` or its `resolve`. * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` */ resolve(moduleName, relativeToPath) { diff --git a/node_modules/eslint/lib/shared/runtime-info.js b/node_modules/eslint/lib/shared/runtime-info.js index 3f16c9152..b99ad1038 100644 --- a/node_modules/eslint/lib/shared/runtime-info.js +++ b/node_modules/eslint/lib/shared/runtime-info.js @@ -11,6 +11,7 @@ const path = require("path"); const spawn = require("cross-spawn"); +const os = require("os"); const log = require("../shared/logging"); const packageJson = require("../../package.json"); @@ -39,6 +40,7 @@ function environment() { * Synchronously executes a shell command and formats the result. * @param {string} cmd The command to execute. * @param {Array} args The arguments to be executed with the command. + * @throws {Error} As may be collected by `cross-spawn.sync`. * @returns {string} The version returned by the command. */ function execCommand(cmd, args) { @@ -72,6 +74,7 @@ function environment() { /** * Gets bin version. * @param {string} bin The bin to check. + * @throws {Error} As may be collected by `cross-spawn.sync`. * @returns {string} The normalized version returned by the command. */ function getBinVersion(bin) { @@ -89,11 +92,12 @@ function environment() { * Gets installed npm package version. * @param {string} pkg The package to check. * @param {boolean} global Whether to check globally or not. + * @throws {Error} As may be collected by `cross-spawn.sync`. * @returns {string} The normalized version returned by the command. */ function getNpmPackageVersion(pkg, { global = false } = {}) { const npmBinArgs = ["bin", "-g"]; - const npmLsArgs = ["ls", "--depth=0", "--json", "eslint"]; + const npmLsArgs = ["ls", "--depth=0", "--json", pkg]; if (global) { npmLsArgs.push("-g"); @@ -140,7 +144,8 @@ function environment() { `Node version: ${getBinVersion("node")}`, `npm version: ${getBinVersion("npm")}`, `Local ESLint version: ${getNpmPackageVersion("eslint", { global: false })}`, - `Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}` + `Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}`, + `Operating System: ${os.platform()} ${os.release()}` ].join("\n"); } diff --git a/node_modules/eslint/lib/shared/string-utils.js b/node_modules/eslint/lib/shared/string-utils.js new file mode 100644 index 000000000..e4a55d799 --- /dev/null +++ b/node_modules/eslint/lib/shared/string-utils.js @@ -0,0 +1,22 @@ +/** + * @fileoverview Utilities to operate on strings. + * @author Stephen Wade + */ + +"use strict"; + +/** + * Converts the first letter of a string to uppercase. + * @param {string} string The string to operate on + * @returns {string} The converted string + */ +function upperCaseFirst(string) { + if (string.length <= 1) { + return string.toUpperCase(); + } + return string[0].toUpperCase() + string.slice(1); +} + +module.exports = { + upperCaseFirst +}; diff --git a/node_modules/eslint/lib/shared/traverser.js b/node_modules/eslint/lib/shared/traverser.js index 32f767795..38b4e2151 100644 --- a/node_modules/eslint/lib/shared/traverser.js +++ b/node_modules/eslint/lib/shared/traverser.js @@ -65,16 +65,16 @@ class Traverser { this._leave = null; } - // eslint-disable-next-line jsdoc/require-description /** + * Gives current node. * @returns {ASTNode} The current node. */ current() { return this._current; } - // eslint-disable-next-line jsdoc/require-description /** + * Gives a copy of the ancestor nodes. * @returns {ASTNode[]} The ancestor nodes. */ parents() { diff --git a/node_modules/eslint/lib/shared/types.js b/node_modules/eslint/lib/shared/types.js index c3b76e42d..20335f68a 100644 --- a/node_modules/eslint/lib/shared/types.js +++ b/node_modules/eslint/lib/shared/types.js @@ -21,8 +21,18 @@ module.exports = {}; /** * @typedef {Object} ParserOptions * @property {EcmaFeatures} [ecmaFeatures] The optional features. - * @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number). + * @property {3|5|6|7|8|9|10|11|12|13|14|2015|2016|2017|2018|2019|2020|2021|2022|2023} [ecmaVersion] The ECMAScript version (or revision number). * @property {"script"|"module"} [sourceType] The source code type. + * @property {boolean} [allowReserved] Allowing the use of reserved words as identifiers in ES3. + */ + +/** + * @typedef {Object} LanguageOptions + * @property {number|"latest"} [ecmaVersion] The ECMAScript version (or revision number). + * @property {Record} [globals] The global variable settings. + * @property {"script"|"module"|"commonjs"} [sourceType] The source code type. + * @property {string|Object} [parser] The parser to use. + * @property {Object} [parserOptions] The parser options to use. */ /** @@ -83,18 +93,33 @@ module.exports = {}; /** * @typedef {Object} LintMessage - * @property {number} column The 1-based column number. + * @property {number|undefined} column The 1-based column number. * @property {number} [endColumn] The 1-based column number of the end location. * @property {number} [endLine] The 1-based line number of the end location. * @property {boolean} fatal If `true` then this is a fatal error. * @property {{range:[number,number], text:string}} [fix] Information for autofix. - * @property {number} line The 1-based line number. + * @property {number|undefined} line The 1-based line number. * @property {string} message The error message. * @property {string|null} ruleId The ID of the rule which makes this message. * @property {0|1|2} severity The severity of this message. * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. */ +/** + * @typedef {Object} SuppressedLintMessage + * @property {number|undefined} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} fatal If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number|undefined} line The 1-based line number. + * @property {string} message The error message. + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{kind: string, justification: string}>} suppressions The suppression info. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + /** * @typedef {Object} SuggestionResult * @property {string} desc A short description. @@ -111,7 +136,6 @@ module.exports = {}; /** * @typedef {Object} RuleMetaDocs - * @property {string} category The category of the rule. * @property {string} description The description of the rule. * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. * @property {string} url The URL of the rule documentation. @@ -122,6 +146,7 @@ module.exports = {}; * @property {boolean} [deprecated] If `true` then the rule has been deprecated. * @property {RuleMetaDocs} docs The document information of the rule. * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {boolean} [hasSuggestions] If `true` then the rule provides suggestions. * @property {Record} [messages] The messages the rule reports. * @property {string[]} [replacedBy] The IDs of the alternative rules. * @property {Array|Object} schema The option schema of the rule. @@ -148,3 +173,40 @@ module.exports = {}; * @property {string} ruleId The rule ID. * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {SuppressedLintMessage[]} suppressedMessages All of the suppressed messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} fatalErrorCount Number of fatal errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Information provided when the maximum warning threshold is exceeded. + * @typedef {Object} MaxWarningsExceeded + * @property {number} maxWarnings Number of warnings to trigger nonzero exit code. + * @property {number} foundWarnings Number of warnings found while linting. + */ + +/** + * Metadata about results for formatters. + * @typedef {Object} ResultsMeta + * @property {MaxWarningsExceeded} [maxWarningsExceeded] Present if the maxWarnings threshold was exceeded. + */ + +/** + * A formatter function. + * @callback FormatterFunction + * @param {LintResult[]} results The list of linting results. + * @param {{cwd: string, maxWarningsExceeded?: MaxWarningsExceeded, rulesMeta: Record}} [context] A context object. + * @returns {string | Promise} Formatted text. + */ diff --git a/node_modules/eslint/lib/source-code/source-code.js b/node_modules/eslint/lib/source-code/source-code.js index 6b20495b6..9e2b68e2d 100644 --- a/node_modules/eslint/lib/source-code/source-code.js +++ b/node_modules/eslint/lib/source-code/source-code.js @@ -9,11 +9,10 @@ //------------------------------------------------------------------------------ const - { isCommentToken } = require("eslint-utils"), + { isCommentToken } = require("@eslint-community/eslint-utils"), TokenStore = require("./token-store"), astUtils = require("../shared/ast-utils"), - Traverser = require("../shared/traverser"), - lodash = require("lodash"); + Traverser = require("../shared/traverser"); //------------------------------------------------------------------------------ // Private @@ -144,10 +143,12 @@ function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) { // Public Interface //------------------------------------------------------------------------------ +/** + * Represents parsed source code. + */ class SourceCode extends TokenStore { /** - * Represents parsed source code. * @param {string|Object} textOrConfig The source code text or config object. * @param {string} textOrConfig.text The source code text. * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. @@ -176,20 +177,20 @@ class SourceCode extends TokenStore { /** * The flag to indicate that the source code has Unicode BOM. - * @type boolean + * @type {boolean} */ this.hasBOM = (text.charCodeAt(0) === 0xFEFF); /** * The original text source code. * BOM was stripped from this text. - * @type string + * @type {string} */ this.text = (this.hasBOM ? text.slice(1) : text); /** * The parsed AST for the source code. - * @type ASTNode + * @type {ASTNode} */ this.ast = ast; @@ -224,7 +225,7 @@ class SourceCode extends TokenStore { /** * The source code split into lines according to ECMA-262 specification. * This is done to avoid each rule needing to do so separately. - * @type string[] + * @type {string[]} */ this.lines = []; this.lineStartIndices = [0]; @@ -350,7 +351,7 @@ class SourceCode extends TokenStore { let currentToken = this.getTokenBefore(node, { includeComments: true }); while (currentToken && isCommentToken(currentToken)) { - if (node.parent && (currentToken.start < node.parent.start)) { + if (node.parent && node.parent.type !== "Program" && (currentToken.start < node.parent.start)) { break; } comments.leading.push(currentToken); @@ -362,7 +363,7 @@ class SourceCode extends TokenStore { currentToken = this.getTokenAfter(node, { includeComments: true }); while (currentToken && isCommentToken(currentToken)) { - if (node.parent && (currentToken.end > node.parent.end)) { + if (node.parent && node.parent.type !== "Program" && (currentToken.end > node.parent.end)) { break; } comments.trailing.push(currentToken); @@ -507,6 +508,7 @@ class SourceCode extends TokenStore { /** * Converts a source text index into a (line, column) pair. * @param {number} index The index of a character in a file + * @throws {TypeError} If non-numeric index or index out of range. * @returns {Object} A {line, column} location object with a 0-indexed column * @public */ @@ -531,10 +533,12 @@ class SourceCode extends TokenStore { } /* - * To figure out which line rangeIndex is on, determine the last index at which rangeIndex could - * be inserted into lineIndices to keep the list sorted. + * To figure out which line index is on, determine the last place at which index could + * be inserted into lineStartIndices to keep the list sorted. */ - const lineNumber = lodash.sortedLastIndex(this.lineStartIndices, index); + const lineNumber = index >= this.lineStartIndices[this.lineStartIndices.length - 1] + ? this.lineStartIndices.length + : this.lineStartIndices.findIndex(el => index < el); return { line: lineNumber, column: index - this.lineStartIndices[lineNumber - 1] }; } @@ -544,6 +548,9 @@ class SourceCode extends TokenStore { * @param {Object} loc A line/column location * @param {number} loc.line The line number of the location (1-indexed) * @param {number} loc.column The column number of the location (0-indexed) + * @throws {TypeError|RangeError} If `loc` is not an object with a numeric + * `line` and `column`, if the `line` is less than or equal to zero or + * the line or column is out of the expected range. * @returns {number} The range index of the location in the file. * @public */ diff --git a/node_modules/eslint/lib/source-code/token-store/cursor.js b/node_modules/eslint/lib/source-code/token-store/cursor.js index 4e1595c6d..0b726006e 100644 --- a/node_modules/eslint/lib/source-code/token-store/cursor.js +++ b/node_modules/eslint/lib/source-code/token-store/cursor.js @@ -69,8 +69,8 @@ module.exports = class Cursor { * @returns {boolean} `true` if the next token exists. * @abstract */ - /* istanbul ignore next */ - moveNext() { // eslint-disable-line class-methods-use-this + /* c8 ignore next */ + moveNext() { // eslint-disable-line class-methods-use-this -- Unused throw new Error("Not implemented."); } }; diff --git a/node_modules/eslint/lib/source-code/token-store/index.js b/node_modules/eslint/lib/source-code/token-store/index.js index 25db8a4f4..46a96b2f4 100644 --- a/node_modules/eslint/lib/source-code/token-store/index.js +++ b/node_modules/eslint/lib/source-code/token-store/index.js @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ const assert = require("assert"); -const { isCommentToken } = require("eslint-utils"); +const { isCommentToken } = require("@eslint-community/eslint-utils"); const cursors = require("./cursors"); const ForwardTokenCursor = require("./forward-token-cursor"); const PaddedTokenCursor = require("./padded-token-cursor"); diff --git a/node_modules/eslint/lib/source-code/token-store/utils.js b/node_modules/eslint/lib/source-code/token-store/utils.js index 21e1d6ff7..a2bd77de7 100644 --- a/node_modules/eslint/lib/source-code/token-store/utils.js +++ b/node_modules/eslint/lib/source-code/token-store/utils.js @@ -4,12 +4,6 @@ */ "use strict"; -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const lodash = require("lodash"); - //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -29,18 +23,16 @@ function getStartLocation(token) { //------------------------------------------------------------------------------ /** - * Binary-searches the index of the first token which is after the given location. + * Finds the index of the first token which is after the given location. * If it was not found, this returns `tokens.length`. * @param {(Token|Comment)[]} tokens It searches the token in this list. * @param {number} location The location to search. * @returns {number} The found index or `tokens.length`. */ exports.search = function search(tokens, location) { - return lodash.sortedIndexBy( - tokens, - { range: [location] }, - getStartLocation - ); + const index = tokens.findIndex(el => location <= getStartLocation(el)); + + return index === -1 ? tokens.length : index; }; /** diff --git a/node_modules/eslint/lib/unsupported-api.js b/node_modules/eslint/lib/unsupported-api.js new file mode 100644 index 000000000..c1daf54d6 --- /dev/null +++ b/node_modules/eslint/lib/unsupported-api.js @@ -0,0 +1,27 @@ +/** + * @fileoverview APIs that are not officially supported by ESLint. + * These APIs may change or be removed at any time. Use at your + * own risk. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { FileEnumerator } = require("./cli-engine/file-enumerator"); +const { FlatESLint } = require("./eslint/flat-eslint"); +const FlatRuleTester = require("./rule-tester/flat-rule-tester"); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + builtinRules: require("./rules"), + FlatESLint, + FlatRuleTester, + FileEnumerator +}; diff --git a/node_modules/eslint/messages/all-files-ignored.txt b/node_modules/eslint/messages/all-files-ignored.js similarity index 50% rename from node_modules/eslint/messages/all-files-ignored.txt rename to node_modules/eslint/messages/all-files-ignored.js index 3f4c8ced4..70877a4d8 100644 --- a/node_modules/eslint/messages/all-files-ignored.txt +++ b/node_modules/eslint/messages/all-files-ignored.js @@ -1,8 +1,16 @@ -You are linting "<%= pattern %>", but all of the files matching the glob pattern "<%= pattern %>" are ignored. +"use strict"; -If you don't want to lint these files, remove the pattern "<%= pattern %>" from the list of arguments passed to ESLint. +module.exports = function(it) { + const { pattern } = it; + + return ` +You are linting "${pattern}", but all of the files matching the glob pattern "${pattern}" are ignored. + +If you don't want to lint these files, remove the pattern "${pattern}" from the list of arguments passed to ESLint. If you do want to lint these files, try the following solutions: * Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored. * Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/extend-config-missing.js b/node_modules/eslint/messages/extend-config-missing.js new file mode 100644 index 000000000..5b3498fcd --- /dev/null +++ b/node_modules/eslint/messages/extend-config-missing.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function(it) { + const { configName, importerName } = it; + + return ` +ESLint couldn't find the config "${configName}" to extend from. Please check that the name of the config is correct. + +The config "${configName}" was referenced from the config file in "${importerName}". + +If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/extend-config-missing.txt b/node_modules/eslint/messages/extend-config-missing.txt deleted file mode 100644 index 4defd7ac4..000000000 --- a/node_modules/eslint/messages/extend-config-missing.txt +++ /dev/null @@ -1,5 +0,0 @@ -ESLint couldn't find the config "<%- configName %>" to extend from. Please check that the name of the config is correct. - -The config "<%- configName %>" was referenced from the config file in "<%- importerName %>". - -If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/failed-to-read-json.js b/node_modules/eslint/messages/failed-to-read-json.js new file mode 100644 index 000000000..e7c6cb587 --- /dev/null +++ b/node_modules/eslint/messages/failed-to-read-json.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function(it) { + const { path, message } = it; + + return ` +Failed to read JSON file at ${path}: + +${message} +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/failed-to-read-json.txt b/node_modules/eslint/messages/failed-to-read-json.txt deleted file mode 100644 index b5e2b861c..000000000 --- a/node_modules/eslint/messages/failed-to-read-json.txt +++ /dev/null @@ -1,3 +0,0 @@ -Failed to read JSON file at <%= path %>: - -<%= message %> diff --git a/node_modules/eslint/messages/file-not-found.js b/node_modules/eslint/messages/file-not-found.js new file mode 100644 index 000000000..1a62fcf96 --- /dev/null +++ b/node_modules/eslint/messages/file-not-found.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function(it) { + const { pattern, globDisabled } = it; + + return ` +No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found. +Please check for typing mistakes in the pattern. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/file-not-found.txt b/node_modules/eslint/messages/file-not-found.txt deleted file mode 100644 index 639498eb5..000000000 --- a/node_modules/eslint/messages/file-not-found.txt +++ /dev/null @@ -1,2 +0,0 @@ -No files matching the pattern "<%= pattern %>"<% if (globDisabled) { %> (with disabling globs)<% } %> were found. -Please check for typing mistakes in the pattern. diff --git a/node_modules/eslint/messages/no-config-found.js b/node_modules/eslint/messages/no-config-found.js new file mode 100644 index 000000000..21cf549eb --- /dev/null +++ b/node_modules/eslint/messages/no-config-found.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function(it) { + const { directoryPath } = it; + + return ` +ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: + + npm init @eslint/config + +ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory. + +If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/no-config-found.txt b/node_modules/eslint/messages/no-config-found.txt deleted file mode 100644 index b46a7e5a7..000000000 --- a/node_modules/eslint/messages/no-config-found.txt +++ /dev/null @@ -1,7 +0,0 @@ -ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: - - eslint --init - -ESLint looked for configuration files in <%= directoryPath %> and its ancestors. If it found none, it then looked in your home directory. - -If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat/help diff --git a/node_modules/eslint/messages/plugin-conflict.js b/node_modules/eslint/messages/plugin-conflict.js new file mode 100644 index 000000000..c8c060e2f --- /dev/null +++ b/node_modules/eslint/messages/plugin-conflict.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function(it) { + const { pluginId, plugins } = it; + + let result = `ESLint couldn't determine the plugin "${pluginId}" uniquely. +`; + + for (const { filePath, importerName } of plugins) { + result += ` +- ${filePath} (loaded in "${importerName}")`; + } + + result += ` + +Please remove the "plugins" setting from either config or remove either plugin installation. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. +`; + + return result; +}; diff --git a/node_modules/eslint/messages/plugin-conflict.txt b/node_modules/eslint/messages/plugin-conflict.txt deleted file mode 100644 index 3ab4b340e..000000000 --- a/node_modules/eslint/messages/plugin-conflict.txt +++ /dev/null @@ -1,7 +0,0 @@ -ESLint couldn't determine the plugin "<%- pluginId %>" uniquely. -<% for (const { filePath, importerName } of plugins) { %> -- <%= filePath %> (loaded in "<%= importerName %>")<% } %> - -Please remove the "plugins" setting from either config or remove either plugin installation. - -If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/plugin-invalid.js b/node_modules/eslint/messages/plugin-invalid.js new file mode 100644 index 000000000..8b471d4a3 --- /dev/null +++ b/node_modules/eslint/messages/plugin-invalid.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function(it) { + const { configName, importerName } = it; + + return ` +"${configName}" is invalid syntax for a config specifier. + +* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "${configName}/myConfig". +* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "${configName.slice("plugin:".length)}". + +"${configName}" was referenced from the config file in "${importerName}". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/plugin-invalid.txt b/node_modules/eslint/messages/plugin-invalid.txt deleted file mode 100644 index 3ee251821..000000000 --- a/node_modules/eslint/messages/plugin-invalid.txt +++ /dev/null @@ -1,8 +0,0 @@ -"<%- configName %>" is invalid syntax for a config specifier. - -* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "<%- configName %>/myConfig". -* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "<%- configName.slice("plugin:".length) %>". - -"<%- configName %>" was referenced from the config file in "<%- importerName %>". - -If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/plugin-missing.js b/node_modules/eslint/messages/plugin-missing.js new file mode 100644 index 000000000..0b7d34e3a --- /dev/null +++ b/node_modules/eslint/messages/plugin-missing.js @@ -0,0 +1,19 @@ +"use strict"; + +module.exports = function(it) { + const { pluginName, resolvePluginsRelativeTo, importerName } = it; + + return ` +ESLint couldn't find the plugin "${pluginName}". + +(The package "${pluginName}" was not found when loaded as a Node module from the directory "${resolvePluginsRelativeTo}".) + +It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: + + npm install ${pluginName}@latest --save-dev + +The plugin "${pluginName}" was referenced from the config file in "${importerName}". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/plugin-missing.txt b/node_modules/eslint/messages/plugin-missing.txt deleted file mode 100644 index aa25f59ac..000000000 --- a/node_modules/eslint/messages/plugin-missing.txt +++ /dev/null @@ -1,11 +0,0 @@ -ESLint couldn't find the plugin "<%- pluginName %>". - -(The package "<%- pluginName %>" was not found when loaded as a Node module from the directory "<%- resolvePluginsRelativeTo %>".) - -It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: - - npm install <%- pluginName %>@latest --save-dev - -The plugin "<%- pluginName %>" was referenced from the config file in "<%- importerName %>". - -If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/print-config-with-directory-path.js b/node_modules/eslint/messages/print-config-with-directory-path.js new file mode 100644 index 000000000..4559c8d6d --- /dev/null +++ b/node_modules/eslint/messages/print-config-with-directory-path.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function() { + return ` +The '--print-config' CLI option requires a path to a source code file rather than a directory. +See also: https://eslint.org/docs/latest/use/command-line-interface#--print-config +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/print-config-with-directory-path.txt b/node_modules/eslint/messages/print-config-with-directory-path.txt deleted file mode 100644 index 1afc9b1e8..000000000 --- a/node_modules/eslint/messages/print-config-with-directory-path.txt +++ /dev/null @@ -1,2 +0,0 @@ -The '--print-config' CLI option requires a path to a source code file rather than a directory. -See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config diff --git a/node_modules/eslint/messages/whitespace-found.js b/node_modules/eslint/messages/whitespace-found.js new file mode 100644 index 000000000..8a801bcec --- /dev/null +++ b/node_modules/eslint/messages/whitespace-found.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function(it) { + const { pluginName } = it; + + return ` +ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. +`.trimStart(); +}; diff --git a/node_modules/eslint/messages/whitespace-found.txt b/node_modules/eslint/messages/whitespace-found.txt deleted file mode 100644 index 3eed1af58..000000000 --- a/node_modules/eslint/messages/whitespace-found.txt +++ /dev/null @@ -1,3 +0,0 @@ -ESLint couldn't find the plugin "<%- pluginName %>". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. - -If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/node_modules/.bin/js-yaml b/node_modules/eslint/node_modules/.bin/js-yaml new file mode 120000 index 000000000..9dbd010d4 --- /dev/null +++ b/node_modules/eslint/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/semver b/node_modules/eslint/node_modules/.bin/semver deleted file mode 120000 index 5aaadf42c..000000000 --- a/node_modules/eslint/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/@babel/code-frame/README.md b/node_modules/eslint/node_modules/@babel/code-frame/README.md deleted file mode 100644 index 08cacb047..000000000 --- a/node_modules/eslint/node_modules/@babel/code-frame/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @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/en/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/eslint/node_modules/@babel/code-frame/lib/index.js b/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js deleted file mode 100644 index 28d86f7bc..000000000 --- a/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeFrameColumns = codeFrameColumns; -exports.default = _default; - -var _highlight = _interopRequireWildcard(require("@babel/highlight")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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 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 = (0, _highlight.getChalk)(opts); - 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).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, markerLine].join(""); - } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${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); -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/@babel/code-frame/package.json b/node_modules/eslint/node_modules/@babel/code-frame/package.json deleted file mode 100644 index 293f09c42..000000000 --- a/node_modules/eslint/node_modules/@babel/code-frame/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "@babel/code-frame@7.12.11", - "_id": "@babel/code-frame@7.12.11", - "_inBundle": false, - "_integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "_location": "/eslint/@babel/code-frame", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/code-frame@7.12.11", - "name": "@babel/code-frame", - "escapedName": "@babel%2fcode-frame", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "_shasum": "f4ad435aa263db935b8f10f2c552d23fb716a63f", - "_spec": "@babel/code-frame@7.12.11", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/highlight": "^7.10.4" - }, - "deprecated": false, - "description": "Generate errors that contain a code frame that point to source locations.", - "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "homepage": "https://babeljs.io/", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/code-frame", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-code-frame" - }, - "version": "7.12.11" -} diff --git a/node_modules/eslint/node_modules/argparse/CHANGELOG.md b/node_modules/eslint/node_modules/argparse/CHANGELOG.md new file mode 100644 index 000000000..dc39ed695 --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/CHANGELOG.md @@ -0,0 +1,216 @@ +# 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). + + +## [2.0.1] - 2020-08-29 +### Fixed +- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150. + + +## [2.0.0] - 2020-08-14 +### Changed +- Full rewrite. Now port from python 3.9.0 & more precise following. + See [doc](./doc) for difference and migration info. +- node.js 10+ required +- Removed most of local docs in favour of original ones. + + +## [1.0.10] - 2018-02-15 +### Fixed +- Use .concat instead of + for arrays, #122. + + +## [1.0.9] - 2016-09-29 +### Changed +- Rerelease after 1.0.8 - deps cleanup. + + +## [1.0.8] - 2016-09-29 +### Changed +- Maintenance (deps bump, fix node 6.5+ tests, coverage report). + + +## [1.0.7] - 2016-03-17 +### Changed +- Teach `addArgument` to accept string arg names. #97, @tomxtobin. + + +## [1.0.6] - 2016-02-06 +### Changed +- Maintenance: moved to eslint & updated CS. + + +## [1.0.5] - 2016-02-05 +### Changed +- Removed lodash dependency to significantly reduce install size. + Thanks to @mourner. + + +## [1.0.4] - 2016-01-17 +### Changed +- Maintenance: lodash update to 4.0.0. + + +## [1.0.3] - 2015-10-27 +### Fixed +- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. + + +## [1.0.2] - 2015-03-22 +### Changed +- Relaxed lodash version dependency. + + +## [1.0.1] - 2015-02-20 +### Changed +- Changed dependencies to be compatible with ancient nodejs. + + +## [1.0.0] - 2015-02-19 +### Changed +- Maintenance release. +- Replaced `underscore` with `lodash`. +- Bumped version to 1.0.0 to better reflect semver meaning. +- HISTORY.md -> CHANGELOG.md + + +## [0.1.16] - 2013-12-01 +### Changed +- Maintenance release. Updated dependencies and docs. + + +## [0.1.15] - 2013-05-13 +### Fixed +- Fixed #55, @trebor89 + + +## [0.1.14] - 2013-05-12 +### Fixed +- Fixed #62, @maxtaco + + +## [0.1.13] - 2013-04-08 +### Changed +- Added `.npmignore` to reduce package size + + +## [0.1.12] - 2013-02-10 +### Fixed +- Fixed conflictHandler (#46), @hpaulj + + +## [0.1.11] - 2013-02-07 +### Added +- Added 70+ tests (ported from python), @hpaulj +- Added conflictHandler, @applepicke +- Added fromfilePrefixChar, @hpaulj + +### Fixed +- Multiple bugfixes, @hpaulj + + +## [0.1.10] - 2012-12-30 +### Added +- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) + support, thanks to @hpaulj + +### Fixed +- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj + + +## [0.1.9] - 2012-12-27 +### Fixed +- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj +- Fixed default value behavior with `*` positionals, thanks to @hpaulj +- Improve `getDefault()` behavior, thanks to @hpaulj +- Improve negative argument parsing, thanks to @hpaulj + + +## [0.1.8] - 2012-12-01 +### Fixed +- Fixed parser parents (issue #19), thanks to @hpaulj +- Fixed negative argument parse (issue #20), thanks to @hpaulj + + +## [0.1.7] - 2012-10-14 +### Fixed +- Fixed 'choices' argument parse (issue #16) +- Fixed stderr output (issue #15) + + +## [0.1.6] - 2012-09-09 +### Fixed +- Fixed check for conflict of options (thanks to @tomxtobin) + + +## [0.1.5] - 2012-09-03 +### Fixed +- Fix parser #setDefaults method (thanks to @tomxtobin) + + +## [0.1.4] - 2012-07-30 +### Fixed +- Fixed pseudo-argument support (thanks to @CGamesPlay) +- Fixed addHelp default (should be true), if not set (thanks to @benblank) + + +## [0.1.3] - 2012-06-27 +### Fixed +- Fixed formatter api name: Formatter -> HelpFormatter + + +## [0.1.2] - 2012-05-29 +### Fixed +- Removed excess whitespace in help +- Fixed error reporting, when parcer with subcommands + called with empty arguments + +### Added +- Added basic tests + + +## [0.1.1] - 2012-05-23 +### Fixed +- Fixed line wrapping in help formatter +- Added better error reporting on invalid arguments + + +## [0.1.0] - 2012-05-16 +### Added +- First release. + + +[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0 +[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10 +[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9 +[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8 +[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7 +[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6 +[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5 +[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4 +[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0 +[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16 +[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15 +[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14 +[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13 +[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12 +[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11 +[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10 +[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9 +[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8 +[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7 +[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6 +[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5 +[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4 +[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2 +[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1 +[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0 diff --git a/node_modules/eslint/node_modules/argparse/LICENSE b/node_modules/eslint/node_modules/argparse/LICENSE new file mode 100644 index 000000000..66a3ac80d --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/LICENSE @@ -0,0 +1,254 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, 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/eslint/node_modules/argparse/README.md b/node_modules/eslint/node_modules/argparse/README.md new file mode 100644 index 000000000..550b5c9b7 --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/README.md @@ -0,0 +1,84 @@ +argparse +======== + +[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) +[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) + +CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)). + +**Difference with original.** + +- JS has no keyword arguments support. + - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`. +- JS has no python's types `int`, `float`, ... + - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`. +- `%r` format specifier uses `require('util').inspect()`. + +More details in [doc](./doc). + + +Example +------- + +`test.js` file: + +```javascript +#!/usr/bin/env node +'use strict'; + +const { ArgumentParser } = require('argparse'); +const { version } = require('./package.json'); + +const parser = new ArgumentParser({ + description: 'Argparse example' +}); + +parser.add_argument('-v', '--version', { action: 'version', version }); +parser.add_argument('-f', '--foo', { help: 'foo bar' }); +parser.add_argument('-b', '--bar', { help: 'bar foo' }); +parser.add_argument('--baz', { help: 'baz bar' }); + +console.dir(parser.parse_args()); +``` + +Display help: + +``` +$ ./test.js -h +usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] + +Argparse example + +optional arguments: + -h, --help show this help message and exit + -v, --version show program's version number and exit + -f FOO, --foo FOO foo bar + -b BAR, --bar BAR bar foo + --baz BAZ baz bar +``` + +Parse arguments: + +``` +$ ./test.js -f=3 --bar=4 --baz 5 +{ foo: '3', bar: '4', baz: '5' } +``` + + +API docs +-------- + +Since this is a port with minimal divergence, there's no separate documentation. +Use original one instead, with notes about difference. + +1. [Original doc](https://docs.python.org/3.9/library/argparse.html). +2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html). +3. [Difference with python](./doc). + + +argparse for enterprise +----------------------- + +Available as part of the Tidelift Subscription + +The maintainers of argparse 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-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/eslint/node_modules/argparse/argparse.js b/node_modules/eslint/node_modules/argparse/argparse.js new file mode 100644 index 000000000..2b8c8c631 --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/argparse.js @@ -0,0 +1,3707 @@ +// Port of python's argparse module, version 3.9.0: +// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py + +'use strict' + +// Copyright (C) 2010-2020 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors + +/* + * Command-line parsing library + * + * This module is an optparse-inspired command-line parsing library that: + * + * - handles both optional and positional arguments + * - produces highly informative usage messages + * - supports parsers that dispatch to sub-parsers + * + * The following is a simple usage example that sums integers from the + * command-line and writes the result to a file:: + * + * parser = argparse.ArgumentParser( + * description='sum the integers at the command line') + * parser.add_argument( + * 'integers', metavar='int', nargs='+', type=int, + * help='an integer to be summed') + * parser.add_argument( + * '--log', default=sys.stdout, type=argparse.FileType('w'), + * help='the file where the sum should be written') + * args = parser.parse_args() + * args.log.write('%s' % sum(args.integers)) + * args.log.close() + * + * The module contains the following public classes: + * + * - ArgumentParser -- The main entry point for command-line parsing. As the + * example above shows, the add_argument() method is used to populate + * the parser with actions for optional and positional arguments. Then + * the parse_args() method is invoked to convert the args at the + * command-line into an object with attributes. + * + * - ArgumentError -- The exception raised by ArgumentParser objects when + * there are errors with the parser's actions. Errors raised while + * parsing the command-line are caught by ArgumentParser and emitted + * as command-line messages. + * + * - FileType -- A factory for defining types of files to be created. As the + * example above shows, instances of FileType are typically passed as + * the type= argument of add_argument() calls. + * + * - Action -- The base class for parser actions. Typically actions are + * selected by passing strings like 'store_true' or 'append_const' to + * the action= argument of add_argument(). However, for greater + * customization of ArgumentParser actions, subclasses of Action may + * be defined and passed as the action= argument. + * + * - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, + * ArgumentDefaultsHelpFormatter -- Formatter classes which + * may be passed as the formatter_class= argument to the + * ArgumentParser constructor. HelpFormatter is the default, + * RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser + * not to change the formatting for help text, and + * ArgumentDefaultsHelpFormatter adds information about argument defaults + * to the help. + * + * All other classes in this module are considered implementation details. + * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only + * considered public as object names -- the API of the formatter objects is + * still considered an implementation detail.) + */ + +const SUPPRESS = '==SUPPRESS==' + +const OPTIONAL = '?' +const ZERO_OR_MORE = '*' +const ONE_OR_MORE = '+' +const PARSER = 'A...' +const REMAINDER = '...' +const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args' + + +// ================================== +// Utility functions used for porting +// ================================== +const assert = require('assert') +const util = require('util') +const fs = require('fs') +const sub = require('./lib/sub') +const path = require('path') +const repr = util.inspect + +function get_argv() { + // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.) + return process.argv.slice(1) +} + +function get_terminal_size() { + return { + columns: +process.env.COLUMNS || process.stdout.columns || 80 + } +} + +function hasattr(object, name) { + return Object.prototype.hasOwnProperty.call(object, name) +} + +function getattr(object, name, value) { + return hasattr(object, name) ? object[name] : value +} + +function setattr(object, name, value) { + object[name] = value +} + +function setdefault(object, name, value) { + if (!hasattr(object, name)) object[name] = value + return object[name] +} + +function delattr(object, name) { + delete object[name] +} + +function range(from, to, step=1) { + // range(10) is equivalent to range(0, 10) + if (arguments.length === 1) [ to, from ] = [ from, 0 ] + if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') { + throw new TypeError('argument cannot be interpreted as an integer') + } + if (step === 0) throw new TypeError('range() arg 3 must not be zero') + + let result = [] + if (step > 0) { + for (let i = from; i < to; i += step) result.push(i) + } else { + for (let i = from; i > to; i += step) result.push(i) + } + return result +} + +function splitlines(str, keepends = false) { + let result + if (!keepends) { + result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/) + } else { + result = [] + let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/) + for (let i = 0; i < parts.length; i += 2) { + result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : '')) + } + } + if (!result[result.length - 1]) result.pop() + return result +} + +function _string_lstrip(string, prefix_chars) { + let idx = 0 + while (idx < string.length && prefix_chars.includes(string[idx])) idx++ + return idx ? string.slice(idx) : string +} + +function _string_split(string, sep, maxsplit) { + let result = string.split(sep) + if (result.length > maxsplit) { + result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ]) + } + return result +} + +function _array_equal(array1, array2) { + if (array1.length !== array2.length) return false + for (let i = 0; i < array1.length; i++) { + if (array1[i] !== array2[i]) return false + } + return true +} + +function _array_remove(array, item) { + let idx = array.indexOf(item) + if (idx === -1) throw new TypeError(sub('%r not in list', item)) + array.splice(idx, 1) +} + +// normalize choices to array; +// this isn't required in python because `in` and `map` operators work with anything, +// but in js dealing with multiple types here is too clunky +function _choices_to_array(choices) { + if (choices === undefined) { + return [] + } else if (Array.isArray(choices)) { + return choices + } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') { + return Array.from(choices) + } else if (typeof choices === 'object' && choices !== null) { + return Object.keys(choices) + } else { + throw new Error(sub('invalid choices value: %r', choices)) + } +} + +// decorator that allows a class to be called without new +function _callable(cls) { + let result = { // object is needed for inferred class name + [cls.name]: function (...args) { + let this_class = new.target === result || !new.target + return Reflect.construct(cls, args, this_class ? cls : new.target) + } + } + result[cls.name].prototype = cls.prototype + // fix default tag for toString, e.g. [object Action] instead of [object Object] + cls.prototype[Symbol.toStringTag] = cls.name + return result[cls.name] +} + +function _alias(object, from, to) { + try { + let name = object.constructor.name + Object.defineProperty(object, from, { + value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()', + name, from, name, to)), + enumerable: false + }) + } catch {} +} + +// decorator that allows snake_case class methods to be called with camelCase and vice versa +function _camelcase_alias(_class) { + for (let name of Object.getOwnPropertyNames(_class.prototype)) { + let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (camelcase !== name) _alias(_class.prototype, camelcase, name) + } + return _class +} + +function _to_legacy_name(key) { + key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (key === 'default') key = 'defaultValue' + if (key === 'const') key = 'constant' + return key +} + +function _to_new_name(key) { + if (key === 'defaultValue') key = 'default' + if (key === 'constant') key = 'const' + key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase()) + return key +} + +// parse options +let no_default = Symbol('no_default_value') +function _parse_opts(args, descriptor) { + function get_name() { + let stack = new Error().stack.split('\n') + .map(x => x.match(/^ at (.*) \(.*\)$/)) + .filter(Boolean) + .map(m => m[1]) + .map(fn => fn.match(/[^ .]*$/)[0]) + + if (stack.length && stack[0] === get_name.name) stack.shift() + if (stack.length && stack[0] === _parse_opts.name) stack.shift() + return stack.length ? stack[0] : '' + } + + args = Array.from(args) + let kwargs = {} + let result = [] + let last_opt = args.length && args[args.length - 1] + + if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) && + (!last_opt.constructor || last_opt.constructor.name === 'Object')) { + kwargs = Object.assign({}, args.pop()) + } + + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(descriptor)) { + let old_name = _to_legacy_name(key) + if (old_name !== key && (old_name in kwargs)) { + if (key in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else { + kwargs[key] = kwargs[old_name] + } + renames.push([ old_name, key ]) + delete kwargs[old_name] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + + let missing_positionals = [] + let positional_count = args.length + + for (let [ key, def ] of Object.entries(descriptor)) { + if (key[0] === '*') { + if (key.length > 0 && key[1] === '*') { + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(kwargs)) { + let new_name = _to_new_name(key) + if (new_name !== key && (key in kwargs)) { + if (new_name in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name)) + } else { + kwargs[new_name] = kwargs[key] + } + renames.push([ key, new_name ]) + delete kwargs[key] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + result.push(kwargs) + kwargs = {} + } else { + result.push(args) + args = [] + } + } else if (key in kwargs && args.length > 0) { + throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else if (key in kwargs) { + result.push(kwargs[key]) + delete kwargs[key] + } else if (args.length > 0) { + result.push(args.shift()) + } else if (def !== no_default) { + result.push(def) + } else { + missing_positionals.push(key) + } + } + + if (Object.keys(kwargs).length) { + throw new TypeError(sub('%s() got an unexpected keyword argument %r', + get_name(), Object.keys(kwargs)[0])) + } + + if (args.length) { + let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length + let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length + throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given', + get_name(), + from === to ? sub('from %s to %s', from, to) : to, + from === to && to === 1 ? '' : 's', + positional_count, + positional_count === 1 ? 'was' : 'were')) + } + + if (missing_positionals.length) { + let strs = missing_positionals.map(repr) + if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1] + let str_joined = strs.join(strs.length === 2 ? '' : ', ') + throw new TypeError(sub('%s() missing %i required positional argument%s: %s', + get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined)) + } + + return result +} + +let _deprecations = {} +function deprecate(id, string) { + _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string) + _deprecations[id]() +} + + +// ============================= +// Utility functions and classes +// ============================= +function _AttributeHolder(cls = Object) { + /* + * Abstract base class that provides __repr__. + * + * The __repr__ method returns a string in the format:: + * ClassName(attr=name, attr=name, ...) + * The attributes are determined either by a class-level attribute, + * '_kwarg_names', or by inspecting the instance __dict__. + */ + + return class _AttributeHolder extends cls { + [util.inspect.custom]() { + let type_name = this.constructor.name + let arg_strings = [] + let star_args = {} + for (let arg of this._get_args()) { + arg_strings.push(repr(arg)) + } + for (let [ name, value ] of this._get_kwargs()) { + if (/^[a-z_][a-z0-9_$]*$/i.test(name)) { + arg_strings.push(sub('%s=%r', name, value)) + } else { + star_args[name] = value + } + } + if (Object.keys(star_args).length) { + arg_strings.push(sub('**%s', repr(star_args))) + } + return sub('%s(%s)', type_name, arg_strings.join(', ')) + } + + toString() { + return this[util.inspect.custom]() + } + + _get_kwargs() { + return Object.entries(this) + } + + _get_args() { + return [] + } + } +} + + +function _copy_items(items) { + if (items === undefined) { + return [] + } + return items.slice(0) +} + + +// =============== +// Formatting Help +// =============== +const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter { + /* + * Formatter for generating usage messages and argument help strings. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + constructor() { + let [ + prog, + indent_increment, + max_help_position, + width + ] = _parse_opts(arguments, { + prog: no_default, + indent_increment: 2, + max_help_position: 24, + width: undefined + }) + + // default setting for width + if (width === undefined) { + width = get_terminal_size().columns + width -= 2 + } + + this._prog = prog + this._indent_increment = indent_increment + this._max_help_position = Math.min(max_help_position, + Math.max(width - 20, indent_increment * 2)) + this._width = width + + this._current_indent = 0 + this._level = 0 + this._action_max_length = 0 + + this._root_section = this._Section(this, undefined) + this._current_section = this._root_section + + this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag + this._long_break_matcher = /\n\n\n+/g + } + + // =============================== + // Section and indentation methods + // =============================== + _indent() { + this._current_indent += this._indent_increment + this._level += 1 + } + + _dedent() { + this._current_indent -= this._indent_increment + assert(this._current_indent >= 0, 'Indent decreased below 0.') + this._level -= 1 + } + + _add_item(func, args) { + this._current_section.items.push([ func, args ]) + } + + // ======================== + // Message building methods + // ======================== + start_section(heading) { + this._indent() + let section = this._Section(this, this._current_section, heading) + this._add_item(section.format_help.bind(section), []) + this._current_section = section + } + + end_section() { + this._current_section = this._current_section.parent + this._dedent() + } + + add_text(text) { + if (text !== SUPPRESS && text !== undefined) { + this._add_item(this._format_text.bind(this), [text]) + } + } + + add_usage(usage, actions, groups, prefix = undefined) { + if (usage !== SUPPRESS) { + let args = [ usage, actions, groups, prefix ] + this._add_item(this._format_usage.bind(this), args) + } + } + + add_argument(action) { + if (action.help !== SUPPRESS) { + + // find all invocations + let invocations = [this._format_action_invocation(action)] + for (let subaction of this._iter_indented_subactions(action)) { + invocations.push(this._format_action_invocation(subaction)) + } + + // update the maximum item length + let invocation_length = Math.max(...invocations.map(invocation => invocation.length)) + let action_length = invocation_length + this._current_indent + this._action_max_length = Math.max(this._action_max_length, + action_length) + + // add the item to the list + this._add_item(this._format_action.bind(this), [action]) + } + } + + add_arguments(actions) { + for (let action of actions) { + this.add_argument(action) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_help() { + let help = this._root_section.format_help() + if (help) { + help = help.replace(this._long_break_matcher, '\n\n') + help = help.replace(/^\n+|\n+$/g, '') + '\n' + } + return help + } + + _join_parts(part_strings) { + return part_strings.filter(part => part && part !== SUPPRESS).join('') + } + + _format_usage(usage, actions, groups, prefix) { + if (prefix === undefined) { + prefix = 'usage: ' + } + + // if usage is specified, use that + if (usage !== undefined) { + usage = sub(usage, { prog: this._prog }) + + // if no optionals or positionals are available, usage is just prog + } else if (usage === undefined && !actions.length) { + usage = sub('%(prog)s', { prog: this._prog }) + + // if optionals and positionals are available, calculate usage + } else if (usage === undefined) { + let prog = sub('%(prog)s', { prog: this._prog }) + + // split optionals from positionals + let optionals = [] + let positionals = [] + for (let action of actions) { + if (action.option_strings.length) { + optionals.push(action) + } else { + positionals.push(action) + } + } + + // build full usage string + let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups) + usage = [ prog, action_usage ].map(String).join(' ') + + // wrap the usage parts if it's too long + let text_width = this._width - this._current_indent + if (prefix.length + usage.length > text_width) { + + // break usage into wrappable parts + let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g + let opt_usage = this._format_actions_usage(optionals, groups) + let pos_usage = this._format_actions_usage(positionals, groups) + let opt_parts = opt_usage.match(part_regexp) || [] + let pos_parts = pos_usage.match(part_regexp) || [] + assert(opt_parts.join(' ') === opt_usage) + assert(pos_parts.join(' ') === pos_usage) + + // helper for wrapping lines + let get_lines = (parts, indent, prefix = undefined) => { + let lines = [] + let line = [] + let line_len + if (prefix !== undefined) { + line_len = prefix.length - 1 + } else { + line_len = indent.length - 1 + } + for (let part of parts) { + if (line_len + 1 + part.length > text_width && line) { + lines.push(indent + line.join(' ')) + line = [] + line_len = indent.length - 1 + } + line.push(part) + line_len += part.length + 1 + } + if (line.length) { + lines.push(indent + line.join(' ')) + } + if (prefix !== undefined) { + lines[0] = lines[0].slice(indent.length) + } + return lines + } + + let lines + + // if prog is short, follow it with optionals or positionals + if (prefix.length + prog.length <= 0.75 * text_width) { + let indent = ' '.repeat(prefix.length + prog.length + 1) + if (opt_parts.length) { + lines = get_lines([prog].concat(opt_parts), indent, prefix) + lines = lines.concat(get_lines(pos_parts, indent)) + } else if (pos_parts.length) { + lines = get_lines([prog].concat(pos_parts), indent, prefix) + } else { + lines = [prog] + } + + // if prog is long, put it on its own line + } else { + let indent = ' '.repeat(prefix.length) + let parts = [].concat(opt_parts).concat(pos_parts) + lines = get_lines(parts, indent) + if (lines.length > 1) { + lines = [] + lines = lines.concat(get_lines(opt_parts, indent)) + lines = lines.concat(get_lines(pos_parts, indent)) + } + lines = [prog].concat(lines) + } + + // join lines into usage + usage = lines.join('\n') + } + } + + // prefix with 'usage:' + return sub('%s%s\n\n', prefix, usage) + } + + _format_actions_usage(actions, groups) { + // find group indices and identify actions in groups + let group_actions = new Set() + let inserts = {} + for (let group of groups) { + let start = actions.indexOf(group._group_actions[0]) + if (start === -1) { + continue + } else { + let end = start + group._group_actions.length + if (_array_equal(actions.slice(start, end), group._group_actions)) { + for (let action of group._group_actions) { + group_actions.add(action) + } + if (!group.required) { + if (start in inserts) { + inserts[start] += ' [' + } else { + inserts[start] = '[' + } + if (end in inserts) { + inserts[end] += ']' + } else { + inserts[end] = ']' + } + } else { + if (start in inserts) { + inserts[start] += ' (' + } else { + inserts[start] = '(' + } + if (end in inserts) { + inserts[end] += ')' + } else { + inserts[end] = ')' + } + } + for (let i of range(start + 1, end)) { + inserts[i] = '|' + } + } + } + } + + // collect all actions format strings + let parts = [] + for (let [ i, action ] of Object.entries(actions)) { + + // suppressed arguments are marked with None + // remove | separators for suppressed arguments + if (action.help === SUPPRESS) { + parts.push(undefined) + if (inserts[+i] === '|') { + delete inserts[+i] + } else if (inserts[+i + 1] === '|') { + delete inserts[+i + 1] + } + + // produce all arg strings + } else if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let part = this._format_args(action, default_value) + + // if it's in a group, strip the outer [] + if (group_actions.has(action)) { + if (part[0] === '[' && part[part.length - 1] === ']') { + part = part.slice(1, -1) + } + } + + // add the action string to the list + parts.push(part) + + // produce the first way to invoke the option in brackets + } else { + let option_string = action.option_strings[0] + let part + + // if the Optional doesn't take a value, format is: + // -s or --long + if (action.nargs === 0) { + part = action.format_usage() + + // if the Optional takes a value, format is: + // -s ARGS or --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + part = sub('%s %s', option_string, args_string) + } + + // make it look optional if it's not required or in a group + if (!action.required && !group_actions.has(action)) { + part = sub('[%s]', part) + } + + // add the action string to the list + parts.push(part) + } + } + + // insert things at the necessary indices + for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) { + parts.splice(+i, 0, inserts[+i]) + } + + // join all the action items with spaces + let text = parts.filter(Boolean).join(' ') + + // clean up separators for mutually exclusive groups + text = text.replace(/([\[(]) /g, '$1') + text = text.replace(/ ([\])])/g, '$1') + text = text.replace(/[\[(] *[\])]/g, '') + text = text.replace(/\(([^|]*)\)/g, '$1', text) + text = text.trim() + + // return the text + return text + } + + _format_text(text) { + if (text.includes('%(prog)')) { + text = sub(text, { prog: this._prog }) + } + let text_width = Math.max(this._width - this._current_indent, 11) + let indent = ' '.repeat(this._current_indent) + return this._fill_text(text, text_width, indent) + '\n\n' + } + + _format_action(action) { + // determine the required width and the entry label + let help_position = Math.min(this._action_max_length + 2, + this._max_help_position) + let help_width = Math.max(this._width - help_position, 11) + let action_width = help_position - this._current_indent - 2 + let action_header = this._format_action_invocation(action) + let indent_first + + // no help; start on same line and add a final newline + if (!action.help) { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + + // short action name; start on the same line and pad two spaces + } else if (action_header.length <= action_width) { + let tup = [ this._current_indent, '', action_width, action_header ] + action_header = sub('%*s%-*s ', ...tup) + indent_first = 0 + + // long action name; start on the next line + } else { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + indent_first = help_position + } + + // collect the pieces of the action help + let parts = [action_header] + + // if there was help for the action, add lines of help text + if (action.help) { + let help_text = this._expand_help(action) + let help_lines = this._split_lines(help_text, help_width) + parts.push(sub('%*s%s\n', indent_first, '', help_lines[0])) + for (let line of help_lines.slice(1)) { + parts.push(sub('%*s%s\n', help_position, '', line)) + } + + // or add a newline if the description doesn't end with one + } else if (!action_header.endsWith('\n')) { + parts.push('\n') + } + + // if there are any sub-actions, add their help as well + for (let subaction of this._iter_indented_subactions(action)) { + parts.push(this._format_action(subaction)) + } + + // return a single string + return this._join_parts(parts) + } + + _format_action_invocation(action) { + if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let metavar = this._metavar_formatter(action, default_value)(1)[0] + return metavar + + } else { + let parts = [] + + // if the Optional doesn't take a value, format is: + // -s, --long + if (action.nargs === 0) { + parts = parts.concat(action.option_strings) + + // if the Optional takes a value, format is: + // -s ARGS, --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + for (let option_string of action.option_strings) { + parts.push(sub('%s %s', option_string, args_string)) + } + } + + return parts.join(', ') + } + } + + _metavar_formatter(action, default_metavar) { + let result + if (action.metavar !== undefined) { + result = action.metavar + } else if (action.choices !== undefined) { + let choice_strs = _choices_to_array(action.choices).map(String) + result = sub('{%s}', choice_strs.join(',')) + } else { + result = default_metavar + } + + function format(tuple_size) { + if (Array.isArray(result)) { + return result + } else { + return Array(tuple_size).fill(result) + } + } + return format + } + + _format_args(action, default_metavar) { + let get_metavar = this._metavar_formatter(action, default_metavar) + let result + if (action.nargs === undefined) { + result = sub('%s', ...get_metavar(1)) + } else if (action.nargs === OPTIONAL) { + result = sub('[%s]', ...get_metavar(1)) + } else if (action.nargs === ZERO_OR_MORE) { + let metavar = get_metavar(1) + if (metavar.length === 2) { + result = sub('[%s [%s ...]]', ...metavar) + } else { + result = sub('[%s ...]', ...metavar) + } + } else if (action.nargs === ONE_OR_MORE) { + result = sub('%s [%s ...]', ...get_metavar(2)) + } else if (action.nargs === REMAINDER) { + result = '...' + } else if (action.nargs === PARSER) { + result = sub('%s ...', ...get_metavar(1)) + } else if (action.nargs === SUPPRESS) { + result = '' + } else { + let formats + try { + formats = range(action.nargs).map(() => '%s') + } catch (err) { + throw new TypeError('invalid nargs value') + } + result = sub(formats.join(' '), ...get_metavar(action.nargs)) + } + return result + } + + _expand_help(action) { + let params = Object.assign({ prog: this._prog }, action) + for (let name of Object.keys(params)) { + if (params[name] === SUPPRESS) { + delete params[name] + } + } + for (let name of Object.keys(params)) { + if (params[name] && params[name].name) { + params[name] = params[name].name + } + } + if (params.choices !== undefined) { + let choices_str = _choices_to_array(params.choices).map(String).join(', ') + params.choices = choices_str + } + // LEGACY (v1 compatibility): camelcase + for (let key of Object.keys(params)) { + let old_name = _to_legacy_name(key) + if (old_name !== key) { + params[old_name] = params[key] + } + } + // end + return sub(this._get_help_string(action), params) + } + + * _iter_indented_subactions(action) { + if (typeof action._get_subactions === 'function') { + this._indent() + yield* action._get_subactions() + this._dedent() + } + } + + _split_lines(text, width) { + text = text.replace(this._whitespace_matcher, ' ').trim() + // The textwrap module is used only for formatting help. + // Delay its import for speeding up the common usage of argparse. + let textwrap = require('./lib/textwrap') + return textwrap.wrap(text, { width }) + } + + _fill_text(text, width, indent) { + text = text.replace(this._whitespace_matcher, ' ').trim() + let textwrap = require('./lib/textwrap') + return textwrap.fill(text, { width, + initial_indent: indent, + subsequent_indent: indent }) + } + + _get_help_string(action) { + return action.help + } + + _get_default_metavar_for_optional(action) { + return action.dest.toUpperCase() + } + + _get_default_metavar_for_positional(action) { + return action.dest + } +})) + +HelpFormatter.prototype._Section = _callable(class _Section { + + constructor(formatter, parent, heading = undefined) { + this.formatter = formatter + this.parent = parent + this.heading = heading + this.items = [] + } + + format_help() { + // format the indented section + if (this.parent !== undefined) { + this.formatter._indent() + } + let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args))) + if (this.parent !== undefined) { + this.formatter._dedent() + } + + // return nothing if the section was empty + if (!item_help) { + return '' + } + + // add the heading if the section was non-empty + let heading + if (this.heading !== SUPPRESS && this.heading !== undefined) { + let current_indent = this.formatter._current_indent + heading = sub('%*s%s:\n', current_indent, '', this.heading) + } else { + heading = '' + } + + // join the section-initial newline, the heading and the help + return this.formatter._join_parts(['\n', heading, item_help, '\n']) + } +}) + + +const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter { + /* + * Help message formatter which retains any formatting in descriptions. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _fill_text(text, width, indent) { + return splitlines(text, true).map(line => indent + line).join('') + } +})) + + +const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter { + /* + * Help message formatter which retains formatting of all help text. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _split_lines(text/*, width*/) { + return splitlines(text) + } +})) + + +const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter { + /* + * Help message formatter which adds default values to argument help. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_help_string(action) { + let help = action.help + // LEGACY (v1 compatibility): additional check for defaultValue needed + if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) { + if (action.default !== SUPPRESS) { + let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] + if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) { + help += ' (default: %(default)s)' + } + } + } + return help + } +})) + + +const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter { + /* + * Help message formatter which uses the argument 'type' as the default + * metavar value (instead of the argument 'dest') + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_default_metavar_for_optional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } + + _get_default_metavar_for_positional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } +})) + + +// ===================== +// Options and Arguments +// ===================== +function _get_action_name(argument) { + if (argument === undefined) { + return undefined + } else if (argument.option_strings.length) { + return argument.option_strings.join('/') + } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) { + return argument.metavar + } else if (![ undefined, SUPPRESS ].includes(argument.dest)) { + return argument.dest + } else { + return undefined + } +} + + +const ArgumentError = _callable(class ArgumentError extends Error { + /* + * An error from creating or using an argument (optional or positional). + * + * The string value of this exception is the message, augmented with + * information about the argument that caused it. + */ + + constructor(argument, message) { + super() + this.name = 'ArgumentError' + this._argument_name = _get_action_name(argument) + this._message = message + this.message = this.str() + } + + str() { + let format + if (this._argument_name === undefined) { + format = '%(message)s' + } else { + format = 'argument %(argument_name)s: %(message)s' + } + return sub(format, { message: this._message, + argument_name: this._argument_name }) + } +}) + + +const ArgumentTypeError = _callable(class ArgumentTypeError extends Error { + /* + * An error from trying to convert a command line string to a type. + */ + + constructor(message) { + super(message) + this.name = 'ArgumentTypeError' + } +}) + + +// ============== +// Action classes +// ============== +const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) { + /* + * Information about how to convert command line strings to Python objects. + * + * Action objects are used by an ArgumentParser to represent the information + * needed to parse a single argument from one or more strings from the + * command line. The keyword arguments to the Action constructor are also + * all attributes of Action instances. + * + * Keyword Arguments: + * + * - option_strings -- A list of command-line option strings which + * should be associated with this action. + * + * - dest -- The name of the attribute to hold the created object(s) + * + * - nargs -- The number of command-line arguments that should be + * consumed. By default, one argument will be consumed and a single + * value will be produced. Other values include: + * - N (an integer) consumes N arguments (and produces a list) + * - '?' consumes zero or one arguments + * - '*' consumes zero or more arguments (and produces a list) + * - '+' consumes one or more arguments (and produces a list) + * Note that the difference between the default and nargs=1 is that + * with the default, a single value will be produced, while with + * nargs=1, a list containing a single value will be produced. + * + * - const -- The value to be produced if the option is specified and the + * option uses an action that takes no values. + * + * - default -- The value to be produced if the option is not specified. + * + * - type -- A callable that accepts a single string argument, and + * returns the converted value. The standard Python types str, int, + * float, and complex are useful examples of such callables. If None, + * str is used. + * + * - choices -- A container of values that should be allowed. If not None, + * after a command-line argument has been converted to the appropriate + * type, an exception will be raised if it is not a member of this + * collection. + * + * - required -- True if the action must always be specified at the + * command line. This is only meaningful for optional command-line + * arguments. + * + * - help -- The help string describing the argument. + * + * - metavar -- The name to be used for the option's argument with the + * help string. If None, the 'dest' value will be used as the name. + */ + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + this.option_strings = option_strings + this.dest = dest + this.nargs = nargs + this.const = const_value + this.default = default_value + this.type = type + this.choices = choices + this.required = required + this.help = help + this.metavar = metavar + } + + _get_kwargs() { + let names = [ + 'option_strings', + 'dest', + 'nargs', + 'const', + 'default', + 'type', + 'choices', + 'help', + 'metavar' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + format_usage() { + return this.option_strings[0] + } + + call(/*parser, namespace, values, option_string = undefined*/) { + throw new Error('.call() not defined') + } +})) + + +const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + let _option_strings = [] + for (let option_string of option_strings) { + _option_strings.push(option_string) + + if (option_string.startsWith('--')) { + option_string = '--no-' + option_string.slice(2) + _option_strings.push(option_string) + } + } + + if (help !== undefined && default_value !== undefined) { + help += ` (default: ${default_value})` + } + + super({ + option_strings: _option_strings, + dest, + nargs: 0, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values, option_string = undefined) { + if (this.option_strings.includes(option_string)) { + setattr(namespace, this.dest, !option_string.startsWith('--no-')) + } + } + + format_usage() { + return this.option_strings.join(' | ') + } +})) + + +const _StoreAction = _callable(class _StoreAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for store actions must be != 0; if you ' + + 'have nothing to store, actions such as store ' + + 'true or store const may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + setattr(namespace, this.dest, values) + } +}) + + +const _StoreConstAction = _callable(class _StoreConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help + //, metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + setattr(namespace, this.dest, this.const) + } +}) + + +const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: false, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: true, + default: default_value, + required, + help + }) + } +}) + + +const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: true, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: false, + default: default_value, + required, + help + }) + } +}) + + +const _AppendAction = _callable(class _AppendAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for append actions must be != 0; if arg ' + + 'strings are not supplying the value to append, ' + + 'the append const action may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(values) + setattr(namespace, this.dest, items) + } +}) + + +const _AppendConstAction = _callable(class _AppendConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help, + metavar + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(this.const) + setattr(namespace, this.dest, items) + } +}) + + +const _CountAction = _callable(class _CountAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let count = getattr(namespace, this.dest, undefined) + if (count === undefined) { + count = 0 + } + setattr(namespace, this.dest, count + 1) + } +}) + + +const _HelpAction = _callable(class _HelpAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: SUPPRESS, + default: SUPPRESS, + help: undefined + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + } + + call(parser/*, namespace, values, option_string = undefined*/) { + parser.print_help() + parser.exit() + } +}) + + +const _VersionAction = _callable(class _VersionAction extends Action { + + constructor() { + let [ + option_strings, + version, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + version: undefined, + dest: SUPPRESS, + default: SUPPRESS, + help: "show program's version number and exit" + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + this.version = version + } + + call(parser/*, namespace, values, option_string = undefined*/) { + let version = this.version + if (version === undefined) { + version = parser.version + } + let formatter = parser._get_formatter() + formatter.add_text(version) + parser._print_message(formatter.format_help(), process.stdout) + parser.exit() + } +}) + + +const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action { + + constructor() { + let [ + option_strings, + prog, + parser_class, + dest, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + prog: no_default, + parser_class: no_default, + dest: SUPPRESS, + required: false, + help: undefined, + metavar: undefined + }) + + let name_parser_map = {} + + super({ + option_strings, + dest, + nargs: PARSER, + choices: name_parser_map, + required, + help, + metavar + }) + + this._prog_prefix = prog + this._parser_class = parser_class + this._name_parser_map = name_parser_map + this._choices_actions = [] + } + + add_parser() { + let [ + name, + kwargs + ] = _parse_opts(arguments, { + name: no_default, + '**kwargs': no_default + }) + + // set prog from the existing prefix + if (kwargs.prog === undefined) { + kwargs.prog = sub('%s %s', this._prog_prefix, name) + } + + let aliases = getattr(kwargs, 'aliases', []) + delete kwargs.aliases + + // create a pseudo-action to hold the choice help + if ('help' in kwargs) { + let help = kwargs.help + delete kwargs.help + let choice_action = this._ChoicesPseudoAction(name, aliases, help) + this._choices_actions.push(choice_action) + } + + // create the parser and add it to the map + let parser = new this._parser_class(kwargs) + this._name_parser_map[name] = parser + + // make parser available under aliases also + for (let alias of aliases) { + this._name_parser_map[alias] = parser + } + + return parser + } + + _get_subactions() { + return this._choices_actions + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let parser_name = values[0] + let arg_strings = values.slice(1) + + // set the parser name if requested + if (this.dest !== SUPPRESS) { + setattr(namespace, this.dest, parser_name) + } + + // select the parser + if (hasattr(this._name_parser_map, parser_name)) { + parser = this._name_parser_map[parser_name] + } else { + let args = {parser_name, + choices: this._name_parser_map.join(', ')} + let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args) + throw new ArgumentError(this, msg) + } + + // parse all the remaining options into the namespace + // store any unrecognized options on the object, so that the top + // level parser can decide what to do with them + + // In case this subparser defines new defaults, we parse them + // in a new namespace object and then update the original + // namespace for the relevant parts. + let subnamespace + [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined) + for (let [ key, value ] of Object.entries(subnamespace)) { + setattr(namespace, key, value) + } + + if (arg_strings.length) { + setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, []) + getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings) + } + } +})) + + +_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action { + constructor(name, aliases, help) { + let metavar = name, dest = name + if (aliases.length) { + metavar += sub(' (%s)', aliases.join(', ')) + } + super({ option_strings: [], dest, help, metavar }) + } +}) + + +const _ExtendAction = _callable(class _ExtendAction extends _AppendAction { + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items = items.concat(values) + setattr(namespace, this.dest, items) + } +}) + + +// ============== +// Type classes +// ============== +const FileType = _callable(class FileType extends Function { + /* + * Factory for creating file object types + * + * Instances of FileType are typically passed as type= arguments to the + * ArgumentParser add_argument() method. + * + * Keyword Arguments: + * - mode -- A string indicating how the file is to be opened. Accepts the + * same values as the builtin open() function. + * - bufsize -- The file's desired buffer size. Accepts the same values as + * the builtin open() function. + * - encoding -- The file's encoding. Accepts the same values as the + * builtin open() function. + * - errors -- A string indicating how encoding and decoding errors are to + * be handled. Accepts the same value as the builtin open() function. + */ + + constructor() { + let [ + flags, + encoding, + mode, + autoClose, + emitClose, + start, + end, + highWaterMark, + fs + ] = _parse_opts(arguments, { + flags: 'r', + encoding: undefined, + mode: undefined, // 0o666 + autoClose: undefined, // true + emitClose: undefined, // false + start: undefined, // 0 + end: undefined, // Infinity + highWaterMark: undefined, // 64 * 1024 + fs: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + Object.defineProperty(this, 'name', { + get() { + return sub('FileType(%r)', flags) + } + }) + this._flags = flags + this._options = {} + if (encoding !== undefined) this._options.encoding = encoding + if (mode !== undefined) this._options.mode = mode + if (autoClose !== undefined) this._options.autoClose = autoClose + if (emitClose !== undefined) this._options.emitClose = emitClose + if (start !== undefined) this._options.start = start + if (end !== undefined) this._options.end = end + if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark + if (fs !== undefined) this._options.fs = fs + } + + call(string) { + // the special argument "-" means sys.std{in,out} + if (string === '-') { + if (this._flags.includes('r')) { + return process.stdin + } else if (this._flags.includes('w')) { + return process.stdout + } else { + let msg = sub('argument "-" with mode %r', this._flags) + throw new TypeError(msg) + } + } + + // all other arguments are used as file names + let fd + try { + fd = fs.openSync(string, this._flags, this._options.mode) + } catch (e) { + let args = { filename: string, error: e.message } + let message = "can't open '%(filename)s': %(error)s" + throw new ArgumentTypeError(sub(message, args)) + } + + let options = Object.assign({ fd, flags: this._flags }, this._options) + if (this._flags.includes('r')) { + return fs.createReadStream(undefined, options) + } else if (this._flags.includes('w')) { + return fs.createWriteStream(undefined, options) + } else { + let msg = sub('argument "%s" with mode %r', string, this._flags) + throw new TypeError(msg) + } + } + + [util.inspect.custom]() { + let args = [ this._flags ] + let kwargs = Object.entries(this._options).map(([ k, v ]) => { + if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } } + return [ k, v ] + }) + let args_str = [] + .concat(args.filter(arg => arg !== -1).map(repr)) + .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined) + .map(([kw, arg]) => sub('%s=%r', kw, arg))) + .join(', ') + return sub('%s(%s)', this.constructor.name, args_str) + } + + toString() { + return this[util.inspect.custom]() + } +}) + +// =========================== +// Optional and Positional Parsing +// =========================== +const Namespace = _callable(class Namespace extends _AttributeHolder() { + /* + * Simple object for storing attributes. + * + * Implements equality by attribute names and values, and provides a simple + * string representation. + */ + + constructor(options = {}) { + super() + Object.assign(this, options) + } +}) + +// unset string tag to mimic plain object +Namespace.prototype[Symbol.toStringTag] = undefined + + +const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer { + + constructor() { + let [ + description, + prefix_chars, + argument_default, + conflict_handler + ] = _parse_opts(arguments, { + description: no_default, + prefix_chars: no_default, + argument_default: no_default, + conflict_handler: no_default + }) + + this.description = description + this.argument_default = argument_default + this.prefix_chars = prefix_chars + this.conflict_handler = conflict_handler + + // set up registries + this._registries = {} + + // register actions + this.register('action', undefined, _StoreAction) + this.register('action', 'store', _StoreAction) + this.register('action', 'store_const', _StoreConstAction) + this.register('action', 'store_true', _StoreTrueAction) + this.register('action', 'store_false', _StoreFalseAction) + this.register('action', 'append', _AppendAction) + this.register('action', 'append_const', _AppendConstAction) + this.register('action', 'count', _CountAction) + this.register('action', 'help', _HelpAction) + this.register('action', 'version', _VersionAction) + this.register('action', 'parsers', _SubParsersAction) + this.register('action', 'extend', _ExtendAction) + // LEGACY (v1 compatibility): camelcase variants + ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => { + let new_name = _to_new_name(old_name) + this.register('action', old_name, util.deprecate(this._registry_get('action', new_name), + sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name))) + }) + // end + + // raise an exception if the conflict handler is invalid + this._get_handler() + + // action storage + this._actions = [] + this._option_string_actions = {} + + // groups + this._action_groups = [] + this._mutually_exclusive_groups = [] + + // defaults storage + this._defaults = {} + + // determines whether an "option" looks like a negative number + this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/ + + // whether or not there are any optionals that look like negative + // numbers -- uses a list so it can be shared and edited + this._has_negative_number_optionals = [] + } + + // ==================== + // Registration methods + // ==================== + register(registry_name, value, object) { + let registry = setdefault(this._registries, registry_name, {}) + registry[value] = object + } + + _registry_get(registry_name, value, default_value = undefined) { + return getattr(this._registries[registry_name], value, default_value) + } + + // ================================== + // Namespace default accessor methods + // ================================== + set_defaults(kwargs) { + Object.assign(this._defaults, kwargs) + + // if these defaults match any existing arguments, replace + // the previous default on the object with the new one + for (let action of this._actions) { + if (action.dest in kwargs) { + action.default = kwargs[action.dest] + } + } + } + + get_default(dest) { + for (let action of this._actions) { + if (action.dest === dest && action.default !== undefined) { + return action.default + } + } + return this._defaults[dest] + } + + + // ======================= + // Adding argument actions + // ======================= + add_argument() { + /* + * add_argument(dest, ..., name=value, ...) + * add_argument(option_string, option_string, ..., name=value, ...) + */ + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + // LEGACY (v1 compatibility), old-style add_argument([ args ], { options }) + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + deprecate('argument-array', + sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', { + args: args.map(repr).join(', ') + })) + } + // end + + // if no positional args are supplied or only one is supplied and + // it doesn't look like an option string, parse a positional + // argument + let chars = this.prefix_chars + if (!args.length || args.length === 1 && !chars.includes(args[0][0])) { + if (args.length && 'dest' in kwargs) { + throw new TypeError('dest supplied twice for positional argument') + } + kwargs = this._get_positional_kwargs(...args, kwargs) + + // otherwise, we're adding an optional argument + } else { + kwargs = this._get_optional_kwargs(...args, kwargs) + } + + // if no default was supplied, use the parser-level default + if (!('default' in kwargs)) { + let dest = kwargs.dest + if (dest in this._defaults) { + kwargs.default = this._defaults[dest] + } else if (this.argument_default !== undefined) { + kwargs.default = this.argument_default + } + } + + // create the action object, and add it to the parser + let action_class = this._pop_action_class(kwargs) + if (typeof action_class !== 'function') { + throw new TypeError(sub('unknown action "%s"', action_class)) + } + // eslint-disable-next-line new-cap + let action = new action_class(kwargs) + + // raise an error if the action type is not callable + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + throw new TypeError(sub('%r is not callable', type_func)) + } + + if (type_func === FileType) { + throw new TypeError(sub('%r is a FileType class object, instance of it' + + ' must be passed', type_func)) + } + + // raise an error if the metavar does not match the type + if ('_get_formatter' in this) { + try { + this._get_formatter()._format_args(action, undefined) + } catch (err) { + // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same + if (err instanceof TypeError && err.message !== 'invalid nargs value') { + throw new TypeError('length of metavar tuple does not match nargs') + } else { + throw err + } + } + } + + return this._add_action(action) + } + + add_argument_group() { + let group = _ArgumentGroup(this, ...arguments) + this._action_groups.push(group) + return group + } + + add_mutually_exclusive_group() { + // eslint-disable-next-line no-use-before-define + let group = _MutuallyExclusiveGroup(this, ...arguments) + this._mutually_exclusive_groups.push(group) + return group + } + + _add_action(action) { + // resolve any conflicts + this._check_conflict(action) + + // add to actions list + this._actions.push(action) + action.container = this + + // index the action by any option strings it has + for (let option_string of action.option_strings) { + this._option_string_actions[option_string] = action + } + + // set the flag if any option strings look like negative numbers + for (let option_string of action.option_strings) { + if (this._negative_number_matcher.test(option_string)) { + if (!this._has_negative_number_optionals.length) { + this._has_negative_number_optionals.push(true) + } + } + } + + // return the created action + return action + } + + _remove_action(action) { + _array_remove(this._actions, action) + } + + _add_container_actions(container) { + // collect groups by titles + let title_group_map = {} + for (let group of this._action_groups) { + if (group.title in title_group_map) { + let msg = 'cannot merge actions - two groups are named %r' + throw new TypeError(sub(msg, group.title)) + } + title_group_map[group.title] = group + } + + // map each action to its group + let group_map = new Map() + for (let group of container._action_groups) { + + // if a group with the title exists, use that, otherwise + // create a new group matching the container's group + if (!(group.title in title_group_map)) { + title_group_map[group.title] = this.add_argument_group({ + title: group.title, + description: group.description, + conflict_handler: group.conflict_handler + }) + } + + // map the actions to their new group + for (let action of group._group_actions) { + group_map.set(action, title_group_map[group.title]) + } + } + + // add container's mutually exclusive groups + // NOTE: if add_mutually_exclusive_group ever gains title= and + // description= then this code will need to be expanded as above + for (let group of container._mutually_exclusive_groups) { + let mutex_group = this.add_mutually_exclusive_group({ + required: group.required + }) + + // map the actions to their new mutex group + for (let action of group._group_actions) { + group_map.set(action, mutex_group) + } + } + + // add all actions to this container or their group + for (let action of container._actions) { + group_map.get(action)._add_action(action) + } + } + + _get_positional_kwargs() { + let [ + dest, + kwargs + ] = _parse_opts(arguments, { + dest: no_default, + '**kwargs': no_default + }) + + // make sure required is not specified + if ('required' in kwargs) { + let msg = "'required' is an invalid argument for positionals" + throw new TypeError(msg) + } + + // mark positional arguments as required if at least one is + // always required + if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) { + kwargs.required = true + } + if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) { + kwargs.required = true + } + + // return the keyword arguments with no option strings + return Object.assign(kwargs, { dest, option_strings: [] }) + } + + _get_optional_kwargs() { + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + + // determine short and long option strings + let option_strings = [] + let long_option_strings = [] + let option_string + for (option_string of args) { + // error on strings that don't start with an appropriate prefix + if (!this.prefix_chars.includes(option_string[0])) { + let args = {option: option_string, + prefix_chars: this.prefix_chars} + let msg = 'invalid option string %(option)r: ' + + 'must start with a character %(prefix_chars)r' + throw new TypeError(sub(msg, args)) + } + + // strings starting with two prefix characters are long options + option_strings.push(option_string) + if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) { + long_option_strings.push(option_string) + } + } + + // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' + let dest = kwargs.dest + delete kwargs.dest + if (dest === undefined) { + let dest_option_string + if (long_option_strings.length) { + dest_option_string = long_option_strings[0] + } else { + dest_option_string = option_strings[0] + } + dest = _string_lstrip(dest_option_string, this.prefix_chars) + if (!dest) { + let msg = 'dest= is required for options like %r' + throw new TypeError(sub(msg, option_string)) + } + dest = dest.replace(/-/g, '_') + } + + // return the updated keyword arguments + return Object.assign(kwargs, { dest, option_strings }) + } + + _pop_action_class(kwargs, default_value = undefined) { + let action = getattr(kwargs, 'action', default_value) + delete kwargs.action + return this._registry_get('action', action, action) + } + + _get_handler() { + // determine function from conflict handler string + let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler) + if (typeof this[handler_func_name] === 'function') { + return this[handler_func_name] + } else { + let msg = 'invalid conflict_resolution value: %r' + throw new TypeError(sub(msg, this.conflict_handler)) + } + } + + _check_conflict(action) { + + // find all options that conflict with this option + let confl_optionals = [] + for (let option_string of action.option_strings) { + if (hasattr(this._option_string_actions, option_string)) { + let confl_optional = this._option_string_actions[option_string] + confl_optionals.push([ option_string, confl_optional ]) + } + } + + // resolve any conflicts + if (confl_optionals.length) { + let conflict_handler = this._get_handler() + conflict_handler.call(this, action, confl_optionals) + } + } + + _handle_conflict_error(action, conflicting_actions) { + let message = conflicting_actions.length === 1 ? + 'conflicting option string: %s' : + 'conflicting option strings: %s' + let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ') + throw new ArgumentError(action, sub(message, conflict_string)) + } + + _handle_conflict_resolve(action, conflicting_actions) { + + // remove all conflicting options + for (let [ option_string, action ] of conflicting_actions) { + + // remove the conflicting option + _array_remove(action.option_strings, option_string) + delete this._option_string_actions[option_string] + + // if the option now has no option string, remove it from the + // container holding it + if (!action.option_strings.length) { + action.container._remove_action(action) + } + } + } +})) + + +const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer { + + constructor() { + let [ + container, + title, + description, + kwargs + ] = _parse_opts(arguments, { + container: no_default, + title: undefined, + description: undefined, + '**kwargs': no_default + }) + + // add any missing keyword arguments by checking the container + setdefault(kwargs, 'conflict_handler', container.conflict_handler) + setdefault(kwargs, 'prefix_chars', container.prefix_chars) + setdefault(kwargs, 'argument_default', container.argument_default) + super(Object.assign({ description }, kwargs)) + + // group attributes + this.title = title + this._group_actions = [] + + // share most attributes with the container + this._registries = container._registries + this._actions = container._actions + this._option_string_actions = container._option_string_actions + this._defaults = container._defaults + this._has_negative_number_optionals = + container._has_negative_number_optionals + this._mutually_exclusive_groups = container._mutually_exclusive_groups + } + + _add_action(action) { + action = super._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + super._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup { + + constructor() { + let [ + container, + required + ] = _parse_opts(arguments, { + container: no_default, + required: false + }) + + super(container) + this.required = required + this._container = container + } + + _add_action(action) { + if (action.required) { + let msg = 'mutually exclusive arguments must be optional' + throw new TypeError(msg) + } + action = this._container._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + this._container._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) { + /* + * Object for parsing command line strings into Python objects. + * + * Keyword Arguments: + * - prog -- The name of the program (default: sys.argv[0]) + * - usage -- A usage message (default: auto-generated from arguments) + * - description -- A description of what the program does + * - epilog -- Text following the argument descriptions + * - parents -- Parsers whose arguments should be copied into this one + * - formatter_class -- HelpFormatter class for printing help messages + * - prefix_chars -- Characters that prefix optional arguments + * - fromfile_prefix_chars -- Characters that prefix files containing + * additional arguments + * - argument_default -- The default value for all arguments + * - conflict_handler -- String indicating how to handle conflicts + * - add_help -- Add a -h/-help option + * - allow_abbrev -- Allow long options to be abbreviated unambiguously + * - exit_on_error -- Determines whether or not ArgumentParser exits with + * error info when an error occurs + */ + + constructor() { + let [ + prog, + usage, + description, + epilog, + parents, + formatter_class, + prefix_chars, + fromfile_prefix_chars, + argument_default, + conflict_handler, + add_help, + allow_abbrev, + exit_on_error, + debug, // LEGACY (v1 compatibility), debug mode + version // LEGACY (v1 compatibility), version + ] = _parse_opts(arguments, { + prog: undefined, + usage: undefined, + description: undefined, + epilog: undefined, + parents: [], + formatter_class: HelpFormatter, + prefix_chars: '-', + fromfile_prefix_chars: undefined, + argument_default: undefined, + conflict_handler: 'error', + add_help: true, + allow_abbrev: true, + exit_on_error: true, + debug: undefined, // LEGACY (v1 compatibility), debug mode + version: undefined // LEGACY (v1 compatibility), version + }) + + // LEGACY (v1 compatibility) + if (debug !== undefined) { + deprecate('debug', + 'The "debug" argument to ArgumentParser is deprecated. Please ' + + 'override ArgumentParser.exit function instead.' + ) + } + + if (version !== undefined) { + deprecate('version', + 'The "version" argument to ArgumentParser is deprecated. Please use ' + + "add_argument(..., { action: 'version', version: 'N', ... }) instead." + ) + } + // end + + super({ + description, + prefix_chars, + argument_default, + conflict_handler + }) + + // default setting for prog + if (prog === undefined) { + prog = path.basename(get_argv()[0] || '') + } + + this.prog = prog + this.usage = usage + this.epilog = epilog + this.formatter_class = formatter_class + this.fromfile_prefix_chars = fromfile_prefix_chars + this.add_help = add_help + this.allow_abbrev = allow_abbrev + this.exit_on_error = exit_on_error + // LEGACY (v1 compatibility), debug mode + this.debug = debug + // end + + this._positionals = this.add_argument_group('positional arguments') + this._optionals = this.add_argument_group('optional arguments') + this._subparsers = undefined + + // register types + function identity(string) { + return string + } + this.register('type', undefined, identity) + this.register('type', null, identity) + this.register('type', 'auto', identity) + this.register('type', 'int', function (x) { + let result = Number(x) + if (!Number.isInteger(result)) { + throw new TypeError(sub('could not convert string to int: %r', x)) + } + return result + }) + this.register('type', 'float', function (x) { + let result = Number(x) + if (isNaN(result)) { + throw new TypeError(sub('could not convert string to float: %r', x)) + } + return result + }) + this.register('type', 'str', String) + // LEGACY (v1 compatibility): custom types + this.register('type', 'string', + util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')) + // end + + // add help argument if necessary + // (using explicit default to override global argument_default) + let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0] + if (this.add_help) { + this.add_argument( + default_prefix + 'h', + default_prefix.repeat(2) + 'help', + { + action: 'help', + default: SUPPRESS, + help: 'show this help message and exit' + } + ) + } + // LEGACY (v1 compatibility), version + if (version) { + this.add_argument( + default_prefix + 'v', + default_prefix.repeat(2) + 'version', + { + action: 'version', + default: SUPPRESS, + version: this.version, + help: "show program's version number and exit" + } + ) + } + // end + + // add parent arguments and defaults + for (let parent of parents) { + this._add_container_actions(parent) + Object.assign(this._defaults, parent._defaults) + } + } + + // ======================= + // Pretty __repr__ methods + // ======================= + _get_kwargs() { + let names = [ + 'prog', + 'usage', + 'description', + 'formatter_class', + 'conflict_handler', + 'add_help' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + // ================================== + // Optional/Positional adding methods + // ================================== + add_subparsers() { + let [ + kwargs + ] = _parse_opts(arguments, { + '**kwargs': no_default + }) + + if (this._subparsers !== undefined) { + this.error('cannot have multiple subparser arguments') + } + + // add the parser class to the arguments if it's not present + setdefault(kwargs, 'parser_class', this.constructor) + + if ('title' in kwargs || 'description' in kwargs) { + let title = getattr(kwargs, 'title', 'subcommands') + let description = getattr(kwargs, 'description', undefined) + delete kwargs.title + delete kwargs.description + this._subparsers = this.add_argument_group(title, description) + } else { + this._subparsers = this._positionals + } + + // prog defaults to the usage message of this parser, skipping + // optional arguments and with no "usage:" prefix + if (kwargs.prog === undefined) { + let formatter = this._get_formatter() + let positionals = this._get_positional_actions() + let groups = this._mutually_exclusive_groups + formatter.add_usage(this.usage, positionals, groups, '') + kwargs.prog = formatter.format_help().trim() + } + + // create the parsers action and add it to the positionals list + let parsers_class = this._pop_action_class(kwargs, 'parsers') + // eslint-disable-next-line new-cap + let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs)) + this._subparsers._add_action(action) + + // return the created parsers action + return action + } + + _add_action(action) { + if (action.option_strings.length) { + this._optionals._add_action(action) + } else { + this._positionals._add_action(action) + } + return action + } + + _get_optional_actions() { + return this._actions.filter(action => action.option_strings.length) + } + + _get_positional_actions() { + return this._actions.filter(action => !action.option_strings.length) + } + + // ===================================== + // Command line argument parsing methods + // ===================================== + parse_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_args(args, namespace) + if (argv && argv.length > 0) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_args(args = undefined, namespace = undefined) { + if (args === undefined) { + args = get_argv().slice(1) + } + + // default Namespace built from parser defaults + if (namespace === undefined) { + namespace = new Namespace() + } + + // add any action defaults that aren't present + for (let action of this._actions) { + if (action.dest !== SUPPRESS) { + if (!hasattr(namespace, action.dest)) { + if (action.default !== SUPPRESS) { + setattr(namespace, action.dest, action.default) + } + } + } + } + + // add any parser defaults that aren't present + for (let dest of Object.keys(this._defaults)) { + if (!hasattr(namespace, dest)) { + setattr(namespace, dest, this._defaults[dest]) + } + } + + // parse the arguments and exit if there are any errors + if (this.exit_on_error) { + try { + [ namespace, args ] = this._parse_known_args(args, namespace) + } catch (err) { + if (err instanceof ArgumentError) { + this.error(err.message) + } else { + throw err + } + } + } else { + [ namespace, args ] = this._parse_known_args(args, namespace) + } + + if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) { + args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) + delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) + } + + return [ namespace, args ] + } + + _parse_known_args(arg_strings, namespace) { + // replace arg strings that are file references + if (this.fromfile_prefix_chars !== undefined) { + arg_strings = this._read_args_from_files(arg_strings) + } + + // map all mutually exclusive arguments to the other arguments + // they can't occur with + let action_conflicts = new Map() + for (let mutex_group of this._mutually_exclusive_groups) { + let group_actions = mutex_group._group_actions + for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) { + let conflicts = action_conflicts.get(mutex_action) || [] + conflicts = conflicts.concat(group_actions.slice(0, +i)) + conflicts = conflicts.concat(group_actions.slice(+i + 1)) + action_conflicts.set(mutex_action, conflicts) + } + } + + // find all option indices, and determine the arg_string_pattern + // which has an 'O' if there is an option at an index, + // an 'A' if there is an argument, or a '-' if there is a '--' + let option_string_indices = {} + let arg_string_pattern_parts = [] + let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]() + for (let [ i, arg_string ] of arg_strings_iter) { + + // all args after -- are non-options + if (arg_string === '--') { + arg_string_pattern_parts.push('-') + for ([ i, arg_string ] of arg_strings_iter) { + arg_string_pattern_parts.push('A') + } + + // otherwise, add the arg to the arg strings + // and note the index if it was an option + } else { + let option_tuple = this._parse_optional(arg_string) + let pattern + if (option_tuple === undefined) { + pattern = 'A' + } else { + option_string_indices[i] = option_tuple + pattern = 'O' + } + arg_string_pattern_parts.push(pattern) + } + } + + // join the pieces together to form the pattern + let arg_strings_pattern = arg_string_pattern_parts.join('') + + // converts arg strings to the appropriate and then takes the action + let seen_actions = new Set() + let seen_non_default_actions = new Set() + let extras + + let take_action = (action, argument_strings, option_string = undefined) => { + seen_actions.add(action) + let argument_values = this._get_values(action, argument_strings) + + // error if this argument is not allowed with other previously + // seen arguments, assuming that actions that use the default + // value don't really count as "present" + if (argument_values !== action.default) { + seen_non_default_actions.add(action) + for (let conflict_action of action_conflicts.get(action) || []) { + if (seen_non_default_actions.has(conflict_action)) { + let msg = 'not allowed with argument %s' + let action_name = _get_action_name(conflict_action) + throw new ArgumentError(action, sub(msg, action_name)) + } + } + } + + // take the action if we didn't receive a SUPPRESS value + // (e.g. from a default) + if (argument_values !== SUPPRESS) { + action(this, namespace, argument_values, option_string) + } + } + + // function to convert arg_strings into an optional action + let consume_optional = start_index => { + + // get the optional identified at this index + let option_tuple = option_string_indices[start_index] + let [ action, option_string, explicit_arg ] = option_tuple + + // identify additional optionals in the same arg string + // (e.g. -xyz is the same as -x -y -z if no args are required) + let action_tuples = [] + let stop + for (;;) { + + // if we found no optional action, skip it + if (action === undefined) { + extras.push(arg_strings[start_index]) + return start_index + 1 + } + + // if there is an explicit argument, try to match the + // optional's string arguments to only this + if (explicit_arg !== undefined) { + let arg_count = this._match_argument(action, 'A') + + // if the action is a single-dash option and takes no + // arguments, try to parse more single-dash options out + // of the tail of the option string + let chars = this.prefix_chars + if (arg_count === 0 && !chars.includes(option_string[1])) { + action_tuples.push([ action, [], option_string ]) + let char = option_string[0] + option_string = char + explicit_arg[0] + let new_explicit_arg = explicit_arg.slice(1) || undefined + let optionals_map = this._option_string_actions + if (hasattr(optionals_map, option_string)) { + action = optionals_map[option_string] + explicit_arg = new_explicit_arg + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if the action expect exactly one argument, we've + // successfully matched the option; exit the loop + } else if (arg_count === 1) { + stop = start_index + 1 + let args = [ explicit_arg ] + action_tuples.push([ action, args, option_string ]) + break + + // error if a double-dash option did not use the + // explicit argument + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if there is no explicit argument, try to match the + // optional's string arguments with the following strings + // if successful, exit the loop + } else { + let start = start_index + 1 + let selected_patterns = arg_strings_pattern.slice(start) + let arg_count = this._match_argument(action, selected_patterns) + stop = start + arg_count + let args = arg_strings.slice(start, stop) + action_tuples.push([ action, args, option_string ]) + break + } + } + + // add the Optional to the list and return the index at which + // the Optional's string args stopped + assert(action_tuples.length) + for (let [ action, args, option_string ] of action_tuples) { + take_action(action, args, option_string) + } + return stop + } + + // the list of Positionals left to be parsed; this is modified + // by consume_positionals() + let positionals = this._get_positional_actions() + + // function to convert arg_strings into positional actions + let consume_positionals = start_index => { + // match as many Positionals as possible + let selected_pattern = arg_strings_pattern.slice(start_index) + let arg_counts = this._match_arguments_partial(positionals, selected_pattern) + + // slice off the appropriate arg strings for each Positional + // and add the Positional and its args to the list + for (let i = 0; i < positionals.length && i < arg_counts.length; i++) { + let action = positionals[i] + let arg_count = arg_counts[i] + let args = arg_strings.slice(start_index, start_index + arg_count) + start_index += arg_count + take_action(action, args) + } + + // slice off the Positionals that we just parsed and return the + // index at which the Positionals' string args stopped + positionals = positionals.slice(arg_counts.length) + return start_index + } + + // consume Positionals and Optionals alternately, until we have + // passed the last option string + extras = [] + let start_index = 0 + let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number)) + while (start_index <= max_option_string_index) { + + // consume any Positionals preceding the next option + let next_option_string_index = Math.min( + // eslint-disable-next-line no-loop-func + ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index) + ) + if (start_index !== next_option_string_index) { + let positionals_end_index = consume_positionals(start_index) + + // only try to parse the next optional if we didn't consume + // the option string during the positionals parsing + if (positionals_end_index > start_index) { + start_index = positionals_end_index + continue + } else { + start_index = positionals_end_index + } + } + + // if we consumed all the positionals we could and we're not + // at the index of an option string, there were extra arguments + if (!(start_index in option_string_indices)) { + let strings = arg_strings.slice(start_index, next_option_string_index) + extras = extras.concat(strings) + start_index = next_option_string_index + } + + // consume the next optional and any arguments for it + start_index = consume_optional(start_index) + } + + // consume any positionals following the last Optional + let stop_index = consume_positionals(start_index) + + // if we didn't consume all the argument strings, there were extras + extras = extras.concat(arg_strings.slice(stop_index)) + + // make sure all required actions were present and also convert + // action defaults which were not given as arguments + let required_actions = [] + for (let action of this._actions) { + if (!seen_actions.has(action)) { + if (action.required) { + required_actions.push(_get_action_name(action)) + } else { + // Convert action default now instead of doing it before + // parsing arguments to avoid calling convert functions + // twice (which may fail) if the argument was given, but + // only if it was defined already in the namespace + if (action.default !== undefined && + typeof action.default === 'string' && + hasattr(namespace, action.dest) && + action.default === getattr(namespace, action.dest)) { + setattr(namespace, action.dest, + this._get_value(action, action.default)) + } + } + } + } + + if (required_actions.length) { + this.error(sub('the following arguments are required: %s', + required_actions.join(', '))) + } + + // make sure all required groups had one option present + for (let group of this._mutually_exclusive_groups) { + if (group.required) { + let no_actions_used = true + for (let action of group._group_actions) { + if (seen_non_default_actions.has(action)) { + no_actions_used = false + break + } + } + + // if no actions were used, report the error + if (no_actions_used) { + let names = group._group_actions + .filter(action => action.help !== SUPPRESS) + .map(action => _get_action_name(action)) + let msg = 'one of the arguments %s is required' + this.error(sub(msg, names.join(' '))) + } + } + } + + // return the updated namespace and the extra arguments + return [ namespace, extras ] + } + + _read_args_from_files(arg_strings) { + // expand arguments referencing files + let new_arg_strings = [] + for (let arg_string of arg_strings) { + + // for regular arguments, just add them back into the list + if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) { + new_arg_strings.push(arg_string) + + // replace arguments referencing files with the file content + } else { + try { + let args_file = fs.readFileSync(arg_string.slice(1), 'utf8') + let arg_strings = [] + for (let arg_line of splitlines(args_file)) { + for (let arg of this.convert_arg_line_to_args(arg_line)) { + arg_strings.push(arg) + } + } + arg_strings = this._read_args_from_files(arg_strings) + new_arg_strings = new_arg_strings.concat(arg_strings) + } catch (err) { + this.error(err.message) + } + } + } + + // return the modified argument list + return new_arg_strings + } + + convert_arg_line_to_args(arg_line) { + return [arg_line] + } + + _match_argument(action, arg_strings_pattern) { + // match the pattern for this action to the arg strings + let nargs_pattern = this._get_nargs_pattern(action) + let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern)) + + // raise an exception if we weren't able to find a match + if (match === null) { + let nargs_errors = { + undefined: 'expected one argument', + [OPTIONAL]: 'expected at most one argument', + [ONE_OR_MORE]: 'expected at least one argument' + } + let msg = nargs_errors[action.nargs] + if (msg === undefined) { + msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs) + } + throw new ArgumentError(action, msg) + } + + // return the number of arguments matched + return match[1].length + } + + _match_arguments_partial(actions, arg_strings_pattern) { + // progressively shorten the actions list by slicing off the + // final actions until we find a match + let result = [] + for (let i of range(actions.length, 0, -1)) { + let actions_slice = actions.slice(0, i) + let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('') + let match = arg_strings_pattern.match(new RegExp('^' + pattern)) + if (match !== null) { + result = result.concat(match.slice(1).map(string => string.length)) + break + } + } + + // return the list of arg string counts + return result + } + + _parse_optional(arg_string) { + // if it's an empty string, it was meant to be a positional + if (!arg_string) { + return undefined + } + + // if it doesn't start with a prefix, it was meant to be positional + if (!this.prefix_chars.includes(arg_string[0])) { + return undefined + } + + // if the option string is present in the parser, return the action + if (arg_string in this._option_string_actions) { + let action = this._option_string_actions[arg_string] + return [ action, arg_string, undefined ] + } + + // if it's just a single character, it was meant to be positional + if (arg_string.length === 1) { + return undefined + } + + // if the option string before the "=" is present, return the action + if (arg_string.includes('=')) { + let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1) + if (option_string in this._option_string_actions) { + let action = this._option_string_actions[option_string] + return [ action, option_string, explicit_arg ] + } + } + + // search through all possible prefixes of the option string + // and all actions in the parser for possible interpretations + let option_tuples = this._get_option_tuples(arg_string) + + // if multiple actions match, the option string was ambiguous + if (option_tuples.length > 1) { + let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ') + let args = {option: arg_string, matches: options} + let msg = 'ambiguous option: %(option)s could match %(matches)s' + this.error(sub(msg, args)) + + // if exactly one action matched, this segmentation is good, + // so return the parsed action + } else if (option_tuples.length === 1) { + let [ option_tuple ] = option_tuples + return option_tuple + } + + // if it was not found as an option, but it looks like a negative + // number, it was meant to be positional + // unless there are negative-number-like options + if (this._negative_number_matcher.test(arg_string)) { + if (!this._has_negative_number_optionals.length) { + return undefined + } + } + + // if it contains a space, it was meant to be a positional + if (arg_string.includes(' ')) { + return undefined + } + + // it was meant to be an optional but there is no such option + // in this parser (though it might be a valid option in a subparser) + return [ undefined, arg_string, undefined ] + } + + _get_option_tuples(option_string) { + let result = [] + + // option strings starting with two prefix characters are only + // split at the '=' + let chars = this.prefix_chars + if (chars.includes(option_string[0]) && chars.includes(option_string[1])) { + if (this.allow_abbrev) { + let option_prefix, explicit_arg + if (option_string.includes('=')) { + [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1) + } else { + option_prefix = option_string + explicit_arg = undefined + } + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + } + + // single character options can be concatenated with their arguments + // but multiple character options always have to have their argument + // separate + } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) { + let option_prefix = option_string + let explicit_arg = undefined + let short_option_prefix = option_string.slice(0, 2) + let short_explicit_arg = option_string.slice(2) + + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string === short_option_prefix) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, short_explicit_arg ] + result.push(tup) + } else if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + + // shouldn't ever get here + } else { + this.error(sub('unexpected option string: %s', option_string)) + } + + // return the collected option tuples + return result + } + + _get_nargs_pattern(action) { + // in all examples below, we have to allow for '--' args + // which are represented as '-' in the pattern + let nargs = action.nargs + let nargs_pattern + + // the default (None) is assumed to be a single argument + if (nargs === undefined) { + nargs_pattern = '(-*A-*)' + + // allow zero or one arguments + } else if (nargs === OPTIONAL) { + nargs_pattern = '(-*A?-*)' + + // allow zero or more arguments + } else if (nargs === ZERO_OR_MORE) { + nargs_pattern = '(-*[A-]*)' + + // allow one or more arguments + } else if (nargs === ONE_OR_MORE) { + nargs_pattern = '(-*A[A-]*)' + + // allow any number of options or arguments + } else if (nargs === REMAINDER) { + nargs_pattern = '([-AO]*)' + + // allow one argument followed by any number of options or arguments + } else if (nargs === PARSER) { + nargs_pattern = '(-*A[-AO]*)' + + // suppress action, like nargs=0 + } else if (nargs === SUPPRESS) { + nargs_pattern = '(-*-*)' + + // all others should be integers + } else { + nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*')) + } + + // if this is an optional action, -- is not allowed + if (action.option_strings.length) { + nargs_pattern = nargs_pattern.replace(/-\*/g, '') + nargs_pattern = nargs_pattern.replace(/-/g, '') + } + + // return the pattern + return nargs_pattern + } + + // ======================== + // Alt command line argument parsing, allowing free intermix + // ======================== + + parse_intermixed_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_intermixed_args(args, namespace) + if (argv.length) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_intermixed_args(args = undefined, namespace = undefined) { + // returns a namespace and list of extras + // + // positional can be freely intermixed with optionals. optionals are + // first parsed with all positional arguments deactivated. The 'extras' + // are then parsed. If the parser definition is incompatible with the + // intermixed assumptions (e.g. use of REMAINDER, subparsers) a + // TypeError is raised. + // + // positionals are 'deactivated' by setting nargs and default to + // SUPPRESS. This blocks the addition of that positional to the + // namespace + + let extras + let positionals = this._get_positional_actions() + let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs)) + if (a.length) { + throw new TypeError(sub('parse_intermixed_args: positional arg' + + ' with nargs=%s', a[0].nargs)) + } + + for (let group of this._mutually_exclusive_groups) { + for (let action of group._group_actions) { + if (positionals.includes(action)) { + throw new TypeError('parse_intermixed_args: positional in' + + ' mutuallyExclusiveGroup') + } + } + } + + let save_usage + try { + save_usage = this.usage + let remaining_args + try { + if (this.usage === undefined) { + // capture the full usage for use in error messages + this.usage = this.format_usage().slice(7) + } + for (let action of positionals) { + // deactivate positionals + action.save_nargs = action.nargs + // action.nargs = 0 + action.nargs = SUPPRESS + action.save_default = action.default + action.default = SUPPRESS + } + [ namespace, remaining_args ] = this.parse_known_args(args, + namespace) + for (let action of positionals) { + // remove the empty positional values from namespace + let attr = getattr(namespace, action.dest) + if (Array.isArray(attr) && attr.length === 0) { + // eslint-disable-next-line no-console + console.warn(sub('Do not expect %s in %s', action.dest, namespace)) + delattr(namespace, action.dest) + } + } + } finally { + // restore nargs and usage before exiting + for (let action of positionals) { + action.nargs = action.save_nargs + action.default = action.save_default + } + } + let optionals = this._get_optional_actions() + try { + // parse positionals. optionals aren't normally required, but + // they could be, so make sure they aren't. + for (let action of optionals) { + action.save_required = action.required + action.required = false + } + for (let group of this._mutually_exclusive_groups) { + group.save_required = group.required + group.required = false + } + [ namespace, extras ] = this.parse_known_args(remaining_args, + namespace) + } finally { + // restore parser values before exiting + for (let action of optionals) { + action.required = action.save_required + } + for (let group of this._mutually_exclusive_groups) { + group.required = group.save_required + } + } + } finally { + this.usage = save_usage + } + return [ namespace, extras ] + } + + // ======================== + // Value conversion methods + // ======================== + _get_values(action, arg_strings) { + // for everything but PARSER, REMAINDER args, strip out first '--' + if (![PARSER, REMAINDER].includes(action.nargs)) { + try { + _array_remove(arg_strings, '--') + } catch (err) {} + } + + let value + // optional argument produces a default when not present + if (!arg_strings.length && action.nargs === OPTIONAL) { + if (action.option_strings.length) { + value = action.const + } else { + value = action.default + } + if (typeof value === 'string') { + value = this._get_value(action, value) + this._check_value(action, value) + } + + // when nargs='*' on a positional, if there were no command-line + // args, use the default if it is anything other than None + } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE && + !action.option_strings.length) { + if (action.default !== undefined) { + value = action.default + } else { + value = arg_strings + } + this._check_value(action, value) + + // single argument or optional argument produces a single value + } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) { + let arg_string = arg_strings[0] + value = this._get_value(action, arg_string) + this._check_value(action, value) + + // REMAINDER arguments convert all values, checking none + } else if (action.nargs === REMAINDER) { + value = arg_strings.map(v => this._get_value(action, v)) + + // PARSER arguments convert all values, but check only the first + } else if (action.nargs === PARSER) { + value = arg_strings.map(v => this._get_value(action, v)) + this._check_value(action, value[0]) + + // SUPPRESS argument does not put anything in the namespace + } else if (action.nargs === SUPPRESS) { + value = SUPPRESS + + // all other types of nargs produce a list + } else { + value = arg_strings.map(v => this._get_value(action, v)) + for (let v of value) { + this._check_value(action, v) + } + } + + // return the converted value + return value + } + + _get_value(action, arg_string) { + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + let msg = '%r is not callable' + throw new ArgumentError(action, sub(msg, type_func)) + } + + // convert the value to the appropriate type + let result + try { + try { + result = type_func(arg_string) + } catch (err) { + // Dear TC39, why would you ever consider making es6 classes not callable? + // We had one universal interface, [[Call]], which worked for anything + // (with familiar this-instanceof guard for classes). Now we have two. + if (err instanceof TypeError && + /Class constructor .* cannot be invoked without 'new'/.test(err.message)) { + // eslint-disable-next-line new-cap + result = new type_func(arg_string) + } else { + throw err + } + } + + } catch (err) { + // ArgumentTypeErrors indicate errors + if (err instanceof ArgumentTypeError) { + //let name = getattr(action.type, 'name', repr(action.type)) + let msg = err.message + throw new ArgumentError(action, msg) + + // TypeErrors or ValueErrors also indicate errors + } else if (err instanceof TypeError) { + let name = getattr(action.type, 'name', repr(action.type)) + let args = {type: name, value: arg_string} + let msg = 'invalid %(type)s value: %(value)r' + throw new ArgumentError(action, sub(msg, args)) + } else { + throw err + } + } + + // return the converted value + return result + } + + _check_value(action, value) { + // converted value must be one of the choices (if specified) + if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) { + let args = {value, + choices: _choices_to_array(action.choices).map(repr).join(', ')} + let msg = 'invalid choice: %(value)r (choose from %(choices)s)' + throw new ArgumentError(action, sub(msg, args)) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_usage() { + let formatter = this._get_formatter() + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + return formatter.format_help() + } + + format_help() { + let formatter = this._get_formatter() + + // usage + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + + // description + formatter.add_text(this.description) + + // positionals, optionals and user-defined groups + for (let action_group of this._action_groups) { + formatter.start_section(action_group.title) + formatter.add_text(action_group.description) + formatter.add_arguments(action_group._group_actions) + formatter.end_section() + } + + // epilog + formatter.add_text(this.epilog) + + // determine help from format above + return formatter.format_help() + } + + _get_formatter() { + // eslint-disable-next-line new-cap + return new this.formatter_class({ prog: this.prog }) + } + + // ===================== + // Help-printing methods + // ===================== + print_usage(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_usage(), file) + } + + print_help(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_help(), file) + } + + _print_message(message, file = undefined) { + if (message) { + if (file === undefined) file = process.stderr + file.write(message) + } + } + + // =============== + // Exiting methods + // =============== + exit(status = 0, message = undefined) { + if (message) { + this._print_message(message, process.stderr) + } + process.exit(status) + } + + error(message) { + /* + * error(message: string) + * + * Prints a usage message incorporating the message to stderr and + * exits. + * + * If you override this in a subclass, it should not return -- it + * should either exit or raise an exception. + */ + + // LEGACY (v1 compatibility), debug mode + if (this.debug === true) throw new Error(message) + // end + this.print_usage(process.stderr) + let args = {prog: this.prog, message: message} + this.exit(2, sub('%(prog)s: error: %(message)s\n', args)) + } +})) + + +module.exports = { + ArgumentParser, + ArgumentError, + ArgumentTypeError, + BooleanOptionalAction, + FileType, + HelpFormatter, + ArgumentDefaultsHelpFormatter, + RawDescriptionHelpFormatter, + RawTextHelpFormatter, + MetavarTypeHelpFormatter, + Namespace, + Action, + ONE_OR_MORE, + OPTIONAL, + PARSER, + REMAINDER, + SUPPRESS, + ZERO_OR_MORE +} + +// LEGACY (v1 compatibility), Const alias +Object.defineProperty(module.exports, 'Const', { + get() { + let result = {} + Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n)) + return v + } + }) + }) + Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n)) + return v + } + }) + }) + return result + }, + enumerable: false +}) +// end diff --git a/node_modules/eslint/node_modules/argparse/lib/sub.js b/node_modules/eslint/node_modules/argparse/lib/sub.js new file mode 100644 index 000000000..e3eb3215f --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/lib/sub.js @@ -0,0 +1,67 @@ +// Limited implementation of python % string operator, supports only %s and %r for now +// (other formats are not used here, but may appear in custom templates) + +'use strict' + +const { inspect } = require('util') + + +module.exports = function sub(pattern, ...values) { + let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g + + let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) { + if (is_literal) return '%' + + let padded_count = 0 + if (is_padded) { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + padded_count = values.shift() + if (!Number.isInteger(padded_count)) throw new TypeError('* wants int') + } + + let str + if (name !== undefined) { + let dict = values[0] + if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping') + if (!(name in dict)) throw new TypeError(`no such key: '${name}'`) + str = dict[name] + } else { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + str = values.shift() + } + + switch (format) { + case 's': + str = String(str) + break + case 'r': + str = inspect(str) + break + case 'd': + case 'i': + if (typeof str !== 'number') { + throw new TypeError(`%${format} format: a number is required, not ${typeof str}`) + } + str = String(str.toFixed(0)) + break + default: + throw new TypeError(`unsupported format character '${format}'`) + } + + if (padded_count > 0) { + return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count) + } else { + return str + } + }) + + if (values.length) { + if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) { + // mapping + } else { + throw new TypeError('not all arguments converted during string formatting') + } + } + + return result +} diff --git a/node_modules/eslint/node_modules/argparse/lib/textwrap.js b/node_modules/eslint/node_modules/argparse/lib/textwrap.js new file mode 100644 index 000000000..23d51cdb9 --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/lib/textwrap.js @@ -0,0 +1,440 @@ +// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions): +// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py + +'use strict' + +/* + * Text wrapping and filling. + */ + +// Copyright (C) 1999-2001 Gregory P. Ward. +// Copyright (C) 2002, 2003 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors +// Originally written by Greg Ward + +// Hardcode the recognized whitespace characters to the US-ASCII +// whitespace characters. The main reason for doing this is that +// some Unicode spaces (like \u00a0) are non-breaking whitespaces. +// +// This less funky little regex just split on recognized spaces. E.g. +// "Hello there -- you goof-ball, use the -b option!" +// splits into +// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/ +const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/ + +class TextWrapper { + /* + * Object for wrapping/filling text. The public interface consists of + * the wrap() and fill() methods; the other methods are just there for + * subclasses to override in order to tweak the default behaviour. + * If you want to completely replace the main wrapping algorithm, + * you'll probably have to override _wrap_chunks(). + * + * Several instance attributes control various aspects of wrapping: + * width (default: 70) + * the maximum width of wrapped lines (unless break_long_words + * is false) + * initial_indent (default: "") + * string that will be prepended to the first line of wrapped + * output. Counts towards the line's width. + * subsequent_indent (default: "") + * string that will be prepended to all lines save the first + * of wrapped output; also counts towards each line's width. + * expand_tabs (default: true) + * Expand tabs in input text to spaces before further processing. + * Each tab will become 0 .. 'tabsize' spaces, depending on its position + * in its line. If false, each tab is treated as a single character. + * tabsize (default: 8) + * Expand tabs in input text to 0 .. 'tabsize' spaces, unless + * 'expand_tabs' is false. + * replace_whitespace (default: true) + * Replace all whitespace characters in the input text by spaces + * after tab expansion. Note that if expand_tabs is false and + * replace_whitespace is true, every tab will be converted to a + * single space! + * fix_sentence_endings (default: false) + * Ensure that sentence-ending punctuation is always followed + * by two spaces. Off by default because the algorithm is + * (unavoidably) imperfect. + * break_long_words (default: true) + * Break words longer than 'width'. If false, those words will not + * be broken, and some lines might be longer than 'width'. + * break_on_hyphens (default: true) + * Allow breaking hyphenated words. If true, wrapping will occur + * preferably on whitespaces and right after hyphens part of + * compound words. + * drop_whitespace (default: true) + * Drop leading and trailing whitespace from lines. + * max_lines (default: None) + * Truncate wrapped lines. + * placeholder (default: ' [...]') + * Append to the last line of truncated text. + */ + + constructor(options = {}) { + let { + width = 70, + initial_indent = '', + subsequent_indent = '', + expand_tabs = true, + replace_whitespace = true, + fix_sentence_endings = false, + break_long_words = true, + drop_whitespace = true, + break_on_hyphens = true, + tabsize = 8, + max_lines = undefined, + placeholder=' [...]' + } = options + + this.width = width + this.initial_indent = initial_indent + this.subsequent_indent = subsequent_indent + this.expand_tabs = expand_tabs + this.replace_whitespace = replace_whitespace + this.fix_sentence_endings = fix_sentence_endings + this.break_long_words = break_long_words + this.drop_whitespace = drop_whitespace + this.break_on_hyphens = break_on_hyphens + this.tabsize = tabsize + this.max_lines = max_lines + this.placeholder = placeholder + } + + + // -- Private methods ----------------------------------------------- + // (possibly useful for subclasses to override) + + _munge_whitespace(text) { + /* + * _munge_whitespace(text : string) -> string + * + * Munge whitespace in text: expand tabs and convert all other + * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" + * becomes " foo bar baz". + */ + if (this.expand_tabs) { + text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js + } + if (this.replace_whitespace) { + text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ') + } + return text + } + + _split(text) { + /* + * _split(text : string) -> [string] + * + * Split the text to wrap into indivisible chunks. Chunks are + * not quite the same as words; see _wrap_chunks() for full + * details. As an example, the text + * Look, goof-ball -- use the -b option! + * breaks into the following chunks: + * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', 'option!' + * if break_on_hyphens is True, or in: + * 'Look,', ' ', 'goof-ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', option!' + * otherwise. + */ + let chunks = text.split(wordsep_simple_re) + chunks = chunks.filter(Boolean) + return chunks + } + + _handle_long_word(reversed_chunks, cur_line, cur_len, width) { + /* + * _handle_long_word(chunks : [string], + * cur_line : [string], + * cur_len : int, width : int) + * + * Handle a chunk of text (most likely a word, not whitespace) that + * is too long to fit in any line. + */ + // Figure out when indent is larger than the specified width, and make + // sure at least one character is stripped off on every pass + let space_left + if (width < 1) { + space_left = 1 + } else { + space_left = width - cur_len + } + + // If we're allowed to break long words, then do so: put as much + // of the next chunk onto the current line as will fit. + if (this.break_long_words) { + cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left)) + reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left) + + // Otherwise, we have to preserve the long word intact. Only add + // it to the current line if there's nothing already there -- + // that minimizes how much we violate the width constraint. + } else if (!cur_line) { + cur_line.push(...reversed_chunks.pop()) + } + + // If we're not allowed to break long words, and there's already + // text on the current line, do nothing. Next time through the + // main loop of _wrap_chunks(), we'll wind up here again, but + // cur_len will be zero, so the next line will be entirely + // devoted to the long word that we can't handle right now. + } + + _wrap_chunks(chunks) { + /* + * _wrap_chunks(chunks : [string]) -> [string] + * + * Wrap a sequence of text chunks and return a list of lines of + * length 'self.width' or less. (If 'break_long_words' is false, + * some lines may be longer than this.) Chunks correspond roughly + * to words and the whitespace between them: each chunk is + * indivisible (modulo 'break_long_words'), but a line break can + * come between any two chunks. Chunks should not have internal + * whitespace; ie. a chunk is either all whitespace or a "word". + * Whitespace chunks will be removed from the beginning and end of + * lines, but apart from that whitespace is preserved. + */ + let lines = [] + let indent + if (this.width <= 0) { + throw Error(`invalid width ${this.width} (must be > 0)`) + } + if (this.max_lines !== undefined) { + if (this.max_lines > 1) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + if (indent.length + this.placeholder.trimStart().length > this.width) { + throw Error('placeholder too large for max width') + } + } + + // Arrange in reverse order so items can be efficiently popped + // from a stack of chucks. + chunks = chunks.reverse() + + while (chunks.length > 0) { + + // Start the list of chunks that will make up the current line. + // cur_len is just the length of all the chunks in cur_line. + let cur_line = [] + let cur_len = 0 + + // Figure out which static string will prefix this line. + let indent + if (lines) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + + // Maximum width for this line. + let width = this.width - indent.length + + // First chunk on line is whitespace -- drop it, unless this + // is the very beginning of the text (ie. no lines started yet). + if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) { + chunks.pop() + } + + while (chunks.length > 0) { + let l = chunks[chunks.length - 1].length + + // Can at least squeeze this chunk onto the current line. + if (cur_len + l <= width) { + cur_line.push(chunks.pop()) + cur_len += l + + // Nope, this line is full. + } else { + break + } + } + + // The current line is full, and the next chunk is too big to + // fit on *any* line (not just this one). + if (chunks.length && chunks[chunks.length - 1].length > width) { + this._handle_long_word(chunks, cur_line, cur_len, width) + cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0) + } + + // If the last chunk on this line is all whitespace, drop it. + if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') { + cur_len -= cur_line[cur_line.length - 1].length + cur_line.pop() + } + + if (cur_line) { + if (this.max_lines === undefined || + lines.length + 1 < this.max_lines || + (chunks.length === 0 || + this.drop_whitespace && + chunks.length === 1 && + !chunks[0].trim()) && cur_len <= width) { + // Convert current line back to a string and store it in + // list of all lines (return value). + lines.push(indent + cur_line.join('')) + } else { + let had_break = false + while (cur_line) { + if (cur_line[cur_line.length - 1].trim() && + cur_len + this.placeholder.length <= width) { + cur_line.push(this.placeholder) + lines.push(indent + cur_line.join('')) + had_break = true + break + } + cur_len -= cur_line[-1].length + cur_line.pop() + } + if (!had_break) { + if (lines) { + let prev_line = lines[lines.length - 1].trimEnd() + if (prev_line.length + this.placeholder.length <= + this.width) { + lines[lines.length - 1] = prev_line + this.placeholder + break + } + } + lines.push(indent + this.placeholder.lstrip()) + } + break + } + } + } + + return lines + } + + _split_chunks(text) { + text = this._munge_whitespace(text) + return this._split(text) + } + + // -- Public interface ---------------------------------------------- + + wrap(text) { + /* + * wrap(text : string) -> [string] + * + * Reformat the single paragraph in 'text' so it fits in lines of + * no more than 'self.width' columns, and return a list of wrapped + * lines. Tabs in 'text' are expanded with string.expandtabs(), + * and all other whitespace characters (including newline) are + * converted to space. + */ + let chunks = this._split_chunks(text) + // not implemented in js + //if (this.fix_sentence_endings) { + // this._fix_sentence_endings(chunks) + //} + return this._wrap_chunks(chunks) + } + + fill(text) { + /* + * fill(text : string) -> string + * + * Reformat the single paragraph in 'text' to fit in lines of no + * more than 'self.width' columns, and return a new string + * containing the entire wrapped paragraph. + */ + return this.wrap(text).join('\n') + } +} + + +// -- Convenience interface --------------------------------------------- + +function wrap(text, options = {}) { + /* + * Wrap a single paragraph of text, returning a list of wrapped lines. + * + * Reformat the single paragraph in 'text' so it fits in lines of no + * more than 'width' columns, and return a list of wrapped lines. By + * default, tabs in 'text' are expanded with string.expandtabs(), and + * all other whitespace characters (including newline) are converted to + * space. See TextWrapper class for available keyword args to customize + * wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.wrap(text) +} + +function fill(text, options = {}) { + /* + * Fill a single paragraph of text, returning a new string. + * + * Reformat the single paragraph in 'text' to fit in lines of no more + * than 'width' columns, and return a new string containing the entire + * wrapped paragraph. As with wrap(), tabs are expanded and other + * whitespace characters converted to space. See TextWrapper class for + * available keyword args to customize wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.fill(text) +} + +// -- Loosely related functionality ------------------------------------- + +let _whitespace_only_re = /^[ \t]+$/mg +let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg + +function dedent(text) { + /* + * Remove any common leading whitespace from every line in `text`. + * + * This can be used to make triple-quoted strings line up with the left + * edge of the display, while still presenting them in the source code + * in indented form. + * + * Note that tabs and spaces are both treated as whitespace, but they + * are not equal: the lines " hello" and "\\thello" are + * considered to have no common leading whitespace. + * + * Entirely blank lines are normalized to a newline character. + */ + // Look for the longest leading string of spaces and tabs common to + // all lines. + let margin = undefined + text = text.replace(_whitespace_only_re, '') + let indents = text.match(_leading_whitespace_re) || [] + for (let indent of indents) { + indent = indent.slice(0, -1) + + if (margin === undefined) { + margin = indent + + // Current line more deeply indented than previous winner: + // no change (previous winner is still on top). + } else if (indent.startsWith(margin)) { + // pass + + // Current line consistent with and no deeper than previous winner: + // it's the new winner. + } else if (margin.startsWith(indent)) { + margin = indent + + // Find the largest common whitespace between current line and previous + // winner. + } else { + for (let i = 0; i < margin.length && i < indent.length; i++) { + if (margin[i] !== indent[i]) { + margin = margin.slice(0, i) + break + } + } + } + } + + if (margin) { + text = text.replace(new RegExp('^' + margin, 'mg'), '') + } + return text +} + +module.exports = { wrap, fill, dedent } diff --git a/node_modules/eslint/node_modules/argparse/package.json b/node_modules/eslint/node_modules/argparse/package.json new file mode 100644 index 000000000..647d2aff1 --- /dev/null +++ b/node_modules/eslint/node_modules/argparse/package.json @@ -0,0 +1,31 @@ +{ + "name": "argparse", + "description": "CLI arguments parser. Native port of python's argparse.", + "version": "2.0.1", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "main": "argparse.js", + "files": [ + "argparse.js", + "lib/" + ], + "license": "Python-2.0", + "repository": "nodeca/argparse", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && nyc mocha", + "coverage": "npm run test && nyc report --reporter html" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.11.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", + "eslint": "^7.5.0", + "mocha": "^8.0.1", + "nyc": "^15.1.0" + } +} diff --git a/node_modules/eslint/node_modules/escape-string-regexp/index.d.ts b/node_modules/eslint/node_modules/escape-string-regexp/index.d.ts new file mode 100644 index 000000000..7d34edc7c --- /dev/null +++ b/node_modules/eslint/node_modules/escape-string-regexp/index.d.ts @@ -0,0 +1,18 @@ +/** +Escape RegExp special characters. + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +@example +``` +import escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` +*/ +declare const escapeStringRegexp: (string: string) => string; + +export = escapeStringRegexp; diff --git a/node_modules/eslint/node_modules/escape-string-regexp/index.js b/node_modules/eslint/node_modules/escape-string-regexp/index.js new file mode 100644 index 000000000..387c5615a --- /dev/null +++ b/node_modules/eslint/node_modules/escape-string-regexp/index.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +}; diff --git a/node_modules/slice-ansi/license b/node_modules/eslint/node_modules/escape-string-regexp/license similarity index 96% rename from node_modules/slice-ansi/license rename to node_modules/eslint/node_modules/escape-string-regexp/license index e05b33c55..fa7ceba3e 100644 --- a/node_modules/slice-ansi/license +++ b/node_modules/eslint/node_modules/escape-string-regexp/license @@ -1,6 +1,5 @@ MIT License -Copyright (c) DC 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: diff --git a/node_modules/eslint/node_modules/escape-string-regexp/package.json b/node_modules/eslint/node_modules/escape-string-regexp/package.json new file mode 100644 index 000000000..c6eb4a91b --- /dev/null +++ b/node_modules/eslint/node_modules/escape-string-regexp/package.json @@ -0,0 +1,38 @@ +{ + "name": "escape-string-regexp", + "version": "4.0.0", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", + "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": [ + "escape", + "regex", + "regexp", + "regular", + "expression", + "string", + "special", + "characters" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.11.0", + "xo": "^0.28.3" + } +} diff --git a/node_modules/eslint/node_modules/escape-string-regexp/readme.md b/node_modules/eslint/node_modules/escape-string-regexp/readme.md new file mode 100644 index 000000000..2945dfcb2 --- /dev/null +++ b/node_modules/eslint/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,34 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + +## Install + +``` +$ npm install escape-string-regexp +``` + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +--- + + diff --git a/node_modules/eslint/node_modules/find-up/index.d.ts b/node_modules/eslint/node_modules/find-up/index.d.ts new file mode 100644 index 000000000..6746bb729 --- /dev/null +++ b/node_modules/eslint/node_modules/find-up/index.d.ts @@ -0,0 +1,138 @@ +/* eslint-disable @typescript-eslint/unified-signatures */ +import {Options as LocatePathOptions} from 'locate-path'; + +declare const stop: unique symbol; + +declare namespace findUp { + interface Options extends LocatePathOptions {} + + type StopSymbol = typeof stop; + + type Match = string | StopSymbol | undefined; +} + +declare const findUp: { + sync: { + /** + Synchronously check if a path exists. + + @param path - Path to the file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png')); + //=> true + ``` + */ + exists: (path: string) => boolean; + + /** + Synchronously find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + */ + (name: string | readonly string[], options?: findUp.Options): string | undefined; + + /** + Synchronously find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + console.log(findUp.sync(directory => { + const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + ``` + */ + (matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined; + }; + + /** + Check if a path exists. + + @param path - Path to a file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + (async () => { + console.log(await findUp.exists('/Users/sindresorhus/unicorn.png')); + //=> true + })(); + ``` + */ + exists: (path: string) => Promise; + + /** + Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`. + */ + readonly stop: findUp.StopSymbol; + + /** + Find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + + @example + ``` + // / + // └── Users + // └── sindresorhus + // ├── unicorn.png + // └── foo + // └── bar + // ├── baz + // └── example.js + + // example.js + import findUp = require('find-up'); + + (async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + })(); + ``` + */ + (name: string | readonly string[], options?: findUp.Options): Promise; + + /** + Find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + (async () => { + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + })(); + ``` + */ + (matcher: (directory: string) => (findUp.Match | Promise), options?: findUp.Options): Promise; +}; + +export = findUp; diff --git a/node_modules/eslint/node_modules/find-up/index.js b/node_modules/eslint/node_modules/find-up/index.js new file mode 100644 index 000000000..ce564e5d3 --- /dev/null +++ b/node_modules/eslint/node_modules/find-up/index.js @@ -0,0 +1,89 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); +const pathExists = require('path-exists'); + +const stop = Symbol('findUp.stop'); + +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } + + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } + + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.exists = pathExists; + +module.exports.sync.exists = pathExists.sync; + +module.exports.stop = stop; diff --git a/node_modules/eslint/node_modules/find-up/license b/node_modules/eslint/node_modules/find-up/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/eslint/node_modules/find-up/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/eslint/node_modules/find-up/package.json b/node_modules/eslint/node_modules/find-up/package.json new file mode 100644 index 000000000..56db6dd80 --- /dev/null +++ b/node_modules/eslint/node_modules/find-up/package.json @@ -0,0 +1,54 @@ +{ + "name": "find-up", + "version": "5.0.0", + "description": "Find a file or directory by walking up parent directories", + "license": "MIT", + "repository": "sindresorhus/find-up", + "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": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "walk", + "walking", + "path" + ], + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "is-path-inside": "^2.1.0", + "tempy": "^0.6.0", + "tsd": "^0.13.1", + "xo": "^0.33.0" + } +} diff --git a/node_modules/eslint/node_modules/find-up/readme.md b/node_modules/eslint/node_modules/find-up/readme.md new file mode 100644 index 000000000..7ad908a7c --- /dev/null +++ b/node_modules/eslint/node_modules/find-up/readme.md @@ -0,0 +1,151 @@ +# find-up [![Build Status](https://travis-ci.com/sindresorhus/find-up.svg?branch=master)](https://travis-ci.com/github/sindresorhus/find-up) + +> Find a file or directory by walking up parent directories + +## Install + +``` +$ npm install find-up +``` + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' +})(); +``` + +## API + +### findUp(name, options?) +### findUp(matcher, options?) + +Returns a `Promise` for either the path or `undefined` if it couldn't be found. + +### findUp([...name], options?) + +Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found. + +### findUp.sync(name, options?) +### findUp.sync(matcher, options?) + +Returns a path or `undefined` if it couldn't be found. + +### findUp.sync([...name], options?) + +Returns the first path found (by respecting the order of the array) or `undefined` if none could be found. + +#### name + +Type: `string` + +Name of the file or directory to find. + +#### matcher + +Type: `Function` + +A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases. + +When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path. + +#### options + +Type: `object` + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Directory to start from. + +##### type + +Type: `string`\ +Default: `'file'`\ +Values: `'file'` `'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`\ +Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### findUp.exists(path) + +Returns a `Promise` of whether the path exists. + +### findUp.sync.exists(path) + +Returns a `boolean` of whether the path exists. + +#### path + +Type: `string` + +Path to a file or directory. + +### findUp.stop + +A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem. + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + await findUp(directory => { + return path.basename(directory) === 'work' ? findUp.stop : 'logo.png'; + }); +})(); +``` + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + +--- + +
+ + Get professional support for 'find-up' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/eslint/node_modules/globals/globals.json b/node_modules/eslint/node_modules/globals/globals.json index 53d2b86fa..c8460073c 100644 --- a/node_modules/eslint/node_modules/globals/globals.json +++ b/node_modules/eslint/node_modules/globals/globals.json @@ -388,7 +388,7 @@ "AudioParam": false, "AudioProcessingEvent": false, "AudioScheduledSourceNode": false, - "AudioWorkletGlobalScope ": false, + "AudioWorkletGlobalScope": false, "AudioWorkletNode": false, "AudioWorkletProcessor": false, "BarProp": false, @@ -419,6 +419,7 @@ "clearTimeout": false, "clientInformation": false, "ClipboardEvent": false, + "ClipboardItem": false, "close": false, "closed": false, "CloseEvent": false, @@ -442,15 +443,24 @@ "CSSImportRule": false, "CSSKeyframeRule": false, "CSSKeyframesRule": false, + "CSSMatrixComponent": false, "CSSMediaRule": false, "CSSNamespaceRule": false, "CSSPageRule": false, + "CSSPerspective": false, + "CSSRotate": false, "CSSRule": false, "CSSRuleList": false, + "CSSScale": false, + "CSSSkew": false, + "CSSSkewX": false, + "CSSSkewY": false, "CSSStyleDeclaration": false, "CSSStyleRule": false, "CSSStyleSheet": false, "CSSSupportsRule": false, + "CSSTransformValue": false, + "CSSTranslate": false, "CustomElementRegistry": false, "customElements": false, "CustomEvent": false, @@ -478,6 +488,7 @@ "DOMPointReadOnly": false, "DOMQuad": false, "DOMRect": false, + "DOMRectList": false, "DOMRectReadOnly": false, "DOMStringList": false, "DOMStringMap": false, @@ -501,6 +512,7 @@ "FontFace": false, "FontFaceSetLoadEvent": false, "FormData": false, + "FormDataEvent": false, "frameElement": false, "frames": false, "GainNode": false, @@ -636,6 +648,7 @@ "MediaKeyStatusMap": false, "MediaKeySystemAccess": false, "MediaList": false, + "MediaMetadata": false, "MediaQueryList": false, "MediaQueryListEvent": false, "MediaRecorder": false, @@ -672,6 +685,7 @@ "NavigationPreloadManager": false, "navigator": false, "Navigator": false, + "NavigatorUAData": false, "NetworkInformation": false, "Node": false, "NodeFilter": false, @@ -787,6 +801,7 @@ "OscillatorNode": false, "outerHeight": false, "outerWidth": false, + "OverconstrainedError": false, "PageTransitionEvent": false, "pageXOffset": false, "pageYOffset": false, @@ -843,6 +858,7 @@ "registerProcessor": false, "RemotePlayback": false, "removeEventListener": false, + "reportError": false, "Request": false, "requestAnimationFrame": false, "requestIdleCallback": false, @@ -905,9 +921,11 @@ "Storage": false, "StorageEvent": false, "StorageManager": false, + "structuredClone": false, "styleMedia": false, "StyleSheet": false, "StyleSheetList": false, + "SubmitEvent": false, "SubtleCrypto": false, "SVGAElement": false, "SVGAngle": false, @@ -1024,6 +1042,7 @@ "TouchEvent": false, "TouchList": false, "TrackEvent": false, + "TransformStream": false, "TransitionEvent": false, "TreeWalker": false, "UIEvent": false, @@ -1081,6 +1100,9 @@ "clearTimeout": false, "close": true, "console": false, + "CustomEvent": false, + "ErrorEvent": false, + "Event": false, "fetch": false, "FileReaderSync": false, "FormData": false, @@ -1101,6 +1123,7 @@ "indexedDB": false, "location": false, "MessageChannel": false, + "MessageEvent": false, "MessagePort": false, "name": false, "navigator": false, @@ -1126,6 +1149,7 @@ "Promise": false, "queueMicrotask": false, "removeEventListener": false, + "reportError": false, "Request": false, "Response": false, "self": true, @@ -1145,21 +1169,37 @@ "__dirname": false, "__filename": false, "AbortController": false, + "AbortSignal": false, + "atob": false, + "btoa": false, "Buffer": false, "clearImmediate": false, "clearInterval": false, "clearTimeout": false, "console": false, + "DOMException": false, + "Event": false, + "EventTarget": false, "exports": true, + "fetch": false, + "FormData": false, "global": false, + "Headers": false, "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, "module": false, + "performance": false, "process": false, "queueMicrotask": false, + "Request": false, "require": false, + "Response": false, "setImmediate": false, "setInterval": false, "setTimeout": false, + "structuredClone": false, "TextDecoder": false, "TextEncoder": false, "URL": false, @@ -1167,18 +1207,34 @@ }, "nodeBuiltin": { "AbortController": false, + "AbortSignal": false, + "atob": false, + "btoa": false, "Buffer": false, "clearImmediate": false, "clearInterval": false, "clearTimeout": false, "console": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "FormData": false, "global": false, + "Headers": false, "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "performance": false, "process": false, "queueMicrotask": false, + "Request": false, + "Response": false, "setImmediate": false, "setInterval": false, "setTimeout": false, + "structuredClone": false, "TextDecoder": false, "TextEncoder": false, "URL": false, @@ -1542,6 +1598,9 @@ "Clients": false, "close": true, "console": false, + "CustomEvent": false, + "ErrorEvent": false, + "Event": false, "ExtendableEvent": false, "ExtendableMessageEvent": false, "fetch": false, @@ -1565,6 +1624,7 @@ "indexedDB": false, "location": false, "MessageChannel": false, + "MessageEvent": false, "MessagePort": false, "name": false, "navigator": false, @@ -1658,11 +1718,32 @@ "protractor": false }, "shared-node-browser": { + "AbortController": false, + "AbortSignal": false, + "atob": false, + "btoa": false, "clearInterval": false, "clearTimeout": false, "console": false, + "DOMException": false, + "Event": false, + "EventTarget": false, + "fetch": false, + "FormData": false, + "Headers": false, + "Intl": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "performance": false, + "queueMicrotask": false, + "Request": false, + "Response": false, "setInterval": false, "setTimeout": false, + "structuredClone": false, + "TextDecoder": false, + "TextEncoder": false, "URL": false, "URLSearchParams": false }, @@ -1676,6 +1757,7 @@ "createObjectIn": false, "exportFunction": false, "GM": false, + "GM_addElement": false, "GM_addStyle": false, "GM_addValueChangeListener": false, "GM_deleteValue": false, diff --git a/node_modules/eslint/node_modules/globals/package.json b/node_modules/eslint/node_modules/globals/package.json index 9f49985c1..17cc85afb 100644 --- a/node_modules/eslint/node_modules/globals/package.json +++ b/node_modules/eslint/node_modules/globals/package.json @@ -1,87 +1,55 @@ { - "_from": "globals@^13.6.0", - "_id": "globals@13.7.0", - "_inBundle": false, - "_integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", - "_location": "/eslint/globals", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "globals@^13.6.0", - "name": "globals", - "escapedName": "globals", - "rawSpec": "^13.6.0", - "saveSpec": null, - "fetchSpec": "^13.6.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", - "_shasum": "aed3bcefd80ad3ec0f0be2cf0c895110c0591795", - "_spec": "globals@^13.6.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/globals/issues" - }, - "bundleDependencies": false, - "dependencies": { - "type-fest": "^0.20.2" - }, - "deprecated": false, - "description": "Global identifiers from different JavaScript environments", - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.14.0", - "xo": "^0.36.1" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts", - "globals.json" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/globals#readme", - "keywords": [ - "globals", - "global", - "identifiers", - "variables", - "vars", - "jshint", - "eslint", - "environments" - ], - "license": "MIT", - "name": "globals", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/globals.git" - }, - "scripts": { - "test": "xo && ava" - }, - "tsd": { - "compilerOptions": { - "resolveJsonModule": true - } - }, - "version": "13.7.0", - "xo": { - "ignores": [ - "get-browser-globals.js" - ], - "rules": { - "node/no-unsupported-features/es-syntax": "off" - } - } + "name": "globals", + "version": "13.20.0", + "description": "Global identifiers from different JavaScript environments", + "license": "MIT", + "repository": "sindresorhus/globals", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "dependencies": { + "type-fest": "^0.20.2" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.14.0", + "xo": "^0.36.1" + }, + "xo": { + "ignores": [ + "get-browser-globals.js" + ], + "rules": { + "node/no-unsupported-features/es-syntax": "off" + } + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + } } diff --git a/node_modules/eslint/node_modules/js-yaml/CHANGELOG.md b/node_modules/eslint/node_modules/js-yaml/CHANGELOG.md new file mode 100644 index 000000000..ff2375e05 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/CHANGELOG.md @@ -0,0 +1,616 @@ +# 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). + + +## [4.1.0] - 2021-04-15 +### Added +- Types are now exported as `yaml.types.XXX`. +- Every type now has `options` property with original arguments kept as they were + (see `yaml.types.int.options` as an example). + +### Changed +- `Schema.extend()` now keeps old type order in case of conflicts + (e.g. Schema.extend([ a, b, c ]).extend([ b, a, d ]) is now ordered as `abcd` instead of `cbad`). + + +## [4.0.0] - 2021-01-03 +### Changed +- Check [migration guide](migrate_v3_to_v4.md) to see details for all breaking changes. +- Breaking: "unsafe" tags `!!js/function`, `!!js/regexp`, `!!js/undefined` are + moved to [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) package. +- Breaking: removed `safe*` functions. Use `load`, `loadAll`, `dump` + instead which are all now safe by default. +- `yaml.DEFAULT_SAFE_SCHEMA` and `yaml.DEFAULT_FULL_SCHEMA` are removed, use + `yaml.DEFAULT_SCHEMA` instead. +- `yaml.Schema.create(schema, tags)` is removed, use `schema.extend(tags)` instead. +- `!!binary` now always mapped to `Uint8Array` on load. +- Reduced nesting of `/lib` folder. +- Parse numbers according to YAML 1.2 instead of YAML 1.1 (`01234` is now decimal, + `0o1234` is octal, `1:23` is parsed as string instead of base60). +- `dump()` no longer quotes `:`, `[`, `]`, `(`, `)` except when necessary, #470, #557. +- Line and column in exceptions are now formatted as `(X:Y)` instead of + `at line X, column Y` (also present in compact format), #332. +- Code snippet created in exceptions now contains multiple lines with line numbers. +- `dump()` now serializes `undefined` as `null` in collections and removes keys with + `undefined` in mappings, #571. +- `dump()` with `skipInvalid=true` now serializes invalid items in collections as null. +- Custom tags starting with `!` are now dumped as `!tag` instead of `!`, #576. +- Custom tags starting with `tag:yaml.org,2002:` are now shorthanded using `!!`, #258. + +### Added +- Added `.mjs` (es modules) support. +- Added `quotingType` and `forceQuotes` options for dumper to configure + string literal style, #290, #529. +- Added `styles: { '!!null': 'empty' }` option for dumper + (serializes `{ foo: null }` as "`foo: `"), #570. +- Added `replacer` option (similar to option in JSON.stringify), #339. +- Custom `Tag` can now handle all tags or multiple tags with the same prefix, #385. + +### Fixed +- Astral characters are no longer encoded by `dump()`, #587. +- "duplicate mapping key" exception now points at the correct column, #452. +- Extra commas in flow collections (e.g. `[foo,,bar]`) now throw an exception + instead of producing null, #321. +- `__proto__` key no longer overrides object prototype, #164. +- Removed `bower.json`. +- Tags are now url-decoded in `load()` and url-encoded in `dump()` + (previously usage of custom non-ascii tags may have led to invalid YAML that can't be parsed). +- Anchors now work correctly with empty nodes, #301. +- Fix incorrect parsing of invalid block mapping syntax, #418. +- Throw an error if block sequence/mapping indent contains a tab, #80. + + +## [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 + + +[4.1.0]: https://github.com/nodeca/js-yaml/compare/4.0.0...4.1.0 +[4.0.0]: https://github.com/nodeca/js-yaml/compare/3.14.0...4.0.0 +[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/ansi-colors/LICENSE b/node_modules/eslint/node_modules/js-yaml/LICENSE similarity index 93% rename from node_modules/ansi-colors/LICENSE rename to node_modules/eslint/node_modules/js-yaml/LICENSE index 8749cc754..09d3a29e9 100644 --- a/node_modules/ansi-colors/LICENSE +++ b/node_modules/eslint/node_modules/js-yaml/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +(The MIT License) -Copyright (c) 2015-present, Brian Woodward. +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 diff --git a/node_modules/eslint/node_modules/js-yaml/README.md b/node_modules/eslint/node_modules/js-yaml/README.md new file mode 100644 index 000000000..3cbc4bd2d --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/README.md @@ -0,0 +1,246 @@ +JS-YAML - YAML 1.2 parser / writer for JavaScript +================================================= + +[![CI](https://github.com/nodeca/js-yaml/workflows/CI/badge.svg?branch=master)](https://github.com/nodeca/js-yaml/actions) +[![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 +``` + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [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.load(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### load (string [ , options ]) + +Parses `string` as single YAML document. Returns either a +plain object, a string, a number, `null` or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. + +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_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_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. + + +### loadAll (string [, iterator] [, options ]) + +Same as `load()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.loadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### dump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_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_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. Set `-1` for unlimited 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. +- `quotingType` _(`'` or `"`, default: `'`)_ - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters. +- `forceQuotes` _(default: `false`)_ - if `true`, all non-key strings will be quoted even if they normally don't need to. +- `replacer` - callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`). + +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" -> "0o1", "0o52", "0o16172" + "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 +dump(object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScript 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** + +See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for +extra types. + + +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/eslint/node_modules/js-yaml/bin/js-yaml.js b/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js new file mode 100755 index 000000000..a182f1afb --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,126 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +var fs = require('fs'); +var argparse = require('argparse'); +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + add_help: true +}); + +cli.add_argument('-v', '--version', { + action: 'version', + version: require('../package.json').version +}); + +cli.add_argument('-c', '--compact', { + help: 'Display errors in compact mode', + action: 'store_true' +}); + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.add_argument('-j', '--to-json', { + help: argparse.SUPPRESS, + dest: 'json', + action: 'store_true' +}); + +cli.add_argument('-t', '--trace', { + help: 'Show stack trace on error', + action: 'store_true' +}); + +cli.add_argument('file', { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + default: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parse_args(); + + +//////////////////////////////////////////////////////////////////////////////// + +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/eslint/node_modules/js-yaml/dist/js-yaml.js b/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 000000000..4cc0ddf6d --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,3874 @@ + +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jsyaml = {})); +}(this, (function (exports) { 'use strict'; + + function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); + } + + + function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); + } + + + function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; + } + + + function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; + } + + + function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; + } + + + function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); + } + + + var isNothing_1 = isNothing; + var isObject_1 = isObject; + var toArray_1 = toArray; + var repeat_1 = repeat; + var isNegativeZero_1 = isNegativeZero; + var extend_1 = extend; + + var common = { + isNothing: isNothing_1, + isObject: isObject_1, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 + }; + + // YAML error class. http://stackoverflow.com/questions/8458984 + + + function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; + } + + + function YAMLException$1(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // 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$1.prototype = Object.create(Error.prototype); + YAMLException$1.prototype.constructor = YAMLException$1; + + + YAMLException$1.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); + }; + + + var exception = YAMLException$1; + + // get snippet for a single line, respecting maxLength + function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; + } + + + function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; + } + + + function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); + } + + + var snippet = makeSnippet; + + var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + '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$1(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + 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.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } + } + + var type = Type$1; + + /*eslint-disable max-len*/ + + + + + + function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; + } + + + function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + 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$1(definition) { + return this.extend(definition); + } + + + Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema$1.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; + }; + + + var schema = Schema$1; + + var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } + }); + + var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } + }); + + var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } + }); + + var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] + }); + + 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; + } + + var _null = 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'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' + }); + + 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]'; + } + + var bool = 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' + }); + + 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 !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + 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) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; + } + + function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + 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.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); + } + + function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); + } + + var int = 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 ? '0o' + obj.toString(8) : '-0o' + 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' ] + } + }); + + var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[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; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + 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; + } + 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)); + } + + var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' + }); + + var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] + }); + + var core = json; + + 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(); + } + + var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp + }); + + function resolveYamlMerge(data) { + return data === '<<' || data === null; + } + + var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge + }); + + /*eslint-disable no-bitwise*/ + + + + + + // [ 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); + } + + return new Uint8Array(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(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; + } + + var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary + }); + + var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; + var _toString$2 = 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$2.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty$3.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 : []; + } + + var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap + }); + + var _toString$1 = 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$1.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; + } + + var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs + }); + + var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + + function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; + } + + function constructYamlSet(data) { + return data !== null ? data : {}; + } + + var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet + }); + + var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] + }); + + /*eslint-disable max-len,no-use-before-define*/ + + + + + + + + var _hasOwnProperty$1 = 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$1(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + 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; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + + } + + + function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = snippet(mark); + + return new exception(message, mark); + } + + 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$1.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'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + 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$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } + } + + function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, 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$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _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; + state.firstTabInLine = -1; + } + + function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + 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, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + 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'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + 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; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + 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, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } 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; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + 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, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // 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, _keyLine, _keyLineStart, _keyPos); + 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 { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + 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, _keyLine, _keyLineStart, _keyPos); + 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`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + 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, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + 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 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, _keyLine, _keyLineStart, _keyPos); + } + + // 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); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.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$1.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) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else 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 (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + 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.tag)) { // `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, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + 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 = Object.create(null); + state.anchorMap = Object.create(null); + + 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$1.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$1(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$1(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$1(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 exception('expected a single document in the stream, but found more'); + } + + + var loadAll_1 = loadAll$1; + var load_1 = load$1; + + var loader = { + loadAll: loadAll_1, + load: load_1 + }; + + /*eslint-disable no-use-before-define*/ + + + + + + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + + var CHAR_BOM = 0xFEFF; + var CHAR_TAB = 0x09; /* Tab */ + var CHAR_LINE_FEED = 0x0A; /* LF */ + var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ + var CHAR_SPACE = 0x20; /* Space */ + var CHAR_EXCLAMATION = 0x21; /* ! */ + var CHAR_DOUBLE_QUOTE = 0x22; /* " */ + var CHAR_SHARP = 0x23; /* # */ + var CHAR_PERCENT = 0x25; /* % */ + var CHAR_AMPERSAND = 0x26; /* & */ + var CHAR_SINGLE_QUOTE = 0x27; /* ' */ + var CHAR_ASTERISK = 0x2A; /* * */ + var CHAR_COMMA = 0x2C; /* , */ + var CHAR_MINUS = 0x2D; /* - */ + var CHAR_COLON = 0x3A; /* : */ + var CHAR_EQUALS = 0x3D; /* = */ + var CHAR_GREATER_THAN = 0x3E; /* > */ + 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' + ]; + + var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + + 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 exception('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; + } + + + var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + + function State(options) { + this.schema = options['schema'] || _default; + 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.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + 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 !== CHAR_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 + // Including s-white (for some reason, examples doesn't match specs in this aspect) + // ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark + function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; + } + + // [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out + // c = flow-in ⇒ ns-plain-safe-in + // c = block-key ⇒ ns-plain-safe-out + // c = flow-key ⇒ ns-plain-safe-in + // [128] ns-plain-safe-out ::= ns-char + // [129] ns-plain-safe-in ::= ns-char - c-flow-indicator + // [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) + // | ( /* An ns-char preceding */ “#” ) + // | ( “:” /* Followed by an ns-plain-safe(c) */ ) + function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - 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 + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' + } + + // 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. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !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; + } + + // Simplified test for values allowed as the last character in plain style. + function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; + } + + // Same as 'string'.codePointAt(pos), but works in older browsers. + function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; + } + + // 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, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + 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(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, 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; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = 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. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : 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. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + + // 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, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + 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, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + 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) + '"'; + default: + throw new exception('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 = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; + } + + function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _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, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _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 (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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 exception('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.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 exception('!<' + 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, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + 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]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + 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$1(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; + } + + var dump_1 = dump$1; + + var dumper = { + dump: dump_1 + }; + + function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; + } + + + var Type = type; + var Schema = schema; + var FAILSAFE_SCHEMA = failsafe; + var JSON_SCHEMA = json; + var CORE_SCHEMA = core; + var DEFAULT_SCHEMA = _default; + var load = loader.load; + var loadAll = loader.loadAll; + var dump = dumper.dump; + var YAMLException = exception; + + // Re-export all types in case user wants to create custom schema + var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str + }; + + // Removed functions from JS-YAML 3.0.x + var safeLoad = renamed('safeLoad', 'load'); + var safeLoadAll = renamed('safeLoadAll', 'loadAll'); + var safeDump = renamed('safeDump', 'dump'); + + var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump + }; + + exports.CORE_SCHEMA = CORE_SCHEMA; + exports.DEFAULT_SCHEMA = DEFAULT_SCHEMA; + exports.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA; + exports.JSON_SCHEMA = JSON_SCHEMA; + exports.Schema = Schema; + exports.Type = Type; + exports.YAMLException = YAMLException; + exports.default = jsYaml; + exports.dump = dump; + exports.load = load; + exports.loadAll = loadAll; + exports.safeDump = safeDump; + exports.safeLoad = safeLoad; + exports.safeLoadAll = safeLoadAll; + exports.types = types; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 000000000..bdd8eef54 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1,2 @@ +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsyaml={})}(this,(function(e){"use strict";function t(e){return null==e}var n={isNothing:t,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:t(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;nl&&(t=i-l+(o=" ... ").length),n-i>l&&(n=i+l-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+o.length}}function l(e,t){return n.repeat(" ",t-e.length)+e}var c=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var i,r=/\r?\n|\r|\0/g,o=[0],c=[],s=-1;i=r.exec(e.buffer);)c.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=o.length-2);s<0&&(s=o.length-1);var u,p,f="",d=Math.min(e.line+t.linesAfter,c.length).toString().length,h=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)p=a(e.buffer,o[s-u],c[s-u],e.position-(o[s]-o[s-u]),h),f=n.repeat(" ",t.indent)+l((e.line-u+1).toString(),d)+" | "+p.str+"\n"+f;for(p=a(e.buffer,o[s],c[s],e.position,h),f+=n.repeat(" ",t.indent)+l((e.line+1).toString(),d)+" | "+p.str+"\n",f+=n.repeat("-",t.indent+d+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(s+u>=c.length);u++)p=a(e.buffer,o[s+u],c[s+u],e.position-(o[s]-o[s+u]),h),f+=n.repeat(" ",t.indent)+l((e.line+u+1).toString(),d)+" | "+p.str+"\n";return f.replace(/\n$/,"")},s=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],u=["scalar","sequence","mapping"];var p=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===s.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===u.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function f(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function d(e){return this.extend(e)}d.prototype.extend=function(e){var t=[],n=[];if(e instanceof p)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new o("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof p))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");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.");if(e.multi)throw new o("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof p))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(d.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=f(i,"implicit"),i.compiledExplicit=f(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),x=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var I=/^[-+]?[0-9]+e/;var S=new p("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!x.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||n.isNegativeZero(e))},represent:function(e,t){var i;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(n.isNegativeZero(e))return"-0.0";return i=e.toString(10),I.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),O=b.extend({implicit:[A,v,C,S]}),j=O,T=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),N=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var F=new p("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==T.exec(e)||null!==N.exec(e))},construct:function(e){var t,n,i,r,o,a,l,c,s=0,u=null;if(null===(t=T.exec(e))&&(t=N.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],l=+t[6],t[7]){for(s=t[7].slice(0,3);s.length<3;)s+="0";s=+s}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,i,r,o,a,l,s)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var E=new p("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var L=new p("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=M;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=M,a=0,l=[];for(t=0;t>16&255),l.push(a>>8&255),l.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0===(n=r%4*6)?(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)):18===n?(l.push(a>>10&255),l.push(a>>2&255)):12===n&&l.push(a>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=M;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),_=Object.prototype.hasOwnProperty,D=Object.prototype.toString;var U=new p("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=[],l=e;for(t=0,n=l.length;t>10),56320+(e-65536&1023))}for(var ie=new Array(256),re=new Array(256),oe=0;oe<256;oe++)ie[oe]=te(oe)?1:0,re[oe]=te(oe);function ae(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||K,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function le(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=c(n),new o(t,n)}function ce(e,t){throw le(e,t)}function se(e,t){e.onWarning&&e.onWarning.call(null,le(e,t))}var ue={YAML:function(e,t,n){var i,r,o;null!==e.version&&ce(e,"duplication of %YAML directive"),1!==n.length&&ce(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ce(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&ce(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&se(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&ce(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],G.test(i)||ce(e,"ill-formed tag handle (first argument) of the TAG directive"),P.call(e.tagMap,i)&&ce(e,'there is a previously declared suffix for "'+i+'" tag handle'),V.test(r)||ce(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){ce(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function pe(e,t,n,i){var r,o,a,l;if(t1&&(e.result+=n.repeat("\n",t-1))}function be(e,t){var n,i,r=e.tag,o=e.anchor,a=[],l=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),45===i)&&z(e.input.charCodeAt(e.position+1));)if(l=!0,e.position++,ge(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,we(e,t,3,!1,!0),a.push(e.result),ge(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)ce(e,"bad indentation of a sequence entry");else if(e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt)&&(y&&(a=e.line,l=e.lineStart,c=e.position),we(e,t,4,!0,r)&&(y?g=e.result:m=e.result),y||(de(e,f,d,h,g,m,a,l,c),h=g=m=null),ge(e,!0,-1),s=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==s)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===o?ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ce(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(Q(a)){do{a=e.input.charCodeAt(++e.position)}while(Q(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!J(a)&&0!==a)}for(;0!==a;){for(he(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),J(a))f++;else{if(e.lineIndent0){for(r=a,o=0;r>0;r--)(a=ee(l=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:ce(e,"expected hexadecimal character");e.result+=ne(o),e.position++}else ce(e,"unknown escape sequence");n=i=e.position}else J(l)?(pe(e,n,i,!0),ye(e,ge(e,!1,t)),n=i=e.position):e.position===e.lineStart&&me(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?y=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!z(i)&&!X(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),P.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,l,c,s,u,p=e.kind,f=e.result;if(z(u=e.input.charCodeAt(e.position))||X(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(z(i=e.input.charCodeAt(e.position+1))||n&&X(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(z(i=e.input.charCodeAt(e.position+1))||n&&X(i))break}else if(35===u){if(z(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&me(e)||n&&X(u))break;if(J(u)){if(l=e.line,c=e.lineStart,s=e.lineIndent,ge(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=l,e.lineStart=c,e.lineIndent=s;break}}a&&(pe(e,r,o,!1),ye(e,e.line-l),r=o=e.position,a=!1),Q(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return pe(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===i)&&(y=!0,null===e.tag&&(e.tag="?")):(y=!0,null===e.tag&&null===e.anchor||ce(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(y=c&&be(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ce(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),s=0,u=e.implicitTypes.length;s"),null!==e.result&&f.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function ke(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(ge(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&ce(e,"directive name must not be less than one character in length");0!==r;){for(;Q(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!J(r));break}if(J(r))break;for(t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&he(e),P.call(ue,n)?ue[n](e,n,i):se(e,'unknown document directive "'+n+'"')}ge(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ge(e,!0,-1)):a&&ce(e,"directives end mark is expected"),we(e,e.lineIndent-1,4,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&H.test(e.input.slice(o,e.position))&&se(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&me(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ge(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function Re(e){return/^\n* /.test(e)}function Be(e,t,n,i,r,o,a,l){var c,s,u=0,p=null,f=!1,d=!1,h=-1!==i,g=-1,m=De(s=Ye(e,0))&&s!==Oe&&!_e(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&61!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&function(e){return!_e(e)&&58!==e}(Ye(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!De(u=Ye(e,c)))return 5;m=m&&qe(u,p,l),p=u}else{for(c=0;c=65536?c+=2:c++){if(10===(u=Ye(e,c)))f=!0,h&&(d=d||c-g-1>i&&" "!==e[g+1],g=c);else if(!De(u))return 5;m=m&&qe(u,p,l),p=u}d=d||h&&c-g-1>i&&" "!==e[g+1]}return f||d?n>9&&Re(e)?5:a?2===o?5:2:d?4:3:!m||a||r(e)?2===o?5:2:1}function Ke(e,t,n,i,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Te.indexOf(t)||Ne.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),l=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=i||e.flowLevel>-1&&n>=e.flowLevel;switch(Be(t,c,e.indent,l,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+Pe(t,e.indent)+We(Me(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(l=e.indexOf("\n"),l=-1!==l?l:e.length,r.lastIndex=l,He(e.slice(0,l),t)),a="\n"===e[0]||" "===e[0];var l;for(;i=r.exec(e);){var c=i[1],s=i[2];n=" "===s[0],o+=c+(a||n||""===s?"":"\n")+He(s,t),a=n}return o}(t,l),a));case 5:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=Ye(e,r),!(t=je[i])&&De(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Fe(i);return n}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function Pe(e,t){var n=Re(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function We(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function He(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,l=0,c="";n=r.exec(e);)(l=n.index)-o>t&&(i=a>o?a:l,c+="\n"+e.slice(o,i),o=i+1),a=l;return c+="\n",e.length-o>t&&a>o?c+=e.slice(o,a)+"\n"+e.slice(a+1):c+=e.slice(o),c.slice(1)}function $e(e,t,n,i){var r,o,a,l="",c=e.tag;for(r=0,o=n.length;r tag resolver accepts not "'+s+'" style');i=c.represent[s](t,s)}e.dump=i}return!0}return!1}function Ve(e,t,n,i,r,a,l){e.tag=null,e.dump=n,Ge(e,n,!1)||Ge(e,n,!0);var c,s=Ie.call(e.dump),u=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var p,f,d="[object Object]"===s||"[object Array]"===s;if(d&&(f=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(r=!1),f&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(d&&f&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===s)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,a,l,c,s,u,p="",f=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(r=0,a=d.length;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,s&&(u+=Le(e,t)),Ve(e,t+1,c,!0,s)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a,l,c="",s=e.tag,u=Object.keys(n);for(i=0,r=u.length;i1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ve(e,t,a,!1,!1)&&(c+=l+=e.dump));e.tag=s,e.dump="{"+c+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===s)i&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?$e(e,t-1,e.dump,r):$e(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a="",l=e.tag;for(i=0,r=n.length;i",e.dump=c+" "+e.dump)}return!0}function Ze(e,t){var n,i,r=[],o=[];for(Je(e,r,o),n=0,i=o.length;n maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +var snippet = makeSnippet; + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + '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$1(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + 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.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +var type = Type$1; + +/*eslint-disable max-len*/ + + + + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + 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$1(definition) { + return this.extend(definition); +} + + +Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema$1.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +var schema = Schema$1; + +var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] +}); + +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; +} + +var _null = 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'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); + +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]'; +} + +var bool = 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' +}); + +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 !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + 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) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + 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.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +var int = 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 ? '0o' + obj.toString(8) : '-0o' + 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' ] + } +}); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[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; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + 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; + } + 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)); +} + +var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] +}); + +var core = json; + +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(); +} + +var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +/*eslint-disable no-bitwise*/ + + + + + +// [ 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); + } + + return new Uint8Array(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(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; +var _toString$2 = 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$2.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty$3.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 : []; +} + +var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +var _toString$1 = 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$1.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; +} + +var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] +}); + +/*eslint-disable max-len,no-use-before-define*/ + + + + + + + +var _hasOwnProperty$1 = 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$1(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + 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; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = snippet(mark); + + return new exception(message, mark); +} + +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$1.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'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + 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$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, 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$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _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; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + 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, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + 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'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + 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; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + 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, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } 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; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + 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, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // 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, _keyLine, _keyLineStart, _keyPos); + 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 { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + 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, _keyLine, _keyLineStart, _keyPos); + 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`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + 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, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + 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 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, _keyLine, _keyLineStart, _keyPos); + } + + // 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); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.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$1.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) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else 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 (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + 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.tag)) { // `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, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + 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 = Object.create(null); + state.anchorMap = Object.create(null); + + 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$1.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$1(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$1(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$1(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 exception('expected a single document in the stream, but found more'); +} + + +var loadAll_1 = loadAll$1; +var load_1 = load$1; + +var loader = { + loadAll: loadAll_1, + load: load_1 +}; + +/*eslint-disable no-use-before-define*/ + + + + + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +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' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +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 exception('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || _default; + 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.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + 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 !== CHAR_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 +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - 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 + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// 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. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !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; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// 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, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + 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(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, 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; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = 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. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : 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. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// 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, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + 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, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + 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) + '"'; + default: + throw new exception('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 = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _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, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _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 (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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 exception('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.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 exception('!<' + 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, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + 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]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + 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$1(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +var dump_1 = dump$1; + +var dumper = { + dump: dump_1 +}; + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +var Type = type; +var Schema = schema; +var FAILSAFE_SCHEMA = failsafe; +var JSON_SCHEMA = json; +var CORE_SCHEMA = core; +var DEFAULT_SCHEMA = _default; +var load = loader.load; +var loadAll = loader.loadAll; +var dump = dumper.dump; +var YAMLException = exception; + +// Re-export all types in case user wants to create custom schema +var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str +}; + +// Removed functions from JS-YAML 3.0.x +var safeLoad = renamed('safeLoad', 'load'); +var safeLoadAll = renamed('safeLoadAll', 'loadAll'); +var safeDump = renamed('safeDump', 'dump'); + +var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump +}; + +export default jsYaml; +export { CORE_SCHEMA, DEFAULT_SCHEMA, FAILSAFE_SCHEMA, JSON_SCHEMA, Schema, Type, YAMLException, dump, load, loadAll, safeDump, safeLoad, safeLoadAll, types }; diff --git a/node_modules/eslint/node_modules/js-yaml/index.js b/node_modules/eslint/node_modules/js-yaml/index.js new file mode 100644 index 000000000..bcb7eba7a --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/index.js @@ -0,0 +1,47 @@ +'use strict'; + + +var loader = require('./lib/loader'); +var dumper = require('./lib/dumper'); + + +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} + + +module.exports.Type = require('./lib/type'); +module.exports.Schema = require('./lib/schema'); +module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe'); +module.exports.JSON_SCHEMA = require('./lib/schema/json'); +module.exports.CORE_SCHEMA = require('./lib/schema/core'); +module.exports.DEFAULT_SCHEMA = require('./lib/schema/default'); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.dump = dumper.dump; +module.exports.YAMLException = require('./lib/exception'); + +// Re-export all types in case user wants to create custom schema +module.exports.types = { + binary: require('./lib/type/binary'), + float: require('./lib/type/float'), + map: require('./lib/type/map'), + null: require('./lib/type/null'), + pairs: require('./lib/type/pairs'), + set: require('./lib/type/set'), + timestamp: require('./lib/type/timestamp'), + bool: require('./lib/type/bool'), + int: require('./lib/type/int'), + merge: require('./lib/type/merge'), + omap: require('./lib/type/omap'), + seq: require('./lib/type/seq'), + str: require('./lib/type/str') +}; + +// Removed functions from JS-YAML 3.0.x +module.exports.safeLoad = renamed('safeLoad', 'load'); +module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll'); +module.exports.safeDump = renamed('safeDump', 'dump'); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/common.js b/node_modules/eslint/node_modules/js-yaml/lib/common.js new file mode 100644 index 000000000..25ef7d8e4 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/common.js @@ -0,0 +1,59 @@ +'use strict'; + + +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} + + +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/dumper.js b/node_modules/eslint/node_modules/js-yaml/lib/dumper.js new file mode 100644 index 000000000..f357a6aee --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/dumper.js @@ -0,0 +1,965 @@ +'use strict'; + +/*eslint-disable no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var DEFAULT_SCHEMA = require('./schema/default'); + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +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' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +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; +} + + +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; + +function State(options) { + this.schema = options['schema'] || DEFAULT_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.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + + 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 !== CHAR_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 +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - 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 + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} + +// 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. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !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; +} + +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} + +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +} + +// 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, quotingType, forceQuotes, inblock) { + + var i; + var char = 0; + var prevChar = null; + 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(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); + + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, 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; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = 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. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : 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. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} + +// 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, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + 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, state.quotingType, state.forceQuotes && !iskey, inblock)) { + + 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 = 0; + var escapeSeq; + + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; + + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { + + if (_result !== '') _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, + value; + + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; + + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } + + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { + + if (!compact || _result !== '') { + _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 (_result !== '') pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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 || _result !== '') { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + + 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))) { + + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.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, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; + + 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]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); + + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } + + state.dump = tagStr + ' ' + 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); + + var value = input; + + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); + } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; +} + +module.exports.dump = dump; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/exception.js b/node_modules/eslint/node_modules/js-yaml/lib/exception.js new file mode 100644 index 000000000..7f62daaef --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/exception.js @@ -0,0 +1,55 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + + +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; + } + + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; +} + + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + + // 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) { + return this.name + ': ' + formatError(this, compact); +}; + + +module.exports = YAMLException; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/loader.js b/node_modules/eslint/node_modules/js-yaml/lib/loader.js new file mode 100644 index 000000000..39f13f561 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/loader.js @@ -0,0 +1,1727 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var makeSnippet = require('./snippet'); +var DEFAULT_SCHEMA = require('./schema/default'); + + +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_SCHEMA; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + 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; + + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + + mark.snippet = makeSnippet(mark); + + return new YAMLException(message, mark); +} + +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'); + } + + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); + } + + 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, startLineStart, 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.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _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; + state.firstTabInLine = -1; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + 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, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + 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'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); + } + + 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; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + 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, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } 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; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + 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, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } + + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + + // + // 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, _keyLine, _keyLineStart, _keyPos); + 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 { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; + } + + 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, _keyLine, _keyLineStart, _keyPos); + 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`. + } + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + + 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, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + + 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 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, _keyLine, _keyLineStart, _keyPos); + } + + // 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); + } + + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + 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) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + + } else 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 (state.tag !== '!') { + if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; + + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } + + if (!type) { + throwError(state, 'unknown tag !<' + 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.tag)) { // `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, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + + 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 = Object.create(null); + state.anchorMap = Object.create(null); + + 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'); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/schema.js b/node_modules/eslint/node_modules/js-yaml/lib/schema.js new file mode 100644 index 000000000..65b41f401 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/schema.js @@ -0,0 +1,121 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name) { + var result = []; + + schema[name].forEach(function (currentType) { + var newIndex = result.length; + + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { + + newIndex = previousIndex; + } + }); + + result[newIndex] = currentType; + }); + + return result; +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + 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) { + return this.extend(definition); +} + + +Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + + if (definition instanceof Type) { + // Schema.extend(type) + explicit.push(definition); + + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); + + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + + } else { + throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } + + implicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + 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.'); + } + + if (type.multi) { + throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); + + explicit.forEach(function (type) { + if (!(type instanceof Type)) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); + + var result = Object.create(Schema.prototype); + + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + + return result; +}; + + +module.exports = Schema; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js b/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js new file mode 100644 index 000000000..608b26de2 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js @@ -0,0 +1,11 @@ +// 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'; + + +module.exports = require('./json'); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js b/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js new file mode 100644 index 000000000..3af0520d5 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js @@ -0,0 +1,22 @@ +// 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'; + + +module.exports = require('./core').extend({ + 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/eslint/node_modules/js-yaml/lib/schema/failsafe.js b/node_modules/eslint/node_modules/js-yaml/lib/schema/failsafe.js new file mode 100644 index 000000000..b7a33eb7a --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/schema/json.js b/node_modules/eslint/node_modules/js-yaml/lib/schema/json.js new file mode 100644 index 000000000..b73df78e5 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/schema/json.js @@ -0,0 +1,19 @@ +// 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'; + + +module.exports = require('./failsafe').extend({ + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/snippet.js b/node_modules/eslint/node_modules/js-yaml/lib/snippet.js new file mode 100644 index 000000000..00e2133c0 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/snippet.js @@ -0,0 +1,101 @@ +'use strict'; + + +var common = require('./common'); + + +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } + + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; +} + + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; +} + + +function makeSnippet(mark, options) { + options = Object.create(options || null); + + if (!mark.buffer) return null; + + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; + + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; + + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } + + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; + + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } + + return result.replace(/\n$/, ''); +} + + +module.exports = makeSnippet; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/type.js b/node_modules/eslint/node_modules/js-yaml/lib/type.js new file mode 100644 index 000000000..5e57877fe --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/type.js @@ -0,0 +1,66 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + '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.options = options; // keep original options in case user wants to extend this type later + 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.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + 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/eslint/node_modules/js-yaml/lib/type/binary.js b/node_modules/eslint/node_modules/js-yaml/lib/type/binary.js new file mode 100644 index 000000000..e1523513d --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/type/binary.js @@ -0,0 +1,125 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + + +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); + } + + return new Uint8Array(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(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/type/bool.js b/node_modules/eslint/node_modules/js-yaml/lib/type/bool.js new file mode 100644 index 000000000..cb7745930 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/float.js b/node_modules/eslint/node_modules/js-yaml/lib/type/float.js new file mode 100644 index 000000000..74d77ec2e --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/type/float.js @@ -0,0 +1,97 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[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; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + + 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; + } + 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/eslint/node_modules/js-yaml/lib/type/int.js b/node_modules/eslint/node_modules/js-yaml/lib/type/int.js new file mode 100644 index 000000000..3fe3a4437 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/type/int.js @@ -0,0 +1,156 @@ +'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 !== '_'; + } + + + if (ch === 'o') { + // base 8 + index++; + + 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) + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + return true; +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch; + + 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.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } + + 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 ? '0o' + obj.toString(8) : '-0o' + 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/eslint/node_modules/js-yaml/lib/type/map.js b/node_modules/eslint/node_modules/js-yaml/lib/type/map.js new file mode 100644 index 000000000..f327beebd --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/merge.js b/node_modules/eslint/node_modules/js-yaml/lib/type/merge.js new file mode 100644 index 000000000..ae08a8644 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/null.js b/node_modules/eslint/node_modules/js-yaml/lib/type/null.js new file mode 100644 index 000000000..315ca4e23 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/type/null.js @@ -0,0 +1,35 @@ +'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'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/type/omap.js b/node_modules/eslint/node_modules/js-yaml/lib/type/omap.js new file mode 100644 index 000000000..b2b5323bd --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/pairs.js b/node_modules/eslint/node_modules/js-yaml/lib/type/pairs.js new file mode 100644 index 000000000..74b52403f --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/seq.js b/node_modules/eslint/node_modules/js-yaml/lib/type/seq.js new file mode 100644 index 000000000..be8f77f28 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/set.js b/node_modules/eslint/node_modules/js-yaml/lib/type/set.js new file mode 100644 index 000000000..f885a329c --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/str.js b/node_modules/eslint/node_modules/js-yaml/lib/type/str.js new file mode 100644 index 000000000..27acc106c --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/lib/type/timestamp.js b/node_modules/eslint/node_modules/js-yaml/lib/type/timestamp.js new file mode 100644 index 000000000..8fa9c5865 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/lib/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/eslint/node_modules/js-yaml/package.json b/node_modules/eslint/node_modules/js-yaml/package.json new file mode 100644 index 000000000..17574da80 --- /dev/null +++ b/node_modules/eslint/node_modules/js-yaml/package.json @@ -0,0 +1,66 @@ +{ + "name": "js-yaml", + "version": "4.1.0", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "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" + }, + "module": "./dist/js-yaml.mjs", + "exports": { + ".": { + "import": "./dist/js-yaml.mjs", + "require": "./index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "lint": "eslint .", + "test": "npm run lint && mocha", + "coverage": "npm run lint && nyc mocha && nyc report --reporter html", + "demo": "npm run lint && node support/build_demo.js", + "gh-demo": "npm run demo && gh-pages -d demo -f", + "browserify": "rollup -c support/rollup.config.js", + "prepublishOnly": "npm run gh-demo" + }, + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", + "dependencies": { + "argparse": "^2.0.1" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-node-resolve": "^11.0.0", + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^2.8.0", + "gh-pages": "^3.1.0", + "mocha": "^8.2.1", + "nyc": "^15.1.0", + "rollup": "^2.34.1", + "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^7.0.2", + "shelljs": "^0.8.4" + } +} diff --git a/node_modules/eslint/node_modules/locate-path/index.d.ts b/node_modules/eslint/node_modules/locate-path/index.d.ts new file mode 100644 index 000000000..a714f1d3f --- /dev/null +++ b/node_modules/eslint/node_modules/locate-path/index.d.ts @@ -0,0 +1,83 @@ +declare namespace locatePath { + interface Options { + /** + Current working directory. + + @default process.cwd() + */ + readonly cwd?: string; + + /** + Type of path to match. + + @default 'file' + */ + readonly type?: 'file' | 'directory'; + + /** + Allow symbolic links to match if they point to the requested path type. + + @default true + */ + readonly allowSymlinks?: boolean; + } + + interface AsyncOptions extends Options { + /** + Number of concurrently pending promises. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `paths` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const locatePath: { + /** + Synchronously get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + */ + sync: ( + paths: Iterable, + options?: locatePath.Options + ) => string | undefined; + + /** + Get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + + @example + ``` + import locatePath = require('locate-path'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + console(await locatePath(files)); + //=> 'rainbow' + })(); + ``` + */ + (paths: Iterable, options?: locatePath.AsyncOptions): Promise< + string | undefined + >; +}; + +export = locatePath; diff --git a/node_modules/eslint/node_modules/locate-path/index.js b/node_modules/eslint/node_modules/locate-path/index.js new file mode 100644 index 000000000..a6358e546 --- /dev/null +++ b/node_modules/eslint/node_modules/locate-path/index.js @@ -0,0 +1,68 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const {promisify} = require('util'); +const pLocate = require('p-locate'); + +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); + +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; + +function checkType({type}) { + if (type in typeMappings) { + return; + } + + throw new Error(`Invalid type specified: ${type}`); +} + +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); + +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + + checkType(options); + + const statFn = options.allowSymlinks ? fsStat : fsLStat; + + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch { + return false; + } + }, options); +}; + +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + + checkType(options); + + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; + + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); + + if (matchType(options.type, stat)) { + return path_; + } + } catch {} + } +}; diff --git a/node_modules/eslint/node_modules/locate-path/license b/node_modules/eslint/node_modules/locate-path/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/eslint/node_modules/locate-path/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/eslint/node_modules/locate-path/package.json b/node_modules/eslint/node_modules/locate-path/package.json new file mode 100644 index 000000000..08bea50dc --- /dev/null +++ b/node_modules/eslint/node_modules/locate-path/package.json @@ -0,0 +1,46 @@ +{ + "name": "locate-path", + "version": "6.0.0", + "description": "Get the first path that exists on disk of multiple paths", + "license": "MIT", + "repository": "sindresorhus/locate-path", + "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": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "dependencies": { + "p-locate": "^5.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.13.1", + "xo": "^0.32.1" + } +} diff --git a/node_modules/eslint/node_modules/locate-path/readme.md b/node_modules/eslint/node_modules/locate-path/readme.md new file mode 100644 index 000000000..1002bcd6a --- /dev/null +++ b/node_modules/eslint/node_modules/locate-path/readme.md @@ -0,0 +1,125 @@ +# locate-path [![Build Status](https://travis-ci.com/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.com/github/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + +## Install + +``` +$ npm install locate-path +``` + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + console(await locatePath(files)); + //=> 'rainbow' +})(); +``` + +## API + +### locatePath(paths, options?) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `object` + +##### concurrency + +Type: `number`\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`\ +Default: `true` + +Preserve `paths` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Current working directory. + +##### type + +Type: `string`\ +Default: `'file'`\ +Values: `'file' | 'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`\ +Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### locatePath.sync(paths, options?) + +Returns the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `object` + +##### cwd + +Same as above. + +##### type + +Same as above. + +##### allowSymlinks + +Same as above. + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + +--- + +
+ + 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/eslint/node_modules/p-limit/index.d.ts b/node_modules/eslint/node_modules/p-limit/index.d.ts new file mode 100644 index 000000000..f348d7f13 --- /dev/null +++ b/node_modules/eslint/node_modules/p-limit/index.d.ts @@ -0,0 +1,42 @@ +declare namespace pLimit { + interface Limit { + /** + The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + + /** + Discard pending promises that are waiting to run. + + This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + + Note: This does not cancel promises that are already running. + */ + clearQueue: () => void; + + /** + @param fn - Promise-returning/async function. + @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. + @returns The promise returned by calling `fn(...arguments)`. + */ + ( + fn: (...arguments: Arguments) => PromiseLike | ReturnType, + ...arguments: Arguments + ): Promise; + } +} + +/** +Run multiple promise-returning & async functions with limited concurrency. + +@param concurrency - Concurrency limit. Minimum: `1`. +@returns A `limit` function. +*/ +declare function pLimit(concurrency: number): pLimit.Limit; + +export = pLimit; diff --git a/node_modules/eslint/node_modules/p-limit/index.js b/node_modules/eslint/node_modules/p-limit/index.js new file mode 100644 index 000000000..c2ae52d90 --- /dev/null +++ b/node_modules/eslint/node_modules/p-limit/index.js @@ -0,0 +1,71 @@ +'use strict'; +const Queue = require('yocto-queue'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = new Queue(); + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.size > 0) { + queue.dequeue()(); + } + }; + + const run = async (fn, resolve, ...args) => { + activeCount++; + + const result = (async () => fn(...args))(); + + resolve(result); + + try { + await result; + } catch {} + + next(); + }; + + const enqueue = (fn, resolve, ...args) => { + queue.enqueue(run.bind(null, fn, resolve, ...args)); + + (async () => { + // This function needs to wait until the next microtask before comparing + // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously + // when the run function is dequeued and called. The comparison in the if-statement + // needs to happen asynchronously as well to get an up-to-date value for `activeCount`. + await Promise.resolve(); + + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); + } + })(); + }; + + const generator = (fn, ...args) => new Promise(resolve => { + enqueue(fn, resolve, ...args); + }); + + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); + } + } + }); + + return generator; +}; + +module.exports = pLimit; diff --git a/node_modules/eslint/node_modules/p-limit/license b/node_modules/eslint/node_modules/p-limit/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/eslint/node_modules/p-limit/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/eslint/node_modules/p-limit/package.json b/node_modules/eslint/node_modules/p-limit/package.json new file mode 100644 index 000000000..76514736f --- /dev/null +++ b/node_modules/eslint/node_modules/p-limit/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-limit", + "version": "3.1.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "delay": "^4.4.0", + "in-range": "^2.0.0", + "random-int": "^2.0.1", + "time-span": "^4.0.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/eslint/node_modules/p-limit/readme.md b/node_modules/eslint/node_modules/p-limit/readme.md new file mode 100644 index 000000000..b283c1e63 --- /dev/null +++ b/node_modules/eslint/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/eslint/node_modules/p-locate/index.d.ts b/node_modules/eslint/node_modules/p-locate/index.d.ts new file mode 100644 index 000000000..38c7e578f --- /dev/null +++ b/node_modules/eslint/node_modules/p-locate/index.d.ts @@ -0,0 +1,53 @@ +declare namespace pLocate { + interface Options { + /** + Number of concurrently pending promises returned by `tester`. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `input` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +/** +Get the first fulfilled promise that satisfies the provided testing function. + +@param input - An iterable of promises/values to test. +@param tester - This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. +@returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +@example +``` +import pathExists = require('path-exists'); +import pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` +*/ +declare function pLocate( + input: Iterable | ValueType>, + tester: (element: ValueType) => PromiseLike | boolean, + options?: pLocate.Options +): Promise; + +export = pLocate; diff --git a/node_modules/eslint/node_modules/p-locate/index.js b/node_modules/eslint/node_modules/p-locate/index.js new file mode 100644 index 000000000..641c3dd1e --- /dev/null +++ b/node_modules/eslint/node_modules/p-locate/index.js @@ -0,0 +1,50 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; +}; + +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; diff --git a/node_modules/eslint/node_modules/p-locate/license b/node_modules/eslint/node_modules/p-locate/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/eslint/node_modules/p-locate/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/eslint/node_modules/p-locate/package.json b/node_modules/eslint/node_modules/p-locate/package.json new file mode 100644 index 000000000..2d5e447f5 --- /dev/null +++ b/node_modules/eslint/node_modules/p-locate/package.json @@ -0,0 +1,54 @@ +{ + "name": "p-locate", + "version": "5.0.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "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": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^3.0.2" + }, + "devDependencies": { + "ava": "^2.4.0", + "delay": "^4.1.0", + "in-range": "^2.0.0", + "time-span": "^4.0.0", + "tsd": "^0.13.1", + "xo": "^0.32.1" + } +} diff --git a/node_modules/eslint/node_modules/p-locate/readme.md b/node_modules/eslint/node_modules/p-locate/readme.md new file mode 100644 index 000000000..be85ec1d4 --- /dev/null +++ b/node_modules/eslint/node_modules/p-locate/readme.md @@ -0,0 +1,93 @@ +# p-locate [![Build Status](https://travis-ci.com/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.com/github/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + +## Install + +``` +$ npm install p-locate +``` + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + +## API + +### pLocate(input, tester, options?) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +An iterable of promises/values to test. + +#### tester(element) + +Type: `Function` + +This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + +#### options + +Type: `object` + +##### concurrency + +Type: `number`\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`\ +Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + 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/eslint/node_modules/semver/CHANGELOG.md b/node_modules/eslint/node_modules/semver/CHANGELOG.md deleted file mode 100644 index 220af176f..000000000 --- a/node_modules/eslint/node_modules/semver/CHANGELOG.md +++ /dev/null @@ -1,111 +0,0 @@ -# changes log - -## 7.3.0 - -* Add `subset(r1, r2)` method to determine if `r1` range is entirely - contained by `r2` range. - -## 7.2.3 - -* Fix handling of `includePrelease` mode where version ranges like `1.0.0 - - 2.0.0` would include `3.0.0-pre` and not `1.0.0-pre`. - -## 7.2.2 - -* Fix bug where `2.0.0-pre` would be included in `^1.0.0` if - `includePrerelease` was set to true. - -## 7.2.0 - -* Add `simplifyRange` method to attempt to generate a more human-readable - range expression that is equivalent to a supplied range, for a given set - of versions. - -## 7.1.2 - -* Remove fancy lazy-loading logic, as it was causing problems for webpack - users. - -## 7.1.0 - -* Add `require('semver/preload')` to load the entire module without using - lazy getter methods. - -## 7.0.0 - -* Refactor module into separate files for better tree-shaking -* Drop support for very old node versions, use const/let, `=>` functions, - and classes. - -## 6.3.0 - -* Expose the token enum on the exports - -## 6.2.0 - -* Coerce numbers to strings when passed to semver.coerce() -* Add `rtl` option to coerce from right to left - -## 6.1.3 - -* Handle X-ranges properly in includePrerelease mode - -## 6.1.2 - -* Do not throw when testing invalid version strings - -## 6.1.1 - -* Add options support for semver.coerce() -* Handle undefined version passed to Range.test - -## 6.1.0 - -* Add semver.compareBuild function -* Support `*` in semver.intersects - -## 6.0 - -* Fix `intersects` logic. - - This is technically a bug fix, but since it is also a change to behavior - that may require users updating their code, it is marked as a major - version increment. - -## 5.7 - -* Add `minVersion` method - -## 5.6 - -* Move boolean `loose` param to an options object, with - backwards-compatibility protection. -* Add ability to opt out of special prerelease version handling with - the `includePrerelease` option flag. - -## 5.5 - -* Add version coercion capabilities - -## 5.4 - -* Add intersection checking - -## 5.3 - -* Add `minSatisfying` method - -## 5.2 - -* Add `prerelease(v)` that returns prerelease components - -## 5.1 - -* Add Backus-Naur for ranges -* Remove excessively cute inspection methods - -## 5.0 - -* Remove AMD/Browserified build artifacts -* Fix ltr and gtr when using the `*` range -* Fix for range `*` with a prerelease identifier diff --git a/node_modules/eslint/node_modules/semver/README.md b/node_modules/eslint/node_modules/semver/README.md deleted file mode 100644 index 9bef045af..000000000 --- a/node_modules/eslint/node_modules/semver/README.md +++ /dev/null @@ -1,566 +0,0 @@ -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 - --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`. - -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 -``` - -### 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 version 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` - -## 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/eslint/node_modules/semver/bin/semver.js b/node_modules/eslint/node_modules/semver/bin/semver.js deleted file mode 100755 index 73fe29538..000000000 --- a/node_modules/eslint/node_modules/semver/bin/semver.js +++ /dev/null @@ -1,173 +0,0 @@ -#!/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 - -const semver = require('../') - -let reverse = false - -const options = {} - -const main = () => { - if (!argv.length) return help() - while (argv.length) { - let a = argv.shift() - const indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - a = a.slice(0, indexOfEqualSign) - argv.unshift(a.slice(indexOfEqualSign + 1)) - } - 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 '-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 - } - } - - const options = { loose: loose, includePrerelease: includePrerelease, rtl: 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) : 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) - -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/eslint/node_modules/semver/classes/comparator.js b/node_modules/eslint/node_modules/semver/classes/comparator.js deleted file mode 100644 index dbbef2d8f..000000000 --- a/node_modules/eslint/node_modules/semver/classes/comparator.js +++ /dev/null @@ -1,135 +0,0 @@ -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 - } - } - - 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 (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - 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) - } - - const sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - const sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - const sameSemVer = this.semver.version === comp.semver.version - const differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - const oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<') - const oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>') - - return ( - sameDirectionIncreasing || - sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || - oppositeDirectionsGreaterThan - ) - } -} - -module.exports = Comparator - -const parseOptions = require('../internal/parse-options') -const {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/eslint/node_modules/semver/classes/index.js b/node_modules/eslint/node_modules/semver/classes/index.js deleted file mode 100644 index 198b84d66..000000000 --- a/node_modules/eslint/node_modules/semver/classes/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - SemVer: require('./semver.js'), - Range: require('./range.js'), - Comparator: require('./comparator.js') -} diff --git a/node_modules/eslint/node_modules/semver/classes/range.js b/node_modules/eslint/node_modules/semver/classes/range.js deleted file mode 100644 index aa04f6bff..000000000 --- a/node_modules/eslint/node_modules/semver/classes/range.js +++ /dev/null @@ -1,510 +0,0 @@ -// 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, split based on boolean or || - this.raw = range - this.set = range - .split(/\s*\|\|\s*/) - // map the range to a 2d array of comparators - .map(range => this.parseRange(range.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: ${range}`) - } - - // 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) => { - return comps.join(' ').trim() - }) - .join('||') - .trim() - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - range = range.trim() - - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = Object.keys(this.options).join(',') - const memoKey = `parseRange:${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, re[t.COMPARATORTRIM]) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - // in loose mode, throw out any that are not valid comparators - .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) - .map(comp => new Comparator(comp, this.options)) - - // 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 l = rangeList.length - const rangeMap = new Map() - for (const comp of rangeList) { - 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 { - re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace -} = require('../internal/re') - -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 -const replaceTildes = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceTilde(comp, 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 -const replaceCarets = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceCaret(comp, 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((comp) => { - return replaceXRange(comp, 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/eslint/node_modules/semver/classes/semver.js b/node_modules/eslint/node_modules/semver/classes/semver.js deleted file mode 100644 index ed81a7ec6..000000000 --- a/node_modules/eslint/node_modules/semver/classes/semver.js +++ /dev/null @@ -1,287 +0,0 @@ -const debug = require('../internal/debug') -const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') -const { 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: ${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) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - 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) - this.inc('pre', identifier) - 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) - } - this.inc('pre', identifier) - 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': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } 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 - this.prerelease.push(0) - } - } - 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 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break - - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.format() - this.raw = this.version - return this - } -} - -module.exports = SemVer diff --git a/node_modules/eslint/node_modules/semver/functions/clean.js b/node_modules/eslint/node_modules/semver/functions/clean.js deleted file mode 100644 index 811fe6b82..000000000 --- a/node_modules/eslint/node_modules/semver/functions/clean.js +++ /dev/null @@ -1,6 +0,0 @@ -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/eslint/node_modules/semver/functions/cmp.js b/node_modules/eslint/node_modules/semver/functions/cmp.js deleted file mode 100644 index 3b89db779..000000000 --- a/node_modules/eslint/node_modules/semver/functions/cmp.js +++ /dev/null @@ -1,48 +0,0 @@ -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/eslint/node_modules/semver/functions/coerce.js b/node_modules/eslint/node_modules/semver/functions/coerce.js deleted file mode 100644 index 106ca71c9..000000000 --- a/node_modules/eslint/node_modules/semver/functions/coerce.js +++ /dev/null @@ -1,51 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = require('./parse') -const {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/eslint/node_modules/semver/functions/compare-build.js b/node_modules/eslint/node_modules/semver/functions/compare-build.js deleted file mode 100644 index 9eb881bef..000000000 --- a/node_modules/eslint/node_modules/semver/functions/compare-build.js +++ /dev/null @@ -1,7 +0,0 @@ -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/eslint/node_modules/semver/functions/compare-loose.js b/node_modules/eslint/node_modules/semver/functions/compare-loose.js deleted file mode 100644 index 4881fbe00..000000000 --- a/node_modules/eslint/node_modules/semver/functions/compare-loose.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose diff --git a/node_modules/eslint/node_modules/semver/functions/compare.js b/node_modules/eslint/node_modules/semver/functions/compare.js deleted file mode 100644 index 748b7afa5..000000000 --- a/node_modules/eslint/node_modules/semver/functions/compare.js +++ /dev/null @@ -1,5 +0,0 @@ -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/eslint/node_modules/semver/functions/diff.js b/node_modules/eslint/node_modules/semver/functions/diff.js deleted file mode 100644 index 87200ef3b..000000000 --- a/node_modules/eslint/node_modules/semver/functions/diff.js +++ /dev/null @@ -1,23 +0,0 @@ -const parse = require('./parse') -const eq = require('./eq') - -const diff = (version1, version2) => { - if (eq(version1, version2)) { - return null - } else { - const v1 = parse(version1) - const v2 = parse(version2) - const hasPre = v1.prerelease.length || v2.prerelease.length - const prefix = hasPre ? 'pre' : '' - const defaultResult = hasPre ? 'prerelease' : '' - for (const key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} -module.exports = diff diff --git a/node_modules/eslint/node_modules/semver/functions/eq.js b/node_modules/eslint/node_modules/semver/functions/eq.js deleted file mode 100644 index 271fed976..000000000 --- a/node_modules/eslint/node_modules/semver/functions/eq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq diff --git a/node_modules/eslint/node_modules/semver/functions/gt.js b/node_modules/eslint/node_modules/semver/functions/gt.js deleted file mode 100644 index d9b2156d8..000000000 --- a/node_modules/eslint/node_modules/semver/functions/gt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt diff --git a/node_modules/eslint/node_modules/semver/functions/gte.js b/node_modules/eslint/node_modules/semver/functions/gte.js deleted file mode 100644 index 5aeaa6347..000000000 --- a/node_modules/eslint/node_modules/semver/functions/gte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte diff --git a/node_modules/eslint/node_modules/semver/functions/inc.js b/node_modules/eslint/node_modules/semver/functions/inc.js deleted file mode 100644 index aa4d83ab4..000000000 --- a/node_modules/eslint/node_modules/semver/functions/inc.js +++ /dev/null @@ -1,15 +0,0 @@ -const SemVer = require('../classes/semver') - -const inc = (version, release, options, identifier) => { - if (typeof (options) === 'string') { - identifier = options - options = undefined - } - - try { - return new SemVer(version, options).inc(release, identifier).version - } catch (er) { - return null - } -} -module.exports = inc diff --git a/node_modules/eslint/node_modules/semver/functions/lt.js b/node_modules/eslint/node_modules/semver/functions/lt.js deleted file mode 100644 index b440ab7d4..000000000 --- a/node_modules/eslint/node_modules/semver/functions/lt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt diff --git a/node_modules/eslint/node_modules/semver/functions/lte.js b/node_modules/eslint/node_modules/semver/functions/lte.js deleted file mode 100644 index 6dcc95650..000000000 --- a/node_modules/eslint/node_modules/semver/functions/lte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte diff --git a/node_modules/eslint/node_modules/semver/functions/major.js b/node_modules/eslint/node_modules/semver/functions/major.js deleted file mode 100644 index 4283165e9..000000000 --- a/node_modules/eslint/node_modules/semver/functions/major.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major diff --git a/node_modules/eslint/node_modules/semver/functions/minor.js b/node_modules/eslint/node_modules/semver/functions/minor.js deleted file mode 100644 index 57b3455f8..000000000 --- a/node_modules/eslint/node_modules/semver/functions/minor.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor diff --git a/node_modules/eslint/node_modules/semver/functions/neq.js b/node_modules/eslint/node_modules/semver/functions/neq.js deleted file mode 100644 index f944c0157..000000000 --- a/node_modules/eslint/node_modules/semver/functions/neq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq diff --git a/node_modules/eslint/node_modules/semver/functions/parse.js b/node_modules/eslint/node_modules/semver/functions/parse.js deleted file mode 100644 index 11f20f037..000000000 --- a/node_modules/eslint/node_modules/semver/functions/parse.js +++ /dev/null @@ -1,33 +0,0 @@ -const {MAX_LENGTH} = require('../internal/constants') -const { re, t } = require('../internal/re') -const SemVer = require('../classes/semver') - -const parseOptions = require('../internal/parse-options') -const parse = (version, options) => { - options = parseOptions(options) - - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - if (version.length > MAX_LENGTH) { - return null - } - - const r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } - - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} - -module.exports = parse diff --git a/node_modules/eslint/node_modules/semver/functions/patch.js b/node_modules/eslint/node_modules/semver/functions/patch.js deleted file mode 100644 index 63afca252..000000000 --- a/node_modules/eslint/node_modules/semver/functions/patch.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch diff --git a/node_modules/eslint/node_modules/semver/functions/prerelease.js b/node_modules/eslint/node_modules/semver/functions/prerelease.js deleted file mode 100644 index 06aa13248..000000000 --- a/node_modules/eslint/node_modules/semver/functions/prerelease.js +++ /dev/null @@ -1,6 +0,0 @@ -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/eslint/node_modules/semver/functions/rcompare.js b/node_modules/eslint/node_modules/semver/functions/rcompare.js deleted file mode 100644 index 0ac509e79..000000000 --- a/node_modules/eslint/node_modules/semver/functions/rcompare.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare diff --git a/node_modules/eslint/node_modules/semver/functions/rsort.js b/node_modules/eslint/node_modules/semver/functions/rsort.js deleted file mode 100644 index 82404c5cf..000000000 --- a/node_modules/eslint/node_modules/semver/functions/rsort.js +++ /dev/null @@ -1,3 +0,0 @@ -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/eslint/node_modules/semver/functions/satisfies.js b/node_modules/eslint/node_modules/semver/functions/satisfies.js deleted file mode 100644 index 50af1c199..000000000 --- a/node_modules/eslint/node_modules/semver/functions/satisfies.js +++ /dev/null @@ -1,10 +0,0 @@ -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/eslint/node_modules/semver/functions/sort.js b/node_modules/eslint/node_modules/semver/functions/sort.js deleted file mode 100644 index 4d10917ab..000000000 --- a/node_modules/eslint/node_modules/semver/functions/sort.js +++ /dev/null @@ -1,3 +0,0 @@ -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/eslint/node_modules/semver/functions/valid.js b/node_modules/eslint/node_modules/semver/functions/valid.js deleted file mode 100644 index f27bae107..000000000 --- a/node_modules/eslint/node_modules/semver/functions/valid.js +++ /dev/null @@ -1,6 +0,0 @@ -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/eslint/node_modules/semver/index.js b/node_modules/eslint/node_modules/semver/index.js deleted file mode 100644 index 57e2ae649..000000000 --- a/node_modules/eslint/node_modules/semver/index.js +++ /dev/null @@ -1,48 +0,0 @@ -// just pre-load all the stuff that index.js lazily exports -const internalRe = require('./internal/re') -module.exports = { - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, - SemVer: require('./classes/semver'), - compareIdentifiers: require('./internal/identifiers').compareIdentifiers, - rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, - parse: require('./functions/parse'), - valid: require('./functions/valid'), - clean: require('./functions/clean'), - inc: require('./functions/inc'), - diff: require('./functions/diff'), - major: require('./functions/major'), - minor: require('./functions/minor'), - patch: require('./functions/patch'), - prerelease: require('./functions/prerelease'), - compare: require('./functions/compare'), - rcompare: require('./functions/rcompare'), - compareLoose: require('./functions/compare-loose'), - compareBuild: require('./functions/compare-build'), - sort: require('./functions/sort'), - rsort: require('./functions/rsort'), - gt: require('./functions/gt'), - lt: require('./functions/lt'), - eq: require('./functions/eq'), - neq: require('./functions/neq'), - gte: require('./functions/gte'), - lte: require('./functions/lte'), - cmp: require('./functions/cmp'), - coerce: require('./functions/coerce'), - Comparator: require('./classes/comparator'), - Range: require('./classes/range'), - satisfies: require('./functions/satisfies'), - toComparators: require('./ranges/to-comparators'), - maxSatisfying: require('./ranges/max-satisfying'), - minSatisfying: require('./ranges/min-satisfying'), - minVersion: require('./ranges/min-version'), - validRange: require('./ranges/valid'), - outside: require('./ranges/outside'), - gtr: require('./ranges/gtr'), - ltr: require('./ranges/ltr'), - intersects: require('./ranges/intersects'), - simplifyRange: require('./ranges/simplify'), - subset: require('./ranges/subset'), -} diff --git a/node_modules/eslint/node_modules/semver/internal/constants.js b/node_modules/eslint/node_modules/semver/internal/constants.js deleted file mode 100644 index 49df215ad..000000000 --- a/node_modules/eslint/node_modules/semver/internal/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -// 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 - -module.exports = { - SEMVER_SPEC_VERSION, - MAX_LENGTH, - MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH -} diff --git a/node_modules/eslint/node_modules/semver/internal/debug.js b/node_modules/eslint/node_modules/semver/internal/debug.js deleted file mode 100644 index 1c00e1369..000000000 --- a/node_modules/eslint/node_modules/semver/internal/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -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/eslint/node_modules/semver/internal/identifiers.js b/node_modules/eslint/node_modules/semver/internal/identifiers.js deleted file mode 100644 index ed1309421..000000000 --- a/node_modules/eslint/node_modules/semver/internal/identifiers.js +++ /dev/null @@ -1,23 +0,0 @@ -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/eslint/node_modules/semver/internal/parse-options.js b/node_modules/eslint/node_modules/semver/internal/parse-options.js deleted file mode 100644 index 42d2ebd6f..000000000 --- a/node_modules/eslint/node_modules/semver/internal/parse-options.js +++ /dev/null @@ -1,11 +0,0 @@ -// parse out just the options we care about so we always get a consistent -// obj with keys in a consistent order. -const opts = ['includePrerelease', 'loose', 'rtl'] -const parseOptions = options => - !options ? {} - : typeof options !== 'object' ? { loose: true } - : opts.filter(k => options[k]).reduce((options, k) => { - options[k] = true - return options - }, {}) -module.exports = parseOptions diff --git a/node_modules/eslint/node_modules/semver/internal/re.js b/node_modules/eslint/node_modules/semver/internal/re.js deleted file mode 100644 index 54d4176de..000000000 --- a/node_modules/eslint/node_modules/semver/internal/re.js +++ /dev/null @@ -1,182 +0,0 @@ -const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') -const debug = require('./debug') -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const createToken = (name, value, isGlobal) => { - const index = R++ - debug(index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, 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', '[0-9]+') - -// ## 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-][a-zA-Z0-9-]*') - -// ## 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', '[0-9A-Za-z-]+') - -// ## 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/eslint/node_modules/semver/package.json b/node_modules/eslint/node_modules/semver/package.json deleted file mode 100644 index 1fa130c4e..000000000 --- a/node_modules/eslint/node_modules/semver/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "semver@^7.2.1", - "_id": "semver@7.3.5", - "_inBundle": false, - "_integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "_location": "/eslint/semver", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "semver@^7.2.1", - "name": "semver", - "escapedName": "semver", - "rawSpec": "^7.2.1", - "saveSpec": null, - "fetchSpec": "^7.2.1" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "_shasum": "0b621c879348d8998e4b0e4be94b3f12e6018ef7", - "_spec": "semver@^7.2.1", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "bin": { - "semver": "bin/semver.js" - }, - "bugs": { - "url": "https://github.com/npm/node-semver/issues" - }, - "bundleDependencies": false, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "deprecated": false, - "description": "The semantic version parser used by npm.", - "devDependencies": { - "tap": "^14.10.7" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "bin/**/*.js", - "range.bnf", - "classes/**/*.js", - "functions/**/*.js", - "internal/**/*.js", - "ranges/**/*.js", - "index.js", - "preload.js" - ], - "homepage": "https://github.com/npm/node-semver#readme", - "license": "ISC", - "main": "index.js", - "name": "semver", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "tap", - "test": "tap" - }, - "tap": { - "check-coverage": true, - "coverage-map": "map.js" - }, - "version": "7.3.5" -} diff --git a/node_modules/eslint/node_modules/semver/preload.js b/node_modules/eslint/node_modules/semver/preload.js deleted file mode 100644 index 947cd4f79..000000000 --- a/node_modules/eslint/node_modules/semver/preload.js +++ /dev/null @@ -1,2 +0,0 @@ -// XXX remove in v8 or beyond -module.exports = require('./index.js') diff --git a/node_modules/eslint/node_modules/semver/range.bnf b/node_modules/eslint/node_modules/semver/range.bnf deleted file mode 100644 index d4c6ae0d7..000000000 --- a/node_modules/eslint/node_modules/semver/range.bnf +++ /dev/null @@ -1,16 +0,0 @@ -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/eslint/node_modules/semver/ranges/gtr.js b/node_modules/eslint/node_modules/semver/ranges/gtr.js deleted file mode 100644 index db7e35599..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/gtr.js +++ /dev/null @@ -1,4 +0,0 @@ -// 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/eslint/node_modules/semver/ranges/intersects.js b/node_modules/eslint/node_modules/semver/ranges/intersects.js deleted file mode 100644 index 3d1a6f31d..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/intersects.js +++ /dev/null @@ -1,7 +0,0 @@ -const Range = require('../classes/range') -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -module.exports = intersects diff --git a/node_modules/eslint/node_modules/semver/ranges/ltr.js b/node_modules/eslint/node_modules/semver/ranges/ltr.js deleted file mode 100644 index 528a885eb..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/ltr.js +++ /dev/null @@ -1,4 +0,0 @@ -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/eslint/node_modules/semver/ranges/max-satisfying.js b/node_modules/eslint/node_modules/semver/ranges/max-satisfying.js deleted file mode 100644 index 6e3d993c6..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/max-satisfying.js +++ /dev/null @@ -1,25 +0,0 @@ -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/eslint/node_modules/semver/ranges/min-satisfying.js b/node_modules/eslint/node_modules/semver/ranges/min-satisfying.js deleted file mode 100644 index 9b60974e2..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/min-satisfying.js +++ /dev/null @@ -1,24 +0,0 @@ -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/eslint/node_modules/semver/ranges/min-version.js b/node_modules/eslint/node_modules/semver/ranges/min-version.js deleted file mode 100644 index 2fac41291..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/min-version.js +++ /dev/null @@ -1,60 +0,0 @@ -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/eslint/node_modules/semver/ranges/outside.js b/node_modules/eslint/node_modules/semver/ranges/outside.js deleted file mode 100644 index 2a4b0a13f..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/outside.js +++ /dev/null @@ -1,80 +0,0 @@ -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/eslint/node_modules/semver/ranges/simplify.js b/node_modules/eslint/node_modules/semver/ranges/simplify.js deleted file mode 100644 index b792f9729..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/simplify.js +++ /dev/null @@ -1,44 +0,0 @@ -// 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 min = 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 (!min) - min = version - } else { - if (prev) { - set.push([min, prev]) - } - prev = null - min = null - } - } - if (min) - set.push([min, 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/eslint/node_modules/semver/ranges/subset.js b/node_modules/eslint/node_modules/semver/ranges/subset.js deleted file mode 100644 index 532fd1364..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/subset.js +++ /dev/null @@ -1,222 +0,0 @@ -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 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 = [ new Comparator('>=0.0.0-0') ] - else - sub = [ new Comparator('>=0.0.0') ] - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) - return true - else - dom = [ new Comparator('>=0.0.0') ] - } - - 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/eslint/node_modules/semver/ranges/to-comparators.js b/node_modules/eslint/node_modules/semver/ranges/to-comparators.js deleted file mode 100644 index 6c8bc7e6f..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/to-comparators.js +++ /dev/null @@ -1,8 +0,0 @@ -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/eslint/node_modules/semver/ranges/valid.js b/node_modules/eslint/node_modules/semver/ranges/valid.js deleted file mode 100644 index 365f35689..000000000 --- a/node_modules/eslint/node_modules/semver/ranges/valid.js +++ /dev/null @@ -1,11 +0,0 @@ -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/eslint/package.json b/node_modules/eslint/package.json index 9c3a07c3e..c8c7f5fbb 100644 --- a/node_modules/eslint/package.json +++ b/node_modules/eslint/package.json @@ -1,153 +1,167 @@ { - "_from": "eslint@latest", - "_id": "eslint@7.22.0", - "_inBundle": false, - "_integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", - "_location": "/eslint", - "_phantomChildren": { - "@babel/highlight": "7.13.10", - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "isexe": "2.0.0", - "lru-cache": "6.0.0", - "word-wrap": "1.2.3" + "name": "eslint", + "version": "8.36.0", + "author": "Nicholas C. Zakas ", + "description": "An AST-based pattern checker for JavaScript.", + "bin": { + "eslint": "./bin/eslint.js" }, - "_requested": { - "type": "tag", - "registry": true, - "raw": "eslint@latest", - "name": "eslint", - "escapedName": "eslint", - "rawSpec": "latest", - "saveSpec": null, - "fetchSpec": "latest" + "main": "./lib/api.js", + "exports": { + "./package.json": "./package.json", + ".": "./lib/api.js", + "./use-at-your-own-risk": "./lib/unsupported-api.js" }, - "_requiredBy": [ - "#DEV:/", - "#USER" - ], - "_resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "_shasum": "07ecc61052fec63661a2cab6bd507127c07adc6f", - "_spec": "eslint@latest", - "_where": "/Users/christopher/Projects/github-actions-asana", - "author": { - "name": "Nicholas C. Zakas", - "email": "nicholas+npm@nczconsulting.com" + "scripts": { + "build:docs:update-links": "node tools/fetch-docs-links.js", + "build:site": "node Makefile.js gensite", + "build:webpack": "node Makefile.js webpack", + "build:readme": "node tools/update-readme.js", + "lint": "node Makefile.js lint", + "lint:docs:js": "node Makefile.js lintDocsJS", + "lint:fix": "node Makefile.js lint -- fix", + "lint:fix:docs:js": "node Makefile.js lintDocsJS -- fix", + "release:generate:alpha": "node Makefile.js generatePrerelease -- alpha", + "release:generate:beta": "node Makefile.js generatePrerelease -- beta", + "release:generate:latest": "node Makefile.js generateRelease", + "release:generate:rc": "node Makefile.js generatePrerelease -- rc", + "release:publish": "node Makefile.js publishRelease", + "test": "node Makefile.js test", + "test:cli": "mocha", + "test:fuzz": "node Makefile.js fuzz", + "test:performance": "node Makefile.js perf" }, - "bin": { - "eslint": "bin/eslint.js" + "gitHooks": { + "pre-commit": "lint-staged" }, - "bugs": { - "url": "https://github.com/eslint/eslint/issues/" + "lint-staged": { + "*.js": "eslint --fix", + "*.md": "markdownlint --fix", + "lib/rules/*.js": [ + "node tools/update-eslint-all.js", + "git add packages/js/src/configs/eslint-all.js" + ], + "docs/src/rules/*.md": [ + "node tools/fetch-docs-links.js", + "git add docs/src/_data/further_reading_links.json" + ], + "docs/**/*.svg": "npx svgo -r --multipass" }, - "bundleDependencies": false, + "files": [ + "LICENSE", + "README.md", + "bin", + "conf", + "lib", + "messages" + ], + "repository": "eslint/eslint", + "funding": "https://opencollective.com/eslint", + "homepage": "https://eslint.org", + "bugs": "https://github.com/eslint/eslint/issues/", "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.5.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, - "deprecated": false, - "description": "An AST-based pattern checker for JavaScript.", "devDependencies": { "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", - "acorn": "^7.2.0", "babel-loader": "^8.0.5", + "c8": "^7.12.0", "chai": "^4.0.1", "cheerio": "^0.22.0", "common-tags": "^1.8.0", "core-js": "^3.1.3", - "dateformat": "^3.0.3", "ejs": "^3.0.2", - "escape-string-regexp": "^3.0.0", "eslint": "file:.", "eslint-config-eslint": "file:packages/eslint-config-eslint", - "eslint-plugin-eslint-plugin": "^2.2.1", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-eslint-plugin": "^4.4.0", "eslint-plugin-internal-rules": "file:tools/internal-rules", - "eslint-plugin-jsdoc": "^22.1.0", - "eslint-plugin-node": "^11.1.0", - "eslint-release": "^2.0.0", - "eslump": "^2.0.0", + "eslint-plugin-jsdoc": "^38.1.6", + "eslint-plugin-n": "^15.2.4", + "eslint-plugin-unicorn": "^42.0.0", + "eslint-release": "^3.2.0", + "eslump": "^3.0.0", "esprima": "^4.0.1", - "fs-teardown": "^0.1.0", + "fast-glob": "^3.2.11", + "fs-teardown": "^0.1.3", "glob": "^7.1.6", - "jsdoc": "^3.5.5", + "got": "^11.8.3", + "gray-matter": "^4.0.3", "karma": "^6.1.1", "karma-chrome-launcher": "^3.1.0", "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", "karma-webpack": "^5.0.0", - "lint-staged": "^10.1.2", + "lint-staged": "^11.0.0", "load-perf": "^0.2.0", - "markdownlint": "^0.19.0", - "markdownlint-cli": "^0.22.0", + "markdownlint": "^0.25.1", + "markdownlint-cli": "^0.31.1", + "marked": "^4.0.8", "memfs": "^3.0.1", - "mocha": "^7.1.1", - "mocha-junit-reporter": "^1.23.0", + "metascraper": "^5.25.7", + "metascraper-description": "^5.25.7", + "metascraper-image": "^5.29.3", + "metascraper-logo": "^5.25.7", + "metascraper-logo-favicon": "^5.25.7", + "metascraper-title": "^5.25.7", + "mocha": "^8.3.2", + "mocha-junit-reporter": "^2.0.0", "node-polyfill-webpack-plugin": "^1.0.3", "npm-license": "^0.3.3", - "nyc": "^15.0.1", + "pirates": "^4.0.5", + "progress": "^2.0.3", "proxyquire": "^2.0.1", - "puppeteer": "^7.1.0", - "recast": "^0.19.0", + "puppeteer": "^13.7.0", + "recast": "^0.20.4", "regenerator-runtime": "^0.13.2", + "semver": "^7.3.5", "shelljs": "^0.8.2", - "sinon": "^9.0.1", + "sinon": "^11.0.0", "temp": "^0.9.0", "webpack": "^5.23.0", "webpack-cli": "^4.5.0", "yorkie": "^2.0.0" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "files": [ - "LICENSE", - "README.md", - "bin", - "conf", - "lib", - "messages" - ], - "funding": "https://opencollective.com/eslint", - "gitHooks": { - "pre-commit": "lint-staged" - }, - "homepage": "https://eslint.org", "keywords": [ "ast", "lint", @@ -156,34 +170,7 @@ "espree" ], "license": "MIT", - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ], - "*.md": "markdownlint" - }, - "main": "./lib/api.js", - "name": "eslint", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint.git" - }, - "scripts": { - "docs": "node Makefile.js docs", - "fix": "node Makefile.js lint -- fix", - "fuzz": "node Makefile.js fuzz", - "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", - "generate-betarelease": "node Makefile.js generatePrerelease -- beta", - "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", - "generate-release": "node Makefile.js generateRelease", - "gensite": "node Makefile.js gensite", - "lint": "node Makefile.js lint", - "perf": "node Makefile.js perf", - "publish-release": "node Makefile.js publishRelease", - "test": "node Makefile.js test", - "test:cli": "mocha", - "webpack": "node Makefile.js webpack" - }, - "version": "7.22.0" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } } diff --git a/node_modules/espree/CHANGELOG.md b/node_modules/espree/CHANGELOG.md deleted file mode 100644 index 85409ca47..000000000 --- a/node_modules/espree/CHANGELOG.md +++ /dev/null @@ -1,509 +0,0 @@ -v7.3.1 - December 5, 2020 - -* [`fef6f4a`](https://github.com/eslint/espree/commit/fef6f4a2803d959304c6961527044bd9da39ac92) Upgrade: acorn-jsx@5.3.1 (#459) (Milos Djermanovic) -* [`0e09d9a`](https://github.com/eslint/espree/commit/0e09d9a4f213cb87073a6a87cb7d6317b77d1a23) Chore: Add tests for ecmaVersion default value (#460) (Milos Djermanovic) -* [`4c70052`](https://github.com/eslint/espree/commit/4c70052df0b0ba903602c1f838918cbc07ee5eca) Docs: Fix some minor typos in the READMEs (#455) (Noah Doersing) - -v7.3.0 - August 22, 2020 - -* [`4ba3eef`](https://github.com/eslint/espree/commit/4ba3eefdc4b32784565822b34f11977e99ca1a19) Chore: move to GitHub Actions (#449) (Kai Cataldo) -* [`bd0a405`](https://github.com/eslint/espree/commit/bd0a405ffbe4962bcf5aa225ed3861a6a15cb827) Update: support logical assignment and numeric separators (#448) (Toru Nagashima) - -v7.2.0 - July 17, 2020 - -* [`91c2d58`](https://github.com/eslint/espree/commit/91c2d5896889042058399cd64de4b218c5add0eb) Docs: Add security policy (#447) (Nicholas C. Zakas) -* [`872645c`](https://github.com/eslint/espree/commit/872645cea0bee08960b93c097f84153d44b44d7f) Update: support optional chaining (#446) (Toru Nagashima) -* [`0cc7800`](https://github.com/eslint/espree/commit/0cc78007c933564f32fd849bd8022992845c3ac1) Docs: Clean up LICENSE file (#445) (Nicholas C. Zakas) - -v7.1.0 - June 4, 2020 - -* [`75e80bc`](https://github.com/eslint/espree/commit/75e80bc1b5a100f64b09b2c7bf47c5168417d890) Update: support `??` operator, `import.meta`, and `export * as ns` (#441) (Toru Nagashima) -* [`ad0543c`](https://github.com/eslint/espree/commit/ad0543c8b9f6981857ebebf23a37589a656e61a6) Chore: added fixlint in Makefile.js (#440) (Anix) - -v7.0.0 - May 7, 2020 - -* [`8fe2efc`](https://github.com/eslint/espree/commit/8fe2efc00902e7f1680af00a6279e1aecb3c5b47) Breaking: drop Node v8 support (#429) (Kai Cataldo) -* [`6048bfe`](https://github.com/eslint/espree/commit/6048bfe3939fa7dc162c0b3c4b043bb410736b0b) Docs: documenting public API (fixes #431) (#442) (Anix) -* [`9a4cff3`](https://github.com/eslint/espree/commit/9a4cff3626d50a88428ca1b66610a2bdedd774dd) Chore: added tests for options normalize (#439) (Anix) -* [`99707f3`](https://github.com/eslint/espree/commit/99707f3f9d337ca719dce5720106f98b65bba7b1) Chore: added lockfiles to .gitignore (#438) (Anix) -* [`9b91bcc`](https://github.com/eslint/espree/commit/9b91bccacea15c75025a62bae828f83598aef5fe) Docs: new site for docs (#436) (Anix) - -v6.2.1 - March 10, 2020 - -* [`d6d7480`](https://github.com/eslint/espree/commit/d6d7480e424960159007caea86f209f696138734) Upgrade: acorn 7.1.1, Regex DOS vuln (fixes #435) (#434) (James) - -v6.2.0 - March 2, 2020 - -* [`ced1b68`](https://github.com/eslint/espree/commit/ced1b6810b991531e6d3788ebd5a322fc5c7d463) Update: update acorn-jsx and fix failing test (#432) (Kai Cataldo) -* [`acb8776`](https://github.com/eslint/espree/commit/acb8776d369abf9e02f79142879e9b1a4774f938) Update: add latestEcmaVersion & supportedEcmaVersions (#430) (Kai Cataldo) - -v6.1.2 - October 20, 2019 - -* [`70c4970`](https://github.com/eslint/espree/commit/70c4970e5eba6f060e1e32a22d231647f2d0e0f8) Fix: misuse token types (fixes #393, refs eslint/eslint#11018) (#426) (Toru Nagashima) - -v6.1.1 - August 23, 2019 - -* [`ba81546`](https://github.com/eslint/espree/commit/ba81546e8552ec0f779aae7e03668c334630484e) Upgrade: dev deps to latest (#424) (薛定谔的猫) -* [`bbe0119`](https://github.com/eslint/espree/commit/bbe01195fb57e24634d18825d39b820ed1767e95) Upgrade: acorn-jsx@5.0.2 (#423) (薛定谔的猫) -* [`c0635ba`](https://github.com/eslint/espree/commit/c0635bac4cd891cb612fb81655012e2579f4e2b1) Docs: update readme to mention ES2020 (#422) (Kai Cataldo) - -v6.1.0 - August 18, 2019 - -* [`9870c55`](https://github.com/eslint/espree/commit/9870c553efd3eb1bd22b4b3bb5220896c5cb6933) Update: improve error messaging when validating ecmaVersion (#421) (Kai Cataldo) -* [`3f49224`](https://github.com/eslint/espree/commit/3f49224eb05f6b8cb1b996ce424a99c40978b389) Fix: tokenize the latest right curly brace (fixes #403) (#419) (finico) -* [`f5e58cc`](https://github.com/eslint/espree/commit/f5e58cc5e9030793baca3426366b8d7286ef5b89) Update: support bigint and dynamic import (#415) (Toru Nagashima) - -v6.0.0 - June 21, 2019 - -* [`a988a36`](https://github.com/eslint/espree/commit/a988a36e436a1ab6c84005ba0adb6cf9c262c1ec) Build: add node 12 (#414) (薛定谔的猫) - -v6.0.0-alpha.0 - April 12, 2019 - -* [`493d464`](https://github.com/eslint/espree/commit/493d464e1564aea0ea33000389771d42ddece2cb) Breaking: validate parser options (fixes #384) (#412) (薛定谔的猫) - -v5.0.1 - February 15, 2019 - -* [`c40e2fc`](https://github.com/eslint/espree/commit/c40e2fcedf81ff06151e82bdf655d2d0d29e71b8) Upgrade: acorn@6.0.7 (#407) (Kai Cataldo) - -v5.0.0 - December 5, 2018 - -* [`1bcd563`](https://github.com/eslint/espree/commit/1bcd563d4eb4b4032d2662cc5ccd3bfd841b39d7) Breaking: remove attachComment (#405) (Kai Cataldo) -* [`35623ee`](https://github.com/eslint/espree/commit/35623ee07289c9199eef8b735c97cb3d3d08d5b8) Chore: update linting config (#406) (Kai Cataldo) -* [`4b86a7d`](https://github.com/eslint/espree/commit/4b86a7dc7c447c11bb6530e46dc43428ce2bd372) Build: add node 11 (#400) (薛定谔的猫) -* [`7c278d6`](https://github.com/eslint/espree/commit/7c278d6acc6b5db86b803d0cd21b830deb6f569e) Fix: build failing due to incorrectly super() call (fixes #398) (#399) (薛定谔的猫) -* [`6ebc219`](https://github.com/eslint/espree/commit/6ebc21947166399a0b4918d4a1beb9d610650336) Upgrade: eslint & eslint-config-eslint (#387) (薛定谔的猫) - -v4.1.0 - October 24, 2018 - -* 8eadb88 Upgrade: acorn 6, acorn-jsx 5, and istanbul (#391) (Toru Nagashima) -* 0f2edb8 Upgrade: eslint-release@1.0.0 (#392) (Teddy Katz) -* 560b6f7 Update: VisitorKeys depend on eslint-visitor-keys (#389) (othree) -* 6bf2ebf Docs: Fix some typos in the README (#386) (Hugo Locurcio) - -v4.0.0 - June 21, 2018 - - - -v4.0.0-rc.0 - June 9, 2018 - -* d8224c4 Build: Adding rc release script to package.json (#383) (Kevin Partington) -* 4207773 Build: add node 10 (#381) (薛定谔的猫) -* cd9da7e Update: upgrade acorn to support two ES2019 syntax (#380) (Toru Nagashima) -* 8cb3ceb Chore: remove Object.assign polyfill (#382) (薛定谔的猫) - -v4.0.0-alpha.1 - May 28, 2018 - -* 56c5a9c Fix: remove workarounds for acorn < 4 (#372) (Rouven Weßling) -* fd305e5 Upgrade: eslint-release to v0.11.1 (#376) (Teddy Katz) - -v4.0.0-alpha.0 - March 30, 2018 - -* 95fa890 Build: fix typos in package.json release scripts (#375) (Teddy Katz) -* 6284e09 Breaking: remove experimentalObjectRestSpread option (#374) (Teddy Katz) -* 0df063f Breaking: require Node.js 6+, upgrade acorn-jsx@4.1.1 (fixes #345) (#371) (薛定谔的猫) -* 0252144 Upgrade: acorn 5.5.1 (#370) (Rouven Weßling) - -v3.5.4 - March 4, 2018 - -* 706167b Upgrade: acorn 5.5.0 (#369) (Toru Nagashima) - -v3.5.3 - February 2, 2018 - -* 70f9859 Upgrade: acorn 5.4.0 (#367) (Toru Nagashima) -* cea4823 Chore: Adding .gitattributes file (#366) (Kevin Partington) -* 4160aee Upgrade: acorn v5.3.0 (#365) (Toru Nagashima) - -v3.5.2 - November 10, 2017 - -* 019b70a Fix: Remove blockBindings from docs (fixes #307, fixes #339) (#356) (Jan Pilzer) -* b2016cb Chore: refactoring rest/spread properties (#361) (Toru Nagashima) -* 59c9d06 Chore: upgrade acorn@5.2 (fixes #358) (#360) (Toru Nagashima) -* 06c35c9 Chore: add .npmrc (#359) (Toru Nagashima) - -v3.5.1 - September 15, 2017 - -* 5eb1388 Fix: Fix parsing of async keyword-named object methods (#352) (#353) (Mark Banner) - -v3.5.0 - August 5, 2017 - -* 4d442a1 Update: add initial support for ES2018 (#348) (Teddy Katz) -* d4bdcb6 Fix: Make template token objects adhere to token object structure (#343) (Ian Christian Myers) -* 9ac671a Upgrade: acorn to 5.1.1 (#347) (Teddy Katz) -* 16e1fec Docs: Specify default values of options (fixes #325) (#342) (Jan Pilzer) -* be85b8e Fix: async shorthand properties (fixes #340) (#341) (Toru Nagashima) - -v3.4.3 - May 5, 2017 - -* 343590a Fix: add AwaitExpression to espree.Syntax (fixes #331) (#332) (Teddy Katz) - -v3.4.2 - April 21, 2017 - -* c99e436 Upgrade: eslint to 2.13.1 (#328) (Teddy Katz) -* 628cf3a Fix: don't mutate user-provided configs (fixes #329) (#330) (Teddy Katz) - -v3.4.1 - March 31, 2017 - -* a3ae0bd Upgrade: acorn to 5.0.1 (#327) (Teddy Katz) -* 15ef24f Docs: Add badges (#326) (Jan Pilzer) -* 652990a Fix: raise error for trailing commas after rest properties (fixes #310) (#323) (Teddy Katz) -* 9d86ba5 Upgrade: acorn to ^4.0.11 (#317) (Toru Nagashima) -* a3442b5 Chore: fix tests for Node 6+ (#315) (Teddy Katz) - -v3.4.0 - February 2, 2017 - -* f55fa51 Build: Lock acorn to v4.0.4 (#314) (Kai Cataldo) -* 58f75be Fix:generic error for invalid ecmaVersion(fixes eslint#7405) (#303) (Scott Stern) -* d6b383d Docs: Update license copyright (Nicholas C. Zakas) -* e5df542 Update: To support year in ecmaVersion number (fixes #300) (#301) (Gyandeep Singh) - -v3.3.2 - September 29, 2016 - -* 7d3e2fc Fix: reset `isAsync` flag for each property (fixes #298) (#299) (Toru Nagashima) - -v3.3.1 - September 26, 2016 - -* 80abdce Fix: `}` token followed by template had been lost (fixes #293) (#294) (Toru Nagashima) -* 9810bab Fix: parsing error on `async` as property name. (#295) (Toru Nagashima) - -v3.3.0 - September 20, 2016 - -* 92b04b1 Update: create-test script (fixes #291) (#292) (Jamund Ferguson) - -v3.2.0 - September 16, 2016 - -* 5a37f80 Build: Update release tool (Nicholas C. Zakas) -* 9bbcad8 Update: Upgrade Acorn to support ES2017 (fixes #287) (#290) (Jamund Ferguson) -* 8d9767d Build: Add CI release scripts (Nicholas C. Zakas) - -v3.1.7 - July 29, 2016 - -* 8f6cfbd Build: Add CI release (Nicholas C. Zakas) -* ff15922 Fix: Catch ES2016 invalid syntax (fixes #284) (#285) (Nicholas C. Zakas) - -v3.1.6 - June 15, 2016 - -* a90edc2 Upgrade: acorn 3.2.0 (fixes #279) (#280) (Toru Nagashima) - -v3.1.5 - May 27, 2016 - -* 7df2e4a Fix: Convert ~ and ! prefix tokens to esprima (fixes #274) (#276) (Daniel Tschinder) - -v3.1.4 - April 21, 2016 - -* e044705 Fix: remove extra leading comments at node level (fixes #264) (Kai Cataldo) -* 25c27fb Chore: Remove jQuery copyright from header of each file (Kai Cataldo) -* 10709f0 Chore: Add jQuery Foundation copyright (Nicholas C. Zakas) -* d754b32 Upgrade: Acorn 3.1.0 (fixes #270) (Toru Nagashima) -* 3a90886 Docs: replace a dead link with the correct contributing guide URL (Shinnosuke Watanabe) -* 55184a2 Build: replace optimist with a simple native method (Shinnosuke Watanabe) -* c7e5a13 Fix: Disallow namespaces objects in JSX (fixes #261) (Kai Cataldo) -* 22290b9 Fix: Add test for leading comments (fixes #136) (Kai Cataldo) - -v3.1.3 - March 18, 2016 - -* 98441cb Fix: Fix behavior of ignoring comments within previous nodes (refs #256) (Kai Cataldo) - -v3.1.2 - March 14, 2016 - -* a2b23ca Fix: Ensure 'var let' works (fixes #149) (Nicholas C. Zakas) -* 5783282 Fix: Make obj.await work in modules (fixes #258) (Nicholas C. Zakas) -* d1b4929 Fix: leading comments added from previous node (fixes #256) (Kai Cataldo) - -v3.1.1 - February 26, 2016 - -* 3614e81 Fix: exponentiation operator token (fixes #254) (Nicholas C. Zakas) - -v3.1.0 - February 25, 2016 - -* da35d98 New: Support ecmaVersion 7 (fixes #246) (Nicholas C. Zakas) - -v3.0.2 - February 19, 2016 - -* 0973cda Build: Update release script (Nicholas C. Zakas) -* 106000f Fix: use the plugins feature of acorn (fixes #250) (Toru Nagashima) -* 36d84c7 Build: Add tests (fixes #243) (Nicholas C. Zakas) - -v3.0.1 - February 2, 2016 - -* ecfe4c8 Upgrade: eslint-config-eslint to 3.0.0 (Nicholas C. Zakas) -* ea6261e Fix: Object rest/spread in assign (fixes #247) (Nicholas C. Zakas) -* 7e57ee0 Docs: fix `options.comment` typo (xuezu) -* dd5863e Build: Add prerelease script (Nicholas C. Zakas) -* 0b409ee Upgrade: eslint-release to 0.2.0 (Nicholas C. Zakas) - -v3.0.0 - January 20, 2016 - -* 5ff65f6 Upgrade: Change Esprima version to latest (Nicholas C. Zakas) -* a8badcc Upgrade: eslint-release to 0.1.4 (Nicholas C. Zakas) -* 34d195b Build: Switch to eslint-release (Nicholas C. Zakas) -* a0ddc30 Breaking: Remove binary scripts (Nicholas C. Zakas) -* 02b5284 Build: Fix package.json dependencies (Nicholas C. Zakas) -* b07696f Fix: tests for importing keywords (fixes #225) (Toru Nagashima) -* 2e2808a Build: Add node@5 to CI (fixes #237) (alberto) -* 445c685 Update: Unrecognized license format in package.json (fixes #234) (alberto) -* 61cb5ee Update: Remove duplicated acorn-jsx dep (fixes #232) (alberto) -* df5b71c Upgrade: eslint and eslint-config-eslint (fixes #231) (alberto) -* ef7a06d Fix: lastToken not reset between calls to parse (fixes #229) (alberto) -* cdf8407 New: ecmaFeatures.impliedStrict (fixes: #227) (Nick Evans) - -v3.0.0-alpha-2 - December 9, 2015 - -* 3.0.0-alpha-2 (Nicholas C. Zakas) -* Breaking: move ecmaFeatures into ecmaVersion (fixes #222) (Nicholas C. Zakas) -* New: Export VisitorKeys (fixes #220) (Nicholas C. Zakas) - -v3.0.0-alpha-1 - December 1, 2015 - -* 3.0.0-alpha-1 (Nicholas C. Zakas) -* Fix: parse unicode escapes in identifiers (fixes #181) (Nicholas C. Zakas) -* Fix: Ensur object rest works in destructed arg (fixes #213) (Nicholas C. Zakas) -* Breaking: Switch to Acorn (fixes #200) (Nicholas C. Zakas) -* Update: Add tokens to tests (fixes #203) (Nicholas C. Zakas) -* Docs: Update README (Nicholas C. Zakas) - -v2.2.5 - September 15, 2015 - -* 2.2.5 (Nicholas C. Zakas) -* Fix: Ensure node type is correct for destructured (fixes #195) (Nicholas C. Zakas) - -v2.2.4 - August 13, 2015 - -* 2.2.4 (Nicholas C. Zakas) -* Fix: newlines in arrow functions (fixes #172) (Jamund Ferguson) -* Fix: nested arrow function as default param (fixes #145) (Jamund Ferguson) -* Fix: Rest Params & Arrow Functions (fixes #187) (Jamund Ferguson) -* Fix: trailing commas in import/export (fixes #148) (Jamund Ferguson) -* Build: Added sudo false to Travis to build faster (fixes #177) (KahWee Teng) - -v2.2.3 - July 22, 2015 - -* 2.2.3 (Nicholas C. Zakas) -* Fix: Incorrect error location (fixes #173) (Nicholas C. Zakas) - -v2.2.2 - July 16, 2015 - -* 2.2.2 (Nicholas C. Zakas) -* 2.2.1 (Nicholas C. Zakas) -* Fix: Yield as identifier in arrow func args (fixes #165) (Nicholas C. Zakas) -* Fix: Allow AssignmentExpression in object spread (fixes #167) (Nicholas C. Zakas) - -v2.2.1 - July 16, 2015 - -* 2.2.1 (Nicholas C. Zakas) - -v2.2.0 - July 15, 2015 - -* 2.2.0 (Nicholas C. Zakas) -* New: Add experimental object rest/spread (fixes #163) (Nicholas C. Zakas) -* Fix: npm browserify (fixes #156) (Jason Laster) - -v2.1.0 - July 10, 2015 - -* 2.1.0 (Nicholas C. Zakas) -* Fix: Leading comments for anonymous classes (fixes #155, fixes #158) (Toru Nagashima) -* New: Add newTarget option (fixes #157) (Nicholas C. Zakas) - -v2.0.4 - June 26, 2015 - -* 2.0.4 (Nicholas C. Zakas) -* Docs: added missing `ecmaFeatures.superInFunctions` option from doc (Clément Fiorio) -* Fix: "await" is a future reserved word (fixes #151) (Jose Roberto Vidal) - -v2.0.3 - June 2, 2015 - -* 2.0.3 (Nicholas C. Zakas) -* Fix: Incomplete Switch Statement Hangs (Fixes #146) (Jamund Ferguson) -* Docs: Clarify ecmaFeatures usage (Dan Wolff) - -v2.0.2 - April 28, 2015 - -* 2.0.2 (Nicholas C. Zakas) -* Fix: Allow yield without value as function param (fixes #134) (Nicholas C. Zakas) -* Fix: Allow computed generators in classes (fixes #123) (Nicholas C. Zakas) -* Fix: Don't allow arrow function rest param (fixes #130) (Nicholas C. Zakas) - -v2.0.1 - April 11, 2015 - -* 2.0.1 (Nicholas C. Zakas) -* Fix: Yield should parse without an argument (fixes #121) (Nicholas C. Zakas) - -v2.0.0 - April 4, 2015 - -* 2.0.0 (Nicholas C. Zakas) -* Docs: Update README with latest info (Nicholas C. Zakas) -* Breaking: Use ESTree format for default params (fixes #114) (Nicholas C. Zakas) -* New: Add Super node (fixes #115) (Nicholas C. Zakas) -* Breaking: Switch to RestElement for rest args (fixes #84) (Nicholas C. Zakas) -* Docs: Correct license info on README (fixes #117) (AJ Ortega) -* Breaking: Remove guardedHandlers/handlers from try (fixes #71) (Nicholas C. Zakas) - -v1.12.3 - March 28, 2015 - -* 1.12.3 (Nicholas C. Zakas) -* Fix: Tagged template strings (fixes #110) (Nicholas C. Zakas) - -v1.12.2 - March 21, 2015 - -* 1.12.2 (Nicholas C. Zakas) -* Fix: Destructured arg for catch (fixes #105) (Nicholas C. Zakas) - -v1.12.1 - March 21, 2015 - -* 1.12.1 (Nicholas C. Zakas) -* Fix: Disallow octals in template strings (fixes #96) (Nicholas C. Zakas) -* Fix: Template string parsing (fixes #95) (Nicholas C. Zakas) -* Fix: shorthand properties named get or set (fixes #100) (Brandon Mills) -* Fix: bad error in parsing invalid class setter (fixes #98) (Marsup) - -v1.12.0 - March 14, 2015 - -* 1.12.0 (Nicholas C. Zakas) -* Fix: Update broken tests (Nicholas C. Zakas) -* New: Add sourceType to Program node (fixes #93) (Nicholas C. Zakas) -* Allow spread in more places (fixes #89) (Nicholas C. Zakas) -* Fix: Deeply nested template literals (fixes #86) (Nicholas C. Zakas) -* Fix: Allow super in classes by default (fixes #87) (Nicholas C. Zakas) -* Fix: generator methods in classes (fixes #85) (Jamund Ferguson) -* Remove XJS note from Esprima-FB incompatibilities (Joe Lencioni) - -v1.11.0 - March 7, 2015 - -* 1.11.0 (Nicholas C. Zakas) -* Fix: Don't allow default export class by mistake (fixes #82) (Nicholas C. Zakas) -* Fix: Export default function should be FunctionDeclaration (fixes #81) (Nicholas C. Zakas) -* Fix: Ensure class declarations must have IDs outside of exports (refs #72) (Nicholas C. Zakas) -* Fix: export class expression support (refs #72) (Jamund Ferguson) -* Update: Add tests for sourceType=module (refs #72) (Nicholas C. Zakas) -* Fix: Class name should be id (fixes #78) (Nicholas C. Zakas) -* Fix: disallow import/export in functions (refs #72) (Jamund Ferguson) -* Test: strict mode enforced in modules (refs #72) (Jamund Ferguson) -* New: Add modules feature flag (refs #72) (Nicholas C. Zakas) -* merging upstream and solving conflicts for PR #43 (Caridy Patino) -* New: Add ES6 module support (fixes #35) (Caridy Patino) -* Update: Add TryStatement.handler (fixes #69) (Brandon Mills) -* Fix: Destructured Defaults (fixes #56) (Jamund Ferguson) -* Update: Refactor out comment attachment logic (Nicholas C. Zakas) - -v1.10.0 - March 1, 2015 - -* 1.10.0 (Nicholas C. Zakas) -* New: Support ES6 classes (refs #10) (Nicholas C. Zakas) -* Docs: Update README.md (Jamund Ferguson) - -v1.9.1 - February 21, 2015 - -* 1.9.1 (Nicholas C. Zakas) -* Fix: Allow let/const in switchcase (fixes #54) (Nicholas C. Zakas) - -v1.9.0 - February 21, 2015 - -* 1.9.0 (Nicholas C. Zakas) -* Fix: Extend property method range and loc to include params (fixes #36) (Brandon Mills) -* New: spread operator (refs #10) (Jamund Ferguson) -* Fix: incorrectly parsed arrow fragment (refs #58) (Jamund Ferguson) -* New: Rest Parameter (refs: #10) (Jamund Ferguson) -* New: Destructuring (refs #10) (Jamund Ferguson) - -v1.8.1 - February 7, 2015 - -* 1.8.1 (Nicholas C. Zakas) -* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) -* Fix: Actuall fix tokenization issue with templates (fixes #44) (Nicholas C. Zakas) - -v1.8.0 - February 6, 2015 - -* 1.8.0 (Nicholas C. Zakas) -* New: Support for Arrow Functions (refs #10) (Jamund Ferguson) -* New: Allow super references in functions (refs #10) (Nicholas C. Zakas) -* Update create-test.js (Jamund Ferguson) -* Fix: Tokenization for template strings (fixes #44) (Nicholas C. Zakas) -* New: Allow return in global scope (fixes #46) (Nicholas C. Zakas) - -v1.7.1 - January 23, 2015 - -* 1.7.1 (Nicholas C. Zakas) -* Fix: When ecmaFeatures.forOf is true, check for operater is "undefined" when match keyword is "in" (fixes #39) (Peter Chanthamynavong) - -v1.7.0 - January 23, 2015 - -* 1.7.0 (Nicholas C. Zakas) -* New: Add support for template strings (FredKSchott) -* New: Add support for default parameters (refs #10) (Jamund Ferguson) -* New: Add support for unicode code point escape sequences (FredKSchott) - -v1.6.0 - January 10, 2015 - -* 1.6.0 (Nicholas C. Zakas) -* Update: Make comment attachment tests look at whole AST (Nicholas C. Zakas) -* Docs: Update README to reflect feature flags (Nicholas C. Zakas) -* Docs: Add a couple more FAQs to README (Nicholas C. Zakas) -* New: Add support for duplicate object literal properties (FredKSchott) -* New: Implement generators (refs #10) (Nicholas C. Zakas) - -v1.5.0 - December 29, 2014 - -* 1.5.0 (Nicholas C. Zakas) -* Docs: Update README with compat info (Nicholas C. Zakas) -* Update: Add regex parsing test (Nicholas C. Zakas) -* Update: s/XJS/JSX/g (Nicholas C. Zakas) -* Build: Update release script (Nicholas C. Zakas) -* Update: Move SyntaxTree to ast-node-factory.js (FredKSchott) -* New: Add JSX parsing (fixes #26) (Nicholas C. Zakas) -* Update: Switch location marker logic (fixes #15) (Nicholas C. Zakas) -* 1.4.0 (Nicholas C. Zakas) - -v1.4.0 - December 23, 2014 - -* 1.4.0 (Nicholas C. Zakas) -* Fix: Parsing issues with property methods (fixes #21) (Nicholas C. Zakas) -* New: Add support for shorthand properties (refs #10) (Nicholas C. Zakas) -* New: Add support for object literal method shorthand (refs #10) (Nicholas C. Zakas) -* Fix: Ensure comments are attached for return (fixes #2) (Nicholas C. Zakas) -* Build: Ensure CHANGELOG.md is committed on release (Nicholas C. Zakas) -* 1.3.1 (Nicholas C. Zakas) - -v1.3.1 - December 22, 2014 - -* 1.3.1 (Nicholas C. Zakas) -* Fix: Add all files to npm package (fixes #17) (Nicholas C. Zakas) -* Update: Move Messages to separate file (Nicholas C. Zakas) -* Docs: Removed unnecessary comment (Nicholas C. Zakas) -* 1.3.0 (Nicholas C. Zakas) - -v1.3.0 - December 21, 2014 - -* 1.3.0 (Nicholas C. Zakas) -* Build: Add release scripts (Nicholas C. Zakas) -* New: Add computed object literal properties (refs #10) (Nicholas C. Zakas) -* Build: Fix commands in Makefile.js (Nicholas C. Zakas) -* Docs: Add FAQ to README (Nicholas C. Zakas) -* Fix: Don't allow let/const in for loops (fixes #14) (Nicholas C. Zakas) -* New: Support for-of loops (refs #10) (Nicholas C. Zakas) -* Update: Change .ast.js files to .result.js files (Nicholas C. Zakas) -* New: Support ES6 octal literals (Nicholas C. Zakas) -* New: Ability to parse binary literals (Nicholas C. Zakas) -* Update: More tests for regex u flag (Nicholas C. Zakas) -* Update: Switch to using ecmaFeatures (Nicholas C. Zakas) -* Update: Add comment attachment tests (Nicholas C. Zakas) -* Update README.md (Jamund Ferguson) -* New: Add u and y regex flags (refs #10) (Nicholas C. Zakas) -* Update: Cleanup tests (Nicholas C. Zakas) -* New: Add ecmascript flag (fixes #7) (Nicholas C. Zakas) -* Docs: Update README with build commands (Nicholas C. Zakas) -* Update: Move some things around (Nicholas C. Zakas) -* Update: Read version number from package.json (Nicholas C. Zakas) -* Update: Move AST node types to separate file (Nicholas C. Zakas) -* Update: Remove duplicate file (Nicholas C. Zakas) -* Update: Move token information to a separate file (Nicholas C. Zakas) -* Update: Bring in Makefile.js for linting and browserify (Nicholas C. Zakas) -* Update: Fix ESLint warnings, remove check-version (Nicholas C. Zakas) -* Update: Move Position and SourceLocation to separate file (Nicholas C. Zakas) -* Update: Move syntax checks into separate file (Nicholas C. Zakas) -* Update: Remove UMD format (Nicholas C. Zakas) -* Docs: Update README with more info (Nicholas C. Zakas) -* Update: remove npm-debug.log from tracked files (Brandon Mills) -* Docs: Remove redundant 'features' in readme (Matthias Oßwald) -* Docs: Fix a link to Wikipedia (Ryuichi Okumura) -* Update: Split parsing tests into smaller files (Nicholas C. Zakas) -* Update: Normalize values in tests (Nicholas C. Zakas) -* Update: CommonJSify test file (Nicholas C. Zakas) diff --git a/node_modules/espree/README.md b/node_modules/espree/README.md index 72d88f833..8a38f247a 100644 --- a/node_modules/espree/README.md +++ b/node_modules/espree/README.md @@ -1,6 +1,6 @@ [![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) -[![Build Status](https://travis-ci.org/eslint/espree.svg?branch=master)](https://travis-ci.org/eslint/espree) [![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) +[![Build Status](https://github.com/eslint/espree/workflows/CI/badge.svg)](https://github.com/eslint/espree/actions) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) # Espree @@ -15,9 +15,17 @@ Install: npm i espree ``` -And in your Node.js code: +To use in an ESM file: -```javascript +```js +import * as espree from "espree"; + +const ast = espree.parse(code); +``` + +To use in a Common JS file: + +```js const espree = require("espree"); const ast = espree.parse(code); @@ -29,13 +37,13 @@ const ast = espree.parse(code); `parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters. -- `code` [string]() - the code which needs to be parsed. +- `code` [string]() - the code which needs to be parsed. - `options (Optional)` [Object]() - read more about this [here](#options). -```javascript -const espree = require("espree"); +```js +import * as espree from "espree"; -const ast = espree.parse(code, options); +const ast = espree.parse(code); ``` **Example :** @@ -73,7 +81,7 @@ Node { `tokenize` returns the tokens of a given code. It takes two parameters. -- `code` [string]() - the code which needs to be parsed. +- `code` [string]() - the code which needs to be parsed. - `options (Optional)` [Object]() - read more about this [here](#options). Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array @@ -81,6 +89,8 @@ Even if `options` is empty or undefined or `options.tokens` is `false`, it assig **Example :** ```js +import * as espree from "espree"; + const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); console.log(tokens); ``` @@ -114,7 +124,7 @@ Returns the latest ECMAScript supported by `espree` Returns an array of all supported ECMAScript versions -## Options +## Options ```js const options = { @@ -130,11 +140,14 @@ const options = { // create a top-level tokens array containing all tokens tokens: false, - // Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. - // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming. - ecmaVersion: 5, + // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13 or 14 to specify the version of ECMAScript syntax you want to use. + // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13) or 2023 (same as 14) to use the year-based naming. + // You can also set "latest" to use the most recently supported version. + ecmaVersion: 3, + + allowReserved: true, // only allowed when ecmaVersion is 3 - // specify which type of script you're parsing ("script" or "module") + // specify which type of script you're parsing ("script", "module", or "commonjs") sourceType: "script", // specify additional language features @@ -143,7 +156,7 @@ const options = { // enable JSX parsing jsx: false, - // enable return in global scope + // enable return in global scope (set to true automatically when sourceType is "commonjs") globalReturn: false, // enable implied strict mode (if ecmaVersion >= 5) @@ -172,7 +185,6 @@ We work hard to ensure that Espree is safe for everyone and that security issues * `npm test` - run all linting and tests * `npm run lint` - run all linting -* `npm run browserify` - creates a version of Espree that is usable in a browser ## Differences from Espree 2.x @@ -219,12 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel ### What ECMAScript features do you support? -Espree supports all ECMAScript 2020 features and partially supports ECMAScript 2021 features. +Espree supports all ECMAScript 2022 features and partially supports ECMAScript 2023 features. -Because ECMAScript 2021 is still under development, we are implementing features as they are finalized. Currently, Espree supports: +Because ECMAScript 2023 is still under development, we are implementing features as they are finalized. Currently, Espree supports: -* [Logical Assignment Operators](https://github.com/tc39/proposal-logical-assignment) -* [Numeric Separators](https://github.com/tc39/proposal-numeric-separator) +* [Hashbang grammar](https://github.com/tc39/proposal-hashbang) See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. diff --git a/node_modules/espree/dist/espree.cjs b/node_modules/espree/dist/espree.cjs new file mode 100644 index 000000000..9ace5376c --- /dev/null +++ b/node_modules/espree/dist/espree.cjs @@ -0,0 +1,940 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var acorn = require('acorn'); +var jsx = require('acorn-jsx'); +var visitorKeys = require('eslint-visitor-keys'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} + +var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); +var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx); +var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys); + +/** + * @fileoverview Translates tokens between Acorn format and Esprima format. + * @author Nicholas C. Zakas + */ +/* eslint no-underscore-dangle: 0 */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + + +// Esprima Token Types +const Token = { + Boolean: "Boolean", + EOF: "", + Identifier: "Identifier", + PrivateIdentifier: "PrivateIdentifier", + Keyword: "Keyword", + Null: "Null", + Numeric: "Numeric", + Punctuator: "Punctuator", + String: "String", + RegularExpression: "RegularExpression", + Template: "Template", + JSXIdentifier: "JSXIdentifier", + JSXText: "JSXText" +}; + +/** + * Converts part of a template into an Esprima token. + * @param {AcornToken[]} tokens The Acorn tokens representing the template. + * @param {string} code The source code. + * @returns {EsprimaToken} The Esprima equivalent of the template token. + * @private + */ +function convertTemplatePart(tokens, code) { + const firstToken = tokens[0], + lastTemplateToken = tokens[tokens.length - 1]; + + const token = { + type: Token.Template, + value: code.slice(firstToken.start, lastTemplateToken.end) + }; + + if (firstToken.loc) { + token.loc = { + start: firstToken.loc.start, + end: lastTemplateToken.loc.end + }; + } + + if (firstToken.range) { + token.start = firstToken.range[0]; + token.end = lastTemplateToken.range[1]; + token.range = [token.start, token.end]; + } + + return token; +} + +/** + * Contains logic to translate Acorn tokens into Esprima tokens. + * @param {Object} acornTokTypes The Acorn token types. + * @param {string} code The source code Acorn is parsing. This is necessary + * to correct the "value" property of some tokens. + * @constructor + */ +function TokenTranslator(acornTokTypes, code) { + + // token types + this._acornTokTypes = acornTokTypes; + + // token buffer for templates + this._tokens = []; + + // track the last curly brace + this._curlyBrace = null; + + // the source code + this._code = code; + +} + +TokenTranslator.prototype = { + constructor: TokenTranslator, + + /** + * Translates a single Esprima token to a single Acorn token. This may be + * inaccurate due to how templates are handled differently in Esprima and + * Acorn, but should be accurate for all other tokens. + * @param {AcornToken} token The Acorn token to translate. + * @param {Object} extra Espree extra object. + * @returns {EsprimaToken} The Esprima version of the token. + */ + translate(token, extra) { + + const type = token.type, + tt = this._acornTokTypes; + + if (type === tt.name) { + token.type = Token.Identifier; + + // TODO: See if this is an Acorn bug + if (token.value === "static") { + token.type = Token.Keyword; + } + + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + + } else if (type === tt.privateId) { + token.type = Token.PrivateIdentifier; + + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.dot || type === tt.bracketL || + type === tt.colon || type === tt.question || + type === tt.bracketR || type === tt.ellipsis || + type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || + type === tt.jsxTagEnd || type === tt.prefix || + type === tt.questionDot || + (type.binop && !type.keyword) || + type.isAssign) { + + token.type = Token.Punctuator; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.jsxName) { + token.type = Token.JSXIdentifier; + } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { + token.type = Token.JSXText; + } else if (type.keyword) { + if (type.keyword === "true" || type.keyword === "false") { + token.type = Token.Boolean; + } else if (type.keyword === "null") { + token.type = Token.Null; + } else { + token.type = Token.Keyword; + } + } else if (type === tt.num) { + token.type = Token.Numeric; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.string) { + + if (extra.jsxAttrValueToken) { + extra.jsxAttrValueToken = false; + token.type = Token.JSXText; + } else { + token.type = Token.String; + } + + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = Token.RegularExpression; + const value = token.value; + + token.regex = { + flags: value.flags, + pattern: value.pattern + }; + token.value = `/${value.pattern}/${value.flags}`; + } + + return token; + }, + + /** + * Function to call during Acorn's onToken handler. + * @param {AcornToken} token The Acorn token. + * @param {Object} extra The Espree extra object. + * @returns {void} + */ + onToken(token, extra) { + + const that = this, + tt = this._acornTokTypes, + tokens = extra.tokens, + templateTokens = this._tokens; + + /** + * Flushes the buffered template tokens and resets the template + * tracking. + * @returns {void} + * @private + */ + function translateTemplateTokens() { + tokens.push(convertTemplatePart(that._tokens, that._code)); + that._tokens = []; + } + + if (token.type === tt.eof) { + + // might be one last curlyBrace + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + return; + } + + if (token.type === tt.backQuote) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + templateTokens.push(token); + + // it's the end + if (templateTokens.length > 1) { + translateTemplateTokens(); + } + + return; + } + if (token.type === tt.dollarBraceL) { + templateTokens.push(token); + translateTemplateTokens(); + return; + } + if (token.type === tt.braceR) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + // store new curly for later + this._curlyBrace = token; + return; + } + if (token.type === tt.template || token.type === tt.invalidTemplate) { + if (this._curlyBrace) { + templateTokens.push(this._curlyBrace); + this._curlyBrace = null; + } + + templateTokens.push(token); + return; + } + + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + tokens.push(this.translate(token, extra)); + } +}; + +/** + * @fileoverview A collection of methods for processing Espree's options. + * @author Kai Cataldo + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SUPPORTED_VERSIONS = [ + 3, + 5, + 6, // 2015 + 7, // 2016 + 8, // 2017 + 9, // 2018 + 10, // 2019 + 11, // 2020 + 12, // 2021 + 13, // 2022 + 14 // 2023 +]; + +/** + * Get the latest ECMAScript version supported by Espree. + * @returns {number} The latest ECMAScript version. + */ +function getLatestEcmaVersion() { + return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; +} + +/** + * Get the list of ECMAScript versions supported by Espree. + * @returns {number[]} An array containing the supported ECMAScript versions. + */ +function getSupportedEcmaVersions() { + return [...SUPPORTED_VERSIONS]; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config + * @throws {Error} throws an error if the ecmaVersion is invalid. + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion = 5) { + + let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; + + if (typeof version !== "number") { + throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); + } + + // Calculate ECMAScript edition number from official year version starting with + // ES2015, which corresponds with ES6 (or a difference of 2009). + if (version >= 2015) { + version -= 2009; + } + + if (!SUPPORTED_VERSIONS.includes(version)) { + throw new Error("Invalid ecmaVersion."); + } + + return version; +} + +/** + * Normalize sourceType from the initial config + * @param {string} sourceType to normalize + * @throws {Error} throw an error if sourceType is invalid + * @returns {string} normalized sourceType + */ +function normalizeSourceType(sourceType = "script") { + if (sourceType === "script" || sourceType === "module") { + return sourceType; + } + + if (sourceType === "commonjs") { + return "script"; + } + + throw new Error("Invalid sourceType."); +} + +/** + * Normalize parserOptions + * @param {Object} options the parser options to normalize + * @throws {Error} throw an error if found invalid option. + * @returns {Object} normalized options + */ +function normalizeOptions(options) { + const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); + const sourceType = normalizeSourceType(options.sourceType); + const ranges = options.range === true; + const locations = options.loc === true; + + if (ecmaVersion !== 3 && options.allowReserved) { + + // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed + throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); + } + if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { + throw new Error("`allowReserved`, when present, must be `true` or `false`"); + } + const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; + const ecmaFeatures = options.ecmaFeatures || {}; + const allowReturnOutsideFunction = options.sourceType === "commonjs" || + Boolean(ecmaFeatures.globalReturn); + + if (sourceType === "module" && ecmaVersion < 6) { + throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); + } + + return Object.assign({}, options, { + ecmaVersion, + sourceType, + ranges, + locations, + allowReserved, + allowReturnOutsideFunction + }); +} + +/* eslint-disable no-param-reassign*/ + + +const STATE = Symbol("espree's internal state"); +const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); + + +/** + * Converts an Acorn comment to a Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @param {string} code The source code being parsed. + * @returns {Object} The comment object. + * @private + */ +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { + let type; + + if (block) { + type = "Block"; + } else if (code.slice(start, start + 2) === "#!") { + type = "Hashbang"; + } else { + type = "Line"; + } + + const comment = { + type, + value: text + }; + + if (typeof start === "number") { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +var espree = () => Parser => { + const tokTypes = Object.assign({}, Parser.acorn.tokTypes); + + if (Parser.acornJsx) { + Object.assign(tokTypes, Parser.acornJsx.tokTypes); + } + + return class Espree extends Parser { + constructor(opts, code) { + if (typeof opts !== "object" || opts === null) { + opts = {}; + } + if (typeof code !== "string" && !(code instanceof String)) { + code = String(code); + } + + // save original source type in case of commonjs + const originalSourceType = opts.sourceType; + const options = normalizeOptions(opts); + const ecmaFeatures = options.ecmaFeatures || {}; + const tokenTranslator = + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; + + /* + * Data that is unique to Espree and is not represented internally + * in Acorn. + * + * For ES2023 hashbangs, Espree will call `onComment()` during the + * constructor, so we must define state before having access to + * `this`. + */ + const state = { + originalSourceType: originalSourceType || options.sourceType, + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, + ecmaVersion: options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null, + templateElements: [] + }; + + // Initialize acorn parser. + super({ + + // do not use spread, because we don't want to pass any unknown options to acorn + ecmaVersion: options.ecmaVersion, + sourceType: options.sourceType, + ranges: options.ranges, + locations: options.locations, + allowReserved: options.allowReserved, + + // Truthy value is true for backward compatibility. + allowReturnOutsideFunction: options.allowReturnOutsideFunction, + + // Collect tokens + onToken: token => { + if (tokenTranslator) { + + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. + tokenTranslator.onToken(token, state); + } + if (token.type !== tokTypes.eof) { + state.lastToken = token; + } + }, + + // Collect comments + onComment: (block, text, start, end, startLoc, endLoc) => { + if (state.comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); + + state.comments.push(comment); + } + } + }, code); + + /* + * We put all of this data into a symbol property as a way to avoid + * potential naming conflicts with future versions of Acorn. + */ + this[STATE] = state; + } + + tokenize() { + do { + this.next(); + } while (this.type !== tokTypes.eof); + + // Consume the final eof token + this.next(); + + const extra = this[STATE]; + const tokens = extra.tokens; + + if (extra.comments) { + tokens.comments = extra.comments; + } + + return tokens; + } + + finishNode(...args) { + const result = super.finishNode(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + finishNodeAt(...args) { + const result = super.finishNodeAt(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + parse() { + const extra = this[STATE]; + const program = super.parse(); + + program.sourceType = extra.originalSourceType; + + if (extra.comments) { + program.comments = extra.comments; + } + if (extra.tokens) { + program.tokens = extra.tokens; + } + + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.body.length) { + const [firstNode] = program.body; + + if (program.range) { + program.range[0] = firstNode.range[0]; + } + if (program.loc) { + program.loc.start = firstNode.loc.start; + } + program.start = firstNode.start; + } + if (extra.lastToken) { + if (program.range) { + program.range[1] = extra.lastToken.range[1]; + } + if (program.loc) { + program.loc.end = extra.lastToken.loc.end; + } + program.end = extra.lastToken.end; + } + + + /* + * https://github.com/eslint/espree/issues/349 + * Ensure that template elements have correct range information. + * This is one location where Acorn produces a different value + * for its start and end properties vs. the values present in the + * range property. In order to avoid confusion, we set the start + * and end properties to the values that are present in range. + * This is done here, instead of in finishNode(), because Acorn + * uses the values of start and end internally while parsing, making + * it dangerous to change those values while parsing is ongoing. + * By waiting until the end of parsing, we can safely change these + * values without affect any other part of the process. + */ + this[STATE].templateElements.forEach(templateElement => { + const startOffset = -1; + const endOffset = templateElement.tail ? 1 : 2; + + templateElement.start += startOffset; + templateElement.end += endOffset; + + if (templateElement.range) { + templateElement.range[0] += startOffset; + templateElement.range[1] += endOffset; + } + + if (templateElement.loc) { + templateElement.loc.start.column += startOffset; + templateElement.loc.end.column += endOffset; + } + }); + + return program; + } + + parseTopLevel(node) { + if (this[STATE].impliedStrict) { + this.strict = true; + } + return super.parseTopLevel(node); + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raise(pos, message) { + const loc = Parser.acorn.getLineInfo(this.input, pos); + const err = new SyntaxError(message); + + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raiseRecoverable(pos, message) { + this.raise(pos, message); + } + + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + unexpected(pos) { + let message = "Unexpected token"; + + if (pos !== null && pos !== void 0) { + this.pos = pos; + + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } + } + + this.nextToken(); + } + + if (this.end > this.start) { + message += ` ${this.input.slice(this.start, this.end)}`; + } + + this.raise(this.start, message); + } + + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + jsx_readString(quote) { // eslint-disable-line camelcase + const result = super.jsx_readString(quote); + + if (this.type === tokTypes.string) { + this[STATE].jsxAttrValueToken = true; + } + return result; + } + + /** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + */ + [ESPRIMA_FINISH_NODE](result) { + + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { + + // save template element references to fix start/end later + this[STATE].templateElements.push(result); + } + + if (result.type.includes("Function") && !result.generator) { + result.generator = false; + } + + return result; + } + }; +}; + +const version$1 = "9.5.0"; + +/** + * @fileoverview Main Espree file that converts Acorn into Esprima output. + * + * This file contains code from the following MIT-licensed projects: + * 1. Acorn + * 2. Babylon + * 3. Babel-ESLint + * + * This file also contains code from Esprima, which is BSD licensed. + * + * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) + * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) + * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +// To initialize lazily. +const parsers = { + _regular: null, + _jsx: null, + + get regular() { + if (this._regular === null) { + this._regular = acorn__namespace.Parser.extend(espree()); + } + return this._regular; + }, + + get jsx() { + if (this._jsx === null) { + this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree()); + } + return this._jsx; + }, + + get(options) { + const useJsx = Boolean( + options && + options.ecmaFeatures && + options.ecmaFeatures.jsx + ); + + return useJsx ? this.jsx : this.regular; + } +}; + +//------------------------------------------------------------------------------ +// Tokenizer +//------------------------------------------------------------------------------ + +/** + * Tokenizes the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {Token[]} An array of tokens. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ +function tokenize(code, options) { + const Parser = parsers.get(options); + + // Ensure to collect tokens. + if (!options || options.tokens !== true) { + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign + } + + return new Parser(options, code).tokenize(); +} + +//------------------------------------------------------------------------------ +// Parser +//------------------------------------------------------------------------------ + +/** + * Parses the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {ASTNode} The "Program" AST node. + * @throws {SyntaxError} If the input code is invalid. + */ +function parse(code, options) { + const Parser = parsers.get(options); + + return new Parser(options, code).parse(); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +const version = version$1; +const name = "espree"; + +/* istanbul ignore next */ +const VisitorKeys = (function() { + return visitorKeys__namespace.KEYS; +}()); + +// Derive node types from VisitorKeys +/* istanbul ignore next */ +const Syntax = (function() { + let key, + types = {}; + + if (typeof Object.create === "function") { + types = Object.create(null); + } + + for (key in VisitorKeys) { + if (Object.hasOwnProperty.call(VisitorKeys, key)) { + types[key] = key; + } + } + + if (typeof Object.freeze === "function") { + Object.freeze(types); + } + + return types; +}()); + +const latestEcmaVersion = getLatestEcmaVersion(); + +const supportedEcmaVersions = getSupportedEcmaVersions(); + +exports.Syntax = Syntax; +exports.VisitorKeys = VisitorKeys; +exports.latestEcmaVersion = latestEcmaVersion; +exports.name = name; +exports.parse = parse; +exports.supportedEcmaVersions = supportedEcmaVersions; +exports.tokenize = tokenize; +exports.version = version; +//# sourceMappingURL=espree.cjs.map diff --git a/node_modules/espree/espree.js b/node_modules/espree/espree.js index d8069528b..97bda4bd1 100644 --- a/node_modules/espree/espree.js +++ b/node_modules/espree/espree.js @@ -56,13 +56,13 @@ */ /* eslint no-undefined:0, no-use-before-define: 0 */ -"use strict"; +import * as acorn from "acorn"; +import jsx from "acorn-jsx"; +import espree from "./lib/espree.js"; +import espreeVersion from "./lib/version.js"; +import * as visitorKeys from "eslint-visitor-keys"; +import { getLatestEcmaVersion, getSupportedEcmaVersions } from "./lib/options.js"; -const acorn = require("acorn"); -const jsx = require("acorn-jsx"); -const astNodeTypes = require("./lib/ast-node-types"); -const espree = require("./lib/espree"); -const { getLatestEcmaVersion, getSupportedEcmaVersions } = require("./lib/options"); // To initialize lazily. const parsers = { @@ -106,7 +106,7 @@ const parsers = { * @throws {SyntaxError} If the input code is invalid. * @private */ -function tokenize(code, options) { +export function tokenize(code, options) { const Parser = parsers.get(options); // Ensure to collect tokens. @@ -128,7 +128,7 @@ function tokenize(code, options) { * @returns {ASTNode} The "Program" AST node. * @throws {SyntaxError} If the input code is invalid. */ -function parse(code, options) { +export function parse(code, options) { const Parser = parsers.get(options); return new Parser(options, code).parse(); @@ -138,25 +138,27 @@ function parse(code, options) { // Public //------------------------------------------------------------------------------ -exports.version = require("./package.json").version; +export const version = espreeVersion; +export const name = "espree"; -exports.tokenize = tokenize; - -exports.parse = parse; +/* istanbul ignore next */ +export const VisitorKeys = (function() { + return visitorKeys.KEYS; +}()); -// Deep copy. +// Derive node types from VisitorKeys /* istanbul ignore next */ -exports.Syntax = (function() { - let name, +export const Syntax = (function() { + let key, types = {}; if (typeof Object.create === "function") { types = Object.create(null); } - for (name in astNodeTypes) { - if (Object.hasOwnProperty.call(astNodeTypes, name)) { - types[name] = astNodeTypes[name]; + for (key in VisitorKeys) { + if (Object.hasOwnProperty.call(VisitorKeys, key)) { + types[key] = key; } } @@ -167,11 +169,6 @@ exports.Syntax = (function() { return types; }()); -/* istanbul ignore next */ -exports.VisitorKeys = (function() { - return require("eslint-visitor-keys").KEYS; -}()); - -exports.latestEcmaVersion = getLatestEcmaVersion(); +export const latestEcmaVersion = getLatestEcmaVersion(); -exports.supportedEcmaVersions = getSupportedEcmaVersions(); +export const supportedEcmaVersions = getSupportedEcmaVersions(); diff --git a/node_modules/espree/lib/ast-node-types.js b/node_modules/espree/lib/ast-node-types.js deleted file mode 100644 index 2844024d5..000000000 --- a/node_modules/espree/lib/ast-node-types.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @fileoverview The AST node types produced by the parser. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - AssignmentExpression: "AssignmentExpression", - AssignmentPattern: "AssignmentPattern", - ArrayExpression: "ArrayExpression", - ArrayPattern: "ArrayPattern", - ArrowFunctionExpression: "ArrowFunctionExpression", - AwaitExpression: "AwaitExpression", - BlockStatement: "BlockStatement", - BinaryExpression: "BinaryExpression", - BreakStatement: "BreakStatement", - CallExpression: "CallExpression", - CatchClause: "CatchClause", - ClassBody: "ClassBody", - ClassDeclaration: "ClassDeclaration", - ClassExpression: "ClassExpression", - ConditionalExpression: "ConditionalExpression", - ContinueStatement: "ContinueStatement", - DoWhileStatement: "DoWhileStatement", - DebuggerStatement: "DebuggerStatement", - EmptyStatement: "EmptyStatement", - ExpressionStatement: "ExpressionStatement", - ForStatement: "ForStatement", - ForInStatement: "ForInStatement", - ForOfStatement: "ForOfStatement", - FunctionDeclaration: "FunctionDeclaration", - FunctionExpression: "FunctionExpression", - Identifier: "Identifier", - IfStatement: "IfStatement", - Literal: "Literal", - LabeledStatement: "LabeledStatement", - LogicalExpression: "LogicalExpression", - MemberExpression: "MemberExpression", - MetaProperty: "MetaProperty", - MethodDefinition: "MethodDefinition", - NewExpression: "NewExpression", - ObjectExpression: "ObjectExpression", - ObjectPattern: "ObjectPattern", - Program: "Program", - Property: "Property", - RestElement: "RestElement", - ReturnStatement: "ReturnStatement", - SequenceExpression: "SequenceExpression", - SpreadElement: "SpreadElement", - Super: "Super", - SwitchCase: "SwitchCase", - SwitchStatement: "SwitchStatement", - TaggedTemplateExpression: "TaggedTemplateExpression", - TemplateElement: "TemplateElement", - TemplateLiteral: "TemplateLiteral", - ThisExpression: "ThisExpression", - ThrowStatement: "ThrowStatement", - TryStatement: "TryStatement", - UnaryExpression: "UnaryExpression", - UpdateExpression: "UpdateExpression", - VariableDeclaration: "VariableDeclaration", - VariableDeclarator: "VariableDeclarator", - WhileStatement: "WhileStatement", - WithStatement: "WithStatement", - YieldExpression: "YieldExpression", - JSXIdentifier: "JSXIdentifier", - JSXNamespacedName: "JSXNamespacedName", - JSXMemberExpression: "JSXMemberExpression", - JSXEmptyExpression: "JSXEmptyExpression", - JSXExpressionContainer: "JSXExpressionContainer", - JSXElement: "JSXElement", - JSXClosingElement: "JSXClosingElement", - JSXOpeningElement: "JSXOpeningElement", - JSXAttribute: "JSXAttribute", - JSXSpreadAttribute: "JSXSpreadAttribute", - JSXText: "JSXText", - ExportDefaultDeclaration: "ExportDefaultDeclaration", - ExportNamedDeclaration: "ExportNamedDeclaration", - ExportAllDeclaration: "ExportAllDeclaration", - ExportSpecifier: "ExportSpecifier", - ImportDeclaration: "ImportDeclaration", - ImportSpecifier: "ImportSpecifier", - ImportDefaultSpecifier: "ImportDefaultSpecifier", - ImportNamespaceSpecifier: "ImportNamespaceSpecifier" -}; diff --git a/node_modules/espree/lib/espree.js b/node_modules/espree/lib/espree.js index 50ca6e42f..262dd276a 100644 --- a/node_modules/espree/lib/espree.js +++ b/node_modules/espree/lib/espree.js @@ -1,8 +1,7 @@ -"use strict"; - /* eslint-disable no-param-reassign*/ -const TokenTranslator = require("./token-translator"); -const { normalizeOptions } = require("./options"); +import TokenTranslator from "./token-translator.js"; +import { normalizeOptions } from "./options.js"; + const STATE = Symbol("espree's internal state"); const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); @@ -16,12 +15,23 @@ const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); * @param {int} end The index at which the comment ends. * @param {Location} startLoc The location at which the comment starts. * @param {Location} endLoc The location at which the comment ends. + * @param {string} code The source code being parsed. * @returns {Object} The comment object. * @private */ -function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) { + let type; + + if (block) { + type = "Block"; + } else if (code.slice(start, start + 2) === "#!") { + type = "Hashbang"; + } else { + type = "Line"; + } + const comment = { - type: block ? "Block" : "Line", + type, value: text }; @@ -41,7 +51,7 @@ function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, return comment; } -module.exports = () => Parser => { +export default () => Parser => { const tokTypes = Object.assign({}, Parser.acorn.tokTypes); if (Parser.acornJsx) { @@ -57,6 +67,8 @@ module.exports = () => Parser => { code = String(code); } + // save original source type in case of commonjs + const originalSourceType = opts.sourceType; const options = normalizeOptions(opts); const ecmaFeatures = options.ecmaFeatures || {}; const tokenTranslator = @@ -64,49 +76,65 @@ module.exports = () => Parser => { ? new TokenTranslator(tokTypes, code) : null; + /* + * Data that is unique to Espree and is not represented internally + * in Acorn. + * + * For ES2023 hashbangs, Espree will call `onComment()` during the + * constructor, so we must define state before having access to + * `this`. + */ + const state = { + originalSourceType: originalSourceType || options.sourceType, + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5, + ecmaVersion: options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null, + templateElements: [] + }; + // Initialize acorn parser. super({ - // TODO: use {...options} when spread is supported(Node.js >= 8.3.0). + // do not use spread, because we don't want to pass any unknown options to acorn ecmaVersion: options.ecmaVersion, sourceType: options.sourceType, ranges: options.ranges, locations: options.locations, + allowReserved: options.allowReserved, // Truthy value is true for backward compatibility. - allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn), + allowReturnOutsideFunction: options.allowReturnOutsideFunction, // Collect tokens onToken: token => { if (tokenTranslator) { // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. - tokenTranslator.onToken(token, this[STATE]); + tokenTranslator.onToken(token, state); } if (token.type !== tokTypes.eof) { - this[STATE].lastToken = token; + state.lastToken = token; } }, // Collect comments onComment: (block, text, start, end, startLoc, endLoc) => { - if (this[STATE].comments) { - const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); + if (state.comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code); - this[STATE].comments.push(comment); + state.comments.push(comment); } } }, code); - // Initialize internal state. - this[STATE] = { - tokens: tokenTranslator ? [] : null, - comments: options.comment === true ? [] : null, - impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5, - ecmaVersion: this.options.ecmaVersion, - jsxAttrValueToken: false, - lastToken: null - }; + /* + * We put all of this data into a symbol property as a way to avoid + * potential naming conflicts with future versions of Acorn. + */ + this[STATE] = state; } tokenize() { @@ -143,7 +171,7 @@ module.exports = () => Parser => { const extra = this[STATE]; const program = super.parse(); - program.sourceType = this.options.sourceType; + program.sourceType = extra.originalSourceType; if (extra.comments) { program.comments = extra.comments; @@ -159,15 +187,59 @@ module.exports = () => Parser => { * whitespace or leading comments). Acorn also counts trailing whitespace * as part of the program whereas Esprima only counts up to the last token. */ - if (program.range) { - program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0]; - program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1]; + if (program.body.length) { + const [firstNode] = program.body; + + if (program.range) { + program.range[0] = firstNode.range[0]; + } + if (program.loc) { + program.loc.start = firstNode.loc.start; + } + program.start = firstNode.start; } - if (program.loc) { - program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start; - program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end; + if (extra.lastToken) { + if (program.range) { + program.range[1] = extra.lastToken.range[1]; + } + if (program.loc) { + program.loc.end = extra.lastToken.loc.end; + } + program.end = extra.lastToken.end; } + + /* + * https://github.com/eslint/espree/issues/349 + * Ensure that template elements have correct range information. + * This is one location where Acorn produces a different value + * for its start and end properties vs. the values present in the + * range property. In order to avoid confusion, we set the start + * and end properties to the values that are present in range. + * This is done here, instead of in finishNode(), because Acorn + * uses the values of start and end internally while parsing, making + * it dangerous to change those values while parsing is ongoing. + * By waiting until the end of parsing, we can safely change these + * values without affect any other part of the process. + */ + this[STATE].templateElements.forEach(templateElement => { + const startOffset = -1; + const endOffset = templateElement.tail ? 1 : 2; + + templateElement.start += startOffset; + templateElement.end += endOffset; + + if (templateElement.range) { + templateElement.range[0] += startOffset; + templateElement.range[1] += endOffset; + } + + if (templateElement.loc) { + templateElement.loc.start.column += startOffset; + templateElement.loc.end.column += endOffset; + } + }); + return program; } @@ -262,21 +334,11 @@ module.exports = () => Parser => { // so we have to adjust ranges/locations appropriately. if (result.type === "TemplateElement") { - // additional adjustment needed if ${ is the last token - const terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; - - if (result.range) { - result.range[0]--; - result.range[1] += (terminalDollarBraceL ? 2 : 1); - } - - if (result.loc) { - result.loc.start.column--; - result.loc.end.column += (terminalDollarBraceL ? 2 : 1); - } + // save template element references to fix start/end later + this[STATE].templateElements.push(result); } - if (result.type.indexOf("Function") > -1 && !result.generator) { + if (result.type.includes("Function") && !result.generator) { result.generator = false; } diff --git a/node_modules/espree/lib/features.js b/node_modules/espree/lib/features.js index d1ad5f851..31467d288 100644 --- a/node_modules/espree/lib/features.js +++ b/node_modules/espree/lib/features.js @@ -4,8 +4,6 @@ * @author Nicholas C. Zakas */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ @@ -16,7 +14,7 @@ // Public //------------------------------------------------------------------------------ -module.exports = { +export default { // React JSX parsing jsx: false, diff --git a/node_modules/espree/lib/options.js b/node_modules/espree/lib/options.js index eddca200e..d28480728 100644 --- a/node_modules/espree/lib/options.js +++ b/node_modules/espree/lib/options.js @@ -3,37 +3,53 @@ * @author Kai Cataldo */ -"use strict"; - //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ -const DEFAULT_ECMA_VERSION = 5; const SUPPORTED_VERSIONS = [ 3, 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12 + 6, // 2015 + 7, // 2016 + 8, // 2017 + 9, // 2018 + 10, // 2019 + 11, // 2020 + 12, // 2021 + 13, // 2022 + 14 // 2023 ]; +/** + * Get the latest ECMAScript version supported by Espree. + * @returns {number} The latest ECMAScript version. + */ +export function getLatestEcmaVersion() { + return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; +} + +/** + * Get the list of ECMAScript versions supported by Espree. + * @returns {number[]} An array containing the supported ECMAScript versions. + */ +export function getSupportedEcmaVersions() { + return [...SUPPORTED_VERSIONS]; +} + /** * Normalize ECMAScript version from the initial config - * @param {number} ecmaVersion ECMAScript version from the initial config + * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config * @throws {Error} throws an error if the ecmaVersion is invalid. * @returns {number} normalized ECMAScript version */ -function normalizeEcmaVersion(ecmaVersion = DEFAULT_ECMA_VERSION) { - if (typeof ecmaVersion !== "number") { - throw new Error(`ecmaVersion must be a number. Received value of type ${typeof ecmaVersion} instead.`); - } +function normalizeEcmaVersion(ecmaVersion = 5) { - let version = ecmaVersion; + let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion; + + if (typeof version !== "number") { + throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`); + } // Calculate ECMAScript edition number from official year version starting with // ES2015, which corresponds with ES6 (or a difference of 2009). @@ -58,6 +74,11 @@ function normalizeSourceType(sourceType = "script") { if (sourceType === "script" || sourceType === "module") { return sourceType; } + + if (sourceType === "commonjs") { + return "script"; + } + throw new Error("Invalid sourceType."); } @@ -67,40 +88,35 @@ function normalizeSourceType(sourceType = "script") { * @throws {Error} throw an error if found invalid option. * @returns {Object} normalized options */ -function normalizeOptions(options) { +export function normalizeOptions(options) { const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); const sourceType = normalizeSourceType(options.sourceType); const ranges = options.range === true; const locations = options.loc === true; + if (ecmaVersion !== 3 && options.allowReserved) { + + // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed + throw new Error("`allowReserved` is only supported when ecmaVersion is 3"); + } + if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") { + throw new Error("`allowReserved`, when present, must be `true` or `false`"); + } + const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false; + const ecmaFeatures = options.ecmaFeatures || {}; + const allowReturnOutsideFunction = options.sourceType === "commonjs" || + Boolean(ecmaFeatures.globalReturn); + if (sourceType === "module" && ecmaVersion < 6) { throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); } - return Object.assign({}, options, { ecmaVersion, sourceType, ranges, locations }); -} -/** - * Get the latest ECMAScript version supported by Espree. - * @returns {number} The latest ECMAScript version. - */ -function getLatestEcmaVersion() { - return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; + return Object.assign({}, options, { + ecmaVersion, + sourceType, + ranges, + locations, + allowReserved, + allowReturnOutsideFunction + }); } - -/** - * Get the list of ECMAScript versions supported by Espree. - * @returns {number[]} An array containing the supported ECMAScript versions. - */ -function getSupportedEcmaVersions() { - return [...SUPPORTED_VERSIONS]; -} - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - normalizeOptions, - getLatestEcmaVersion, - getSupportedEcmaVersions -}; diff --git a/node_modules/espree/lib/token-translator.js b/node_modules/espree/lib/token-translator.js index f06c7c072..9aa5e22ee 100644 --- a/node_modules/espree/lib/token-translator.js +++ b/node_modules/espree/lib/token-translator.js @@ -4,8 +4,6 @@ */ /* eslint no-underscore-dangle: 0 */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ @@ -22,6 +20,7 @@ const Token = { Boolean: "Boolean", EOF: "", Identifier: "Identifier", + PrivateIdentifier: "PrivateIdentifier", Keyword: "Keyword", Null: "Null", Numeric: "Numeric", @@ -116,6 +115,9 @@ TokenTranslator.prototype = { token.type = Token.Keyword; } + } else if (type === tt.privateId) { + token.type = Token.PrivateIdentifier; + } else if (type === tt.semi || type === tt.comma || type === tt.parenL || type === tt.parenR || type === tt.braceL || type === tt.braceR || @@ -260,4 +262,4 @@ TokenTranslator.prototype = { // Public //------------------------------------------------------------------------------ -module.exports = TokenTranslator; +export default TokenTranslator; diff --git a/node_modules/espree/lib/version.js b/node_modules/espree/lib/version.js new file mode 100644 index 000000000..597a13f17 --- /dev/null +++ b/node_modules/espree/lib/version.js @@ -0,0 +1,3 @@ +const version = "9.5.0"; + +export default version; diff --git a/node_modules/espree/lib/visitor-keys.js b/node_modules/espree/lib/visitor-keys.js deleted file mode 100644 index 4216864f1..000000000 --- a/node_modules/espree/lib/visitor-keys.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @fileoverview The visitor keys for the node types Espree supports - * @author Nicholas C. Zakas - * - * This file contains code from estraverse-fb. - * - * The MIT license. Copyright (c) 2014 Ingvar Stepanyan - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - - // ECMAScript - AssignmentExpression: ["left", "right"], - AssignmentPattern: ["left", "right"], - ArrayExpression: ["elements"], - ArrayPattern: ["elements"], - ArrowFunctionExpression: ["params", "body"], - BlockStatement: ["body"], - BinaryExpression: ["left", "right"], - BreakStatement: ["label"], - CallExpression: ["callee", "arguments"], - CatchClause: ["param", "body"], - ClassBody: ["body"], - ClassDeclaration: ["id", "superClass", "body"], - ClassExpression: ["id", "superClass", "body"], - ConditionalExpression: ["test", "consequent", "alternate"], - ContinueStatement: ["label"], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ["body", "test"], - EmptyStatement: [], - ExportAllDeclaration: ["source"], - ExportDefaultDeclaration: ["declaration"], - ExportNamedDeclaration: ["declaration", "specifiers", "source"], - ExportSpecifier: ["exported", "local"], - ExpressionStatement: ["expression"], - ForStatement: ["init", "test", "update", "body"], - ForInStatement: ["left", "right", "body"], - ForOfStatement: ["left", "right", "body"], - FunctionDeclaration: ["id", "params", "body"], - FunctionExpression: ["id", "params", "body"], - Identifier: [], - IfStatement: ["test", "consequent", "alternate"], - ImportDeclaration: ["specifiers", "source"], - ImportDefaultSpecifier: ["local"], - ImportNamespaceSpecifier: ["local"], - ImportSpecifier: ["imported", "local"], - Literal: [], - LabeledStatement: ["label", "body"], - LogicalExpression: ["left", "right"], - MemberExpression: ["object", "property"], - MetaProperty: ["meta", "property"], - MethodDefinition: ["key", "value"], - ModuleSpecifier: [], - NewExpression: ["callee", "arguments"], - ObjectExpression: ["properties"], - ObjectPattern: ["properties"], - Program: ["body"], - Property: ["key", "value"], - RestElement: ["argument"], - ReturnStatement: ["argument"], - SequenceExpression: ["expressions"], - SpreadElement: ["argument"], - Super: [], - SwitchStatement: ["discriminant", "cases"], - SwitchCase: ["test", "consequent"], - TaggedTemplateExpression: ["tag", "quasi"], - TemplateElement: [], - TemplateLiteral: ["quasis", "expressions"], - ThisExpression: [], - ThrowStatement: ["argument"], - TryStatement: ["block", "handler", "finalizer"], - UnaryExpression: ["argument"], - UpdateExpression: ["argument"], - VariableDeclaration: ["declarations"], - VariableDeclarator: ["id", "init"], - WhileStatement: ["test", "body"], - WithStatement: ["object", "body"], - YieldExpression: ["argument"], - - // JSX - JSXIdentifier: [], - JSXNamespacedName: ["namespace", "name"], - JSXMemberExpression: ["object", "property"], - JSXEmptyExpression: [], - JSXExpressionContainer: ["expression"], - JSXElement: ["openingElement", "closingElement", "children"], - JSXClosingElement: ["name"], - JSXOpeningElement: ["name", "attributes"], - JSXAttribute: ["name", "value"], - JSXText: null, - JSXSpreadAttribute: ["argument"] -}; diff --git a/node_modules/espree/node_modules/.bin/acorn b/node_modules/espree/node_modules/.bin/acorn deleted file mode 120000 index cf7676038..000000000 --- a/node_modules/espree/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/espree/node_modules/acorn/CHANGELOG.md b/node_modules/espree/node_modules/acorn/CHANGELOG.md deleted file mode 100644 index 164fd27c6..000000000 --- a/node_modules/espree/node_modules/acorn/CHANGELOG.md +++ /dev/null @@ -1,620 +0,0 @@ -## 7.4.0 (2020-08-03) - -### New features - -Add support for logical assignment operators. - -Add support for numeric separators. - -## 7.3.1 (2020-06-11) - -### Bug fixes - -Make the string in the `version` export match the actual library version. - -## 7.3.0 (2020-06-11) - -### Bug fixes - -Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail. - -### New features - -Add support for optional chaining (`?.`). - -## 7.2.0 (2020-05-09) - -### Bug fixes - -Fix precedence issue in parsing of async arrow functions. - -### New features - -Add support for nullish coalescing. - -Add support for `import.meta`. - -Support `export * as ...` syntax. - -Upgrade to Unicode 13. - -## 6.4.1 (2020-03-09) - -### Bug fixes - -More carefully check for valid UTF16 surrogate pairs in regexp validator. - -## 7.1.1 (2020-03-01) - -### Bug fixes - -Treat `\8` and `\9` as invalid escapes in template strings. - -Allow unicode escapes in property names that are keywords. - -Don't error on an exponential operator expression as argument to `await`. - -More carefully check for valid UTF16 surrogate pairs in regexp validator. - -## 7.1.0 (2019-09-24) - -### Bug fixes - -Disallow trailing object literal commas when ecmaVersion is less than 5. - -### New features - -Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on. - -## 7.0.0 (2019-08-13) - -### Breaking changes - -Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression). - -Makes 10 (ES2019) the default value for the `ecmaVersion` option. - -## 6.3.0 (2019-08-12) - -### New features - -`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard. - -## 6.2.1 (2019-07-21) - -### Bug fixes - -Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such. - -Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances. - -## 6.2.0 (2019-07-04) - -### Bug fixes - -Improve valid assignment checking in `for`/`in` and `for`/`of` loops. - -Disallow binding `let` in patterns. - -### New features - -Support bigint syntax with `ecmaVersion` >= 11. - -Support dynamic `import` syntax with `ecmaVersion` >= 11. - -Upgrade to Unicode version 12. - -## 6.1.1 (2019-02-27) - -### Bug fixes - -Fix bug that caused parsing default exports of with names to fail. - -## 6.1.0 (2019-02-08) - -### Bug fixes - -Fix scope checking when redefining a `var` as a lexical binding. - -### New features - -Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins. - -## 6.0.7 (2019-02-04) - -### Bug fixes - -Check that exported bindings are defined. - -Don't treat `\u180e` as a whitespace character. - -Check for duplicate parameter names in methods. - -Don't allow shorthand properties when they are generators or async methods. - -Forbid binding `await` in async arrow function's parameter list. - -## 6.0.6 (2019-01-30) - -### Bug fixes - -The content of class declarations and expressions is now always parsed in strict mode. - -Don't allow `let` or `const` to bind the variable name `let`. - -Treat class declarations as lexical. - -Don't allow a generator function declaration as the sole body of an `if` or `else`. - -Ignore `"use strict"` when after an empty statement. - -Allow string line continuations with special line terminator characters. - -Treat `for` bodies as part of the `for` scope when checking for conflicting bindings. - -Fix bug with parsing `yield` in a `for` loop initializer. - -Implement special cases around scope checking for functions. - -## 6.0.5 (2019-01-02) - -### Bug fixes - -Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type. - -Don't treat `let` as a keyword when the next token is `{` on the next line. - -Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on. - -## 6.0.4 (2018-11-05) - -### Bug fixes - -Further improvements to tokenizing regular expressions in corner cases. - -## 6.0.3 (2018-11-04) - -### Bug fixes - -Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression. - -Remove stray symlink in the package tarball. - -## 6.0.2 (2018-09-26) - -### Bug fixes - -Fix bug where default expressions could fail to parse inside an object destructuring assignment expression. - -## 6.0.1 (2018-09-14) - -### Bug fixes - -Fix wrong value in `version` export. - -## 6.0.0 (2018-09-14) - -### Bug fixes - -Better handle variable-redefinition checks for catch bindings and functions directly under if statements. - -Forbid `new.target` in top-level arrow functions. - -Fix issue with parsing a regexp after `yield` in some contexts. - -### New features - -The package now comes with TypeScript definitions. - -### Breaking changes - -The default value of the `ecmaVersion` option is now 9 (2018). - -Plugins work differently, and will have to be rewritten to work with this version. - -The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`). - -## 5.7.3 (2018-09-10) - -### Bug fixes - -Fix failure to tokenize regexps after expressions like `x.of`. - -Better error message for unterminated template literals. - -## 5.7.2 (2018-08-24) - -### Bug fixes - -Properly handle `allowAwaitOutsideFunction` in for statements. - -Treat function declarations at the top level of modules like let bindings. - -Don't allow async function declarations as the only statement under a label. - -## 5.7.0 (2018-06-15) - -### New features - -Upgraded to Unicode 11. - -## 5.6.0 (2018-05-31) - -### New features - -Allow U+2028 and U+2029 in string when ECMAVersion >= 10. - -Allow binding-less catch statements when ECMAVersion >= 10. - -Add `allowAwaitOutsideFunction` option for parsing top-level `await`. - -## 5.5.3 (2018-03-08) - -### Bug fixes - -A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. - -## 5.5.2 (2018-03-08) - -### Bug fixes - -A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. - -## 5.5.1 (2018-03-06) - -### Bug fixes - -Fix misleading error message for octal escapes in template strings. - -## 5.5.0 (2018-02-27) - -### New features - -The identifier character categorization is now based on Unicode version 10. - -Acorn will now validate the content of regular expressions, including new ES9 features. - -## 5.4.0 (2018-02-01) - -### Bug fixes - -Disallow duplicate or escaped flags on regular expressions. - -Disallow octal escapes in strings in strict mode. - -### New features - -Add support for async iteration. - -Add support for object spread and rest. - -## 5.3.0 (2017-12-28) - -### Bug fixes - -Fix parsing of floating point literals with leading zeroes in loose mode. - -Allow duplicate property names in object patterns. - -Don't allow static class methods named `prototype`. - -Disallow async functions directly under `if` or `else`. - -Parse right-hand-side of `for`/`of` as an assignment expression. - -Stricter parsing of `for`/`in`. - -Don't allow unicode escapes in contextual keywords. - -### New features - -Parsing class members was factored into smaller methods to allow plugins to hook into it. - -## 5.2.1 (2017-10-30) - -### Bug fixes - -Fix a token context corruption bug. - -## 5.2.0 (2017-10-30) - -### Bug fixes - -Fix token context tracking for `class` and `function` in property-name position. - -Make sure `%*` isn't parsed as a valid operator. - -Allow shorthand properties `get` and `set` to be followed by default values. - -Disallow `super` when not in callee or object position. - -### New features - -Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. - -## 5.1.2 (2017-09-04) - -### Bug fixes - -Disable parsing of legacy HTML-style comments in modules. - -Fix parsing of async methods whose names are keywords. - -## 5.1.1 (2017-07-06) - -### Bug fixes - -Fix problem with disambiguating regexp and division after a class. - -## 5.1.0 (2017-07-05) - -### Bug fixes - -Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. - -Parse zero-prefixed numbers with non-octal digits as decimal. - -Allow object/array patterns in rest parameters. - -Don't error when `yield` is used as a property name. - -Allow `async` as a shorthand object property. - -### New features - -Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. - -## 5.0.3 (2017-04-01) - -### Bug fixes - -Fix spurious duplicate variable definition errors for named functions. - -## 5.0.2 (2017-03-30) - -### Bug fixes - -A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. - -## 5.0.0 (2017-03-28) - -### Bug fixes - -Raise an error for duplicated lexical bindings. - -Fix spurious error when an assignement expression occurred after a spread expression. - -Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. - -Allow labels in front or `var` declarations, even in strict mode. - -### Breaking changes - -Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. - -## 4.0.11 (2017-02-07) - -### Bug fixes - -Allow all forms of member expressions to be parenthesized as lvalue. - -## 4.0.10 (2017-02-07) - -### Bug fixes - -Don't expect semicolons after default-exported functions or classes, even when they are expressions. - -Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode. - -## 4.0.9 (2017-02-06) - -### Bug fixes - -Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again. - -## 4.0.8 (2017-02-03) - -### Bug fixes - -Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet. - -## 4.0.7 (2017-02-02) - -### Bug fixes - -Accept invalidly rejected code like `(x).y = 2` again. - -Don't raise an error when a function _inside_ strict code has a non-simple parameter list. - -## 4.0.6 (2017-02-02) - -### Bug fixes - -Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check. - -## 4.0.5 (2017-02-02) - -### Bug fixes - -Disallow parenthesized pattern expressions. - -Allow keywords as export names. - -Don't allow the `async` keyword to be parenthesized. - -Properly raise an error when a keyword contains a character escape. - -Allow `"use strict"` to appear after other string literal expressions. - -Disallow labeled declarations. - -## 4.0.4 (2016-12-19) - -### Bug fixes - -Fix crash when `export` was followed by a keyword that can't be -exported. - -## 4.0.3 (2016-08-16) - -### Bug fixes - -Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode. - -Properly parse properties named `async` in ES2017 mode. - -Fix bug where reserved words were broken in ES2017 mode. - -## 4.0.2 (2016-08-11) - -### Bug fixes - -Don't ignore period or 'e' characters after octal numbers. - -Fix broken parsing for call expressions in default parameter values of arrow functions. - -## 4.0.1 (2016-08-08) - -### Bug fixes - -Fix false positives in duplicated export name errors. - -## 4.0.0 (2016-08-07) - -### Breaking changes - -The default `ecmaVersion` option value is now 7. - -A number of internal method signatures changed, so plugins might need to be updated. - -### Bug fixes - -The parser now raises errors on duplicated export names. - -`arguments` and `eval` can now be used in shorthand properties. - -Duplicate parameter names in non-simple argument lists now always produce an error. - -### New features - -The `ecmaVersion` option now also accepts year-style version numbers -(2015, etc). - -Support for `async`/`await` syntax when `ecmaVersion` is >= 8. - -Support for trailing commas in call expressions when `ecmaVersion` is >= 8. - -## 3.3.0 (2016-07-25) - -### Bug fixes - -Fix bug in tokenizing of regexp operator after a function declaration. - -Fix parser crash when parsing an array pattern with a hole. - -### New features - -Implement check against complex argument lists in functions that enable strict mode in ES7. - -## 3.2.0 (2016-06-07) - -### Bug fixes - -Improve handling of lack of unicode regexp support in host -environment. - -Properly reject shorthand properties whose name is a keyword. - -### New features - -Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object. - -## 3.1.0 (2016-04-18) - -### Bug fixes - -Properly tokenize the division operator directly after a function expression. - -Allow trailing comma in destructuring arrays. - -## 3.0.4 (2016-02-25) - -### Fixes - -Allow update expressions as left-hand-side of the ES7 exponential operator. - -## 3.0.2 (2016-02-10) - -### Fixes - -Fix bug that accidentally made `undefined` a reserved word when parsing ES7. - -## 3.0.0 (2016-02-10) - -### Breaking changes - -The default value of the `ecmaVersion` option is now 6 (used to be 5). - -Support for comprehension syntax (which was dropped from the draft spec) has been removed. - -### Fixes - -`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code. - -A parenthesized class or function expression after `export default` is now parsed correctly. - -### New features - -When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`). - -The identifier character ranges are now based on Unicode 8.0.0. - -Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled. - -## 2.7.0 (2016-01-04) - -### Fixes - -Stop allowing rest parameters in setters. - -Disallow `y` rexexp flag in ES5. - -Disallow `\00` and `\000` escapes in strict mode. - -Raise an error when an import name is a reserved word. - -## 2.6.2 (2015-11-10) - -### Fixes - -Don't crash when no options object is passed. - -## 2.6.0 (2015-11-09) - -### Fixes - -Add `await` as a reserved word in module sources. - -Disallow `yield` in a parameter default value for a generator. - -Forbid using a comma after a rest pattern in an array destructuring. - -### New features - -Support parsing stdin in command-line tool. - -## 2.5.0 (2015-10-27) - -### Fixes - -Fix tokenizer support in the command-line tool. - -Stop allowing `new.target` outside of functions. - -Remove legacy `guard` and `guardedHandler` properties from try nodes. - -Stop allowing multiple `__proto__` properties on an object literal in strict mode. - -Don't allow rest parameters to be non-identifier patterns. - -Check for duplicate paramter names in arrow functions. diff --git a/node_modules/espree/node_modules/acorn/LICENSE b/node_modules/espree/node_modules/acorn/LICENSE deleted file mode 100644 index cc5272c96..000000000 --- a/node_modules/espree/node_modules/acorn/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (C) 2012-2018 by various contributors (see AUTHORS) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/espree/node_modules/acorn/README.md b/node_modules/espree/node_modules/acorn/README.md deleted file mode 100644 index 52d2e9b71..000000000 --- a/node_modules/espree/node_modules/acorn/README.md +++ /dev/null @@ -1,269 +0,0 @@ -# Acorn - -A tiny, fast JavaScript parser written in JavaScript. - -## Community - -Acorn is open source software released under an -[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). - -You are welcome to -[report bugs](https://github.com/acornjs/acorn/issues) or create pull -requests on [github](https://github.com/acornjs/acorn). For questions -and discussion, please use the -[Tern discussion forum](https://discuss.ternjs.net). - -## Installation - -The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): - -```sh -npm install acorn -``` - -Alternately, you can download the source and build acorn yourself: - -```sh -git clone https://github.com/acornjs/acorn.git -cd acorn -npm install -``` - -## Interface - -**parse**`(input, options)` is the main interface to the library. The -`input` parameter is a string, `options` can be undefined or an object -setting some of the options listed below. The return value will be an -abstract syntax tree object as specified by the [ESTree -spec](https://github.com/estree/estree). - -```javascript -let acorn = require("acorn"); -console.log(acorn.parse("1 + 1")); -``` - -When encountering a syntax error, the parser will raise a -`SyntaxError` object with a meaningful message. The error object will -have a `pos` property that indicates the string offset at which the -error occurred, and a `loc` object that contains a `{line, column}` -object referring to that same position. - -Options can be provided by passing a second argument, which should be -an object containing any of these fields: - -- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be - either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019) or 11 - (2020, partial support). This influences support for strict mode, - the set of reserved words, and support for new syntax features. - Default is 10. - - **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being - implemented by Acorn. Other proposed new features can be implemented - through plugins. - -- **sourceType**: Indicate the mode the code should be parsed in. Can be - either `"script"` or `"module"`. This influences global strict mode - and parsing of `import` and `export` declarations. - - **NOTE**: If set to `"module"`, then static `import` / `export` syntax - will be valid, even if `ecmaVersion` is less than 6. - -- **onInsertedSemicolon**: If given a callback, that callback will be - called whenever a missing semicolon is inserted by the parser. The - callback will be given the character offset of the point where the - semicolon is inserted as argument, and if `locations` is on, also a - `{line, column}` object representing this position. - -- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing - commas. - -- **allowReserved**: If `false`, using a reserved word will generate - an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher - versions. When given the value `"never"`, reserved words and - keywords can also not be used as property names (as in Internet - Explorer's old parser). - -- **allowReturnOutsideFunction**: By default, a return statement at - the top level raises an error. Set this to `true` to accept such - code. - -- **allowImportExportEverywhere**: By default, `import` and `export` - declarations can only appear at a program's top level. Setting this - option to `true` allows them anywhere where a statement is allowed. - -- **allowAwaitOutsideFunction**: By default, `await` expressions can - only appear inside `async` functions. Setting this option to - `true` allows to have top-level `await` expressions. They are - still not allowed in non-`async` functions, though. - -- **allowHashBang**: When this is enabled (off by default), if the - code starts with the characters `#!` (as in a shellscript), the - first line will be treated as a comment. - -- **locations**: When `true`, each node has a `loc` object attached - with `start` and `end` subobjects, each of which contains the - one-based line and zero-based column numbers in `{line, column}` - form. Default is `false`. - -- **onToken**: If a function is passed for this option, each found - token will be passed in same format as tokens returned from - `tokenizer().getToken()`. - - If array is passed, each found token is pushed to it. - - Note that you are not allowed to call the parser from the - callback—that will corrupt its internal state. - -- **onComment**: If a function is passed for this option, whenever a - comment is encountered the function will be called with the - following parameters: - - - `block`: `true` if the comment is a block comment, false if it - is a line comment. - - `text`: The content of the comment. - - `start`: Character offset of the start of the comment. - - `end`: Character offset of the end of the comment. - - When the `locations` options is on, the `{line, column}` locations - of the comment’s start and end are passed as two additional - parameters. - - If array is passed for this option, each found comment is pushed - to it as object in Esprima format: - - ```javascript - { - "type": "Line" | "Block", - "value": "comment text", - "start": Number, - "end": Number, - // If `locations` option is on: - "loc": { - "start": {line: Number, column: Number} - "end": {line: Number, column: Number} - }, - // If `ranges` option is on: - "range": [Number, Number] - } - ``` - - Note that you are not allowed to call the parser from the - callback—that will corrupt its internal state. - -- **ranges**: Nodes have their start and end characters offsets - recorded in `start` and `end` properties (directly on the node, - rather than the `loc` object, which holds line/column data. To also - add a - [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) - `range` property holding a `[start, end]` array with the same - numbers, set the `ranges` option to `true`. - -- **program**: It is possible to parse multiple files into a single - AST by passing the tree produced by parsing the first file as the - `program` option in subsequent parses. This will add the toplevel - forms of the parsed file to the "Program" (top) node of an existing - parse tree. - -- **sourceFile**: When the `locations` option is `true`, you can pass - this option to add a `source` attribute in every node’s `loc` - object. Note that the contents of this option are not examined or - processed in any way; you are free to use whatever format you - choose. - -- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property - will be added (regardless of the `location` option) directly to the - nodes, rather than the `loc` object. - -- **preserveParens**: If this option is `true`, parenthesized expressions - are represented by (non-standard) `ParenthesizedExpression` nodes - that have a single `expression` property containing the expression - inside parentheses. - -**parseExpressionAt**`(input, offset, options)` will parse a single -expression in a string, and return its AST. It will not complain if -there is more of the string left after the expression. - -**tokenizer**`(input, options)` returns an object with a `getToken` -method that can be called repeatedly to get the next token, a `{start, -end, type, value}` object (with added `loc` property when the -`locations` option is enabled and `range` property when the `ranges` -option is enabled). When the token's type is `tokTypes.eof`, you -should stop calling the method, since it will keep returning that same -token forever. - -In ES6 environment, returned result can be used as any other -protocol-compliant iterable: - -```javascript -for (let token of acorn.tokenizer(str)) { - // iterate over the tokens -} - -// transform code to array of tokens: -var tokens = [...acorn.tokenizer(str)]; -``` - -**tokTypes** holds an object mapping names to the token type objects -that end up in the `type` properties of tokens. - -**getLineInfo**`(input, offset)` can be used to get a `{line, -column}` object for a given program string and offset. - -### The `Parser` class - -Instances of the **`Parser`** class contain all the state and logic -that drives a parse. It has static methods `parse`, -`parseExpressionAt`, and `tokenizer` that match the top-level -functions by the same name. - -When extending the parser with plugins, you need to call these methods -on the extended version of the class. To extend a parser with plugins, -you can use its static `extend` method. - -```javascript -var acorn = require("acorn"); -var jsx = require("acorn-jsx"); -var JSXParser = acorn.Parser.extend(jsx()); -JSXParser.parse("foo()"); -``` - -The `extend` method takes any number of plugin values, and returns a -new `Parser` class that includes the extra parser logic provided by -the plugins. - -## Command line interface - -The `bin/acorn` utility can be used to parse a file from the command -line. It accepts as arguments its input file and the following -options: - -- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version - to parse. Default is version 9. - -- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. - -- `--locations`: Attaches a "loc" object to each node with "start" and - "end" subobjects, each of which contains the one-based line and - zero-based column numbers in `{line, column}` form. - -- `--allow-hash-bang`: If the code starts with the characters #! (as - in a shellscript), the first line will be treated as a comment. - -- `--compact`: No whitespace is used in the AST output. - -- `--silent`: Do not output the AST, just return the exit status. - -- `--help`: Print the usage information and quit. - -The utility spits out the syntax tree as JSON data. - -## Existing plugins - - - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) - -Plugins for ECMAScript proposals: - - - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: - - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) - - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) - - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/node_modules/espree/node_modules/acorn/bin/acorn b/node_modules/espree/node_modules/acorn/bin/acorn deleted file mode 100755 index cf7df4689..000000000 --- a/node_modules/espree/node_modules/acorn/bin/acorn +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -require('../dist/bin.js'); diff --git a/node_modules/espree/node_modules/acorn/dist/acorn.d.ts b/node_modules/espree/node_modules/acorn/dist/acorn.d.ts deleted file mode 100644 index bda5f803c..000000000 --- a/node_modules/espree/node_modules/acorn/dist/acorn.d.ts +++ /dev/null @@ -1,209 +0,0 @@ -export as namespace acorn -export = acorn - -declare namespace acorn { - function parse(input: string, options?: Options): Node - - function parseExpressionAt(input: string, pos?: number, options?: Options): Node - - function tokenizer(input: string, options?: Options): { - getToken(): Token - [Symbol.iterator](): Iterator - } - - interface Options { - ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 - sourceType?: 'script' | 'module' - onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void - onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void - allowReserved?: boolean | 'never' - allowReturnOutsideFunction?: boolean - allowImportExportEverywhere?: boolean - allowAwaitOutsideFunction?: boolean - allowHashBang?: boolean - locations?: boolean - onToken?: ((token: Token) => any) | Token[] - onComment?: (( - isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, - endLoc?: Position - ) => void) | Comment[] - ranges?: boolean - program?: Node - sourceFile?: string - directSourceFile?: string - preserveParens?: boolean - } - - class Parser { - constructor(options: Options, input: string, startPos?: number) - parse(this: Parser): Node - static parse(this: typeof Parser, input: string, options?: Options): Node - static parseExpressionAt(this: typeof Parser, input: string, pos: number, options?: Options): Node - static tokenizer(this: typeof Parser, input: string, options?: Options): { - getToken(): Token - [Symbol.iterator](): Iterator - } - static extend(this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser - } - - interface Position { line: number; column: number; offset: number } - - const defaultOptions: Options - - function getLineInfo(input: string, offset: number): Position - - class SourceLocation { - start: Position - end: Position - source?: string | null - constructor(p: Parser, start: Position, end: Position) - } - - class Node { - type: string - start: number - end: number - loc?: SourceLocation - sourceFile?: string - range?: [number, number] - constructor(parser: Parser, pos: number, loc?: SourceLocation) - } - - class TokenType { - label: string - keyword: string - beforeExpr: boolean - startsExpr: boolean - isLoop: boolean - isAssign: boolean - prefix: boolean - postfix: boolean - binop: number - updateContext?: (prevType: TokenType) => void - constructor(label: string, conf?: any) - } - - const tokTypes: { - num: TokenType - regexp: TokenType - string: TokenType - name: TokenType - eof: TokenType - bracketL: TokenType - bracketR: TokenType - braceL: TokenType - braceR: TokenType - parenL: TokenType - parenR: TokenType - comma: TokenType - semi: TokenType - colon: TokenType - dot: TokenType - question: TokenType - arrow: TokenType - template: TokenType - ellipsis: TokenType - backQuote: TokenType - dollarBraceL: TokenType - eq: TokenType - assign: TokenType - incDec: TokenType - prefix: TokenType - logicalOR: TokenType - logicalAND: TokenType - bitwiseOR: TokenType - bitwiseXOR: TokenType - bitwiseAND: TokenType - equality: TokenType - relational: TokenType - bitShift: TokenType - plusMin: TokenType - modulo: TokenType - star: TokenType - slash: TokenType - starstar: TokenType - _break: TokenType - _case: TokenType - _catch: TokenType - _continue: TokenType - _debugger: TokenType - _default: TokenType - _do: TokenType - _else: TokenType - _finally: TokenType - _for: TokenType - _function: TokenType - _if: TokenType - _return: TokenType - _switch: TokenType - _throw: TokenType - _try: TokenType - _var: TokenType - _const: TokenType - _while: TokenType - _with: TokenType - _new: TokenType - _this: TokenType - _super: TokenType - _class: TokenType - _extends: TokenType - _export: TokenType - _import: TokenType - _null: TokenType - _true: TokenType - _false: TokenType - _in: TokenType - _instanceof: TokenType - _typeof: TokenType - _void: TokenType - _delete: TokenType - } - - class TokContext { - constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) - } - - const tokContexts: { - b_stat: TokContext - b_expr: TokContext - b_tmpl: TokContext - p_stat: TokContext - p_expr: TokContext - q_tmpl: TokContext - f_expr: TokContext - } - - function isIdentifierStart(code: number, astral?: boolean): boolean - - function isIdentifierChar(code: number, astral?: boolean): boolean - - interface AbstractToken { - } - - interface Comment extends AbstractToken { - type: string - value: string - start: number - end: number - loc?: SourceLocation - range?: [number, number] - } - - class Token { - type: TokenType - value: any - start: number - end: number - loc?: SourceLocation - range?: [number, number] - constructor(p: Parser) - } - - function isNewLine(code: number): boolean - - const lineBreak: RegExp - - const lineBreakG: RegExp - - const version: string -} diff --git a/node_modules/espree/node_modules/acorn/dist/acorn.js b/node_modules/espree/node_modules/acorn/dist/acorn.js deleted file mode 100644 index 0523f0e34..000000000 --- a/node_modules/espree/node_modules/acorn/dist/acorn.js +++ /dev/null @@ -1,5186 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.acorn = {})); -}(this, (function (exports) { 'use strict'; - - // Reserved word lists for various dialects of the language - - var reservedWords = { - 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", - 5: "class enum extends super const export import", - 6: "enum", - strict: "implements interface let package private protected public static yield", - strictBind: "eval arguments" - }; - - // And the keywords - - var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; - - var keywords = { - 5: ecma5AndLessKeywords, - "5module": ecma5AndLessKeywords + " export import", - 6: ecma5AndLessKeywords + " const class extends export import super" - }; - - var keywordRelationalOperator = /^in(stanceof)?$/; - - // ## Character categories - - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - // Generated by `bin/generate-identifier-regex.js`. - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - - nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; - - // These are a run-length and offset encoded representation of the - // >0xffff code points that are a valid part of identifiers. The - // offset starts at 0x10000, and each pair of numbers represents an - // offset to the next range, and then a size of the range. They were - // generated by bin/generate-identifier-regex.js - - // eslint-disable-next-line comma-spacing - var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; - - // eslint-disable-next-line comma-spacing - var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; - - // This has a complexity linear to the value of the code. The - // assumption is that looking up astral identifier characters is - // rare. - function isInAstralSet(code, set) { - var pos = 0x10000; - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code) { return false } - pos += set[i + 1]; - if (pos >= code) { return true } - } - } - - // Test whether a given character code starts an identifier. - - function isIdentifierStart(code, astral) { - if (code < 65) { return code === 36 } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) - } - - // Test whether a given character is part of an identifier. - - function isIdentifierChar(code, astral) { - if (code < 48) { return code === 36 } - if (code < 58) { return true } - if (code < 65) { return false } - if (code < 91) { return true } - if (code < 97) { return code === 95 } - if (code < 123) { return true } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } - if (astral === false) { return false } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) - } - - // ## Token types - - // The assignment of fine-grained, information-carrying type objects - // allows the tokenizer to store the information it has about a - // token in a way that is very cheap for the parser to look up. - - // All token type variables start with an underscore, to make them - // easy to recognize. - - // The `beforeExpr` property is used to disambiguate between regular - // expressions and divisions. It is set on all token types that can - // be followed by an expression (thus, a slash after them would be a - // regular expression). - // - // The `startsExpr` property is used to check if the token ends a - // `yield` expression. It is set on all token types that either can - // directly start an expression (like a quotation mark) or can - // continue an expression (like the body of a string). - // - // `isLoop` marks a keyword as starting a loop, which is important - // to know when parsing a label, in order to allow or disallow - // continue jumps to that label. - - var TokenType = function TokenType(label, conf) { - if ( conf === void 0 ) conf = {}; - - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop || null; - this.updateContext = null; - }; - - function binop(name, prec) { - return new TokenType(name, {beforeExpr: true, binop: prec}) - } - var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; - - // Map keyword names to token types. - - var keywords$1 = {}; - - // Succinct definitions of keyword token types - function kw(name, options) { - if ( options === void 0 ) options = {}; - - options.keyword = name; - return keywords$1[name] = new TokenType(name, options) - } - - var types = { - num: new TokenType("num", startsExpr), - regexp: new TokenType("regexp", startsExpr), - string: new TokenType("string", startsExpr), - name: new TokenType("name", startsExpr), - eof: new TokenType("eof"), - - // Punctuation token types. - bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), - bracketR: new TokenType("]"), - braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), - braceR: new TokenType("}"), - parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), - parenR: new TokenType(")"), - comma: new TokenType(",", beforeExpr), - semi: new TokenType(";", beforeExpr), - colon: new TokenType(":", beforeExpr), - dot: new TokenType("."), - question: new TokenType("?", beforeExpr), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", beforeExpr), - template: new TokenType("template"), - invalidTemplate: new TokenType("invalidTemplate"), - ellipsis: new TokenType("...", beforeExpr), - backQuote: new TokenType("`", startsExpr), - dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), - - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - - eq: new TokenType("=", {beforeExpr: true, isAssign: true}), - assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), - incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), - prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), - logicalOR: binop("||", 1), - logicalAND: binop("&&", 2), - bitwiseOR: binop("|", 3), - bitwiseXOR: binop("^", 4), - bitwiseAND: binop("&", 5), - equality: binop("==/!=/===/!==", 6), - relational: binop("/<=/>=", 7), - bitShift: binop("<>/>>>", 8), - plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), - modulo: binop("%", 10), - star: binop("*", 10), - slash: binop("/", 10), - starstar: new TokenType("**", {beforeExpr: true}), - coalesce: binop("??", 1), - - // Keyword token types. - _break: kw("break"), - _case: kw("case", beforeExpr), - _catch: kw("catch"), - _continue: kw("continue"), - _debugger: kw("debugger"), - _default: kw("default", beforeExpr), - _do: kw("do", {isLoop: true, beforeExpr: true}), - _else: kw("else", beforeExpr), - _finally: kw("finally"), - _for: kw("for", {isLoop: true}), - _function: kw("function", startsExpr), - _if: kw("if"), - _return: kw("return", beforeExpr), - _switch: kw("switch"), - _throw: kw("throw", beforeExpr), - _try: kw("try"), - _var: kw("var"), - _const: kw("const"), - _while: kw("while", {isLoop: true}), - _with: kw("with"), - _new: kw("new", {beforeExpr: true, startsExpr: true}), - _this: kw("this", startsExpr), - _super: kw("super", startsExpr), - _class: kw("class", startsExpr), - _extends: kw("extends", beforeExpr), - _export: kw("export"), - _import: kw("import", startsExpr), - _null: kw("null", startsExpr), - _true: kw("true", startsExpr), - _false: kw("false", startsExpr), - _in: kw("in", {beforeExpr: true, binop: 7}), - _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), - _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), - _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), - _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) - }; - - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. - - var lineBreak = /\r\n?|\n|\u2028|\u2029/; - var lineBreakG = new RegExp(lineBreak.source, "g"); - - function isNewLine(code, ecma2019String) { - return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) - } - - var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; - - var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; - - var ref = Object.prototype; - var hasOwnProperty = ref.hasOwnProperty; - var toString = ref.toString; - - // Checks if an object has a property. - - function has(obj, propName) { - return hasOwnProperty.call(obj, propName) - } - - var isArray = Array.isArray || (function (obj) { return ( - toString.call(obj) === "[object Array]" - ); }); - - function wordsRegexp(words) { - return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") - } - - // These are used when `options.locations` is on, for the - // `startLoc` and `endLoc` properties. - - var Position = function Position(line, col) { - this.line = line; - this.column = col; - }; - - Position.prototype.offset = function offset (n) { - return new Position(this.line, this.column + n) - }; - - var SourceLocation = function SourceLocation(p, start, end) { - this.start = start; - this.end = end; - if (p.sourceFile !== null) { this.source = p.sourceFile; } - }; - - // The `getLineInfo` function is mostly useful when the - // `locations` option is off (for performance reasons) and you - // want to find the line/column position for a given character - // offset. `input` should be the code string that the offset refers - // into. - - function getLineInfo(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur) - } - } - } - - // A second optional argument can be given to further configure - // the parser process. These options are recognized: - - var defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must be - // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 - // (2019). This influences support for strict mode, the set of - // reserved words, and support for new syntax features. The default - // is 10. - ecmaVersion: 10, - // `sourceType` indicates the mode the code should be parsed in. - // Can be either `"script"` or `"module"`. This influences global - // strict mode and parsing of `import` and `export` declarations. - sourceType: "script", - // `onInsertedSemicolon` can be a callback that will be called - // when a semicolon is automatically inserted. It will be passed - // the position of the comma as an offset, and if `locations` is - // enabled, it is given the location as a `{line, column}` object - // as second argument. - onInsertedSemicolon: null, - // `onTrailingComma` is similar to `onInsertedSemicolon`, but for - // trailing commas. - onTrailingComma: null, - // By default, reserved words are only enforced if ecmaVersion >= 5. - // Set `allowReserved` to a boolean value to explicitly turn this on - // an off. When this option has the value "never", reserved words - // and keywords can also not be used as property names. - allowReserved: null, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When enabled, import/export statements are not constrained to - // appearing at the top of the program. - allowImportExportEverywhere: false, - // When enabled, await identifiers are allowed to appear at the top-level scope, - // but they are still not allowed in non-async functions. - allowAwaitOutsideFunction: false, - // When enabled, hashbang directive in the beginning of file - // is allowed and treated as a line comment. - allowHashBang: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // A function can be passed as `onToken` option, which will - // cause Acorn to call that function with object in the same - // format as tokens returned from `tokenizer().getToken()`. Note - // that you are not allowed to call the parser from the - // callback—that will corrupt its internal state. - onToken: null, - // A function can be passed as `onComment` option, which will - // cause Acorn to call that function with `(block, text, start, - // end)` parameters whenever a comment is skipped. `block` is a - // boolean indicating whether this is a block (`/* */`) comment, - // `text` is the content of the comment, and `start` and `end` are - // character offsets that denote the start and end of the comment. - // When the `locations` option is on, two more parameters are - // passed, the full `{line, column}` locations of the start and - // end of the comments. Note that you are not allowed to call the - // parser from the callback—that will corrupt its internal state. - onComment: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `locations` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null, - // This value, if given, is stored in every node, whether - // `locations` is on or off. - directSourceFile: null, - // When enabled, parenthesized expressions are represented by - // (non-standard) ParenthesizedExpression nodes - preserveParens: false - }; - - // Interpret and default an options object - - function getOptions(opts) { - var options = {}; - - for (var opt in defaultOptions) - { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } - - if (options.ecmaVersion >= 2015) - { options.ecmaVersion -= 2009; } - - if (options.allowReserved == null) - { options.allowReserved = options.ecmaVersion < 5; } - - if (isArray(options.onToken)) { - var tokens = options.onToken; - options.onToken = function (token) { return tokens.push(token); }; - } - if (isArray(options.onComment)) - { options.onComment = pushComment(options, options.onComment); } - - return options - } - - function pushComment(options, array) { - return function(block, text, start, end, startLoc, endLoc) { - var comment = { - type: block ? "Block" : "Line", - value: text, - start: start, - end: end - }; - if (options.locations) - { comment.loc = new SourceLocation(this, startLoc, endLoc); } - if (options.ranges) - { comment.range = [start, end]; } - array.push(comment); - } - } - - // Each scope gets a bitset that may contain these flags - var - SCOPE_TOP = 1, - SCOPE_FUNCTION = 2, - SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, - SCOPE_ASYNC = 4, - SCOPE_GENERATOR = 8, - SCOPE_ARROW = 16, - SCOPE_SIMPLE_CATCH = 32, - SCOPE_SUPER = 64, - SCOPE_DIRECT_SUPER = 128; - - function functionFlags(async, generator) { - return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) - } - - // Used in checkLVal and declareName to determine the type of a binding - var - BIND_NONE = 0, // Not a binding - BIND_VAR = 1, // Var-style binding - BIND_LEXICAL = 2, // Let- or const-style binding - BIND_FUNCTION = 3, // Function declaration - BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding - BIND_OUTSIDE = 5; // Special case for function names as bound inside the function - - var Parser = function Parser(options, input, startPos) { - this.options = options = getOptions(options); - this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); - var reserved = ""; - if (options.allowReserved !== true) { - for (var v = options.ecmaVersion;; v--) - { if (reserved = reservedWords[v]) { break } } - if (options.sourceType === "module") { reserved += " await"; } - } - this.reservedWords = wordsRegexp(reserved); - var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; - this.reservedWordsStrict = wordsRegexp(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); - this.input = String(input); - - // Used to signal to callers of `readWord1` whether the word - // contained any escape sequences. This is needed because words with - // escape sequences must not be interpreted as keywords. - this.containsEsc = false; - - // Set up token state - - // The current position of the tokenizer in the input. - if (startPos) { - this.pos = startPos; - this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - - // Properties of the current token: - // Its type - this.type = types.eof; - // For tokens that include more information than their type, the value - this.value = null; - // Its start and end offset - this.start = this.end = this.pos; - // And, if locations are used, the {line, column} object - // corresponding to those offsets - this.startLoc = this.endLoc = this.curPosition(); - - // Position information for the previous token - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; - - // The context stack is used to superficially track syntactic - // context to predict whether a regular expression is allowed in a - // given position. - this.context = this.initialContext(); - this.exprAllowed = true; - - // Figure out if it's a module code. - this.inModule = options.sourceType === "module"; - this.strict = this.inModule || this.strictDirective(this.pos); - - // Used to signify the start of a potential arrow function - this.potentialArrowAt = -1; - - // Positions to delayed-check that yield/await does not exist in default parameters. - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; - // Labels in scope. - this.labels = []; - // Thus-far undefined exports. - this.undefinedExports = {}; - - // If enabled, skip leading hashbang line. - if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") - { this.skipLineComment(2); } - - // Scope tracking for duplicate variable names (see scope.js) - this.scopeStack = []; - this.enterScope(SCOPE_TOP); - - // For RegExp validation - this.regexpState = null; - }; - - var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; - - Parser.prototype.parse = function parse () { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node) - }; - - prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; - prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; - prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; - prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; - prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; - prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; - - // Switch to a getter for 7.0.0. - Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; - - Parser.extend = function extend () { - var plugins = [], len = arguments.length; - while ( len-- ) plugins[ len ] = arguments[ len ]; - - var cls = this; - for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } - return cls - }; - - Parser.parse = function parse (input, options) { - return new this(options, input).parse() - }; - - Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { - var parser = new this(options, input, pos); - parser.nextToken(); - return parser.parseExpression() - }; - - Parser.tokenizer = function tokenizer (input, options) { - return new this(options, input) - }; - - Object.defineProperties( Parser.prototype, prototypeAccessors ); - - var pp = Parser.prototype; - - // ## Parser utilities - - var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp.strictDirective = function(start) { - for (;;) { - // Try to find string literal. - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - var match = literal.exec(this.input.slice(start)); - if (!match) { return false } - if ((match[1] || match[2]) === "use strict") { - skipWhiteSpace.lastIndex = start + match[0].length; - var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; - var next = this.input.charAt(end); - return next === ";" || next === "}" || - (lineBreak.test(spaceAfter[0]) && - !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) - } - start += match[0].length; - - // Skip semicolon, if any. - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - if (this.input[start] === ";") - { start++; } - } - }; - - // Predicate that tests whether the next token is of the given - // type, and if yes, consumes it as a side effect. - - pp.eat = function(type) { - if (this.type === type) { - this.next(); - return true - } else { - return false - } - }; - - // Tests whether parsed token is a contextual keyword. - - pp.isContextual = function(name) { - return this.type === types.name && this.value === name && !this.containsEsc - }; - - // Consumes contextual keyword if possible. - - pp.eatContextual = function(name) { - if (!this.isContextual(name)) { return false } - this.next(); - return true - }; - - // Asserts that following token is given contextual keyword. - - pp.expectContextual = function(name) { - if (!this.eatContextual(name)) { this.unexpected(); } - }; - - // Test whether a semicolon can be inserted at the current position. - - pp.canInsertSemicolon = function() { - return this.type === types.eof || - this.type === types.braceR || - lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - }; - - pp.insertSemicolon = function() { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) - { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } - return true - } - }; - - // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. - - pp.semicolon = function() { - if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } - }; - - pp.afterTrailingComma = function(tokType, notNext) { - if (this.type === tokType) { - if (this.options.onTrailingComma) - { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } - if (!notNext) - { this.next(); } - return true - } - }; - - // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error. - - pp.expect = function(type) { - this.eat(type) || this.unexpected(); - }; - - // Raise an unexpected token error. - - pp.unexpected = function(pos) { - this.raise(pos != null ? pos : this.start, "Unexpected token"); - }; - - function DestructuringErrors() { - this.shorthandAssign = - this.trailingComma = - this.parenthesizedAssign = - this.parenthesizedBind = - this.doubleProto = - -1; - } - - pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { - if (!refDestructuringErrors) { return } - if (refDestructuringErrors.trailingComma > -1) - { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } - var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } - }; - - pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { - if (!refDestructuringErrors) { return false } - var shorthandAssign = refDestructuringErrors.shorthandAssign; - var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } - if (shorthandAssign >= 0) - { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } - if (doubleProto >= 0) - { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } - }; - - pp.checkYieldAwaitInDefaultParams = function() { - if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) - { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } - if (this.awaitPos) - { this.raise(this.awaitPos, "Await expression cannot be a default value"); } - }; - - pp.isSimpleAssignTarget = function(expr) { - if (expr.type === "ParenthesizedExpression") - { return this.isSimpleAssignTarget(expr.expression) } - return expr.type === "Identifier" || expr.type === "MemberExpression" - }; - - var pp$1 = Parser.prototype; - - // ### Statement parsing - - // Parse a program. Initializes the parser, reads any number of - // statements, and wraps them in a Program node. Optionally takes a - // `program` argument. If present, the statements will be appended - // to its body instead of creating a new node. - - pp$1.parseTopLevel = function(node) { - var exports = {}; - if (!node.body) { node.body = []; } - while (this.type !== types.eof) { - var stmt = this.parseStatement(null, true, exports); - node.body.push(stmt); - } - if (this.inModule) - { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) - { - var name = list[i]; - - this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); - } } - this.adaptDirectivePrologue(node.body); - this.next(); - node.sourceType = this.options.sourceType; - return this.finishNode(node, "Program") - }; - - var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - - pp$1.isLet = function(context) { - if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - // For ambiguous cases, determine if a LexicalDeclaration (or only a - // Statement) is allowed here. If context is not empty then only a Statement - // is allowed. However, `let [` is an explicit negative lookahead for - // ExpressionStatement, so special-case it first. - if (nextCh === 91) { return true } // '[' - if (context) { return false } - - if (nextCh === 123) { return true } // '{' - if (isIdentifierStart(nextCh, true)) { - var pos = next + 1; - while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) { return true } - } - return false - }; - - // check 'async [no LineTerminator here] function' - // - 'async /*foo*/ function' is OK. - // - 'async /*\n*/ function' is invalid. - pp$1.isAsyncFunction = function() { - if (this.options.ecmaVersion < 8 || !this.isContextual("async")) - { return false } - - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length; - return !lineBreak.test(this.input.slice(this.pos, next)) && - this.input.slice(next, next + 8) === "function" && - (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) - }; - - // Parse a single statement. - // - // If expecting a statement and finding a slash operator, parse a - // regular expression literal. This is to handle cases like - // `if (foo) /blah/.exec(foo)`, where looking at the previous token - // does not help. - - pp$1.parseStatement = function(context, topLevel, exports) { - var starttype = this.type, node = this.startNode(), kind; - - if (this.isLet(context)) { - starttype = types._var; - kind = "let"; - } - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types._debugger: return this.parseDebuggerStatement(node) - case types._do: return this.parseDoStatement(node) - case types._for: return this.parseForStatement(node) - case types._function: - // Function as sole body of either an if statement or a labeled statement - // works, but not when it is part of a labeled statement that is the sole - // body of an if statement. - if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } - return this.parseFunctionStatement(node, false, !context) - case types._class: - if (context) { this.unexpected(); } - return this.parseClass(node, true) - case types._if: return this.parseIfStatement(node) - case types._return: return this.parseReturnStatement(node) - case types._switch: return this.parseSwitchStatement(node) - case types._throw: return this.parseThrowStatement(node) - case types._try: return this.parseTryStatement(node) - case types._const: case types._var: - kind = kind || this.value; - if (context && kind !== "var") { this.unexpected(); } - return this.parseVarStatement(node, kind) - case types._while: return this.parseWhileStatement(node) - case types._with: return this.parseWithStatement(node) - case types.braceL: return this.parseBlock(true, node) - case types.semi: return this.parseEmptyStatement(node) - case types._export: - case types._import: - if (this.options.ecmaVersion > 10 && starttype === types._import) { - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - if (nextCh === 40 || nextCh === 46) // '(' or '.' - { return this.parseExpressionStatement(node, this.parseExpression()) } - } - - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) - { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } - if (!this.inModule) - { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } - } - return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - default: - if (this.isAsyncFunction()) { - if (context) { this.unexpected(); } - this.next(); - return this.parseFunctionStatement(node, true, !context) - } - - var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) - { return this.parseLabeledStatement(node, maybeName, expr, context) } - else { return this.parseExpressionStatement(node, expr) } - } - }; - - pp$1.parseBreakContinueStatement = function(node, keyword) { - var isBreak = keyword === "break"; - this.next(); - if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types.name) { this.unexpected(); } - else { - node.label = this.parseIdent(); - this.semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - var i = 0; - for (; i < this.labels.length; ++i) { - var lab = this.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } - if (node.label && isBreak) { break } - } - } - if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") - }; - - pp$1.parseDebuggerStatement = function(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement") - }; - - pp$1.parseDoStatement = function(node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement("do"); - this.labels.pop(); - this.expect(types._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) - { this.eat(types.semi); } - else - { this.semicolon(); } - return this.finishNode(node, "DoWhileStatement") - }; - - // Disambiguating between a `for` and a `for`/`in` or `for`/`of` - // loop is non-trivial. Basically, we have to parse the init `var` - // statement or expression, disallowing the `in` operator (see - // the second parameter to `parseExpression`), and then check - // whether the next token is `in` or `of`. When there is no init - // part (semicolon immediately after the opening parenthesis), it - // is a regular `for` loop. - - pp$1.parseForStatement = function(node) { - this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; - this.labels.push(loopLabel); - this.enterScope(0); - this.expect(types.parenL); - if (this.type === types.semi) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, null) - } - var isLet = this.isLet(); - if (this.type === types._var || this.type === types._const || isLet) { - var init$1 = this.startNode(), kind = isLet ? "let" : this.value; - this.next(); - this.parseVar(init$1, true, kind); - this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - } else { node.await = awaitAt > -1; } - } - return this.parseForIn(node, init$1) - } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init$1) - } - var refDestructuringErrors = new DestructuringErrors; - var init = this.parseExpression(true, refDestructuringErrors); - if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { - if (awaitAt > -1) { this.unexpected(awaitAt); } - } else { node.await = awaitAt > -1; } - } - this.toAssignable(init, false, refDestructuringErrors); - this.checkLVal(init); - return this.parseForIn(node, init) - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init) - }; - - pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) - }; - - pp$1.parseIfStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - // allow function declarations in branches, but only in non-strict mode - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement") - }; - - pp$1.parseReturnStatement = function(node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) - { this.raise(this.start, "'return' outside of function"); } - this.next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } - else { node.argument = this.parseExpression(); this.semicolon(); } - return this.finishNode(node, "ReturnStatement") - }; - - pp$1.parseSwitchStatement = function(node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(types.braceL); - this.labels.push(switchLabel); - this.enterScope(0); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - var cur; - for (var sawDefault = false; this.type !== types.braceR;) { - if (this.type === types._case || this.type === types._default) { - var isCase = this.type === types._case; - if (cur) { this.finishNode(cur, "SwitchCase"); } - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } - sawDefault = true; - cur.test = null; - } - this.expect(types.colon); - } else { - if (!cur) { this.unexpected(); } - cur.consequent.push(this.parseStatement(null)); - } - } - this.exitScope(); - if (cur) { this.finishNode(cur, "SwitchCase"); } - this.next(); // Closing brace - this.labels.pop(); - return this.finishNode(node, "SwitchStatement") - }; - - pp$1.parseThrowStatement = function(node) { - this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) - { this.raise(this.lastTokEnd, "Illegal newline after throw"); } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement") - }; - - // Reused empty array added for node fields that are always empty. - - var empty = []; - - pp$1.parseTryStatement = function(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === types._catch) { - var clause = this.startNode(); - this.next(); - if (this.eat(types.parenL)) { - clause.param = this.parseBindingAtom(); - var simple = clause.param.type === "Identifier"; - this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types.parenR); - } else { - if (this.options.ecmaVersion < 10) { this.unexpected(); } - clause.param = null; - this.enterScope(0); - } - clause.body = this.parseBlock(false); - this.exitScope(); - node.handler = this.finishNode(clause, "CatchClause"); - } - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) - { this.raise(node.start, "Missing catch or finally clause"); } - return this.finishNode(node, "TryStatement") - }; - - pp$1.parseVarStatement = function(node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration") - }; - - pp$1.parseWhileStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement("while"); - this.labels.pop(); - return this.finishNode(node, "WhileStatement") - }; - - pp$1.parseWithStatement = function(node) { - if (this.strict) { this.raise(this.start, "'with' in strict mode"); } - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement("with"); - return this.finishNode(node, "WithStatement") - }; - - pp$1.parseEmptyStatement = function(node) { - this.next(); - return this.finishNode(node, "EmptyStatement") - }; - - pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { - for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) - { - var label = list[i$1]; - - if (label.name === maybeName) - { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - } } - var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; - for (var i = this.labels.length - 1; i >= 0; i--) { - var label$1 = this.labels[i]; - if (label$1.statementStart === node.start) { - // Update information about previous labels on this node - label$1.statementStart = this.start; - label$1.kind = kind; - } else { break } - } - this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement") - }; - - pp$1.parseExpressionStatement = function(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement") - }; - - // Parse a semicolon-enclosed block of statements, handling `"use - // strict"` declarations when `allowStrict` is true (used for - // function bodies). - - pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { - if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; - if ( node === void 0 ) node = this.startNode(); - - node.body = []; - this.expect(types.braceL); - if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - if (exitStrict) { this.strict = false; } - this.next(); - if (createNewLexicalScope) { this.exitScope(); } - return this.finishNode(node, "BlockStatement") - }; - - // Parse a regular `for` loop. The disambiguation code in - // `parseStatement` will already have parsed the init statement or - // expression. - - pp$1.parseFor = function(node, init) { - node.init = init; - this.expect(types.semi); - node.test = this.type === types.semi ? null : this.parseExpression(); - this.expect(types.semi); - node.update = this.type === types.parenR ? null : this.parseExpression(); - this.expect(types.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, "ForStatement") - }; - - // Parse a `for`/`in` and `for`/`of` loop, which are almost - // same from parser's perspective. - - pp$1.parseForIn = function(node, init) { - var isForIn = this.type === types._in; - this.next(); - - if ( - init.type === "VariableDeclaration" && - init.declarations[0].init != null && - ( - !isForIn || - this.options.ecmaVersion < 8 || - this.strict || - init.kind !== "var" || - init.declarations[0].id.type !== "Identifier" - ) - ) { - this.raise( - init.start, - ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") - ); - } else if (init.type === "AssignmentPattern") { - this.raise(init.start, "Invalid left-hand side in for-loop"); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") - }; - - // Parse a list of variable declarations. - - pp$1.parseVar = function(node, isFor, kind) { - node.declarations = []; - node.kind = kind; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl, kind); - if (this.eat(types.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { - this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { - this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) { break } - } - return node - }; - - pp$1.parseVarId = function(decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); - }; - - var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; - - // Parse a function declaration or literal (depending on the - // `statement & FUNC_STATEMENT`). - - // Remove `allowExpressionBody` for 7.0.0, as it is only called with false - pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { - this.initFunction(node); - if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) - { this.unexpected(); } - node.generator = this.eat(types.star); - } - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } - - if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); - if (node.id && !(statement & FUNC_HANGING_STATEMENT)) - // If it is a regular function declaration in sloppy mode, then it is - // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding - // mode depends on properties of the current scope (see - // treatFunctionsAsVar). - { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } - } - - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(node.async, node.generator)); - - if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types.name ? this.parseIdent() : null; } - - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false); - - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") - }; - - pp$1.parseFunctionParams = function(node) { - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); - }; - - // Parse a class declaration or literal (depending on the - // `isStatement` parameter). - - pp$1.parseClass = function(node, isStatement) { - this.next(); - - // ecma-262 14.6 Class Definitions - // A class definition is always strict mode code. - var oldStrict = this.strict; - this.strict = true; - - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(types.braceL); - while (this.type !== types.braceR) { - var element = this.parseClassElement(node.superClass !== null); - if (element) { - classBody.body.push(element); - if (element.type === "MethodDefinition" && element.kind === "constructor") { - if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } - hadConstructor = true; - } - } - } - this.strict = oldStrict; - this.next(); - node.body = this.finishNode(classBody, "ClassBody"); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") - }; - - pp$1.parseClassElement = function(constructorAllowsSuper) { - var this$1 = this; - - if (this.eat(types.semi)) { return null } - - var method = this.startNode(); - var tryContextual = function (k, noLineBreak) { - if ( noLineBreak === void 0 ) noLineBreak = false; - - var start = this$1.start, startLoc = this$1.startLoc; - if (!this$1.eatContextual(k)) { return false } - if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } - if (method.key) { this$1.unexpected(); } - method.computed = false; - method.key = this$1.startNodeAt(start, startLoc); - method.key.name = k; - this$1.finishNode(method.key, "Identifier"); - return false - }; - - method.kind = "method"; - method.static = tryContextual("static"); - var isGenerator = this.eat(types.star); - var isAsync = false; - if (!isGenerator) { - if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); - } else if (tryContextual("get")) { - method.kind = "get"; - } else if (tryContextual("set")) { - method.kind = "set"; - } - } - if (!method.key) { this.parsePropertyName(method); } - var key = method.key; - var allowsDirectSuper = false; - if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || - key.type === "Literal" && key.value === "constructor")) { - if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } - if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } - if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } - method.kind = "constructor"; - allowsDirectSuper = constructorAllowsSuper; - } else if (method.static && key.type === "Identifier" && key.name === "prototype") { - this.raise(key.start, "Classes may not have a static property named prototype"); - } - this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); - if (method.kind === "get" && method.value.params.length !== 0) - { this.raiseRecoverable(method.value.start, "getter should have no params"); } - if (method.kind === "set" && method.value.params.length !== 1) - { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } - if (method.kind === "set" && method.value.params[0].type === "RestElement") - { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } - return method - }; - - pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); - return this.finishNode(method, "MethodDefinition") - }; - - pp$1.parseClassId = function(node, isStatement) { - if (this.type === types.name) { - node.id = this.parseIdent(); - if (isStatement) - { this.checkLVal(node.id, BIND_LEXICAL, false); } - } else { - if (isStatement === true) - { this.unexpected(); } - node.id = null; - } - }; - - pp$1.parseClassSuper = function(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; - }; - - // Parses module export declaration. - - pp$1.parseExport = function(node, exports) { - this.next(); - // export * from '...' - if (this.eat(types.star)) { - if (this.options.ecmaVersion >= 11) { - if (this.eatContextual("as")) { - node.exported = this.parseIdent(true); - this.checkExport(exports, node.exported.name, this.lastTokStart); - } else { - node.exported = null; - } - } - this.expectContextual("from"); - if (this.type !== types.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration") - } - if (this.eat(types._default)) { // export default ... - this.checkExport(exports, "default", this.lastTokStart); - var isAsync; - if (this.type === types._function || (isAsync = this.isAsyncFunction())) { - var fNode = this.startNode(); - this.next(); - if (isAsync) { this.next(); } - node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); - } else if (this.type === types._class) { - var cNode = this.startNode(); - node.declaration = this.parseClass(cNode, "nullableID"); - } else { - node.declaration = this.parseMaybeAssign(); - this.semicolon(); - } - return this.finishNode(node, "ExportDefaultDeclaration") - } - // export var|const|let|function|class ... - if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(null); - if (node.declaration.type === "VariableDeclaration") - { this.checkVariableExport(exports, node.declaration.declarations); } - else - { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } - node.specifiers = []; - node.source = null; - } else { // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { - if (this.type !== types.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - } else { - for (var i = 0, list = node.specifiers; i < list.length; i += 1) { - // check for keywords used as local names - var spec = list[i]; - - this.checkUnreserved(spec.local); - // check if export is defined - this.checkLocalExport(spec.local); - } - - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, "ExportNamedDeclaration") - }; - - pp$1.checkExport = function(exports, name, pos) { - if (!exports) { return } - if (has(exports, name)) - { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } - exports[name] = true; - }; - - pp$1.checkPatternExport = function(exports, pat) { - var type = pat.type; - if (type === "Identifier") - { this.checkExport(exports, pat.name, pat.start); } - else if (type === "ObjectPattern") - { for (var i = 0, list = pat.properties; i < list.length; i += 1) - { - var prop = list[i]; - - this.checkPatternExport(exports, prop); - } } - else if (type === "ArrayPattern") - { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { - var elt = list$1[i$1]; - - if (elt) { this.checkPatternExport(exports, elt); } - } } - else if (type === "Property") - { this.checkPatternExport(exports, pat.value); } - else if (type === "AssignmentPattern") - { this.checkPatternExport(exports, pat.left); } - else if (type === "RestElement") - { this.checkPatternExport(exports, pat.argument); } - else if (type === "ParenthesizedExpression") - { this.checkPatternExport(exports, pat.expression); } - }; - - pp$1.checkVariableExport = function(exports, decls) { - if (!exports) { return } - for (var i = 0, list = decls; i < list.length; i += 1) - { - var decl = list[i]; - - this.checkPatternExport(exports, decl.id); - } - }; - - pp$1.shouldParseExportStatement = function() { - return this.type.keyword === "var" || - this.type.keyword === "const" || - this.type.keyword === "class" || - this.type.keyword === "function" || - this.isLet() || - this.isAsyncFunction() - }; - - // Parses a comma-separated list of module exports. - - pp$1.parseExportSpecifiers = function(exports) { - var nodes = [], first = true; - // export { x, y as z } [from '...'] - this.expect(types.braceL); - while (!this.eat(types.braceR)) { - if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } - } else { first = false; } - - var node = this.startNode(); - node.local = this.parseIdent(true); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - this.checkExport(exports, node.exported.name, node.exported.start); - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - return nodes - }; - - // Parses import declaration. - - pp$1.parseImport = function(node) { - this.next(); - // import '...' - if (this.type === types.string) { - node.specifiers = empty; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration") - }; - - // Parses a comma-separated list of module imports. - - pp$1.parseImportSpecifiers = function() { - var nodes = [], first = true; - if (this.type === types.name) { - // import defaultObj, { x, y as z } from '...' - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLVal(node.local, BIND_LEXICAL); - nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types.comma)) { return nodes } - } - if (this.type === types.star) { - var node$1 = this.startNode(); - this.next(); - this.expectContextual("as"); - node$1.local = this.parseIdent(); - this.checkLVal(node$1.local, BIND_LEXICAL); - nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); - return nodes - } - this.expect(types.braceL); - while (!this.eat(types.braceR)) { - if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } - } else { first = false; } - - var node$2 = this.startNode(); - node$2.imported = this.parseIdent(true); - if (this.eatContextual("as")) { - node$2.local = this.parseIdent(); - } else { - this.checkUnreserved(node$2.imported); - node$2.local = node$2.imported; - } - this.checkLVal(node$2.local, BIND_LEXICAL); - nodes.push(this.finishNode(node$2, "ImportSpecifier")); - } - return nodes - }; - - // Set `ExpressionStatement#directive` property for directive prologues. - pp$1.adaptDirectivePrologue = function(statements) { - for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { - statements[i].directive = statements[i].expression.raw.slice(1, -1); - } - }; - pp$1.isDirectiveCandidate = function(statement) { - return ( - statement.type === "ExpressionStatement" && - statement.expression.type === "Literal" && - typeof statement.expression.value === "string" && - // Reject parenthesized strings. - (this.input[statement.start] === "\"" || this.input[statement.start] === "'") - ) - }; - - var pp$2 = Parser.prototype; - - // Convert existing expression atom to assignable pattern - // if possible. - - pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case "Identifier": - if (this.inAsync && node.name === "await") - { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } - break - - case "ObjectPattern": - case "ArrayPattern": - case "RestElement": - break - - case "ObjectExpression": - node.type = "ObjectPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - for (var i = 0, list = node.properties; i < list.length; i += 1) { - var prop = list[i]; - - this.toAssignable(prop, isBinding); - // Early error: - // AssignmentRestProperty[Yield, Await] : - // `...` DestructuringAssignmentTarget[Yield, Await] - // - // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. - if ( - prop.type === "RestElement" && - (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") - ) { - this.raise(prop.argument.start, "Unexpected token"); - } - } - break - - case "Property": - // AssignmentProperty has type === "Property" - if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } - this.toAssignable(node.value, isBinding); - break - - case "ArrayExpression": - node.type = "ArrayPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - this.toAssignableList(node.elements, isBinding); - break - - case "SpreadElement": - node.type = "RestElement"; - this.toAssignable(node.argument, isBinding); - if (node.argument.type === "AssignmentPattern") - { this.raise(node.argument.start, "Rest elements cannot have a default value"); } - break - - case "AssignmentExpression": - if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isBinding); - // falls through to AssignmentPattern - - case "AssignmentPattern": - break - - case "ParenthesizedExpression": - this.toAssignable(node.expression, isBinding, refDestructuringErrors); - break - - case "ChainExpression": - this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); - break - - case "MemberExpression": - if (!isBinding) { break } - - default: - this.raise(node.start, "Assigning to rvalue"); - } - } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - return node - }; - - // Convert list of expression atoms to binding list. - - pp$2.toAssignableList = function(exprList, isBinding) { - var end = exprList.length; - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) { this.toAssignable(elt, isBinding); } - } - if (end) { - var last = exprList[end - 1]; - if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") - { this.unexpected(last.argument.start); } - } - return exprList - }; - - // Parses spread element. - - pp$2.parseSpread = function(refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refDestructuringErrors); - return this.finishNode(node, "SpreadElement") - }; - - pp$2.parseRestBinding = function() { - var node = this.startNode(); - this.next(); - - // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types.name) - { this.unexpected(); } - - node.argument = this.parseBindingAtom(); - - return this.finishNode(node, "RestElement") - }; - - // Parses lvalue (assignable) atom. - - pp$2.parseBindingAtom = function() { - if (this.options.ecmaVersion >= 6) { - switch (this.type) { - case types.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types.bracketR, true, true); - return this.finishNode(node, "ArrayPattern") - - case types.braceL: - return this.parseObj(true) - } - } - return this.parseIdent() - }; - - pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { - var elts = [], first = true; - while (!this.eat(close)) { - if (first) { first = false; } - else { this.expect(types.comma); } - if (allowEmpty && this.type === types.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break - } else if (this.type === types.ellipsis) { - var rest = this.parseRestBinding(); - this.parseBindingListItem(rest); - elts.push(rest); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } - this.expect(close); - break - } else { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - elts.push(elem); - } - } - return elts - }; - - pp$2.parseBindingListItem = function(param) { - return param - }; - - // Parses assignment pattern around given atom if possible. - - pp$2.parseMaybeDefault = function(startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern") - }; - - // Verify that a node is an lval — something that can be assigned - // to. - // bindingType can be either: - // 'var' indicating that the lval creates a 'var' binding - // 'let' indicating that the lval creates a lexical ('let' or 'const') binding - // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references - - pp$2.checkLVal = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; - - switch (expr.type) { - case "Identifier": - if (bindingType === BIND_LEXICAL && expr.name === "let") - { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) - { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } - if (checkClashes) { - if (has(checkClashes, expr.name)) - { this.raiseRecoverable(expr.start, "Argument name clash"); } - checkClashes[expr.name] = true; - } - if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } - break - - case "ChainExpression": - this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); - break - - case "MemberExpression": - if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } - break - - case "ObjectPattern": - for (var i = 0, list = expr.properties; i < list.length; i += 1) - { - var prop = list[i]; - - this.checkLVal(prop, bindingType, checkClashes); - } - break - - case "Property": - // AssignmentProperty has type === "Property" - this.checkLVal(expr.value, bindingType, checkClashes); - break - - case "ArrayPattern": - for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { - var elem = list$1[i$1]; - - if (elem) { this.checkLVal(elem, bindingType, checkClashes); } - } - break - - case "AssignmentPattern": - this.checkLVal(expr.left, bindingType, checkClashes); - break - - case "RestElement": - this.checkLVal(expr.argument, bindingType, checkClashes); - break - - case "ParenthesizedExpression": - this.checkLVal(expr.expression, bindingType, checkClashes); - break - - default: - this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); - } - }; - - // A recursive descent parser operates by defining functions for all - - var pp$3 = Parser.prototype; - - // Check if property name clashes with already added. - // Object/class getters and setters are not allowed to clash — - // either with each other or with an init property — and in - // strict mode, init properties are also not allowed to be repeated. - - pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { - if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") - { return } - if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) - { return } - var key = prop.key; - var name; - switch (key.type) { - case "Identifier": name = key.name; break - case "Literal": name = String(key.value); break - default: return - } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { - if (name === "__proto__" && kind === "init") { - if (propHash.proto) { - if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) - { refDestructuringErrors.doubleProto = key.start; } - // Backwards-compat kludge. Can be removed in version 6.0 - } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } - } - propHash.proto = true; - } - return - } - name = "$" + name; - var other = propHash[name]; - if (other) { - var redefinition; - if (kind === "init") { - redefinition = this.strict && other.init || other.get || other.set; - } else { - redefinition = other.init || other[kind]; - } - if (redefinition) - { this.raiseRecoverable(key.start, "Redefinition of property"); } - } else { - other = propHash[name] = { - init: false, - get: false, - set: false - }; - } - other[kind] = true; - }; - - // ### Expression parsing - - // These nest, from the most general expression type at the top to - // 'atomic', nondivisible expression types at the bottom. Most of - // the functions will simply let the function(s) below them parse, - // and, *if* the syntactic construct they handle is present, wrap - // the AST node that the inner parser gave them in another node. - - // Parse a full expression. The optional arguments are used to - // forbid the `in` operator (in for loops initalization expressions) - // and provide reference for storing '=' operator inside shorthand - // property assignment in contexts where both object expression - // and object pattern might appear (so it's possible to raise - // delayed syntax error at correct position). - - pp$3.parseExpression = function(noIn, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); - if (this.type === types.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } - return this.finishNode(node, "SequenceExpression") - } - return expr - }; - - // Parse an assignment expression. This includes applications of - // operators like `+=`. - - pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { - if (this.isContextual("yield")) { - if (this.inGenerator) { return this.parseYield(noIn) } - // The tokenizer will assume an expression is allowed after - // `yield`, but this isn't that kind of yield - else { this.exprAllowed = false; } - } - - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; - } else { - refDestructuringErrors = new DestructuringErrors; - ownDestructuringErrors = true; - } - - var startPos = this.start, startLoc = this.startLoc; - if (this.type === types.parenL || this.type === types.name) - { this.potentialArrowAt = this.start; } - var left = this.parseMaybeConditional(noIn, refDestructuringErrors); - if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; - } - if (refDestructuringErrors.shorthandAssign >= node.left.start) - { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - this.checkLVal(left); - this.next(); - node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression") - } else { - if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } - } - if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } - if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } - return left - }; - - // Parse a ternary conditional (`?:`) operator. - - pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprOps(noIn, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types.colon); - node.alternate = this.parseMaybeAssign(noIn); - return this.finishNode(node, "ConditionalExpression") - } - return expr - }; - - // Start the precedence parser. - - pp$3.parseExprOps = function(noIn, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors, false); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) - }; - - // Parse binary operators with the operator precedence parsing - // algorithm. `left` is the left-hand side of the operator. - // `minPrec` provides context that allows the function to stop and - // defer further parser to one of its callers when it encounters an - // operator that has a lower precedence than the set it is parsing. - - pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { - var prec = this.type.binop; - if (prec != null && (!noIn || this.type !== types._in)) { - if (prec > minPrec) { - var logical = this.type === types.logicalOR || this.type === types.logicalAND; - var coalesce = this.type === types.coalesce; - if (coalesce) { - // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. - // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types.logicalAND.binop; - } - var op = this.value; - this.next(); - var startPos = this.start, startLoc = this.startLoc; - var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); - var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { - this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); - } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) - } - } - return left - }; - - pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.operator = op; - node.right = right; - return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") - }; - - // Parse unary operators, both prefix and postfix. - - pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { - var startPos = this.start, startLoc = this.startLoc, expr; - if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { - expr = this.parseAwait(); - sawUnary = true; - } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(null, true); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { this.checkLVal(node.argument); } - else if (this.strict && node.operator === "delete" && - node.argument.type === "Identifier") - { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } - else { sawUnary = true; } - expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } else { - expr = this.parseExprSubscripts(refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.operator = this.value; - node$1.prefix = false; - node$1.argument = expr; - this.checkLVal(expr); - this.next(); - expr = this.finishNode(node$1, "UpdateExpression"); - } - } - - if (!sawUnary && this.eat(types.starstar)) - { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } - else - { return expr } - }; - - // Parse call, dot, and `[]`-subscript expressions. - - pp$3.parseExprSubscripts = function(refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors); - if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") - { return expr } - var result = this.parseSubscripts(expr, startPos, startLoc); - if (refDestructuringErrors && result.type === "MemberExpression") { - if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } - if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } - } - return result - }; - - pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { - var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && - this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && - this.potentialArrowAt === base.start; - var optionalChained = false; - - while (true) { - var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained); - - if (element.optional) { optionalChained = true; } - if (element === base || element.type === "ArrowFunctionExpression") { - if (optionalChained) { - var chainNode = this.startNodeAt(startPos, startLoc); - chainNode.expression = element; - element = this.finishNode(chainNode, "ChainExpression"); - } - return element - } - - base = element; - } - }; - - pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) { - var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types.questionDot); - if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - - var computed = this.eat(types.bracketL); - if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); - node.computed = !!computed; - if (computed) { this.expect(types.bracketR); } - if (optionalSupported) { - node.optional = optional; - } - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types.parenL)) { - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) - { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.callee = base; - node$1.arguments = exprList; - if (optionalSupported) { - node$1.optional = optional; - } - base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types.backQuote) { - if (optional || optionalChained) { - this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); - } - var node$2 = this.startNodeAt(startPos, startLoc); - node$2.tag = base; - node$2.quasi = this.parseTemplate({isTagged: true}); - base = this.finishNode(node$2, "TaggedTemplateExpression"); - } - return base - }; - - // Parse an atomic expression — either a single token that is an - // expression, an expression started by a keyword like `function` or - // `new`, or an expression wrapped in punctuation like `()`, `[]`, - // or `{}`. - - pp$3.parseExprAtom = function(refDestructuringErrors) { - // If a division operator appears in an expression position, the - // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types.slash) { this.readRegexp(); } - - var node, canBeArrow = this.potentialArrowAt === this.start; - switch (this.type) { - case types._super: - if (!this.allowSuper) - { this.raise(this.start, "'super' keyword outside a method"); } - node = this.startNode(); - this.next(); - if (this.type === types.parenL && !this.allowDirectSuper) - { this.raise(node.start, "super() call outside constructor of a subclass"); } - // The `super` keyword can appear at below: - // SuperProperty: - // super [ Expression ] - // super . IdentifierName - // SuperCall: - // super ( Arguments ) - if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) - { this.unexpected(); } - return this.finishNode(node, "Super") - - case types._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression") - - case types.name: - var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; - var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) - { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types.arrow)) - { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { - id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types.arrow)) - { this.unexpected(); } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) - } - } - return id - - case types.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = {pattern: value.pattern, flags: value.flags}; - return node - - case types.num: case types.string: - return this.parseLiteral(this.value) - - case types._null: case types._true: case types._false: - node = this.startNode(); - node.value = this.type === types._null ? null : this.type === types._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, "Literal") - - case types.parenL: - var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); - if (refDestructuringErrors) { - if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) - { refDestructuringErrors.parenthesizedAssign = start; } - if (refDestructuringErrors.parenthesizedBind < 0) - { refDestructuringErrors.parenthesizedBind = start; } - } - return expr - - case types.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); - return this.finishNode(node, "ArrayExpression") - - case types.braceL: - return this.parseObj(false, refDestructuringErrors) - - case types._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, 0) - - case types._class: - return this.parseClass(this.startNode(), false) - - case types._new: - return this.parseNew() - - case types.backQuote: - return this.parseTemplate() - - case types._import: - if (this.options.ecmaVersion >= 11) { - return this.parseExprImport() - } else { - return this.unexpected() - } - - default: - this.unexpected(); - } - }; - - pp$3.parseExprImport = function() { - var node = this.startNode(); - - // Consume `import` as an identifier for `import.meta`. - // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } - var meta = this.parseIdent(true); - - switch (this.type) { - case types.parenL: - return this.parseDynamicImport(node) - case types.dot: - node.meta = meta; - return this.parseImportMeta(node) - default: - this.unexpected(); - } - }; - - pp$3.parseDynamicImport = function(node) { - this.next(); // skip `(` - - // Parse node.source. - node.source = this.parseMaybeAssign(); - - // Verify ending. - if (!this.eat(types.parenR)) { - var errorPos = this.start; - if (this.eat(types.comma) && this.eat(types.parenR)) { - this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); - } else { - this.unexpected(errorPos); - } - } - - return this.finishNode(node, "ImportExpression") - }; - - pp$3.parseImportMeta = function(node) { - this.next(); // skip `.` - - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - - if (node.property.name !== "meta") - { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } - if (containsEsc) - { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } - if (this.options.sourceType !== "module") - { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } - - return this.finishNode(node, "MetaProperty") - }; - - pp$3.parseLiteral = function(value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } - this.next(); - return this.finishNode(node, "Literal") - }; - - pp$3.parseParenExpression = function() { - this.expect(types.parenL); - var val = this.parseExpression(); - this.expect(types.parenR); - return val - }; - - pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { - var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; - if (this.options.ecmaVersion >= 6) { - this.next(); - - var innerStartPos = this.start, innerStartLoc = this.startLoc; - var exprList = [], first = true, lastIsComma = false; - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types.parenR) { - first ? first = false : this.expect(types.comma); - if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { - lastIsComma = true; - break - } else if (this.type === types.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } - break - } else { - exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); - } - } - var innerEndPos = this.start, innerEndLoc = this.startLoc; - this.expect(types.parenR); - - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList) - } - - if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } - if (spreadStart) { this.unexpected(spreadStart); } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, "ParenthesizedExpression") - } else { - return val - } - }; - - pp$3.parseParenItem = function(item) { - return item - }; - - pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) - }; - - // New's precedence is slightly tricky. It must allow its argument to - // be a `[]` or dot subscript expression, but not a call — at least, - // not without wrapping it in parentheses. Thus, it uses the noCalls - // argument to parseSubscripts to prevent it from consuming the - // argument list. - - var empty$1 = []; - - pp$3.parseNew = function() { - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { - node.meta = meta; - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== "target") - { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } - if (containsEsc) - { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } - if (!this.inNonArrowFunction()) - { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); } - return this.finishNode(node, "MetaProperty") - } - var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - if (isImport && node.callee.type === "ImportExpression") { - this.raise(startPos, "Cannot use new with import()"); - } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty$1; } - return this.finishNode(node, "NewExpression") - }; - - // Parse template expression. - - pp$3.parseTemplateElement = function(ref) { - var isTagged = ref.isTagged; - - var elem = this.startNode(); - if (this.type === types.invalidTemplate) { - if (!isTagged) { - this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); - } - elem.value = { - raw: this.value, - cooked: null - }; - } else { - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), - cooked: this.value - }; - } - this.next(); - elem.tail = this.type === types.backQuote; - return this.finishNode(elem, "TemplateElement") - }; - - pp$3.parseTemplate = function(ref) { - if ( ref === void 0 ) ref = {}; - var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; - - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement({isTagged: isTagged}); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types.braceR); - node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); - } - this.next(); - return this.finishNode(node, "TemplateLiteral") - }; - - pp$3.isAsyncProp = function(prop) { - return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && - !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - }; - - // Parse an object literal or binding pattern. - - pp$3.parseObj = function(isPattern, refDestructuringErrors) { - var node = this.startNode(), first = true, propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(types.braceR)) { - if (!first) { - this.expect(types.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } - } else { first = false; } - - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } - node.properties.push(prop); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") - }; - - pp$3.parseProperty = function(isPattern, refDestructuringErrors) { - var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { - if (isPattern) { - prop.argument = this.parseIdent(false); - if (this.type === types.comma) { - this.raise(this.start, "Comma is not permitted after the rest element"); - } - return this.finishNode(prop, "RestElement") - } - // To disallow parenthesized identifier via `this.toAssignable()`. - if (this.type === types.parenL && refDestructuringErrors) { - if (refDestructuringErrors.parenthesizedAssign < 0) { - refDestructuringErrors.parenthesizedAssign = this.start; - } - if (refDestructuringErrors.parenthesizedBind < 0) { - refDestructuringErrors.parenthesizedBind = this.start; - } - } - // Parse argument. - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); - // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { - refDestructuringErrors.trailingComma = this.start; - } - // Finish - return this.finishNode(prop, "SpreadElement") - } - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refDestructuringErrors) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) - { isGenerator = this.eat(types.star); } - } - var containsEsc = this.containsEsc; - this.parsePropertyName(prop); - if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); - this.parsePropertyName(prop, refDestructuringErrors); - } else { - isAsync = false; - } - this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); - return this.finishNode(prop, "Property") - }; - - pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types.colon) - { this.unexpected(); } - - if (this.eat(types.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); - prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { - if (isPattern) { this.unexpected(); } - prop.kind = "init"; - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if (!isPattern && !containsEsc && - this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { - if (isGenerator || isAsync) { this.unexpected(); } - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - var paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start = prop.value.start; - if (prop.kind === "get") - { this.raiseRecoverable(start, "getter should have no params"); } - else - { this.raiseRecoverable(start, "setter should have exactly one param"); } - } else { - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") - { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } - } - } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - if (isGenerator || isAsync) { this.unexpected(); } - this.checkUnreserved(prop.key); - if (prop.key.name === "await" && !this.awaitIdentPos) - { this.awaitIdentPos = startPos; } - prop.kind = "init"; - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else if (this.type === types.eq && refDestructuringErrors) { - if (refDestructuringErrors.shorthandAssign < 0) - { refDestructuringErrors.shorthandAssign = this.start; } - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else { - prop.value = prop.key; - } - prop.shorthand = true; - } else { this.unexpected(); } - }; - - pp$3.parsePropertyName = function(prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(types.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types.bracketR); - return prop.key - } else { - prop.computed = false; - } - } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") - }; - - // Initialize empty function node. - - pp$3.initFunction = function(node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } - if (this.options.ecmaVersion >= 8) { node.async = false; } - }; - - // Parse object or class method. - - pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - - this.initFunction(node); - if (this.options.ecmaVersion >= 6) - { node.generator = isGenerator; } - if (this.options.ecmaVersion >= 8) - { node.async = !!isAsync; } - - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true); - - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "FunctionExpression") - }; - - // Parse arrow function expression with given parameters. - - pp$3.parseArrowExpression = function(node, params, isAsync) { - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - - this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); - this.initFunction(node); - if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false); - - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "ArrowFunctionExpression") - }; - - // Parse function body and check parameters. - - pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { - var isExpression = isArrowFunction && this.type !== types.braceL; - var oldStrict = this.strict, useStrict = false; - - if (isExpression) { - node.body = this.parseMaybeAssign(); - node.expression = true; - this.checkParams(node, false); - } else { - var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (useStrict && nonSimple) - { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } - } - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldLabels = this.labels; - this.labels = []; - if (useStrict) { this.strict = true; } - - // Add the params to varDeclaredNames to ensure that an error is thrown - // if a let/const declaration in the function clashes with one of the params. - this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); - // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' - if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } - node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); - node.expression = false; - this.adaptDirectivePrologue(node.body.body); - this.labels = oldLabels; - } - this.exitScope(); - }; - - pp$3.isSimpleParamList = function(params) { - for (var i = 0, list = params; i < list.length; i += 1) - { - var param = list[i]; - - if (param.type !== "Identifier") { return false - } } - return true - }; - - // Checks function params for various disallowed patterns such as using "eval" - // or "arguments" and duplicate parameters. - - pp$3.checkParams = function(node, allowDuplicates) { - var nameHash = {}; - for (var i = 0, list = node.params; i < list.length; i += 1) - { - var param = list[i]; - - this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); - } - }; - - // Parses a comma-separated list of expressions, and returns them as - // an array. `close` is the token type that ends the list, and - // `allowEmpty` can be turned on to allow subsequent commas with - // nothing in between them to be parsed as `null` (which is needed - // for array literals). - - pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { - var elts = [], first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(types.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { break } - } else { first = false; } - - var elt = (void 0); - if (allowEmpty && this.type === types.comma) - { elt = null; } - else if (this.type === types.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) - { refDestructuringErrors.trailingComma = this.start; } - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors); - } - elts.push(elt); - } - return elts - }; - - pp$3.checkUnreserved = function(ref) { - var start = ref.start; - var end = ref.end; - var name = ref.name; - - if (this.inGenerator && name === "yield") - { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } - if (this.inAsync && name === "await") - { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } - if (this.keywords.test(name)) - { this.raise(start, ("Unexpected keyword '" + name + "'")); } - if (this.options.ecmaVersion < 6 && - this.input.slice(start, end).indexOf("\\") !== -1) { return } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name)) { - if (!this.inAsync && name === "await") - { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } - this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); - } - }; - - // Parse the next token as an identifier. If `liberal` is true (used - // when parsing properties), it will also convert keywords into - // identifiers. - - pp$3.parseIdent = function(liberal, isBinding) { - var node = this.startNode(); - if (this.type === types.name) { - node.name = this.value; - } else if (this.type.keyword) { - node.name = this.type.keyword; - - // To fix https://github.com/acornjs/acorn/issues/575 - // `class` and `function` keywords push new context into this.context. - // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. - // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword - if ((node.name === "class" || node.name === "function") && - (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { - this.context.pop(); - } - } else { - this.unexpected(); - } - this.next(!!liberal); - this.finishNode(node, "Identifier"); - if (!liberal) { - this.checkUnreserved(node); - if (node.name === "await" && !this.awaitIdentPos) - { this.awaitIdentPos = node.start; } - } - return node - }; - - // Parses yield expression inside generator. - - pp$3.parseYield = function(noIn) { - if (!this.yieldPos) { this.yieldPos = this.start; } - - var node = this.startNode(); - this.next(); - if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types.star); - node.argument = this.parseMaybeAssign(noIn); - } - return this.finishNode(node, "YieldExpression") - }; - - pp$3.parseAwait = function() { - if (!this.awaitPos) { this.awaitPos = this.start; } - - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeUnary(null, false); - return this.finishNode(node, "AwaitExpression") - }; - - var pp$4 = Parser.prototype; - - // This function is used to raise exceptions on parse errors. It - // takes an offset integer (into the current `input`) to indicate - // the location of the error, attaches the position to the end - // of the error message, and then raises a `SyntaxError` with that - // message. - - pp$4.raise = function(pos, message) { - var loc = getLineInfo(this.input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos; err.loc = loc; err.raisedAt = this.pos; - throw err - }; - - pp$4.raiseRecoverable = pp$4.raise; - - pp$4.curPosition = function() { - if (this.options.locations) { - return new Position(this.curLine, this.pos - this.lineStart) - } - }; - - var pp$5 = Parser.prototype; - - var Scope = function Scope(flags) { - this.flags = flags; - // A list of var-declared names in the current lexical scope - this.var = []; - // A list of lexically-declared names in the current lexical scope - this.lexical = []; - // A list of lexically-declared FunctionDeclaration names in the current lexical scope - this.functions = []; - }; - - // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. - - pp$5.enterScope = function(flags) { - this.scopeStack.push(new Scope(flags)); - }; - - pp$5.exitScope = function() { - this.scopeStack.pop(); - }; - - // The spec says: - // > At the top level of a function, or script, function declarations are - // > treated like var declarations rather than like lexical declarations. - pp$5.treatFunctionsAsVarInScope = function(scope) { - return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) - }; - - pp$5.declareName = function(name, bindingType, pos) { - var redeclared = false; - if (bindingType === BIND_LEXICAL) { - var scope = this.currentScope(); - redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; - scope.lexical.push(name); - if (this.inModule && (scope.flags & SCOPE_TOP)) - { delete this.undefinedExports[name]; } - } else if (bindingType === BIND_SIMPLE_CATCH) { - var scope$1 = this.currentScope(); - scope$1.lexical.push(name); - } else if (bindingType === BIND_FUNCTION) { - var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) - { redeclared = scope$2.lexical.indexOf(name) > -1; } - else - { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } - scope$2.functions.push(name); - } else { - for (var i = this.scopeStack.length - 1; i >= 0; --i) { - var scope$3 = this.scopeStack[i]; - if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || - !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { - redeclared = true; - break - } - scope$3.var.push(name); - if (this.inModule && (scope$3.flags & SCOPE_TOP)) - { delete this.undefinedExports[name]; } - if (scope$3.flags & SCOPE_VAR) { break } - } - } - if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } - }; - - pp$5.checkLocalExport = function(id) { - // scope.functions must be empty as Module code is always strict. - if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && - this.scopeStack[0].var.indexOf(id.name) === -1) { - this.undefinedExports[id.name] = id; - } - }; - - pp$5.currentScope = function() { - return this.scopeStack[this.scopeStack.length - 1] - }; - - pp$5.currentVarScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR) { return scope } - } - }; - - // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. - pp$5.currentThisScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } - } - }; - - var Node = function Node(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - if (parser.options.locations) - { this.loc = new SourceLocation(parser, loc); } - if (parser.options.directSourceFile) - { this.sourceFile = parser.options.directSourceFile; } - if (parser.options.ranges) - { this.range = [pos, 0]; } - }; - - // Start an AST node, attaching a start offset. - - var pp$6 = Parser.prototype; - - pp$6.startNode = function() { - return new Node(this, this.start, this.startLoc) - }; - - pp$6.startNodeAt = function(pos, loc) { - return new Node(this, pos, loc) - }; - - // Finish an AST node, adding `type` and `end` properties. - - function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) - { node.loc.end = loc; } - if (this.options.ranges) - { node.range[1] = pos; } - return node - } - - pp$6.finishNode = function(node, type) { - return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) - }; - - // Finish node at given position - - pp$6.finishNodeAt = function(node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc) - }; - - // The algorithm used to determine whether a regexp can appear at a - - var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; - }; - - var types$1 = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", false), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), - f_stat: new TokContext("function", false), - f_expr: new TokContext("function", true), - f_expr_gen: new TokContext("function", true, false, null, true), - f_gen: new TokContext("function", false, false, null, true) - }; - - var pp$7 = Parser.prototype; - - pp$7.initialContext = function() { - return [types$1.b_stat] - }; - - pp$7.braceIsBlock = function(prevType) { - var parent = this.curContext(); - if (parent === types$1.f_expr || parent === types$1.f_stat) - { return true } - if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) - { return !parent.isExpr } - - // The check for `tt.name && exprAllowed` detects whether we are - // after a `yield` or `of` construct. See the `updateContext` for - // `tt.name`. - if (prevType === types._return || prevType === types.name && this.exprAllowed) - { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) - { return true } - if (prevType === types.braceL) - { return parent === types$1.b_stat } - if (prevType === types._var || prevType === types._const || prevType === types.name) - { return false } - return !this.exprAllowed - }; - - pp$7.inGeneratorContext = function() { - for (var i = this.context.length - 1; i >= 1; i--) { - var context = this.context[i]; - if (context.token === "function") - { return context.generator } - } - return false - }; - - pp$7.updateContext = function(prevType) { - var update, type = this.type; - if (type.keyword && prevType === types.dot) - { this.exprAllowed = false; } - else if (update = type.updateContext) - { update.call(this, prevType); } - else - { this.exprAllowed = type.beforeExpr; } - }; - - // Token-specific context update code - - types.parenR.updateContext = types.braceR.updateContext = function() { - if (this.context.length === 1) { - this.exprAllowed = true; - return - } - var out = this.context.pop(); - if (out === types$1.b_stat && this.curContext().token === "function") { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; - }; - - types.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); - this.exprAllowed = true; - }; - - types.dollarBraceL.updateContext = function() { - this.context.push(types$1.b_tmpl); - this.exprAllowed = true; - }; - - types.parenL.updateContext = function(prevType) { - var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); - this.exprAllowed = true; - }; - - types.incDec.updateContext = function() { - // tokExprAllowed stays unchanged - }; - - types._function.updateContext = types._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && - !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) - { this.context.push(types$1.f_expr); } - else - { this.context.push(types$1.f_stat); } - this.exprAllowed = false; - }; - - types.backQuote.updateContext = function() { - if (this.curContext() === types$1.q_tmpl) - { this.context.pop(); } - else - { this.context.push(types$1.q_tmpl); } - this.exprAllowed = false; - }; - - types.star.updateContext = function(prevType) { - if (prevType === types._function) { - var index = this.context.length - 1; - if (this.context[index] === types$1.f_expr) - { this.context[index] = types$1.f_expr_gen; } - else - { this.context[index] = types$1.f_gen; } - } - this.exprAllowed = true; - }; - - types.name.updateContext = function(prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { - if (this.value === "of" && !this.exprAllowed || - this.value === "yield" && this.inGeneratorContext()) - { allowed = true; } - } - this.exprAllowed = allowed; - }; - - // This file contains Unicode properties extracted from the ECMAScript - // specification. The lists are extracted like so: - // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) - - // #table-binary-unicode-properties - var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; - var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; - var ecma11BinaryProperties = ecma10BinaryProperties; - var unicodeBinaryProperties = { - 9: ecma9BinaryProperties, - 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties - }; - - // #table-unicode-general-category-values - var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; - - // #table-unicode-script-values - var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; - var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; - var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; - var unicodeScriptValues = { - 9: ecma9ScriptValues, - 10: ecma10ScriptValues, - 11: ecma11ScriptValues - }; - - var data = {}; - function buildUnicodeData(ecmaVersion) { - var d = data[ecmaVersion] = { - binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), - nonBinary: { - General_Category: wordsRegexp(unicodeGeneralCategoryValues), - Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) - } - }; - d.nonBinary.Script_Extensions = d.nonBinary.Script; - - d.nonBinary.gc = d.nonBinary.General_Category; - d.nonBinary.sc = d.nonBinary.Script; - d.nonBinary.scx = d.nonBinary.Script_Extensions; - } - buildUnicodeData(9); - buildUnicodeData(10); - buildUnicodeData(11); - - var pp$8 = Parser.prototype; - - var RegExpValidationState = function RegExpValidationState(parser) { - this.parser = parser; - this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion]; - this.source = ""; - this.flags = ""; - this.start = 0; - this.switchU = false; - this.switchN = false; - this.pos = 0; - this.lastIntValue = 0; - this.lastStringValue = ""; - this.lastAssertionIsQuantifiable = false; - this.numCapturingParens = 0; - this.maxBackReference = 0; - this.groupNames = []; - this.backReferenceNames = []; - }; - - RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { - var unicode = flags.indexOf("u") !== -1; - this.start = start | 0; - this.source = pattern + ""; - this.flags = flags; - this.switchU = unicode && this.parser.options.ecmaVersion >= 6; - this.switchN = unicode && this.parser.options.ecmaVersion >= 9; - }; - - RegExpValidationState.prototype.raise = function raise (message) { - this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); - }; - - // If u flag is given, this returns the code point at the index (it combines a surrogate pair). - // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). - RegExpValidationState.prototype.at = function at (i, forceU) { - if ( forceU === void 0 ) forceU = false; - - var s = this.source; - var l = s.length; - if (i >= l) { - return -1 - } - var c = s.charCodeAt(i); - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { - return c - } - var next = s.charCodeAt(i + 1); - return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c - }; - - RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { - if ( forceU === void 0 ) forceU = false; - - var s = this.source; - var l = s.length; - if (i >= l) { - return l - } - var c = s.charCodeAt(i), next; - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || - (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { - return i + 1 - } - return i + 2 - }; - - RegExpValidationState.prototype.current = function current (forceU) { - if ( forceU === void 0 ) forceU = false; - - return this.at(this.pos, forceU) - }; - - RegExpValidationState.prototype.lookahead = function lookahead (forceU) { - if ( forceU === void 0 ) forceU = false; - - return this.at(this.nextIndex(this.pos, forceU), forceU) - }; - - RegExpValidationState.prototype.advance = function advance (forceU) { - if ( forceU === void 0 ) forceU = false; - - this.pos = this.nextIndex(this.pos, forceU); - }; - - RegExpValidationState.prototype.eat = function eat (ch, forceU) { - if ( forceU === void 0 ) forceU = false; - - if (this.current(forceU) === ch) { - this.advance(forceU); - return true - } - return false - }; - - function codePointToString(ch) { - if (ch <= 0xFFFF) { return String.fromCharCode(ch) } - ch -= 0x10000; - return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) - } - - /** - * Validate the flags part of a given RegExpLiteral. - * - * @param {RegExpValidationState} state The state to validate RegExp. - * @returns {void} - */ - pp$8.validateRegExpFlags = function(state) { - var validFlags = state.validFlags; - var flags = state.flags; - - for (var i = 0; i < flags.length; i++) { - var flag = flags.charAt(i); - if (validFlags.indexOf(flag) === -1) { - this.raise(state.start, "Invalid regular expression flag"); - } - if (flags.indexOf(flag, i + 1) > -1) { - this.raise(state.start, "Duplicate regular expression flag"); - } - } - }; - - /** - * Validate the pattern part of a given RegExpLiteral. - * - * @param {RegExpValidationState} state The state to validate RegExp. - * @returns {void} - */ - pp$8.validateRegExpPattern = function(state) { - this.regexp_pattern(state); - - // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of - // parsing contains a |GroupName|, reparse with the goal symbol - // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* - // exception if _P_ did not conform to the grammar, if any elements of _P_ - // were not matched by the parse, or if any Early Error conditions exist. - if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { - state.switchN = true; - this.regexp_pattern(state); - } - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern - pp$8.regexp_pattern = function(state) { - state.pos = 0; - state.lastIntValue = 0; - state.lastStringValue = ""; - state.lastAssertionIsQuantifiable = false; - state.numCapturingParens = 0; - state.maxBackReference = 0; - state.groupNames.length = 0; - state.backReferenceNames.length = 0; - - this.regexp_disjunction(state); - - if (state.pos !== state.source.length) { - // Make the same messages as V8. - if (state.eat(0x29 /* ) */)) { - state.raise("Unmatched ')'"); - } - if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { - state.raise("Lone quantifier brackets"); - } - } - if (state.maxBackReference > state.numCapturingParens) { - state.raise("Invalid escape"); - } - for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { - var name = list[i]; - - if (state.groupNames.indexOf(name) === -1) { - state.raise("Invalid named capture referenced"); - } - } - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction - pp$8.regexp_disjunction = function(state) { - this.regexp_alternative(state); - while (state.eat(0x7C /* | */)) { - this.regexp_alternative(state); - } - - // Make the same message as V8. - if (this.regexp_eatQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - if (state.eat(0x7B /* { */)) { - state.raise("Lone quantifier brackets"); - } - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative - pp$8.regexp_alternative = function(state) { - while (state.pos < state.source.length && this.regexp_eatTerm(state)) - { } - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term - pp$8.regexp_eatTerm = function(state) { - if (this.regexp_eatAssertion(state)) { - // Handle `QuantifiableAssertion Quantifier` alternative. - // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion - // is a QuantifiableAssertion. - if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { - // Make the same message as V8. - if (state.switchU) { - state.raise("Invalid quantifier"); - } - } - return true - } - - if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { - this.regexp_eatQuantifier(state); - return true - } - - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion - pp$8.regexp_eatAssertion = function(state) { - var start = state.pos; - state.lastAssertionIsQuantifiable = false; - - // ^, $ - if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { - return true - } - - // \b \B - if (state.eat(0x5C /* \ */)) { - if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { - return true - } - state.pos = start; - } - - // Lookahead / Lookbehind - if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { - var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(0x3C /* < */); - } - if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { - this.regexp_disjunction(state); - if (!state.eat(0x29 /* ) */)) { - state.raise("Unterminated group"); - } - state.lastAssertionIsQuantifiable = !lookbehind; - return true - } - } - - state.pos = start; - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier - pp$8.regexp_eatQuantifier = function(state, noError) { - if ( noError === void 0 ) noError = false; - - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(0x3F /* ? */); - return true - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix - pp$8.regexp_eatQuantifierPrefix = function(state, noError) { - return ( - state.eat(0x2A /* * */) || - state.eat(0x2B /* + */) || - state.eat(0x3F /* ? */) || - this.regexp_eatBracedQuantifier(state, noError) - ) - }; - pp$8.regexp_eatBracedQuantifier = function(state, noError) { - var start = state.pos; - if (state.eat(0x7B /* { */)) { - var min = 0, max = -1; - if (this.regexp_eatDecimalDigits(state)) { - min = state.lastIntValue; - if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { - max = state.lastIntValue; - } - if (state.eat(0x7D /* } */)) { - // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term - if (max !== -1 && max < min && !noError) { - state.raise("numbers out of order in {} quantifier"); - } - return true - } - } - if (state.switchU && !noError) { - state.raise("Incomplete quantifier"); - } - state.pos = start; - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom - pp$8.regexp_eatAtom = function(state) { - return ( - this.regexp_eatPatternCharacters(state) || - state.eat(0x2E /* . */) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) - ) - }; - pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { - var start = state.pos; - if (state.eat(0x5C /* \ */)) { - if (this.regexp_eatAtomEscape(state)) { - return true - } - state.pos = start; - } - return false - }; - pp$8.regexp_eatUncapturingGroup = function(state) { - var start = state.pos; - if (state.eat(0x28 /* ( */)) { - if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { - this.regexp_disjunction(state); - if (state.eat(0x29 /* ) */)) { - return true - } - state.raise("Unterminated group"); - } - state.pos = start; - } - return false - }; - pp$8.regexp_eatCapturingGroup = function(state) { - if (state.eat(0x28 /* ( */)) { - if (this.options.ecmaVersion >= 9) { - this.regexp_groupSpecifier(state); - } else if (state.current() === 0x3F /* ? */) { - state.raise("Invalid group"); - } - this.regexp_disjunction(state); - if (state.eat(0x29 /* ) */)) { - state.numCapturingParens += 1; - return true - } - state.raise("Unterminated group"); - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom - pp$8.regexp_eatExtendedAtom = function(state) { - return ( - state.eat(0x2E /* . */) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) || - this.regexp_eatInvalidBracedQuantifier(state) || - this.regexp_eatExtendedPatternCharacter(state) - ) - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier - pp$8.regexp_eatInvalidBracedQuantifier = function(state) { - if (this.regexp_eatBracedQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter - pp$8.regexp_eatSyntaxCharacter = function(state) { - var ch = state.current(); - if (isSyntaxCharacter(ch)) { - state.lastIntValue = ch; - state.advance(); - return true - } - return false - }; - function isSyntaxCharacter(ch) { - return ( - ch === 0x24 /* $ */ || - ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || - ch === 0x2E /* . */ || - ch === 0x3F /* ? */ || - ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || - ch >= 0x7B /* { */ && ch <= 0x7D /* } */ - ) - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter - // But eat eager. - pp$8.regexp_eatPatternCharacters = function(state) { - var start = state.pos; - var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { - state.advance(); - } - return state.pos !== start - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter - pp$8.regexp_eatExtendedPatternCharacter = function(state) { - var ch = state.current(); - if ( - ch !== -1 && - ch !== 0x24 /* $ */ && - !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && - ch !== 0x2E /* . */ && - ch !== 0x3F /* ? */ && - ch !== 0x5B /* [ */ && - ch !== 0x5E /* ^ */ && - ch !== 0x7C /* | */ - ) { - state.advance(); - return true - } - return false - }; - - // GroupSpecifier :: - // [empty] - // `?` GroupName - pp$8.regexp_groupSpecifier = function(state) { - if (state.eat(0x3F /* ? */)) { - if (this.regexp_eatGroupName(state)) { - if (state.groupNames.indexOf(state.lastStringValue) !== -1) { - state.raise("Duplicate capture group name"); - } - state.groupNames.push(state.lastStringValue); - return - } - state.raise("Invalid group"); - } - }; - - // GroupName :: - // `<` RegExpIdentifierName `>` - // Note: this updates `state.lastStringValue` property with the eaten name. - pp$8.regexp_eatGroupName = function(state) { - state.lastStringValue = ""; - if (state.eat(0x3C /* < */)) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { - return true - } - state.raise("Invalid capture group name"); - } - return false - }; - - // RegExpIdentifierName :: - // RegExpIdentifierStart - // RegExpIdentifierName RegExpIdentifierPart - // Note: this updates `state.lastStringValue` property with the eaten name. - pp$8.regexp_eatRegExpIdentifierName = function(state) { - state.lastStringValue = ""; - if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - } - return true - } - return false - }; - - // RegExpIdentifierStart :: - // UnicodeIDStart - // `$` - // `_` - // `\` RegExpUnicodeEscapeSequence[+U] - pp$8.regexp_eatRegExpIdentifierStart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - - if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierStart(ch)) { - state.lastIntValue = ch; - return true - } - - state.pos = start; - return false - }; - function isRegExpIdentifierStart(ch) { - return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ - } - - // RegExpIdentifierPart :: - // UnicodeIDContinue - // `$` - // `_` - // `\` RegExpUnicodeEscapeSequence[+U] - // - // - pp$8.regexp_eatRegExpIdentifierPart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - - if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierPart(ch)) { - state.lastIntValue = ch; - return true - } - - state.pos = start; - return false - }; - function isRegExpIdentifierPart(ch) { - return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape - pp$8.regexp_eatAtomEscape = function(state) { - if ( - this.regexp_eatBackReference(state) || - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) || - (state.switchN && this.regexp_eatKGroupName(state)) - ) { - return true - } - if (state.switchU) { - // Make the same message as V8. - if (state.current() === 0x63 /* c */) { - state.raise("Invalid unicode escape"); - } - state.raise("Invalid escape"); - } - return false - }; - pp$8.regexp_eatBackReference = function(state) { - var start = state.pos; - if (this.regexp_eatDecimalEscape(state)) { - var n = state.lastIntValue; - if (state.switchU) { - // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape - if (n > state.maxBackReference) { - state.maxBackReference = n; - } - return true - } - if (n <= state.numCapturingParens) { - return true - } - state.pos = start; - } - return false - }; - pp$8.regexp_eatKGroupName = function(state) { - if (state.eat(0x6B /* k */)) { - if (this.regexp_eatGroupName(state)) { - state.backReferenceNames.push(state.lastStringValue); - return true - } - state.raise("Invalid named reference"); - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape - pp$8.regexp_eatCharacterEscape = function(state) { - return ( - this.regexp_eatControlEscape(state) || - this.regexp_eatCControlLetter(state) || - this.regexp_eatZero(state) || - this.regexp_eatHexEscapeSequence(state) || - this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || - (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || - this.regexp_eatIdentityEscape(state) - ) - }; - pp$8.regexp_eatCControlLetter = function(state) { - var start = state.pos; - if (state.eat(0x63 /* c */)) { - if (this.regexp_eatControlLetter(state)) { - return true - } - state.pos = start; - } - return false - }; - pp$8.regexp_eatZero = function(state) { - if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { - state.lastIntValue = 0; - state.advance(); - return true - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape - pp$8.regexp_eatControlEscape = function(state) { - var ch = state.current(); - if (ch === 0x74 /* t */) { - state.lastIntValue = 0x09; /* \t */ - state.advance(); - return true - } - if (ch === 0x6E /* n */) { - state.lastIntValue = 0x0A; /* \n */ - state.advance(); - return true - } - if (ch === 0x76 /* v */) { - state.lastIntValue = 0x0B; /* \v */ - state.advance(); - return true - } - if (ch === 0x66 /* f */) { - state.lastIntValue = 0x0C; /* \f */ - state.advance(); - return true - } - if (ch === 0x72 /* r */) { - state.lastIntValue = 0x0D; /* \r */ - state.advance(); - return true - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter - pp$8.regexp_eatControlLetter = function(state) { - var ch = state.current(); - if (isControlLetter(ch)) { - state.lastIntValue = ch % 0x20; - state.advance(); - return true - } - return false - }; - function isControlLetter(ch) { - return ( - (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || - (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) - ) - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence - pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { - if ( forceU === void 0 ) forceU = false; - - var start = state.pos; - var switchU = forceU || state.switchU; - - if (state.eat(0x75 /* u */)) { - if (this.regexp_eatFixedHexDigits(state, 4)) { - var lead = state.lastIntValue; - if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { - var leadSurrogateEnd = state.pos; - if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { - var trail = state.lastIntValue; - if (trail >= 0xDC00 && trail <= 0xDFFF) { - state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; - return true - } - } - state.pos = leadSurrogateEnd; - state.lastIntValue = lead; - } - return true - } - if ( - switchU && - state.eat(0x7B /* { */) && - this.regexp_eatHexDigits(state) && - state.eat(0x7D /* } */) && - isValidUnicode(state.lastIntValue) - ) { - return true - } - if (switchU) { - state.raise("Invalid unicode escape"); - } - state.pos = start; - } - - return false - }; - function isValidUnicode(ch) { - return ch >= 0 && ch <= 0x10FFFF - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape - pp$8.regexp_eatIdentityEscape = function(state) { - if (state.switchU) { - if (this.regexp_eatSyntaxCharacter(state)) { - return true - } - if (state.eat(0x2F /* / */)) { - state.lastIntValue = 0x2F; /* / */ - return true - } - return false - } - - var ch = state.current(); - if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { - state.lastIntValue = ch; - state.advance(); - return true - } - - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape - pp$8.regexp_eatDecimalEscape = function(state) { - state.lastIntValue = 0; - var ch = state.current(); - if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { - do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); - state.advance(); - } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) - return true - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape - pp$8.regexp_eatCharacterClassEscape = function(state) { - var ch = state.current(); - - if (isCharacterClassEscape(ch)) { - state.lastIntValue = -1; - state.advance(); - return true - } - - if ( - state.switchU && - this.options.ecmaVersion >= 9 && - (ch === 0x50 /* P */ || ch === 0x70 /* p */) - ) { - state.lastIntValue = -1; - state.advance(); - if ( - state.eat(0x7B /* { */) && - this.regexp_eatUnicodePropertyValueExpression(state) && - state.eat(0x7D /* } */) - ) { - return true - } - state.raise("Invalid property name"); - } - - return false - }; - function isCharacterClassEscape(ch) { - return ( - ch === 0x64 /* d */ || - ch === 0x44 /* D */ || - ch === 0x73 /* s */ || - ch === 0x53 /* S */ || - ch === 0x77 /* w */ || - ch === 0x57 /* W */ - ) - } - - // UnicodePropertyValueExpression :: - // UnicodePropertyName `=` UnicodePropertyValue - // LoneUnicodePropertyNameOrValue - pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { - var start = state.pos; - - // UnicodePropertyName `=` UnicodePropertyValue - if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { - var name = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { - var value = state.lastStringValue; - this.regexp_validateUnicodePropertyNameAndValue(state, name, value); - return true - } - } - state.pos = start; - - // LoneUnicodePropertyNameOrValue - if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { - var nameOrValue = state.lastStringValue; - this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); - return true - } - return false - }; - pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!has(state.unicodeProperties.nonBinary, name)) - { state.raise("Invalid property name"); } - if (!state.unicodeProperties.nonBinary[name].test(value)) - { state.raise("Invalid property value"); } - }; - pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { - if (!state.unicodeProperties.binary.test(nameOrValue)) - { state.raise("Invalid property name"); } - }; - - // UnicodePropertyName :: - // UnicodePropertyNameCharacters - pp$8.regexp_eatUnicodePropertyName = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyNameCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== "" - }; - function isUnicodePropertyNameCharacter(ch) { - return isControlLetter(ch) || ch === 0x5F /* _ */ - } - - // UnicodePropertyValue :: - // UnicodePropertyValueCharacters - pp$8.regexp_eatUnicodePropertyValue = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyValueCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== "" - }; - function isUnicodePropertyValueCharacter(ch) { - return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) - } - - // LoneUnicodePropertyNameOrValue :: - // UnicodePropertyValueCharacters - pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { - return this.regexp_eatUnicodePropertyValue(state) - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass - pp$8.regexp_eatCharacterClass = function(state) { - if (state.eat(0x5B /* [ */)) { - state.eat(0x5E /* ^ */); - this.regexp_classRanges(state); - if (state.eat(0x5D /* ] */)) { - return true - } - // Unreachable since it threw "unterminated regular expression" error before. - state.raise("Unterminated character class"); - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges - // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges - // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash - pp$8.regexp_classRanges = function(state) { - while (this.regexp_eatClassAtom(state)) { - var left = state.lastIntValue; - if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { - var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { - state.raise("Invalid character class"); - } - if (left !== -1 && right !== -1 && left > right) { - state.raise("Range out of order in character class"); - } - } - } - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom - // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash - pp$8.regexp_eatClassAtom = function(state) { - var start = state.pos; - - if (state.eat(0x5C /* \ */)) { - if (this.regexp_eatClassEscape(state)) { - return true - } - if (state.switchU) { - // Make the same message as V8. - var ch$1 = state.current(); - if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { - state.raise("Invalid class escape"); - } - state.raise("Invalid escape"); - } - state.pos = start; - } - - var ch = state.current(); - if (ch !== 0x5D /* ] */) { - state.lastIntValue = ch; - state.advance(); - return true - } - - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape - pp$8.regexp_eatClassEscape = function(state) { - var start = state.pos; - - if (state.eat(0x62 /* b */)) { - state.lastIntValue = 0x08; /* */ - return true - } - - if (state.switchU && state.eat(0x2D /* - */)) { - state.lastIntValue = 0x2D; /* - */ - return true - } - - if (!state.switchU && state.eat(0x63 /* c */)) { - if (this.regexp_eatClassControlLetter(state)) { - return true - } - state.pos = start; - } - - return ( - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) - ) - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter - pp$8.regexp_eatClassControlLetter = function(state) { - var ch = state.current(); - if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { - state.lastIntValue = ch % 0x20; - state.advance(); - return true - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$8.regexp_eatHexEscapeSequence = function(state) { - var start = state.pos; - if (state.eat(0x78 /* x */)) { - if (this.regexp_eatFixedHexDigits(state, 2)) { - return true - } - if (state.switchU) { - state.raise("Invalid escape"); - } - state.pos = start; - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits - pp$8.regexp_eatDecimalDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isDecimalDigit(ch = state.current())) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); - state.advance(); - } - return state.pos !== start - }; - function isDecimalDigit(ch) { - return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits - pp$8.regexp_eatHexDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isHexDigit(ch = state.current())) { - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return state.pos !== start - }; - function isHexDigit(ch) { - return ( - (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || - (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || - (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) - ) - } - function hexToInt(ch) { - if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { - return 10 + (ch - 0x41 /* A */) - } - if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { - return 10 + (ch - 0x61 /* a */) - } - return ch - 0x30 /* 0 */ - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence - // Allows only 0-377(octal) i.e. 0-255(decimal). - pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { - if (this.regexp_eatOctalDigit(state)) { - var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { - var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { - state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; - } else { - state.lastIntValue = n1 * 8 + n2; - } - } else { - state.lastIntValue = n1; - } - return true - } - return false - }; - - // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit - pp$8.regexp_eatOctalDigit = function(state) { - var ch = state.current(); - if (isOctalDigit(ch)) { - state.lastIntValue = ch - 0x30; /* 0 */ - state.advance(); - return true - } - state.lastIntValue = 0; - return false - }; - function isOctalDigit(ch) { - return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ - } - - // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits - // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit - // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - pp$8.regexp_eatFixedHexDigits = function(state, length) { - var start = state.pos; - state.lastIntValue = 0; - for (var i = 0; i < length; ++i) { - var ch = state.current(); - if (!isHexDigit(ch)) { - state.pos = start; - return false - } - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return true - }; - - // Object type used to represent tokens. Note that normally, tokens - // simply exist as properties on the parser object. This is only - // used for the onToken callback and the external tokenizer. - - var Token = function Token(p) { - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) - { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } - if (p.options.ranges) - { this.range = [p.start, p.end]; } - }; - - // ## Tokenizer - - var pp$9 = Parser.prototype; - - // Move to the next token - - pp$9.next = function(ignoreEscapeSequenceInKeyword) { - if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) - { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } - if (this.options.onToken) - { this.options.onToken(new Token(this)); } - - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); - }; - - pp$9.getToken = function() { - this.next(); - return new Token(this) - }; - - // If we're in an ES6 environment, make parsers iterable - if (typeof Symbol !== "undefined") - { pp$9[Symbol.iterator] = function() { - var this$1 = this; - - return { - next: function () { - var token = this$1.getToken(); - return { - done: token.type === types.eof, - value: token - } - } - } - }; } - - // Toggle strict mode. Re-reads the next number or string to please - // pedantic tests (`"use strict"; 010;` should fail). - - pp$9.curContext = function() { - return this.context[this.context.length - 1] - }; - - // Read a single token, updating the parser object's token-related - // properties. - - pp$9.nextToken = function() { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } - - this.start = this.pos; - if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types.eof) } - - if (curContext.override) { return curContext.override(this) } - else { this.readToken(this.fullCharCodeAtPos()); } - }; - - pp$9.readToken = function(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) - { return this.readWord() } - - return this.getTokenFromCode(code) - }; - - pp$9.fullCharCodeAtPos = function() { - var code = this.input.charCodeAt(this.pos); - if (code <= 0xd7ff || code >= 0xe000) { return code } - var next = this.input.charCodeAt(this.pos + 1); - return (code << 10) + next - 0x35fdc00 - }; - - pp$9.skipBlockComment = function() { - var startLoc = this.options.onComment && this.curPosition(); - var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); - if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } - this.pos = end + 2; - if (this.options.locations) { - lineBreakG.lastIndex = start; - var match; - while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { - ++this.curLine; - this.lineStart = match.index + match[0].length; - } - } - if (this.options.onComment) - { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, - startLoc, this.curPosition()); } - }; - - pp$9.skipLineComment = function(startSkip) { - var start = this.pos; - var startLoc = this.options.onComment && this.curPosition(); - var ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && !isNewLine(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.options.onComment) - { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, - startLoc, this.curPosition()); } - }; - - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. - - pp$9.skipSpace = function() { - loop: while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 32: case 160: // ' ' - ++this.pos; - break - case 13: - if (this.input.charCodeAt(this.pos + 1) === 10) { - ++this.pos; - } - case 10: case 8232: case 8233: - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - break - case 47: // '/' - switch (this.input.charCodeAt(this.pos + 1)) { - case 42: // '*' - this.skipBlockComment(); - break - case 47: - this.skipLineComment(2); - break - default: - break loop - } - break - default: - if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.pos; - } else { - break loop - } - } - } - }; - - // Called at the end of every token. Sets `end`, `val`, and - // maintains `context` and `exprAllowed`, and skips the space after - // the token, so that the next one's `start` will point at the - // right position. - - pp$9.finishToken = function(type, val) { - this.end = this.pos; - if (this.options.locations) { this.endLoc = this.curPosition(); } - var prevType = this.type; - this.type = type; - this.value = val; - - this.updateContext(prevType); - }; - - // ### Token reading - - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - pp$9.readToken_dot = function() { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { return this.readNumber(true) } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' - this.pos += 3; - return this.finishToken(types.ellipsis) - } else { - ++this.pos; - return this.finishToken(types.dot) - } - }; - - pp$9.readToken_slash = function() { // '/' - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.slash, 1) - }; - - pp$9.readToken_mult_modulo_exp = function(code) { // '%*' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - var tokentype = code === 42 ? types.star : types.modulo; - - // exponentiation operator ** and **= - if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { - ++size; - tokentype = types.starstar; - next = this.input.charCodeAt(this.pos + 2); - } - - if (next === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(tokentype, size) - }; - - pp$9.readToken_pipe_amp = function(code) { // '|&' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (this.options.ecmaVersion >= 12) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types.assign, 3) } - } - return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) - }; - - pp$9.readToken_caret = function() { // '^' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.bitwiseXOR, 1) - }; - - pp$9.readToken_plus_min = function(code) { // '+-' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && - (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) - }; - - pp$9.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) -}; - -pp$9.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/glob-parent -[npm-image]: https://img.shields.io/npm/v/glob-parent.svg +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg?style=flat-square -[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master -[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master - -[travis-url]: https://travis-ci.org/gulpjs/glob-parent -[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci - -[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent -[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor +[ci-url]: https://github.com/gulpjs/glob-parent/actions?query=workflow:dev +[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/glob-parent/dev?style=flat-square [coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg?style=flat-square + -[gitter-url]: https://gitter.im/gulpjs/gulp -[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js index 09e257ea3..09dde64ba 100644 --- a/node_modules/glob-parent/index.js +++ b/node_modules/glob-parent/index.js @@ -6,15 +6,12 @@ var isWin32 = require('os').platform() === 'win32'; var slash = '/'; var backslash = /\\/g; -var enclosure = /[\{\[].*[\}\]]$/; -var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; -var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; +var escaped = /\\([!*?|[\](){}])/g; /** * @param {string} str * @param {Object} opts * @param {boolean} [opts.flipBackslashes=true] - * @returns {string} */ module.exports = function globParent(str, opts) { var options = Object.assign({ flipBackslashes: true }, opts); @@ -25,7 +22,7 @@ module.exports = function globParent(str, opts) { } // special case for strings ending in enclosure containing path separator - if (enclosure.test(str)) { + if (isEnclosure(str)) { str += slash; } @@ -35,8 +32,44 @@ module.exports = function globParent(str, opts) { // remove path parts that are globby do { str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); + } while (isGlobby(str)); // remove escape chars and return result return str.replace(escaped, '$1'); }; + +function isEnclosure(str) { + var lastChar = str.slice(-1); + + var enclosureStart; + switch (lastChar) { + case '}': + enclosureStart = '{'; + break; + case ']': + enclosureStart = '['; + break; + default: + return false; + } + + var foundIndex = str.indexOf(enclosureStart); + if (foundIndex < 0) { + return false; + } + + return str.slice(foundIndex + 1, -1).includes(slash); +} + +function isGlobby(str) { + if (/\([^()]+$/.test(str)) { + return true; + } + if (str[0] === '{' || str[0] === '[') { + return true; + } + if (/[^\\][{[]/.test(str)) { + return true; + } + return isGlob(str); +} diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json index 58159eb7c..baeab4217 100644 --- a/node_modules/glob-parent/package.json +++ b/node_modules/glob-parent/package.json @@ -1,67 +1,46 @@ { - "_from": "glob-parent@^5.0.0", - "_id": "glob-parent@5.1.2", - "_inBundle": false, - "_integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "_location": "/glob-parent", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "glob-parent@^5.0.0", - "name": "glob-parent", - "escapedName": "glob-parent", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "_shasum": "869832c58034fe68a4093c17dc15e8340d8401c4", - "_spec": "glob-parent@^5.0.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Gulp Team", - "email": "team@gulpjs.com", - "url": "https://gulpjs.com/" - }, - "bugs": { - "url": "https://github.com/gulpjs/glob-parent/issues" - }, - "bundleDependencies": false, + "name": "glob-parent", + "version": "6.0.2", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", "contributors": [ - { - "name": "Elan Shanker", - "url": "https://github.com/es128" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com" - } + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " ], - "dependencies": { - "is-glob": "^4.0.1" - }, - "deprecated": false, - "description": "Extract the non-magic parent path from a glob string.", - "devDependencies": { - "coveralls": "^3.0.11", - "eslint": "^2.13.1", - "eslint-config-gulp": "^3.0.1", - "expect": "^1.20.2", - "mocha": "^6.0.2", - "nyc": "^13.3.0" - }, + "repository": "gulpjs/glob-parent", + "license": "ISC", "engines": { - "node": ">= 6" + "node": ">=10.13.0" }, + "main": "index.js", "files": [ "LICENSE", "index.js" ], - "homepage": "https://github.com/gulpjs/glob-parent#readme", + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only" + }, + "dependencies": { + "is-glob": "^4.0.3" + }, + "devDependencies": { + "eslint": "^7.0.0", + "eslint-config-gulp": "^5.0.0", + "expect": "^26.0.1", + "mocha": "^7.1.2", + "nyc": "^15.0.1" + }, + "nyc": { + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": { + "singleQuote": true + }, "keywords": [ "glob", "parent", @@ -71,20 +50,5 @@ "directory", "base", "wildcard" - ], - "license": "ISC", - "main": "index.js", - "name": "glob-parent", - "repository": { - "type": "git", - "url": "git+https://github.com/gulpjs/glob-parent.git" - }, - "scripts": { - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only" - }, - "version": "5.1.2" + ] } diff --git a/node_modules/grapheme-splitter/LICENSE b/node_modules/grapheme-splitter/LICENSE new file mode 100644 index 000000000..4f0f53dd0 --- /dev/null +++ b/node_modules/grapheme-splitter/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Orlin Georgiev + +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/grapheme-splitter/README.md b/node_modules/grapheme-splitter/README.md new file mode 100644 index 000000000..394a0aff2 --- /dev/null +++ b/node_modules/grapheme-splitter/README.md @@ -0,0 +1,111 @@ +# Background + +In JavaScript there is not always a one-to-one relationship between string characters and what a user would call a separate visual "letter". Some symbols are represented by several characters. This can cause issues when splitting strings and inadvertently cutting a multi-char letter in half, or when you need the actual number of letters in a string. + +For example, emoji characters like "🌷","🎁","💩","😜" and "👍" are represented by two JavaScript characters each (high surrogate and low surrogate). That is, + +```javascript +"🌷".length == 2 +``` +The combined emoji are even longer: +```javascript +"🏳️‍🌈".length == 6 +``` + +What's more, some languages often include combining marks - characters that are used to modify the letters before them. Common examples are the German letter ü and the Spanish letter ñ. Sometimes they can be represented alternatively both as a single character and as a letter + combining mark, with both forms equally valid: + +```javascript +var two = "ñ"; // unnormalized two-char n+◌̃ , i.e. "\u006E\u0303"; +var one = "ñ"; // normalized single-char, i.e. "\u00F1" +console.log(one!=two); // prints 'true' +``` + +Unicode normalization, as performed by the popular punycode.js library or ECMAScript 6's String.normalize, can **sometimes** fix those differences and turn two-char sequences into single characters. But it is **not** enough in all cases. Some languages like Hindi make extensive use of combining marks on their letters, that have no dedicated single-codepoint Unicode sequences, due to the sheer number of possible combinations. +For example, the Hindi word "अनुच्छेद" is comprised of 5 letters and 3 combining marks: + +अ + न + ु + च + ् + छ + े + द + +which is in fact just 5 user-perceived letters: + +अ + नु + च् + छे + द + +and which Unicode normalization would not combine properly. +There are also the unusual letter+combining mark combinations which have no dedicated Unicode codepoint. The string Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘ obviously has 5 separate letters, but is in fact comprised of 58 JavaScript characters, most of which are combining marks. + +Enter the grapheme-splitter.js library. It can be used to properly split JavaScript strings into what a human user would call separate letters (or "extended grapheme clusters" in Unicode terminology), no matter what their internal representation is. It is an implementation on the [Default Grapheme Cluster Boundary](http://unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table) of [UAX #29](http://www.unicode.org/reports/tr29/). + +# Installation + +You can use the index.js file directly as-is. Or you you can install `grapheme-splitter` to your project using the NPM command below: + +``` +$ npm install --save grapheme-splitter +``` + +# Tests + +To run the tests on `grapheme-splitter`, use the command below: + +``` +$ npm test +``` + +# Usage + +Just initialize and use: + +```javascript +var splitter = new GraphemeSplitter(); + +// split the string to an array of grapheme clusters (one string each) +var graphemes = splitter.splitGraphemes(string); + +// iterate the string to an iterable iterator of grapheme clusters (one string each) +var graphemes = splitter.iterateGraphemes(string); + +// or do this if you just need their number +var graphemeCount = splitter.countGraphemes(string); +``` + +# Examples + +```javascript +var splitter = new GraphemeSplitter(); + +// plain latin alphabet - nothing spectacular +splitter.splitGraphemes("abcd"); // returns ["a", "b", "c", "d"] + +// two-char emojis and six-char combined emoji +splitter.splitGraphemes("🌷🎁💩😜👍🏳️‍🌈"); // returns ["🌷","🎁","💩","😜","👍","🏳️‍🌈"] + +// diacritics as combining marks, 10 JavaScript chars +splitter.splitGraphemes("Ĺo͂řȩm̅"); // returns ["Ĺ","o͂","ř","ȩ","m̅"] + +// individual Korean characters (Jamo), 4 JavaScript chars +splitter.splitGraphemes("뎌쉐"); // returns ["뎌","쉐"] + +// Hindi text with combining marks, 8 JavaScript chars +splitter.splitGraphemes("अनुच्छेद"); // returns ["अ","नु","च्","छे","द"] + +// demonic multiple combining marks, 75 JavaScript chars +splitter.splitGraphemes("Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞"); // returns ["Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍","A̴̵̜̰͔ͫ͗͢","L̠ͨͧͩ͘","G̴̻͈͍͔̹̑͗̎̅͛́","Ǫ̵̹̻̝̳͂̌̌͘","!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞"] +``` + +# TypeScript + +Grapheme splitter includes TypeScript declarations. + +```typescript +import GraphemeSplitter = require('grapheme-splitter') + +const splitter = new GraphemeSplitter() + +const split: string[] = splitter.splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞') +``` + +# Acknowledgements + +This library is heavily influenced by Devon Govett's excellent grapheme-breaker CoffeeScript library at https://github.com/devongovett/grapheme-breaker with an emphasis on ease of integration and pure JavaScript implementation. + + + diff --git a/node_modules/grapheme-splitter/index.d.ts b/node_modules/grapheme-splitter/index.d.ts new file mode 100644 index 000000000..61162acfa --- /dev/null +++ b/node_modules/grapheme-splitter/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for grapheme-splitter + +/*~ Note that ES6 modules cannot directly export class objects. + *~ This file should be imported using the CommonJS-style: + *~ + *~ import GraphemeSplitter = require('grapheme-splitter') + *~ + *~ Refer to the documentation to understand common + *~ workarounds for this limitation of ES6 modules. + *~ + *~ https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html + */ + +declare class GraphemeSplitter { + constructor(); + /** iterate the string to an iterable iterator of grapheme clusters */ + iterateGraphemes(s: string): IterableIterator; + /** split the string to an array of grapheme clusters */ + splitGraphemes(s: string): string[]; + /** count the number of grapheme clusters in a string */ + countGraphemes(s: string): number; +} + +export = GraphemeSplitter; diff --git a/node_modules/grapheme-splitter/index.js b/node_modules/grapheme-splitter/index.js new file mode 100644 index 000000000..d55559163 --- /dev/null +++ b/node_modules/grapheme-splitter/index.js @@ -0,0 +1,1743 @@ +/* +Breaks a Javascript string into individual user-perceived "characters" +called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0 + +Usage: +var splitter = new GraphemeSplitter(); +//returns an array of strings, one string for each grapheme cluster +var graphemes = splitter.splitGraphemes(string); + +*/ +function GraphemeSplitter(){ + var CR = 0, + LF = 1, + Control = 2, + Extend = 3, + Regional_Indicator = 4, + SpacingMark = 5, + L = 6, + V = 7, + T = 8, + LV = 9, + LVT = 10, + Other = 11, + Prepend = 12, + E_Base = 13, + E_Modifier = 14, + ZWJ = 15, + Glue_After_Zwj = 16, + E_Base_GAZ = 17; + + // BreakTypes + var NotBreak = 0, + BreakStart = 1, + Break = 2, + BreakLastRegional = 3, + BreakPenultimateRegional = 4; + + function isSurrogate(str, pos) { + return 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && + 0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff; + } + + // Private function, gets a Unicode code point from a JavaScript UTF-16 string + // handling surrogate pairs appropriately + function codePointAt(str, idx){ + if(idx === undefined){ + idx = 0; + } + var code = str.charCodeAt(idx); + + // if a high surrogate + if (0xD800 <= code && code <= 0xDBFF && + idx < str.length - 1){ + var hi = code; + var low = str.charCodeAt(idx + 1); + if (0xDC00 <= low && low <= 0xDFFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return hi; + } + + // if a low surrogate + if (0xDC00 <= code && code <= 0xDFFF && + idx >= 1){ + var hi = str.charCodeAt(idx - 1); + var low = code; + if (0xD800 <= hi && hi <= 0xDBFF){ + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + return low; + } + + //just return the char if an unmatched surrogate half or a + //single-char codepoint + return code; + } + + // Private function, returns whether a break is allowed between the + // two given grapheme breaking classes + function shouldBreak(start, mid, end){ + var all = [start].concat(mid).concat([end]); + var previous = all[all.length - 2] + var next = end + + // Lookahead termintor for: + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var eModifierIndex = all.lastIndexOf(E_Modifier) + if(eModifierIndex > 1 && + all.slice(1, eModifierIndex).every(function(c){return c == Extend}) && + [Extend, E_Base, E_Base_GAZ].indexOf(start) == -1){ + return Break + } + + // Lookahead termintor for: + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + var rIIndex = all.lastIndexOf(Regional_Indicator) + if(rIIndex > 0 && + all.slice(1, rIIndex).every(function(c){return c == Regional_Indicator}) && + [Prepend, Regional_Indicator].indexOf(previous) == -1) { + if(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) { + return BreakLastRegional + } + else { + return BreakPenultimateRegional + } + } + + // GB3. CR X LF + if(previous == CR && next == LF){ + return NotBreak; + } + // GB4. (Control|CR|LF) ÷ + else if(previous == Control || previous == CR || previous == LF){ + if(next == E_Modifier && mid.every(function(c){return c == Extend})){ + return Break + } + else { + return BreakStart + } + } + // GB5. ÷ (Control|CR|LF) + else if(next == Control || next == CR || next == LF){ + return BreakStart; + } + // GB6. L X (L|V|LV|LVT) + else if(previous == L && + (next == L || next == V || next == LV || next == LVT)){ + return NotBreak; + } + // GB7. (LV|V) X (V|T) + else if((previous == LV || previous == V) && + (next == V || next == T)){ + return NotBreak; + } + // GB8. (LVT|T) X (T) + else if((previous == LVT || previous == T) && + next == T){ + return NotBreak; + } + // GB9. X (Extend|ZWJ) + else if (next == Extend || next == ZWJ){ + return NotBreak; + } + // GB9a. X SpacingMark + else if(next == SpacingMark){ + return NotBreak; + } + // GB9b. Prepend X + else if (previous == Prepend){ + return NotBreak; + } + + // GB10. (E_Base | EBG) Extend* ? E_Modifier + var previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2; + if([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 && + all.slice(previousNonExtendIndex + 1, -1).every(function(c){return c == Extend}) && + next == E_Modifier){ + return NotBreak; + } + + // GB11. ZWJ ? (Glue_After_Zwj | EBG) + if(previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) { + return NotBreak; + } + + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + if(mid.indexOf(Regional_Indicator) != -1) { + return Break; + } + if(previous == Regional_Indicator && next == Regional_Indicator) { + return NotBreak; + } + + // GB999. Any ? Any + return BreakStart; + } + + // Returns the next grapheme break in the string after the given index + this.nextBreak = function(string, index){ + if(index === undefined){ + index = 0; + } + if(index < 0){ + return 0; + } + if(index >= string.length - 1){ + return string.length; + } + var prev = getGraphemeBreakProperty(codePointAt(string, index)); + var mid = [] + for (var i = index + 1; i < string.length; i++) { + // check for already processed low surrogates + if(isSurrogate(string, i - 1)){ + continue; + } + + var next = getGraphemeBreakProperty(codePointAt(string, i)); + if(shouldBreak(prev, mid, next)){ + return i; + } + + mid.push(next); + } + return string.length; + }; + + // Breaks the given string into an array of grapheme cluster strings + this.splitGraphemes = function(str){ + var res = []; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + res.push(str.slice(index, brk)); + index = brk; + } + if(index < str.length){ + res.push(str.slice(index)); + } + return res; + }; + + // Returns the iterator of grapheme clusters there are in the given string + this.iterateGraphemes = function(str) { + var index = 0; + var res = { + next: (function() { + var value; + var brk; + if ((brk = this.nextBreak(str, index)) < str.length) { + value = str.slice(index, brk); + index = brk; + return { value: value, done: false }; + } + if (index < str.length) { + value = str.slice(index); + index = str.length; + return { value: value, done: false }; + } + return { value: undefined, done: true }; + }).bind(this) + }; + // ES2015 @@iterator method (iterable) for spread syntax and for...of statement + if (typeof Symbol !== 'undefined' && Symbol.iterator) { + res[Symbol.iterator] = function() {return res}; + } + return res; + }; + + // Returns the number of grapheme clusters there are in the given string + this.countGraphemes = function(str){ + var count = 0; + var index = 0; + var brk; + while((brk = this.nextBreak(str, index)) < str.length){ + index = brk; + count++; + } + if(index < str.length){ + count++; + } + return count; + }; + + //given a Unicode code point, determines this symbol's grapheme break property + function getGraphemeBreakProperty(code){ + + //grapheme break property for Unicode 10.0.0, + //taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt + //and adapted to JavaScript rules + + if( + (0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE + 0x06DD == code || // Cf ARABIC END OF AYAH + 0x070F == code || // Cf SYRIAC ABBREVIATION MARK + 0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH + 0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH + 0x110BD == code || // Cf KAITHI NUMBER SIGN + (0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA + 0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA + (0x11A86 <= code && code <= 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA + 0x11D46 == code // Lo MASARAM GONDI REPHA + ){ + return Prepend; + } + if( + 0x000D == code // Cc + ){ + return CR; + } + + if( + 0x000A == code // Cc + ){ + return LF; + } + + + if( + (0x0000 <= code && code <= 0x0009) || // Cc [10] .. + (0x000B <= code && code <= 0x000C) || // Cc [2] .. + (0x000E <= code && code <= 0x001F) || // Cc [18] .. + (0x007F <= code && code <= 0x009F) || // Cc [33] .. + 0x00AD == code || // Cf SOFT HYPHEN + 0x061C == code || // Cf ARABIC LETTER MARK + + 0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR + 0x200B == code || // Cf ZERO WIDTH SPACE + (0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK + 0x2028 == code || // Zl LINE SEPARATOR + 0x2029 == code || // Zp PARAGRAPH SEPARATOR + (0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + (0x2060 <= code && code <= 0x2064) || // Cf [5] WORD JOINER..INVISIBLE PLUS + 0x2065 == code || // Cn + (0x2066 <= code && code <= 0x206F) || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES + (0xD800 <= code && code <= 0xDFFF) || // Cs [2048] .. + 0xFEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE + (0xFFF0 <= code && code <= 0xFFF8) || // Cn [9] .. + (0xFFF9 <= code && code <= 0xFFFB) || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR + (0x1BCA0 <= code && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP + (0x1D173 <= code && code <= 0x1D17A) || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE + 0xE0000 == code || // Cn + 0xE0001 == code || // Cf LANGUAGE TAG + (0xE0002 <= code && code <= 0xE001F) || // Cn [30] .. + (0xE0080 <= code && code <= 0xE00FF) || // Cn [128] .. + (0xE01F0 <= code && code <= 0xE0FFF) // Cn [3600] .. + ){ + return Control; + } + + + if( + (0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X + (0x0483 <= code && code <= 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE + (0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN + (0x0591 <= code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + 0x05BF == code || // Mn HEBREW POINT RAFE + (0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + (0x05C4 <= code && code <= 0x05C5) || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + 0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN + (0x0610 <= code && code <= 0x061A) || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA + (0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW + 0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF + (0x06D6 <= code && code <= 0x06DC) || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN + (0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA + (0x06E7 <= code && code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON + (0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM + 0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH + (0x0730 <= code && code <= 0x074A) || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH + (0x07A6 <= code && code <= 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN + (0x07EB <= code && code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE + (0x0816 <= code && code <= 0x0819) || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH + (0x081B <= code && code <= 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A + (0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U + (0x0829 <= code && code <= 0x082D) || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA + (0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK + (0x08D4 <= code && code <= 0x08E1) || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA + (0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA + 0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE + 0x093C == code || // Mn DEVANAGARI SIGN NUKTA + (0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI + 0x094D == code || // Mn DEVANAGARI SIGN VIRAMA + (0x0951 <= code && code <= 0x0957) || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE + (0x0962 <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL + 0x0981 == code || // Mn BENGALI SIGN CANDRABINDU + 0x09BC == code || // Mn BENGALI SIGN NUKTA + 0x09BE == code || // Mc BENGALI VOWEL SIGN AA + (0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR + 0x09CD == code || // Mn BENGALI SIGN VIRAMA + 0x09D7 == code || // Mc BENGALI AU LENGTH MARK + (0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL + (0x0A01 <= code && code <= 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI + 0x0A3C == code || // Mn GURMUKHI SIGN NUKTA + (0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU + (0x0A47 <= code && code <= 0x0A48) || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI + (0x0A4B <= code && code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + 0x0A51 == code || // Mn GURMUKHI SIGN UDAAT + (0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK + 0x0A75 == code || // Mn GURMUKHI SIGN YAKASH + (0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA + 0x0ABC == code || // Mn GUJARATI SIGN NUKTA + (0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E + (0x0AC7 <= code && code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI + 0x0ACD == code || // Mn GUJARATI SIGN VIRAMA + (0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL + (0x0AFA <= code && code <= 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE + 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU + 0x0B3C == code || // Mn ORIYA SIGN NUKTA + 0x0B3E == code || // Mc ORIYA VOWEL SIGN AA + 0x0B3F == code || // Mn ORIYA VOWEL SIGN I + (0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR + 0x0B4D == code || // Mn ORIYA SIGN VIRAMA + 0x0B56 == code || // Mn ORIYA AI LENGTH MARK + 0x0B57 == code || // Mc ORIYA AU LENGTH MARK + (0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL + 0x0B82 == code || // Mn TAMIL SIGN ANUSVARA + 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA + 0x0BC0 == code || // Mn TAMIL VOWEL SIGN II + 0x0BCD == code || // Mn TAMIL SIGN VIRAMA + 0x0BD7 == code || // Mc TAMIL AU LENGTH MARK + 0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE + (0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II + (0x0C46 <= code && code <= 0x0C48) || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + (0x0C4A <= code && code <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + (0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + (0x0C62 <= code && code <= 0x0C63) || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL + 0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU + 0x0CBC == code || // Mn KANNADA SIGN NUKTA + 0x0CBF == code || // Mn KANNADA VOWEL SIGN I + 0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU + 0x0CC6 == code || // Mn KANNADA VOWEL SIGN E + (0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA + (0x0CD5 <= code && code <= 0x0CD6) || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + (0x0CE2 <= code && code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + (0x0D00 <= code && code <= 0x0D01) || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU + (0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA + 0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA + (0x0D41 <= code && code <= 0x0D44) || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR + 0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA + 0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK + (0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL + 0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA + 0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA + (0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA + 0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA + 0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA + 0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT + (0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU + (0x0E47 <= code && code <= 0x0E4E) || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN + 0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN + (0x0EB4 <= code && code <= 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU + (0x0EBB <= code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO + (0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + (0x0F18 <= code && code <= 0x0F19) || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS + 0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA + 0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS + 0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU + (0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO + (0x0F80 <= code && code <= 0x0F84) || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA + (0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS + (0x0F8D <= code && code <= 0x0F97) || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA + (0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA + 0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN + (0x102D <= code && code <= 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU + (0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW + (0x1039 <= code && code <= 0x103A) || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT + (0x103D <= code && code <= 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA + (0x1058 <= code && code <= 0x1059) || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL + (0x105E <= code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA + (0x1071 <= code && code <= 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE + 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA + (0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y + 0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE + 0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI + (0x135D <= code && code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK + (0x1712 <= code && code <= 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + (0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD + (0x1752 <= code && code <= 0x1753) || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + (0x1772 <= code && code <= 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + (0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA + (0x17B7 <= code && code <= 0x17BD) || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA + 0x17C6 == code || // Mn KHMER SIGN NIKAHIT + (0x17C9 <= code && code <= 0x17D3) || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT + 0x17DD == code || // Mn KHMER SIGN ATTHACAN + (0x180B <= code && code <= 0x180D) || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE + (0x1885 <= code && code <= 0x1886) || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA + 0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA + (0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U + (0x1927 <= code && code <= 0x1928) || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O + 0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA + (0x1939 <= code && code <= 0x193B) || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I + (0x1A17 <= code && code <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U + 0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE + 0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA + (0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA + 0x1A60 == code || // Mn TAI THAM SIGN SAKOT + 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT + (0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW + (0x1A73 <= code && code <= 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN + 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT + (0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW + 0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY + (0x1B00 <= code && code <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG + 0x1B34 == code || // Mn BALINESE SIGN REREKAN + (0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA + 0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA + 0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET + (0x1B6B <= code && code <= 0x1B73) || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG + (0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR + (0x1BA2 <= code && code <= 0x1BA5) || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU + (0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG + (0x1BAB <= code && code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA + 0x1BE6 == code || // Mn BATAK SIGN TOMPI + (0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE + 0x1BED == code || // Mn BATAK VOWEL SIGN KARO O + (0x1BEF <= code && code <= 0x1BF1) || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H + (0x1C2C <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T + (0x1C36 <= code && code <= 0x1C37) || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA + (0x1CD0 <= code && code <= 0x1CD2) || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + (0x1CD4 <= code && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA + (0x1CE2 <= code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL + 0x1CED == code || // Mn VEDIC SIGN TIRYAK + 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE + (0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE + (0x1DC0 <= code && code <= 0x1DF9) || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW + (0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + 0x200C == code || // Cf ZERO WIDTH NON-JOINER + (0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE + (0x20DD <= code && code <= 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH + 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE + (0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE + (0x20E5 <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE + (0x2CEF <= code && code <= 0x2CF1) || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS + 0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER + (0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS + (0x302A <= code && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK + (0x302E <= code && code <= 0x302F) || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK + (0x3099 <= code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + 0xA66F == code || // Mn COMBINING CYRILLIC VZMET + (0xA670 <= code && code <= 0xA672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN + (0xA674 <= code && code <= 0xA67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK + (0xA69E <= code && code <= 0xA69F) || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E + (0xA6F0 <= code && code <= 0xA6F1) || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS + 0xA802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA + 0xA806 == code || // Mn SYLOTI NAGRI SIGN HASANTA + 0xA80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA + (0xA825 <= code && code <= 0xA826) || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E + (0xA8C4 <= code && code <= 0xA8C5) || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU + (0xA8E0 <= code && code <= 0xA8F1) || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA + (0xA926 <= code && code <= 0xA92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU + (0xA947 <= code && code <= 0xA951) || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R + (0xA980 <= code && code <= 0xA982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR + 0xA9B3 == code || // Mn JAVANESE SIGN CECAK TELU + (0xA9B6 <= code && code <= 0xA9B9) || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT + 0xA9BC == code || // Mn JAVANESE VOWEL SIGN PEPET + 0xA9E5 == code || // Mn MYANMAR SIGN SHAN SAW + (0xAA29 <= code && code <= 0xAA2E) || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE + (0xAA31 <= code && code <= 0xAA32) || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE + (0xAA35 <= code && code <= 0xAA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA + 0xAA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG + 0xAA4C == code || // Mn CHAM CONSONANT SIGN FINAL M + 0xAA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2 + 0xAAB0 == code || // Mn TAI VIET MAI KANG + (0xAAB2 <= code && code <= 0xAAB4) || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U + (0xAAB7 <= code && code <= 0xAAB8) || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA + (0xAABE <= code && code <= 0xAABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK + 0xAAC1 == code || // Mn TAI VIET TONE MAI THO + (0xAAEC <= code && code <= 0xAAED) || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI + 0xAAF6 == code || // Mn MEETEI MAYEK VIRAMA + 0xABE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP + 0xABE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP + 0xABED == code || // Mn MEETEI MAYEK APUN IYEK + 0xFB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA + (0xFE00 <= code && code <= 0xFE0F) || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 + (0xFE20 <= code && code <= 0xFE2F) || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF + (0xFF9E <= code && code <= 0xFF9F) || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK + (0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII + (0x10A01 <= code && code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R + (0x10A05 <= code && code <= 0x10A06) || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O + (0x10A0C <= code && code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA + (0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW + 0x10A3F == code || // Mn KHAROSHTHI VIRAMA + (0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW + 0x11001 == code || // Mn BRAHMI SIGN ANUSVARA + (0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA + (0x1107F <= code && code <= 0x11081) || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA + (0x110B3 <= code && code <= 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI + (0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA + (0x11100 <= code && code <= 0x11102) || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA + (0x11127 <= code && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU + (0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA + 0x11173 == code || // Mn MAHAJANI SIGN NUKTA + (0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA + (0x111B6 <= code && code <= 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O + (0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK + (0x1122F <= code && code <= 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI + 0x11234 == code || // Mn KHOJKI SIGN ANUSVARA + (0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA + 0x1123E == code || // Mn KHOJKI SIGN SUKUN + 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA + (0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA + (0x11300 <= code && code <= 0x11301) || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU + 0x1133C == code || // Mn GRANTHA SIGN NUKTA + 0x1133E == code || // Mc GRANTHA VOWEL SIGN AA + 0x11340 == code || // Mn GRANTHA VOWEL SIGN II + 0x11357 == code || // Mc GRANTHA AU LENGTH MARK + (0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX + (0x11370 <= code && code <= 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA + (0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI + (0x11442 <= code && code <= 0x11444) || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA + 0x11446 == code || // Mn NEWA SIGN NUKTA + 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA + (0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL + 0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E + 0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O + (0x114BF <= code && code <= 0x114C0) || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA + (0x114C2 <= code && code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA + 0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA + (0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR + (0x115BC <= code && code <= 0x115BD) || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA + (0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA + (0x115DC <= code && code <= 0x115DD) || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU + (0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI + 0x1163D == code || // Mn MODI SIGN ANUSVARA + (0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA + 0x116AB == code || // Mn TAKRI SIGN ANUSVARA + 0x116AD == code || // Mn TAKRI VOWEL SIGN AA + (0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU + 0x116B7 == code || // Mn TAKRI SIGN NUKTA + (0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA + (0x11722 <= code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU + (0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER + (0x11A01 <= code && code <= 0x11A06) || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O + (0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK + (0x11A33 <= code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA + (0x11A3B <= code && code <= 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA + 0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER + (0x11A51 <= code && code <= 0x11A56) || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE + (0x11A59 <= code && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK + (0x11A8A <= code && code <= 0x11A96) || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA + (0x11A98 <= code && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER + (0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L + (0x11C38 <= code && code <= 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA + 0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA + (0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA + (0x11CAA <= code && code <= 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA + (0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E + (0x11CB5 <= code && code <= 0x11CB6) || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU + (0x11D31 <= code && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R + 0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E + (0x11D3C <= code && code <= 0x11D3D) || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O + (0x11D3F <= code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA + 0x11D47 == code || // Mn MASARAM GONDI RA-KARA + (0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE + (0x16B30 <= code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM + (0x16F8F <= code && code <= 0x16F92) || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW + (0x1BC9D <= code && code <= 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK + 0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM + (0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 + (0x1D16E <= code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + (0x1D17B <= code && code <= 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE + (0x1D185 <= code && code <= 0x1D18B) || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE + (0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + (0x1D242 <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME + (0x1DA00 <= code && code <= 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN + (0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT + 0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS + 0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK + (0x1DA9B <= code && code <= 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 + (0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 + (0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE + (0x1E008 <= code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU + (0x1E01B <= code && code <= 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI + (0x1E023 <= code && code <= 0x1E024) || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS + (0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + (0x1E8D0 <= code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS + (0x1E944 <= code && code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + (0xE0020 <= code && code <= 0xE007F) || // Cf [96] TAG SPACE..CANCEL TAG + (0xE0100 <= code && code <= 0xE01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + ){ + return Extend; + } + + + if( + (0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z + ){ + return Regional_Indicator; + } + + if( + 0x0903 == code || // Mc DEVANAGARI SIGN VISARGA + 0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE + (0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II + (0x0949 <= code && code <= 0x094C) || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU + (0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW + (0x0982 <= code && code <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA + (0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II + (0x09C7 <= code && code <= 0x09C8) || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + (0x09CB <= code && code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU + 0x0A03 == code || // Mc GURMUKHI SIGN VISARGA + (0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II + 0x0A83 == code || // Mc GUJARATI SIGN VISARGA + (0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II + 0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O + (0x0ACB <= code && code <= 0x0ACC) || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU + (0x0B02 <= code && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA + 0x0B40 == code || // Mc ORIYA VOWEL SIGN II + (0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + (0x0B4B <= code && code <= 0x0B4C) || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU + 0x0BBF == code || // Mc TAMIL VOWEL SIGN I + (0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU + (0x0BC6 <= code && code <= 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + (0x0BCA <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU + (0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + (0x0C41 <= code && code <= 0x0C44) || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR + (0x0C82 <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA + (0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U + (0x0CC3 <= code && code <= 0x0CC4) || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR + (0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI + (0x0CCA <= code && code <= 0x0CCB) || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO + (0x0D02 <= code && code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA + (0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II + (0x0D46 <= code && code <= 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI + (0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU + (0x0D82 <= code && code <= 0x0D83) || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA + (0x0DD0 <= code && code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA + (0x0DD8 <= code && code <= 0x0DDE) || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA + (0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA + 0x0E33 == code || // Lo THAI CHARACTER SARA AM + 0x0EB3 == code || // Lo LAO VOWEL SIGN AM + (0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES + 0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD + 0x1031 == code || // Mc MYANMAR VOWEL SIGN E + (0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA + (0x1056 <= code && code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR + 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E + 0x17B6 == code || // Mc KHMER VOWEL SIGN AA + (0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU + (0x17C7 <= code && code <= 0x17C8) || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU + (0x1923 <= code && code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU + (0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA + (0x1930 <= code && code <= 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA + (0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA + (0x1A19 <= code && code <= 0x1A1A) || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O + 0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA + 0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI + (0x1A6D <= code && code <= 0x1A72) || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI + 0x1B04 == code || // Mc BALINESE SIGN BISAH + 0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG + 0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG + (0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG + (0x1B43 <= code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG + 0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD + 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL + (0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG + 0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH + 0x1BE7 == code || // Mc BATAK VOWEL SIGN E + (0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O + 0x1BEE == code || // Mc BATAK VOWEL SIGN U + (0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN + (0x1C24 <= code && code <= 0x1C2B) || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU + (0x1C34 <= code && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG + 0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA + (0x1CF2 <= code && code <= 0x1CF3) || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA + 0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA + (0xA823 <= code && code <= 0xA824) || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I + 0xA827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO + (0xA880 <= code && code <= 0xA881) || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA + (0xA8B4 <= code && code <= 0xA8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU + (0xA952 <= code && code <= 0xA953) || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA + 0xA983 == code || // Mc JAVANESE SIGN WIGNYAN + (0xA9B4 <= code && code <= 0xA9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG + (0xA9BA <= code && code <= 0xA9BB) || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE + (0xA9BD <= code && code <= 0xA9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON + (0xAA2F <= code && code <= 0xAA30) || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI + (0xAA33 <= code && code <= 0xAA34) || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA + 0xAA4D == code || // Mc CHAM CONSONANT SIGN FINAL H + 0xAAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II + (0xAAEE <= code && code <= 0xAAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU + 0xAAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA + (0xABE3 <= code && code <= 0xABE4) || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP + (0xABE6 <= code && code <= 0xABE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP + (0xABE9 <= code && code <= 0xABEA) || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG + 0xABEC == code || // Mc MEETEI MAYEK LUM IYEK + 0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU + 0x11002 == code || // Mc BRAHMI SIGN VISARGA + 0x11082 == code || // Mc KAITHI SIGN VISARGA + (0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II + (0x110B7 <= code && code <= 0x110B8) || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + 0x1112C == code || // Mc CHAKMA VOWEL SIGN E + 0x11182 == code || // Mc SHARADA SIGN VISARGA + (0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II + (0x111BF <= code && code <= 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA + (0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II + (0x11232 <= code && code <= 0x11233) || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU + 0x11235 == code || // Mc KHOJKI SIGN VIRAMA + (0x112E0 <= code && code <= 0x112E2) || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II + (0x11302 <= code && code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA + 0x1133F == code || // Mc GRANTHA VOWEL SIGN I + (0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR + (0x11347 <= code && code <= 0x11348) || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI + (0x1134B <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA + (0x11362 <= code && code <= 0x11363) || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL + (0x11435 <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II + (0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU + 0x11445 == code || // Mc NEWA SIGN VISARGA + (0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II + 0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E + (0x114BB <= code && code <= 0x114BC) || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O + 0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU + 0x114C1 == code || // Mc TIRHUTA SIGN VISARGA + (0x115B0 <= code && code <= 0x115B1) || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II + (0x115B8 <= code && code <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU + 0x115BE == code || // Mc SIDDHAM SIGN VISARGA + (0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II + (0x1163B <= code && code <= 0x1163C) || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU + 0x1163E == code || // Mc MODI SIGN VISARGA + 0x116AC == code || // Mc TAKRI SIGN VISARGA + (0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II + 0x116B6 == code || // Mc TAKRI SIGN VIRAMA + (0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA + 0x11726 == code || // Mc AHOM VOWEL SIGN E + (0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU + 0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA + (0x11A57 <= code && code <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU + 0x11A97 == code || // Mc SOYOMBO SIGN VISARGA + 0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA + 0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA + 0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA + 0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I + 0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O + (0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG + 0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM + 0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT + ){ + return SpacingMark; + } + + + if( + (0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER + (0xA960 <= code && code <= 0xA97C) // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + ){ + return L; + } + + if( + (0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE + (0xD7B0 <= code && code <= 0xD7C6) // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + ){ + return V; + } + + + if( + (0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN + (0xD7CB <= code && code <= 0xD7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + ){ + return T; + } + + if( + 0xAC00 == code || // Lo HANGUL SYLLABLE GA + 0xAC1C == code || // Lo HANGUL SYLLABLE GAE + 0xAC38 == code || // Lo HANGUL SYLLABLE GYA + 0xAC54 == code || // Lo HANGUL SYLLABLE GYAE + 0xAC70 == code || // Lo HANGUL SYLLABLE GEO + 0xAC8C == code || // Lo HANGUL SYLLABLE GE + 0xACA8 == code || // Lo HANGUL SYLLABLE GYEO + 0xACC4 == code || // Lo HANGUL SYLLABLE GYE + 0xACE0 == code || // Lo HANGUL SYLLABLE GO + 0xACFC == code || // Lo HANGUL SYLLABLE GWA + 0xAD18 == code || // Lo HANGUL SYLLABLE GWAE + 0xAD34 == code || // Lo HANGUL SYLLABLE GOE + 0xAD50 == code || // Lo HANGUL SYLLABLE GYO + 0xAD6C == code || // Lo HANGUL SYLLABLE GU + 0xAD88 == code || // Lo HANGUL SYLLABLE GWEO + 0xADA4 == code || // Lo HANGUL SYLLABLE GWE + 0xADC0 == code || // Lo HANGUL SYLLABLE GWI + 0xADDC == code || // Lo HANGUL SYLLABLE GYU + 0xADF8 == code || // Lo HANGUL SYLLABLE GEU + 0xAE14 == code || // Lo HANGUL SYLLABLE GYI + 0xAE30 == code || // Lo HANGUL SYLLABLE GI + 0xAE4C == code || // Lo HANGUL SYLLABLE GGA + 0xAE68 == code || // Lo HANGUL SYLLABLE GGAE + 0xAE84 == code || // Lo HANGUL SYLLABLE GGYA + 0xAEA0 == code || // Lo HANGUL SYLLABLE GGYAE + 0xAEBC == code || // Lo HANGUL SYLLABLE GGEO + 0xAED8 == code || // Lo HANGUL SYLLABLE GGE + 0xAEF4 == code || // Lo HANGUL SYLLABLE GGYEO + 0xAF10 == code || // Lo HANGUL SYLLABLE GGYE + 0xAF2C == code || // Lo HANGUL SYLLABLE GGO + 0xAF48 == code || // Lo HANGUL SYLLABLE GGWA + 0xAF64 == code || // Lo HANGUL SYLLABLE GGWAE + 0xAF80 == code || // Lo HANGUL SYLLABLE GGOE + 0xAF9C == code || // Lo HANGUL SYLLABLE GGYO + 0xAFB8 == code || // Lo HANGUL SYLLABLE GGU + 0xAFD4 == code || // Lo HANGUL SYLLABLE GGWEO + 0xAFF0 == code || // Lo HANGUL SYLLABLE GGWE + 0xB00C == code || // Lo HANGUL SYLLABLE GGWI + 0xB028 == code || // Lo HANGUL SYLLABLE GGYU + 0xB044 == code || // Lo HANGUL SYLLABLE GGEU + 0xB060 == code || // Lo HANGUL SYLLABLE GGYI + 0xB07C == code || // Lo HANGUL SYLLABLE GGI + 0xB098 == code || // Lo HANGUL SYLLABLE NA + 0xB0B4 == code || // Lo HANGUL SYLLABLE NAE + 0xB0D0 == code || // Lo HANGUL SYLLABLE NYA + 0xB0EC == code || // Lo HANGUL SYLLABLE NYAE + 0xB108 == code || // Lo HANGUL SYLLABLE NEO + 0xB124 == code || // Lo HANGUL SYLLABLE NE + 0xB140 == code || // Lo HANGUL SYLLABLE NYEO + 0xB15C == code || // Lo HANGUL SYLLABLE NYE + 0xB178 == code || // Lo HANGUL SYLLABLE NO + 0xB194 == code || // Lo HANGUL SYLLABLE NWA + 0xB1B0 == code || // Lo HANGUL SYLLABLE NWAE + 0xB1CC == code || // Lo HANGUL SYLLABLE NOE + 0xB1E8 == code || // Lo HANGUL SYLLABLE NYO + 0xB204 == code || // Lo HANGUL SYLLABLE NU + 0xB220 == code || // Lo HANGUL SYLLABLE NWEO + 0xB23C == code || // Lo HANGUL SYLLABLE NWE + 0xB258 == code || // Lo HANGUL SYLLABLE NWI + 0xB274 == code || // Lo HANGUL SYLLABLE NYU + 0xB290 == code || // Lo HANGUL SYLLABLE NEU + 0xB2AC == code || // Lo HANGUL SYLLABLE NYI + 0xB2C8 == code || // Lo HANGUL SYLLABLE NI + 0xB2E4 == code || // Lo HANGUL SYLLABLE DA + 0xB300 == code || // Lo HANGUL SYLLABLE DAE + 0xB31C == code || // Lo HANGUL SYLLABLE DYA + 0xB338 == code || // Lo HANGUL SYLLABLE DYAE + 0xB354 == code || // Lo HANGUL SYLLABLE DEO + 0xB370 == code || // Lo HANGUL SYLLABLE DE + 0xB38C == code || // Lo HANGUL SYLLABLE DYEO + 0xB3A8 == code || // Lo HANGUL SYLLABLE DYE + 0xB3C4 == code || // Lo HANGUL SYLLABLE DO + 0xB3E0 == code || // Lo HANGUL SYLLABLE DWA + 0xB3FC == code || // Lo HANGUL SYLLABLE DWAE + 0xB418 == code || // Lo HANGUL SYLLABLE DOE + 0xB434 == code || // Lo HANGUL SYLLABLE DYO + 0xB450 == code || // Lo HANGUL SYLLABLE DU + 0xB46C == code || // Lo HANGUL SYLLABLE DWEO + 0xB488 == code || // Lo HANGUL SYLLABLE DWE + 0xB4A4 == code || // Lo HANGUL SYLLABLE DWI + 0xB4C0 == code || // Lo HANGUL SYLLABLE DYU + 0xB4DC == code || // Lo HANGUL SYLLABLE DEU + 0xB4F8 == code || // Lo HANGUL SYLLABLE DYI + 0xB514 == code || // Lo HANGUL SYLLABLE DI + 0xB530 == code || // Lo HANGUL SYLLABLE DDA + 0xB54C == code || // Lo HANGUL SYLLABLE DDAE + 0xB568 == code || // Lo HANGUL SYLLABLE DDYA + 0xB584 == code || // Lo HANGUL SYLLABLE DDYAE + 0xB5A0 == code || // Lo HANGUL SYLLABLE DDEO + 0xB5BC == code || // Lo HANGUL SYLLABLE DDE + 0xB5D8 == code || // Lo HANGUL SYLLABLE DDYEO + 0xB5F4 == code || // Lo HANGUL SYLLABLE DDYE + 0xB610 == code || // Lo HANGUL SYLLABLE DDO + 0xB62C == code || // Lo HANGUL SYLLABLE DDWA + 0xB648 == code || // Lo HANGUL SYLLABLE DDWAE + 0xB664 == code || // Lo HANGUL SYLLABLE DDOE + 0xB680 == code || // Lo HANGUL SYLLABLE DDYO + 0xB69C == code || // Lo HANGUL SYLLABLE DDU + 0xB6B8 == code || // Lo HANGUL SYLLABLE DDWEO + 0xB6D4 == code || // Lo HANGUL SYLLABLE DDWE + 0xB6F0 == code || // Lo HANGUL SYLLABLE DDWI + 0xB70C == code || // Lo HANGUL SYLLABLE DDYU + 0xB728 == code || // Lo HANGUL SYLLABLE DDEU + 0xB744 == code || // Lo HANGUL SYLLABLE DDYI + 0xB760 == code || // Lo HANGUL SYLLABLE DDI + 0xB77C == code || // Lo HANGUL SYLLABLE RA + 0xB798 == code || // Lo HANGUL SYLLABLE RAE + 0xB7B4 == code || // Lo HANGUL SYLLABLE RYA + 0xB7D0 == code || // Lo HANGUL SYLLABLE RYAE + 0xB7EC == code || // Lo HANGUL SYLLABLE REO + 0xB808 == code || // Lo HANGUL SYLLABLE RE + 0xB824 == code || // Lo HANGUL SYLLABLE RYEO + 0xB840 == code || // Lo HANGUL SYLLABLE RYE + 0xB85C == code || // Lo HANGUL SYLLABLE RO + 0xB878 == code || // Lo HANGUL SYLLABLE RWA + 0xB894 == code || // Lo HANGUL SYLLABLE RWAE + 0xB8B0 == code || // Lo HANGUL SYLLABLE ROE + 0xB8CC == code || // Lo HANGUL SYLLABLE RYO + 0xB8E8 == code || // Lo HANGUL SYLLABLE RU + 0xB904 == code || // Lo HANGUL SYLLABLE RWEO + 0xB920 == code || // Lo HANGUL SYLLABLE RWE + 0xB93C == code || // Lo HANGUL SYLLABLE RWI + 0xB958 == code || // Lo HANGUL SYLLABLE RYU + 0xB974 == code || // Lo HANGUL SYLLABLE REU + 0xB990 == code || // Lo HANGUL SYLLABLE RYI + 0xB9AC == code || // Lo HANGUL SYLLABLE RI + 0xB9C8 == code || // Lo HANGUL SYLLABLE MA + 0xB9E4 == code || // Lo HANGUL SYLLABLE MAE + 0xBA00 == code || // Lo HANGUL SYLLABLE MYA + 0xBA1C == code || // Lo HANGUL SYLLABLE MYAE + 0xBA38 == code || // Lo HANGUL SYLLABLE MEO + 0xBA54 == code || // Lo HANGUL SYLLABLE ME + 0xBA70 == code || // Lo HANGUL SYLLABLE MYEO + 0xBA8C == code || // Lo HANGUL SYLLABLE MYE + 0xBAA8 == code || // Lo HANGUL SYLLABLE MO + 0xBAC4 == code || // Lo HANGUL SYLLABLE MWA + 0xBAE0 == code || // Lo HANGUL SYLLABLE MWAE + 0xBAFC == code || // Lo HANGUL SYLLABLE MOE + 0xBB18 == code || // Lo HANGUL SYLLABLE MYO + 0xBB34 == code || // Lo HANGUL SYLLABLE MU + 0xBB50 == code || // Lo HANGUL SYLLABLE MWEO + 0xBB6C == code || // Lo HANGUL SYLLABLE MWE + 0xBB88 == code || // Lo HANGUL SYLLABLE MWI + 0xBBA4 == code || // Lo HANGUL SYLLABLE MYU + 0xBBC0 == code || // Lo HANGUL SYLLABLE MEU + 0xBBDC == code || // Lo HANGUL SYLLABLE MYI + 0xBBF8 == code || // Lo HANGUL SYLLABLE MI + 0xBC14 == code || // Lo HANGUL SYLLABLE BA + 0xBC30 == code || // Lo HANGUL SYLLABLE BAE + 0xBC4C == code || // Lo HANGUL SYLLABLE BYA + 0xBC68 == code || // Lo HANGUL SYLLABLE BYAE + 0xBC84 == code || // Lo HANGUL SYLLABLE BEO + 0xBCA0 == code || // Lo HANGUL SYLLABLE BE + 0xBCBC == code || // Lo HANGUL SYLLABLE BYEO + 0xBCD8 == code || // Lo HANGUL SYLLABLE BYE + 0xBCF4 == code || // Lo HANGUL SYLLABLE BO + 0xBD10 == code || // Lo HANGUL SYLLABLE BWA + 0xBD2C == code || // Lo HANGUL SYLLABLE BWAE + 0xBD48 == code || // Lo HANGUL SYLLABLE BOE + 0xBD64 == code || // Lo HANGUL SYLLABLE BYO + 0xBD80 == code || // Lo HANGUL SYLLABLE BU + 0xBD9C == code || // Lo HANGUL SYLLABLE BWEO + 0xBDB8 == code || // Lo HANGUL SYLLABLE BWE + 0xBDD4 == code || // Lo HANGUL SYLLABLE BWI + 0xBDF0 == code || // Lo HANGUL SYLLABLE BYU + 0xBE0C == code || // Lo HANGUL SYLLABLE BEU + 0xBE28 == code || // Lo HANGUL SYLLABLE BYI + 0xBE44 == code || // Lo HANGUL SYLLABLE BI + 0xBE60 == code || // Lo HANGUL SYLLABLE BBA + 0xBE7C == code || // Lo HANGUL SYLLABLE BBAE + 0xBE98 == code || // Lo HANGUL SYLLABLE BBYA + 0xBEB4 == code || // Lo HANGUL SYLLABLE BBYAE + 0xBED0 == code || // Lo HANGUL SYLLABLE BBEO + 0xBEEC == code || // Lo HANGUL SYLLABLE BBE + 0xBF08 == code || // Lo HANGUL SYLLABLE BBYEO + 0xBF24 == code || // Lo HANGUL SYLLABLE BBYE + 0xBF40 == code || // Lo HANGUL SYLLABLE BBO + 0xBF5C == code || // Lo HANGUL SYLLABLE BBWA + 0xBF78 == code || // Lo HANGUL SYLLABLE BBWAE + 0xBF94 == code || // Lo HANGUL SYLLABLE BBOE + 0xBFB0 == code || // Lo HANGUL SYLLABLE BBYO + 0xBFCC == code || // Lo HANGUL SYLLABLE BBU + 0xBFE8 == code || // Lo HANGUL SYLLABLE BBWEO + 0xC004 == code || // Lo HANGUL SYLLABLE BBWE + 0xC020 == code || // Lo HANGUL SYLLABLE BBWI + 0xC03C == code || // Lo HANGUL SYLLABLE BBYU + 0xC058 == code || // Lo HANGUL SYLLABLE BBEU + 0xC074 == code || // Lo HANGUL SYLLABLE BBYI + 0xC090 == code || // Lo HANGUL SYLLABLE BBI + 0xC0AC == code || // Lo HANGUL SYLLABLE SA + 0xC0C8 == code || // Lo HANGUL SYLLABLE SAE + 0xC0E4 == code || // Lo HANGUL SYLLABLE SYA + 0xC100 == code || // Lo HANGUL SYLLABLE SYAE + 0xC11C == code || // Lo HANGUL SYLLABLE SEO + 0xC138 == code || // Lo HANGUL SYLLABLE SE + 0xC154 == code || // Lo HANGUL SYLLABLE SYEO + 0xC170 == code || // Lo HANGUL SYLLABLE SYE + 0xC18C == code || // Lo HANGUL SYLLABLE SO + 0xC1A8 == code || // Lo HANGUL SYLLABLE SWA + 0xC1C4 == code || // Lo HANGUL SYLLABLE SWAE + 0xC1E0 == code || // Lo HANGUL SYLLABLE SOE + 0xC1FC == code || // Lo HANGUL SYLLABLE SYO + 0xC218 == code || // Lo HANGUL SYLLABLE SU + 0xC234 == code || // Lo HANGUL SYLLABLE SWEO + 0xC250 == code || // Lo HANGUL SYLLABLE SWE + 0xC26C == code || // Lo HANGUL SYLLABLE SWI + 0xC288 == code || // Lo HANGUL SYLLABLE SYU + 0xC2A4 == code || // Lo HANGUL SYLLABLE SEU + 0xC2C0 == code || // Lo HANGUL SYLLABLE SYI + 0xC2DC == code || // Lo HANGUL SYLLABLE SI + 0xC2F8 == code || // Lo HANGUL SYLLABLE SSA + 0xC314 == code || // Lo HANGUL SYLLABLE SSAE + 0xC330 == code || // Lo HANGUL SYLLABLE SSYA + 0xC34C == code || // Lo HANGUL SYLLABLE SSYAE + 0xC368 == code || // Lo HANGUL SYLLABLE SSEO + 0xC384 == code || // Lo HANGUL SYLLABLE SSE + 0xC3A0 == code || // Lo HANGUL SYLLABLE SSYEO + 0xC3BC == code || // Lo HANGUL SYLLABLE SSYE + 0xC3D8 == code || // Lo HANGUL SYLLABLE SSO + 0xC3F4 == code || // Lo HANGUL SYLLABLE SSWA + 0xC410 == code || // Lo HANGUL SYLLABLE SSWAE + 0xC42C == code || // Lo HANGUL SYLLABLE SSOE + 0xC448 == code || // Lo HANGUL SYLLABLE SSYO + 0xC464 == code || // Lo HANGUL SYLLABLE SSU + 0xC480 == code || // Lo HANGUL SYLLABLE SSWEO + 0xC49C == code || // Lo HANGUL SYLLABLE SSWE + 0xC4B8 == code || // Lo HANGUL SYLLABLE SSWI + 0xC4D4 == code || // Lo HANGUL SYLLABLE SSYU + 0xC4F0 == code || // Lo HANGUL SYLLABLE SSEU + 0xC50C == code || // Lo HANGUL SYLLABLE SSYI + 0xC528 == code || // Lo HANGUL SYLLABLE SSI + 0xC544 == code || // Lo HANGUL SYLLABLE A + 0xC560 == code || // Lo HANGUL SYLLABLE AE + 0xC57C == code || // Lo HANGUL SYLLABLE YA + 0xC598 == code || // Lo HANGUL SYLLABLE YAE + 0xC5B4 == code || // Lo HANGUL SYLLABLE EO + 0xC5D0 == code || // Lo HANGUL SYLLABLE E + 0xC5EC == code || // Lo HANGUL SYLLABLE YEO + 0xC608 == code || // Lo HANGUL SYLLABLE YE + 0xC624 == code || // Lo HANGUL SYLLABLE O + 0xC640 == code || // Lo HANGUL SYLLABLE WA + 0xC65C == code || // Lo HANGUL SYLLABLE WAE + 0xC678 == code || // Lo HANGUL SYLLABLE OE + 0xC694 == code || // Lo HANGUL SYLLABLE YO + 0xC6B0 == code || // Lo HANGUL SYLLABLE U + 0xC6CC == code || // Lo HANGUL SYLLABLE WEO + 0xC6E8 == code || // Lo HANGUL SYLLABLE WE + 0xC704 == code || // Lo HANGUL SYLLABLE WI + 0xC720 == code || // Lo HANGUL SYLLABLE YU + 0xC73C == code || // Lo HANGUL SYLLABLE EU + 0xC758 == code || // Lo HANGUL SYLLABLE YI + 0xC774 == code || // Lo HANGUL SYLLABLE I + 0xC790 == code || // Lo HANGUL SYLLABLE JA + 0xC7AC == code || // Lo HANGUL SYLLABLE JAE + 0xC7C8 == code || // Lo HANGUL SYLLABLE JYA + 0xC7E4 == code || // Lo HANGUL SYLLABLE JYAE + 0xC800 == code || // Lo HANGUL SYLLABLE JEO + 0xC81C == code || // Lo HANGUL SYLLABLE JE + 0xC838 == code || // Lo HANGUL SYLLABLE JYEO + 0xC854 == code || // Lo HANGUL SYLLABLE JYE + 0xC870 == code || // Lo HANGUL SYLLABLE JO + 0xC88C == code || // Lo HANGUL SYLLABLE JWA + 0xC8A8 == code || // Lo HANGUL SYLLABLE JWAE + 0xC8C4 == code || // Lo HANGUL SYLLABLE JOE + 0xC8E0 == code || // Lo HANGUL SYLLABLE JYO + 0xC8FC == code || // Lo HANGUL SYLLABLE JU + 0xC918 == code || // Lo HANGUL SYLLABLE JWEO + 0xC934 == code || // Lo HANGUL SYLLABLE JWE + 0xC950 == code || // Lo HANGUL SYLLABLE JWI + 0xC96C == code || // Lo HANGUL SYLLABLE JYU + 0xC988 == code || // Lo HANGUL SYLLABLE JEU + 0xC9A4 == code || // Lo HANGUL SYLLABLE JYI + 0xC9C0 == code || // Lo HANGUL SYLLABLE JI + 0xC9DC == code || // Lo HANGUL SYLLABLE JJA + 0xC9F8 == code || // Lo HANGUL SYLLABLE JJAE + 0xCA14 == code || // Lo HANGUL SYLLABLE JJYA + 0xCA30 == code || // Lo HANGUL SYLLABLE JJYAE + 0xCA4C == code || // Lo HANGUL SYLLABLE JJEO + 0xCA68 == code || // Lo HANGUL SYLLABLE JJE + 0xCA84 == code || // Lo HANGUL SYLLABLE JJYEO + 0xCAA0 == code || // Lo HANGUL SYLLABLE JJYE + 0xCABC == code || // Lo HANGUL SYLLABLE JJO + 0xCAD8 == code || // Lo HANGUL SYLLABLE JJWA + 0xCAF4 == code || // Lo HANGUL SYLLABLE JJWAE + 0xCB10 == code || // Lo HANGUL SYLLABLE JJOE + 0xCB2C == code || // Lo HANGUL SYLLABLE JJYO + 0xCB48 == code || // Lo HANGUL SYLLABLE JJU + 0xCB64 == code || // Lo HANGUL SYLLABLE JJWEO + 0xCB80 == code || // Lo HANGUL SYLLABLE JJWE + 0xCB9C == code || // Lo HANGUL SYLLABLE JJWI + 0xCBB8 == code || // Lo HANGUL SYLLABLE JJYU + 0xCBD4 == code || // Lo HANGUL SYLLABLE JJEU + 0xCBF0 == code || // Lo HANGUL SYLLABLE JJYI + 0xCC0C == code || // Lo HANGUL SYLLABLE JJI + 0xCC28 == code || // Lo HANGUL SYLLABLE CA + 0xCC44 == code || // Lo HANGUL SYLLABLE CAE + 0xCC60 == code || // Lo HANGUL SYLLABLE CYA + 0xCC7C == code || // Lo HANGUL SYLLABLE CYAE + 0xCC98 == code || // Lo HANGUL SYLLABLE CEO + 0xCCB4 == code || // Lo HANGUL SYLLABLE CE + 0xCCD0 == code || // Lo HANGUL SYLLABLE CYEO + 0xCCEC == code || // Lo HANGUL SYLLABLE CYE + 0xCD08 == code || // Lo HANGUL SYLLABLE CO + 0xCD24 == code || // Lo HANGUL SYLLABLE CWA + 0xCD40 == code || // Lo HANGUL SYLLABLE CWAE + 0xCD5C == code || // Lo HANGUL SYLLABLE COE + 0xCD78 == code || // Lo HANGUL SYLLABLE CYO + 0xCD94 == code || // Lo HANGUL SYLLABLE CU + 0xCDB0 == code || // Lo HANGUL SYLLABLE CWEO + 0xCDCC == code || // Lo HANGUL SYLLABLE CWE + 0xCDE8 == code || // Lo HANGUL SYLLABLE CWI + 0xCE04 == code || // Lo HANGUL SYLLABLE CYU + 0xCE20 == code || // Lo HANGUL SYLLABLE CEU + 0xCE3C == code || // Lo HANGUL SYLLABLE CYI + 0xCE58 == code || // Lo HANGUL SYLLABLE CI + 0xCE74 == code || // Lo HANGUL SYLLABLE KA + 0xCE90 == code || // Lo HANGUL SYLLABLE KAE + 0xCEAC == code || // Lo HANGUL SYLLABLE KYA + 0xCEC8 == code || // Lo HANGUL SYLLABLE KYAE + 0xCEE4 == code || // Lo HANGUL SYLLABLE KEO + 0xCF00 == code || // Lo HANGUL SYLLABLE KE + 0xCF1C == code || // Lo HANGUL SYLLABLE KYEO + 0xCF38 == code || // Lo HANGUL SYLLABLE KYE + 0xCF54 == code || // Lo HANGUL SYLLABLE KO + 0xCF70 == code || // Lo HANGUL SYLLABLE KWA + 0xCF8C == code || // Lo HANGUL SYLLABLE KWAE + 0xCFA8 == code || // Lo HANGUL SYLLABLE KOE + 0xCFC4 == code || // Lo HANGUL SYLLABLE KYO + 0xCFE0 == code || // Lo HANGUL SYLLABLE KU + 0xCFFC == code || // Lo HANGUL SYLLABLE KWEO + 0xD018 == code || // Lo HANGUL SYLLABLE KWE + 0xD034 == code || // Lo HANGUL SYLLABLE KWI + 0xD050 == code || // Lo HANGUL SYLLABLE KYU + 0xD06C == code || // Lo HANGUL SYLLABLE KEU + 0xD088 == code || // Lo HANGUL SYLLABLE KYI + 0xD0A4 == code || // Lo HANGUL SYLLABLE KI + 0xD0C0 == code || // Lo HANGUL SYLLABLE TA + 0xD0DC == code || // Lo HANGUL SYLLABLE TAE + 0xD0F8 == code || // Lo HANGUL SYLLABLE TYA + 0xD114 == code || // Lo HANGUL SYLLABLE TYAE + 0xD130 == code || // Lo HANGUL SYLLABLE TEO + 0xD14C == code || // Lo HANGUL SYLLABLE TE + 0xD168 == code || // Lo HANGUL SYLLABLE TYEO + 0xD184 == code || // Lo HANGUL SYLLABLE TYE + 0xD1A0 == code || // Lo HANGUL SYLLABLE TO + 0xD1BC == code || // Lo HANGUL SYLLABLE TWA + 0xD1D8 == code || // Lo HANGUL SYLLABLE TWAE + 0xD1F4 == code || // Lo HANGUL SYLLABLE TOE + 0xD210 == code || // Lo HANGUL SYLLABLE TYO + 0xD22C == code || // Lo HANGUL SYLLABLE TU + 0xD248 == code || // Lo HANGUL SYLLABLE TWEO + 0xD264 == code || // Lo HANGUL SYLLABLE TWE + 0xD280 == code || // Lo HANGUL SYLLABLE TWI + 0xD29C == code || // Lo HANGUL SYLLABLE TYU + 0xD2B8 == code || // Lo HANGUL SYLLABLE TEU + 0xD2D4 == code || // Lo HANGUL SYLLABLE TYI + 0xD2F0 == code || // Lo HANGUL SYLLABLE TI + 0xD30C == code || // Lo HANGUL SYLLABLE PA + 0xD328 == code || // Lo HANGUL SYLLABLE PAE + 0xD344 == code || // Lo HANGUL SYLLABLE PYA + 0xD360 == code || // Lo HANGUL SYLLABLE PYAE + 0xD37C == code || // Lo HANGUL SYLLABLE PEO + 0xD398 == code || // Lo HANGUL SYLLABLE PE + 0xD3B4 == code || // Lo HANGUL SYLLABLE PYEO + 0xD3D0 == code || // Lo HANGUL SYLLABLE PYE + 0xD3EC == code || // Lo HANGUL SYLLABLE PO + 0xD408 == code || // Lo HANGUL SYLLABLE PWA + 0xD424 == code || // Lo HANGUL SYLLABLE PWAE + 0xD440 == code || // Lo HANGUL SYLLABLE POE + 0xD45C == code || // Lo HANGUL SYLLABLE PYO + 0xD478 == code || // Lo HANGUL SYLLABLE PU + 0xD494 == code || // Lo HANGUL SYLLABLE PWEO + 0xD4B0 == code || // Lo HANGUL SYLLABLE PWE + 0xD4CC == code || // Lo HANGUL SYLLABLE PWI + 0xD4E8 == code || // Lo HANGUL SYLLABLE PYU + 0xD504 == code || // Lo HANGUL SYLLABLE PEU + 0xD520 == code || // Lo HANGUL SYLLABLE PYI + 0xD53C == code || // Lo HANGUL SYLLABLE PI + 0xD558 == code || // Lo HANGUL SYLLABLE HA + 0xD574 == code || // Lo HANGUL SYLLABLE HAE + 0xD590 == code || // Lo HANGUL SYLLABLE HYA + 0xD5AC == code || // Lo HANGUL SYLLABLE HYAE + 0xD5C8 == code || // Lo HANGUL SYLLABLE HEO + 0xD5E4 == code || // Lo HANGUL SYLLABLE HE + 0xD600 == code || // Lo HANGUL SYLLABLE HYEO + 0xD61C == code || // Lo HANGUL SYLLABLE HYE + 0xD638 == code || // Lo HANGUL SYLLABLE HO + 0xD654 == code || // Lo HANGUL SYLLABLE HWA + 0xD670 == code || // Lo HANGUL SYLLABLE HWAE + 0xD68C == code || // Lo HANGUL SYLLABLE HOE + 0xD6A8 == code || // Lo HANGUL SYLLABLE HYO + 0xD6C4 == code || // Lo HANGUL SYLLABLE HU + 0xD6E0 == code || // Lo HANGUL SYLLABLE HWEO + 0xD6FC == code || // Lo HANGUL SYLLABLE HWE + 0xD718 == code || // Lo HANGUL SYLLABLE HWI + 0xD734 == code || // Lo HANGUL SYLLABLE HYU + 0xD750 == code || // Lo HANGUL SYLLABLE HEU + 0xD76C == code || // Lo HANGUL SYLLABLE HYI + 0xD788 == code // Lo HANGUL SYLLABLE HI + ){ + return LV; + } + + if( + (0xAC01 <= code && code <= 0xAC1B) || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH + (0xAC1D <= code && code <= 0xAC37) || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH + (0xAC39 <= code && code <= 0xAC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH + (0xAC55 <= code && code <= 0xAC6F) || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH + (0xAC71 <= code && code <= 0xAC8B) || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH + (0xAC8D <= code && code <= 0xACA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH + (0xACA9 <= code && code <= 0xACC3) || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH + (0xACC5 <= code && code <= 0xACDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH + (0xACE1 <= code && code <= 0xACFB) || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH + (0xACFD <= code && code <= 0xAD17) || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH + (0xAD19 <= code && code <= 0xAD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH + (0xAD35 <= code && code <= 0xAD4F) || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH + (0xAD51 <= code && code <= 0xAD6B) || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH + (0xAD6D <= code && code <= 0xAD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH + (0xAD89 <= code && code <= 0xADA3) || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH + (0xADA5 <= code && code <= 0xADBF) || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH + (0xADC1 <= code && code <= 0xADDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH + (0xADDD <= code && code <= 0xADF7) || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH + (0xADF9 <= code && code <= 0xAE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH + (0xAE15 <= code && code <= 0xAE2F) || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH + (0xAE31 <= code && code <= 0xAE4B) || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH + (0xAE4D <= code && code <= 0xAE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH + (0xAE69 <= code && code <= 0xAE83) || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH + (0xAE85 <= code && code <= 0xAE9F) || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH + (0xAEA1 <= code && code <= 0xAEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH + (0xAEBD <= code && code <= 0xAED7) || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH + (0xAED9 <= code && code <= 0xAEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH + (0xAEF5 <= code && code <= 0xAF0F) || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH + (0xAF11 <= code && code <= 0xAF2B) || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH + (0xAF2D <= code && code <= 0xAF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH + (0xAF49 <= code && code <= 0xAF63) || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH + (0xAF65 <= code && code <= 0xAF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH + (0xAF81 <= code && code <= 0xAF9B) || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH + (0xAF9D <= code && code <= 0xAFB7) || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH + (0xAFB9 <= code && code <= 0xAFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH + (0xAFD5 <= code && code <= 0xAFEF) || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH + (0xAFF1 <= code && code <= 0xB00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH + (0xB00D <= code && code <= 0xB027) || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH + (0xB029 <= code && code <= 0xB043) || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH + (0xB045 <= code && code <= 0xB05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH + (0xB061 <= code && code <= 0xB07B) || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH + (0xB07D <= code && code <= 0xB097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH + (0xB099 <= code && code <= 0xB0B3) || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH + (0xB0B5 <= code && code <= 0xB0CF) || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH + (0xB0D1 <= code && code <= 0xB0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH + (0xB0ED <= code && code <= 0xB107) || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH + (0xB109 <= code && code <= 0xB123) || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH + (0xB125 <= code && code <= 0xB13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH + (0xB141 <= code && code <= 0xB15B) || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH + (0xB15D <= code && code <= 0xB177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH + (0xB179 <= code && code <= 0xB193) || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH + (0xB195 <= code && code <= 0xB1AF) || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH + (0xB1B1 <= code && code <= 0xB1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH + (0xB1CD <= code && code <= 0xB1E7) || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH + (0xB1E9 <= code && code <= 0xB203) || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH + (0xB205 <= code && code <= 0xB21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH + (0xB221 <= code && code <= 0xB23B) || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH + (0xB23D <= code && code <= 0xB257) || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH + (0xB259 <= code && code <= 0xB273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH + (0xB275 <= code && code <= 0xB28F) || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH + (0xB291 <= code && code <= 0xB2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH + (0xB2AD <= code && code <= 0xB2C7) || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH + (0xB2C9 <= code && code <= 0xB2E3) || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH + (0xB2E5 <= code && code <= 0xB2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH + (0xB301 <= code && code <= 0xB31B) || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH + (0xB31D <= code && code <= 0xB337) || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH + (0xB339 <= code && code <= 0xB353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH + (0xB355 <= code && code <= 0xB36F) || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH + (0xB371 <= code && code <= 0xB38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH + (0xB38D <= code && code <= 0xB3A7) || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH + (0xB3A9 <= code && code <= 0xB3C3) || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH + (0xB3C5 <= code && code <= 0xB3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH + (0xB3E1 <= code && code <= 0xB3FB) || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH + (0xB3FD <= code && code <= 0xB417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH + (0xB419 <= code && code <= 0xB433) || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH + (0xB435 <= code && code <= 0xB44F) || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH + (0xB451 <= code && code <= 0xB46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH + (0xB46D <= code && code <= 0xB487) || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH + (0xB489 <= code && code <= 0xB4A3) || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH + (0xB4A5 <= code && code <= 0xB4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH + (0xB4C1 <= code && code <= 0xB4DB) || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH + (0xB4DD <= code && code <= 0xB4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH + (0xB4F9 <= code && code <= 0xB513) || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH + (0xB515 <= code && code <= 0xB52F) || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH + (0xB531 <= code && code <= 0xB54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH + (0xB54D <= code && code <= 0xB567) || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH + (0xB569 <= code && code <= 0xB583) || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH + (0xB585 <= code && code <= 0xB59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH + (0xB5A1 <= code && code <= 0xB5BB) || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH + (0xB5BD <= code && code <= 0xB5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH + (0xB5D9 <= code && code <= 0xB5F3) || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH + (0xB5F5 <= code && code <= 0xB60F) || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH + (0xB611 <= code && code <= 0xB62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH + (0xB62D <= code && code <= 0xB647) || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH + (0xB649 <= code && code <= 0xB663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH + (0xB665 <= code && code <= 0xB67F) || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH + (0xB681 <= code && code <= 0xB69B) || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH + (0xB69D <= code && code <= 0xB6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH + (0xB6B9 <= code && code <= 0xB6D3) || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH + (0xB6D5 <= code && code <= 0xB6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH + (0xB6F1 <= code && code <= 0xB70B) || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH + (0xB70D <= code && code <= 0xB727) || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH + (0xB729 <= code && code <= 0xB743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH + (0xB745 <= code && code <= 0xB75F) || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH + (0xB761 <= code && code <= 0xB77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH + (0xB77D <= code && code <= 0xB797) || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH + (0xB799 <= code && code <= 0xB7B3) || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH + (0xB7B5 <= code && code <= 0xB7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH + (0xB7D1 <= code && code <= 0xB7EB) || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH + (0xB7ED <= code && code <= 0xB807) || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH + (0xB809 <= code && code <= 0xB823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH + (0xB825 <= code && code <= 0xB83F) || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH + (0xB841 <= code && code <= 0xB85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH + (0xB85D <= code && code <= 0xB877) || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH + (0xB879 <= code && code <= 0xB893) || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH + (0xB895 <= code && code <= 0xB8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH + (0xB8B1 <= code && code <= 0xB8CB) || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH + (0xB8CD <= code && code <= 0xB8E7) || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH + (0xB8E9 <= code && code <= 0xB903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH + (0xB905 <= code && code <= 0xB91F) || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH + (0xB921 <= code && code <= 0xB93B) || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH + (0xB93D <= code && code <= 0xB957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH + (0xB959 <= code && code <= 0xB973) || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH + (0xB975 <= code && code <= 0xB98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH + (0xB991 <= code && code <= 0xB9AB) || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH + (0xB9AD <= code && code <= 0xB9C7) || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH + (0xB9C9 <= code && code <= 0xB9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH + (0xB9E5 <= code && code <= 0xB9FF) || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH + (0xBA01 <= code && code <= 0xBA1B) || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH + (0xBA1D <= code && code <= 0xBA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH + (0xBA39 <= code && code <= 0xBA53) || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH + (0xBA55 <= code && code <= 0xBA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH + (0xBA71 <= code && code <= 0xBA8B) || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH + (0xBA8D <= code && code <= 0xBAA7) || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH + (0xBAA9 <= code && code <= 0xBAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH + (0xBAC5 <= code && code <= 0xBADF) || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH + (0xBAE1 <= code && code <= 0xBAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH + (0xBAFD <= code && code <= 0xBB17) || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH + (0xBB19 <= code && code <= 0xBB33) || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH + (0xBB35 <= code && code <= 0xBB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH + (0xBB51 <= code && code <= 0xBB6B) || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH + (0xBB6D <= code && code <= 0xBB87) || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH + (0xBB89 <= code && code <= 0xBBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH + (0xBBA5 <= code && code <= 0xBBBF) || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH + (0xBBC1 <= code && code <= 0xBBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH + (0xBBDD <= code && code <= 0xBBF7) || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH + (0xBBF9 <= code && code <= 0xBC13) || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH + (0xBC15 <= code && code <= 0xBC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH + (0xBC31 <= code && code <= 0xBC4B) || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH + (0xBC4D <= code && code <= 0xBC67) || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH + (0xBC69 <= code && code <= 0xBC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH + (0xBC85 <= code && code <= 0xBC9F) || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH + (0xBCA1 <= code && code <= 0xBCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH + (0xBCBD <= code && code <= 0xBCD7) || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH + (0xBCD9 <= code && code <= 0xBCF3) || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH + (0xBCF5 <= code && code <= 0xBD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH + (0xBD11 <= code && code <= 0xBD2B) || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH + (0xBD2D <= code && code <= 0xBD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH + (0xBD49 <= code && code <= 0xBD63) || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH + (0xBD65 <= code && code <= 0xBD7F) || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH + (0xBD81 <= code && code <= 0xBD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH + (0xBD9D <= code && code <= 0xBDB7) || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH + (0xBDB9 <= code && code <= 0xBDD3) || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH + (0xBDD5 <= code && code <= 0xBDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH + (0xBDF1 <= code && code <= 0xBE0B) || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH + (0xBE0D <= code && code <= 0xBE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH + (0xBE29 <= code && code <= 0xBE43) || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH + (0xBE45 <= code && code <= 0xBE5F) || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH + (0xBE61 <= code && code <= 0xBE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH + (0xBE7D <= code && code <= 0xBE97) || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH + (0xBE99 <= code && code <= 0xBEB3) || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH + (0xBEB5 <= code && code <= 0xBECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH + (0xBED1 <= code && code <= 0xBEEB) || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH + (0xBEED <= code && code <= 0xBF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH + (0xBF09 <= code && code <= 0xBF23) || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH + (0xBF25 <= code && code <= 0xBF3F) || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH + (0xBF41 <= code && code <= 0xBF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH + (0xBF5D <= code && code <= 0xBF77) || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH + (0xBF79 <= code && code <= 0xBF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH + (0xBF95 <= code && code <= 0xBFAF) || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH + (0xBFB1 <= code && code <= 0xBFCB) || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH + (0xBFCD <= code && code <= 0xBFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH + (0xBFE9 <= code && code <= 0xC003) || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH + (0xC005 <= code && code <= 0xC01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH + (0xC021 <= code && code <= 0xC03B) || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH + (0xC03D <= code && code <= 0xC057) || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH + (0xC059 <= code && code <= 0xC073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH + (0xC075 <= code && code <= 0xC08F) || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH + (0xC091 <= code && code <= 0xC0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH + (0xC0AD <= code && code <= 0xC0C7) || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH + (0xC0C9 <= code && code <= 0xC0E3) || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH + (0xC0E5 <= code && code <= 0xC0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH + (0xC101 <= code && code <= 0xC11B) || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH + (0xC11D <= code && code <= 0xC137) || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH + (0xC139 <= code && code <= 0xC153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH + (0xC155 <= code && code <= 0xC16F) || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH + (0xC171 <= code && code <= 0xC18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH + (0xC18D <= code && code <= 0xC1A7) || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH + (0xC1A9 <= code && code <= 0xC1C3) || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH + (0xC1C5 <= code && code <= 0xC1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH + (0xC1E1 <= code && code <= 0xC1FB) || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH + (0xC1FD <= code && code <= 0xC217) || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH + (0xC219 <= code && code <= 0xC233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH + (0xC235 <= code && code <= 0xC24F) || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH + (0xC251 <= code && code <= 0xC26B) || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH + (0xC26D <= code && code <= 0xC287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH + (0xC289 <= code && code <= 0xC2A3) || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH + (0xC2A5 <= code && code <= 0xC2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH + (0xC2C1 <= code && code <= 0xC2DB) || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH + (0xC2DD <= code && code <= 0xC2F7) || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH + (0xC2F9 <= code && code <= 0xC313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH + (0xC315 <= code && code <= 0xC32F) || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH + (0xC331 <= code && code <= 0xC34B) || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH + (0xC34D <= code && code <= 0xC367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH + (0xC369 <= code && code <= 0xC383) || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH + (0xC385 <= code && code <= 0xC39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH + (0xC3A1 <= code && code <= 0xC3BB) || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH + (0xC3BD <= code && code <= 0xC3D7) || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH + (0xC3D9 <= code && code <= 0xC3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH + (0xC3F5 <= code && code <= 0xC40F) || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH + (0xC411 <= code && code <= 0xC42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH + (0xC42D <= code && code <= 0xC447) || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH + (0xC449 <= code && code <= 0xC463) || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH + (0xC465 <= code && code <= 0xC47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH + (0xC481 <= code && code <= 0xC49B) || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH + (0xC49D <= code && code <= 0xC4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH + (0xC4B9 <= code && code <= 0xC4D3) || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH + (0xC4D5 <= code && code <= 0xC4EF) || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH + (0xC4F1 <= code && code <= 0xC50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH + (0xC50D <= code && code <= 0xC527) || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH + (0xC529 <= code && code <= 0xC543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH + (0xC545 <= code && code <= 0xC55F) || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH + (0xC561 <= code && code <= 0xC57B) || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH + (0xC57D <= code && code <= 0xC597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH + (0xC599 <= code && code <= 0xC5B3) || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH + (0xC5B5 <= code && code <= 0xC5CF) || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH + (0xC5D1 <= code && code <= 0xC5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH + (0xC5ED <= code && code <= 0xC607) || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH + (0xC609 <= code && code <= 0xC623) || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH + (0xC625 <= code && code <= 0xC63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH + (0xC641 <= code && code <= 0xC65B) || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH + (0xC65D <= code && code <= 0xC677) || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH + (0xC679 <= code && code <= 0xC693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH + (0xC695 <= code && code <= 0xC6AF) || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH + (0xC6B1 <= code && code <= 0xC6CB) || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH + (0xC6CD <= code && code <= 0xC6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH + (0xC6E9 <= code && code <= 0xC703) || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH + (0xC705 <= code && code <= 0xC71F) || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH + (0xC721 <= code && code <= 0xC73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH + (0xC73D <= code && code <= 0xC757) || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH + (0xC759 <= code && code <= 0xC773) || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH + (0xC775 <= code && code <= 0xC78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH + (0xC791 <= code && code <= 0xC7AB) || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH + (0xC7AD <= code && code <= 0xC7C7) || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH + (0xC7C9 <= code && code <= 0xC7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH + (0xC7E5 <= code && code <= 0xC7FF) || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH + (0xC801 <= code && code <= 0xC81B) || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH + (0xC81D <= code && code <= 0xC837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH + (0xC839 <= code && code <= 0xC853) || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH + (0xC855 <= code && code <= 0xC86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH + (0xC871 <= code && code <= 0xC88B) || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH + (0xC88D <= code && code <= 0xC8A7) || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH + (0xC8A9 <= code && code <= 0xC8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH + (0xC8C5 <= code && code <= 0xC8DF) || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH + (0xC8E1 <= code && code <= 0xC8FB) || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH + (0xC8FD <= code && code <= 0xC917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH + (0xC919 <= code && code <= 0xC933) || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH + (0xC935 <= code && code <= 0xC94F) || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH + (0xC951 <= code && code <= 0xC96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH + (0xC96D <= code && code <= 0xC987) || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH + (0xC989 <= code && code <= 0xC9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH + (0xC9A5 <= code && code <= 0xC9BF) || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH + (0xC9C1 <= code && code <= 0xC9DB) || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH + (0xC9DD <= code && code <= 0xC9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH + (0xC9F9 <= code && code <= 0xCA13) || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH + (0xCA15 <= code && code <= 0xCA2F) || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH + (0xCA31 <= code && code <= 0xCA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH + (0xCA4D <= code && code <= 0xCA67) || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH + (0xCA69 <= code && code <= 0xCA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH + (0xCA85 <= code && code <= 0xCA9F) || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH + (0xCAA1 <= code && code <= 0xCABB) || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH + (0xCABD <= code && code <= 0xCAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH + (0xCAD9 <= code && code <= 0xCAF3) || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH + (0xCAF5 <= code && code <= 0xCB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH + (0xCB11 <= code && code <= 0xCB2B) || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH + (0xCB2D <= code && code <= 0xCB47) || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH + (0xCB49 <= code && code <= 0xCB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH + (0xCB65 <= code && code <= 0xCB7F) || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH + (0xCB81 <= code && code <= 0xCB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH + (0xCB9D <= code && code <= 0xCBB7) || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH + (0xCBB9 <= code && code <= 0xCBD3) || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH + (0xCBD5 <= code && code <= 0xCBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH + (0xCBF1 <= code && code <= 0xCC0B) || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH + (0xCC0D <= code && code <= 0xCC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH + (0xCC29 <= code && code <= 0xCC43) || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH + (0xCC45 <= code && code <= 0xCC5F) || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH + (0xCC61 <= code && code <= 0xCC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH + (0xCC7D <= code && code <= 0xCC97) || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH + (0xCC99 <= code && code <= 0xCCB3) || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH + (0xCCB5 <= code && code <= 0xCCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH + (0xCCD1 <= code && code <= 0xCCEB) || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH + (0xCCED <= code && code <= 0xCD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH + (0xCD09 <= code && code <= 0xCD23) || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH + (0xCD25 <= code && code <= 0xCD3F) || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH + (0xCD41 <= code && code <= 0xCD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH + (0xCD5D <= code && code <= 0xCD77) || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH + (0xCD79 <= code && code <= 0xCD93) || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH + (0xCD95 <= code && code <= 0xCDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH + (0xCDB1 <= code && code <= 0xCDCB) || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH + (0xCDCD <= code && code <= 0xCDE7) || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH + (0xCDE9 <= code && code <= 0xCE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH + (0xCE05 <= code && code <= 0xCE1F) || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH + (0xCE21 <= code && code <= 0xCE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH + (0xCE3D <= code && code <= 0xCE57) || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH + (0xCE59 <= code && code <= 0xCE73) || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH + (0xCE75 <= code && code <= 0xCE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH + (0xCE91 <= code && code <= 0xCEAB) || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH + (0xCEAD <= code && code <= 0xCEC7) || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH + (0xCEC9 <= code && code <= 0xCEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH + (0xCEE5 <= code && code <= 0xCEFF) || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH + (0xCF01 <= code && code <= 0xCF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH + (0xCF1D <= code && code <= 0xCF37) || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH + (0xCF39 <= code && code <= 0xCF53) || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH + (0xCF55 <= code && code <= 0xCF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH + (0xCF71 <= code && code <= 0xCF8B) || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH + (0xCF8D <= code && code <= 0xCFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH + (0xCFA9 <= code && code <= 0xCFC3) || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH + (0xCFC5 <= code && code <= 0xCFDF) || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH + (0xCFE1 <= code && code <= 0xCFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH + (0xCFFD <= code && code <= 0xD017) || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH + (0xD019 <= code && code <= 0xD033) || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH + (0xD035 <= code && code <= 0xD04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH + (0xD051 <= code && code <= 0xD06B) || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH + (0xD06D <= code && code <= 0xD087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH + (0xD089 <= code && code <= 0xD0A3) || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH + (0xD0A5 <= code && code <= 0xD0BF) || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH + (0xD0C1 <= code && code <= 0xD0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH + (0xD0DD <= code && code <= 0xD0F7) || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH + (0xD0F9 <= code && code <= 0xD113) || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH + (0xD115 <= code && code <= 0xD12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH + (0xD131 <= code && code <= 0xD14B) || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH + (0xD14D <= code && code <= 0xD167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH + (0xD169 <= code && code <= 0xD183) || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH + (0xD185 <= code && code <= 0xD19F) || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH + (0xD1A1 <= code && code <= 0xD1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH + (0xD1BD <= code && code <= 0xD1D7) || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH + (0xD1D9 <= code && code <= 0xD1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH + (0xD1F5 <= code && code <= 0xD20F) || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH + (0xD211 <= code && code <= 0xD22B) || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH + (0xD22D <= code && code <= 0xD247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH + (0xD249 <= code && code <= 0xD263) || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH + (0xD265 <= code && code <= 0xD27F) || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH + (0xD281 <= code && code <= 0xD29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH + (0xD29D <= code && code <= 0xD2B7) || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH + (0xD2B9 <= code && code <= 0xD2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH + (0xD2D5 <= code && code <= 0xD2EF) || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH + (0xD2F1 <= code && code <= 0xD30B) || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH + (0xD30D <= code && code <= 0xD327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH + (0xD329 <= code && code <= 0xD343) || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH + (0xD345 <= code && code <= 0xD35F) || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH + (0xD361 <= code && code <= 0xD37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH + (0xD37D <= code && code <= 0xD397) || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH + (0xD399 <= code && code <= 0xD3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH + (0xD3B5 <= code && code <= 0xD3CF) || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH + (0xD3D1 <= code && code <= 0xD3EB) || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH + (0xD3ED <= code && code <= 0xD407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH + (0xD409 <= code && code <= 0xD423) || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH + (0xD425 <= code && code <= 0xD43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH + (0xD441 <= code && code <= 0xD45B) || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH + (0xD45D <= code && code <= 0xD477) || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH + (0xD479 <= code && code <= 0xD493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH + (0xD495 <= code && code <= 0xD4AF) || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH + (0xD4B1 <= code && code <= 0xD4CB) || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH + (0xD4CD <= code && code <= 0xD4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH + (0xD4E9 <= code && code <= 0xD503) || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH + (0xD505 <= code && code <= 0xD51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH + (0xD521 <= code && code <= 0xD53B) || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH + (0xD53D <= code && code <= 0xD557) || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH + (0xD559 <= code && code <= 0xD573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH + (0xD575 <= code && code <= 0xD58F) || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH + (0xD591 <= code && code <= 0xD5AB) || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH + (0xD5AD <= code && code <= 0xD5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH + (0xD5C9 <= code && code <= 0xD5E3) || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH + (0xD5E5 <= code && code <= 0xD5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH + (0xD601 <= code && code <= 0xD61B) || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH + (0xD61D <= code && code <= 0xD637) || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH + (0xD639 <= code && code <= 0xD653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH + (0xD655 <= code && code <= 0xD66F) || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH + (0xD671 <= code && code <= 0xD68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH + (0xD68D <= code && code <= 0xD6A7) || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH + (0xD6A9 <= code && code <= 0xD6C3) || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH + (0xD6C5 <= code && code <= 0xD6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH + (0xD6E1 <= code && code <= 0xD6FB) || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH + (0xD6FD <= code && code <= 0xD717) || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH + (0xD719 <= code && code <= 0xD733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH + (0xD735 <= code && code <= 0xD74F) || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH + (0xD751 <= code && code <= 0xD76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH + (0xD76D <= code && code <= 0xD787) || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH + (0xD789 <= code && code <= 0xD7A3) // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + ){ + return LVT; + } + + if( + 0x261D == code || // So WHITE UP POINTING INDEX + 0x26F9 == code || // So PERSON WITH BALL + (0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING HAND + 0x1F385 == code || // So FATHER CHRISTMAS + (0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] SNOWBOARDER..SURFER + 0x1F3C7 == code || // So HORSE RACING + (0x1F3CA <= code && code <= 0x1F3CC) || // So [3] SWIMMER..GOLFER + (0x1F442 <= code && code <= 0x1F443) || // So [2] EAR..NOSE + (0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN + 0x1F46E == code || // So POLICE OFFICER + (0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH VEIL..PRINCESS + 0x1F47C == code || // So BABY ANGEL + (0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK PERSON..DANCER + (0x1F485 <= code && code <= 0x1F487) || // So [3] NAIL POLISH..HAIRCUT + 0x1F4AA == code || // So FLEXED BICEPS + (0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY + 0x1F57A == code || // So MAN DANCING + 0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED + (0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + (0x1F645 <= code && code <= 0x1F647) || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY + (0x1F64B <= code && code <= 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS + 0x1F6A3 == code || // So ROWBOAT + (0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] BICYCLIST..PEDESTRIAN + 0x1F6C0 == code || // So BATH + 0x1F6CC == code || // So SLEEPING ACCOMMODATION + (0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST + (0x1F91E <= code && code <= 0x1F91F) || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN + 0x1F926 == code || // So FACE PALM + (0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT WOMAN..JUGGLING + (0x1F93D <= code && code <= 0x1F93E) || // So [2] WATER POLO..HANDBALL + (0x1F9D1 <= code && code <= 0x1F9DD) // So [13] ADULT..ELF + ){ + return E_Base; + } + + if( + (0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 + ){ + return E_Modifier; + } + + if( + 0x200D == code // Cf ZERO WIDTH JOINER + ){ + return ZWJ; + } + + if( + 0x2640 == code || // So FEMALE SIGN + 0x2642 == code || // So MALE SIGN + (0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF AESCULAPIUS..SCALES + 0x2708 == code || // So AIRPLANE + 0x2764 == code || // So HEAVY BLACK HEART + 0x1F308 == code || // So RAINBOW + 0x1F33E == code || // So EAR OF RICE + 0x1F373 == code || // So COOKING + 0x1F393 == code || // So GRADUATION CAP + 0x1F3A4 == code || // So MICROPHONE + 0x1F3A8 == code || // So ARTIST PALETTE + 0x1F3EB == code || // So SCHOOL + 0x1F3ED == code || // So FACTORY + 0x1F48B == code || // So KISS MARK + (0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL COMPUTER..BRIEFCASE + 0x1F527 == code || // So WRENCH + 0x1F52C == code || // So MICROSCOPE + 0x1F5E8 == code || // So LEFT SPEECH BUBBLE + 0x1F680 == code || // So ROCKET + 0x1F692 == code // So FIRE ENGINE + ){ + return Glue_After_Zwj; + } + + if( + (0x1F466 <= code && code <= 0x1F469) // So [4] BOY..WOMAN + ){ + return E_Base_GAZ; + } + + + //all unlisted characters have a grapheme break property of "Other" + return Other; + } + return this; +} + +if (typeof module != 'undefined' && module.exports) { + module.exports = GraphemeSplitter; +} diff --git a/node_modules/grapheme-splitter/package.json b/node_modules/grapheme-splitter/package.json new file mode 100644 index 000000000..61479af3d --- /dev/null +++ b/node_modules/grapheme-splitter/package.json @@ -0,0 +1,34 @@ +{ + "name": "grapheme-splitter", + "version": "1.0.4", + "description": "A JavaScript library that breaks strings into their individual user-perceived characters. It supports emojis!", + "homepage": "https://github.com/orling/grapheme-splitter", + "author": "Orlin Georgiev", + "contributors": [ + { + "name": "Lucas Tadeu Teixeira", + "email": "lucas@fastmail.nl", + "url": "https://lucas.is" + } + ], + "main": "index.js", + "license": "MIT", + "keywords": [ + "utf-8", + "strings", + "emoji", + "split" + ], + "scripts": { + "test": "tape tests/grapheme_splitter_tests.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/orling/grapheme-splitter.git" + }, + "bugs": "https://github.com/orling/grapheme-splitter/issues", + "dependencies": {}, + "devDependencies": { + "tape": "^4.6.3" + } +} diff --git a/node_modules/grapheme-splitter/tests/GraphemeBreakTest.txt b/node_modules/grapheme-splitter/tests/GraphemeBreakTest.txt new file mode 100644 index 000000000..3d0820bca --- /dev/null +++ b/node_modules/grapheme-splitter/tests/GraphemeBreakTest.txt @@ -0,0 +1,850 @@ +# GraphemeBreakTest-10.0.0.txt +# Date: 2017-04-14, 05:40:29 GMT +# © 2017 Unicode®, Inc. +# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# +# Unicode Character Database +# For documentation, see http://www.unicode.org/reports/tr44/ +# +# Default Grapheme_Cluster_Break Test +# +# Format: +# (# )? +# contains hex Unicode code points, with +# ÷ wherever there is a break opportunity, and +# × wherever there is not. +# the format can change, but currently it shows: +# - the sample character name +# - (x) the Grapheme_Cluster_Break property value for the sample character +# - [x] the rule that determines whether there is a break or not, +# as listed in the Rules section of GraphemeBreakTest.html +# +# These samples may be extended or changed in the future. +# +÷ 0020 ÷ 0020 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0020 × 0308 ÷ 0020 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0020 ÷ 000D ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (CR) ÷ [0.3] +÷ 0020 × 0308 ÷ 000D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0020 ÷ 000A ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (LF) ÷ [0.3] +÷ 0020 × 0308 ÷ 000A ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0020 ÷ 0001 ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0308 ÷ 0001 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0300 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0020 × 0308 × 0300 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0020 ÷ 0600 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0020 × 0308 ÷ 0600 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0020 × 0903 ÷ # ÷ [0.2] SPACE (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0020 × 0308 × 0903 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0020 ÷ 1100 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0020 × 0308 ÷ 1100 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0020 ÷ 1160 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0020 × 0308 ÷ 1160 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0020 ÷ 11A8 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0020 × 0308 ÷ 11A8 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0020 ÷ AC00 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0020 × 0308 ÷ AC00 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0020 ÷ AC01 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0020 × 0308 ÷ AC01 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0020 ÷ 1F1E6 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0020 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0020 ÷ 261D ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0020 × 0308 ÷ 261D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0020 ÷ 1F3FB ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0020 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0020 × 200D ÷ # ÷ [0.2] SPACE (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0020 × 0308 × 200D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0020 ÷ 2640 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0020 × 0308 ÷ 2640 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0020 ÷ 1F466 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0020 × 0308 ÷ 1F466 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0020 ÷ 0378 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] (Other) ÷ [0.3] +÷ 0020 × 0308 ÷ 0378 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0020 ÷ D800 ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0308 ÷ D800 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D ÷ 0020 ÷ # ÷ [0.2] (CR) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 000D ÷ 000D ÷ # ÷ [0.2] (CR) ÷ [4.0] (CR) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 000D × 000A ÷ # ÷ [0.2] (CR) × [3.0] (LF) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 000D ÷ 0001 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Control) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D ÷ 0300 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000D ÷ 0308 × 0300 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000D ÷ 0600 ÷ # ÷ [0.2] (CR) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000D ÷ 0903 ÷ # ÷ [0.2] (CR) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000D ÷ 0308 × 0903 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000D ÷ 1100 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000D ÷ 1160 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000D ÷ 11A8 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000D ÷ AC00 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000D ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000D ÷ AC01 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000D ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000D ÷ 1F1E6 ÷ # ÷ [0.2] (CR) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000D ÷ 261D ÷ # ÷ [0.2] (CR) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000D ÷ 1F3FB ÷ # ÷ [0.2] (CR) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000D ÷ 200D ÷ # ÷ [0.2] (CR) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000D ÷ 0308 × 200D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000D ÷ 2640 ÷ # ÷ [0.2] (CR) ÷ [4.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 2640 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 000D ÷ 1F466 ÷ # ÷ [0.2] (CR) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 000D ÷ 0378 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Other) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 000D ÷ D800 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Control) ÷ [0.3] +÷ 000D ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000A ÷ 0020 ÷ # ÷ [0.2] (LF) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 000A ÷ 000D ÷ # ÷ [0.2] (LF) ÷ [4.0] (CR) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 000A ÷ 000A ÷ # ÷ [0.2] (LF) ÷ [4.0] (LF) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 000A ÷ 0001 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Control) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000A ÷ 0300 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000A ÷ 0308 × 0300 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000A ÷ 0600 ÷ # ÷ [0.2] (LF) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 000A ÷ 0903 ÷ # ÷ [0.2] (LF) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000A ÷ 0308 × 0903 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000A ÷ 1100 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000A ÷ 1160 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000A ÷ 11A8 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000A ÷ AC00 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000A ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000A ÷ AC01 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000A ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000A ÷ 1F1E6 ÷ # ÷ [0.2] (LF) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 000A ÷ 261D ÷ # ÷ [0.2] (LF) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 000A ÷ 1F3FB ÷ # ÷ [0.2] (LF) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 000A ÷ 200D ÷ # ÷ [0.2] (LF) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000A ÷ 0308 × 200D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 000A ÷ 2640 ÷ # ÷ [0.2] (LF) ÷ [4.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 2640 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 000A ÷ 1F466 ÷ # ÷ [0.2] (LF) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 000A ÷ 0378 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Other) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 000A ÷ D800 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Control) ÷ [0.3] +÷ 000A ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0001 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] (CR) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0001 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] (LF) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0001 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0001 ÷ 0308 × 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0001 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0001 ÷ 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0001 ÷ 0308 × 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0001 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0001 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0001 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0001 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0001 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0001 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0001 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0001 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0001 ÷ 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0001 ÷ 0308 × 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0001 ÷ 2640 ÷ # ÷ [0.2] (Control) ÷ [4.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 2640 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0001 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0001 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Other) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0001 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 ÷ 0020 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0300 × 0308 ÷ 0020 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0300 ÷ 000D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0300 × 0308 ÷ 000D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0300 ÷ 000A ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0300 × 0308 ÷ 000A ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0300 ÷ 0001 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0308 ÷ 0001 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0300 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0300 × 0308 × 0300 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0300 ÷ 0600 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0300 × 0308 ÷ 0600 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0300 × 0903 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0300 × 0308 × 0903 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0300 ÷ 1100 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0300 × 0308 ÷ 1100 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0300 ÷ 1160 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0300 × 0308 ÷ 1160 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0300 ÷ 11A8 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0300 × 0308 ÷ 11A8 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0300 ÷ AC00 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0300 × 0308 ÷ AC00 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0300 ÷ AC01 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0300 × 0308 ÷ AC01 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0300 ÷ 1F1E6 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0300 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0300 ÷ 261D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0300 × 0308 ÷ 261D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0300 ÷ 1F3FB ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0300 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0300 × 200D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0300 × 0308 × 200D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0300 ÷ 2640 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0300 × 0308 ÷ 2640 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0300 ÷ 1F466 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0300 × 0308 ÷ 1F466 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0300 ÷ 0378 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0300 × 0308 ÷ 0378 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0300 ÷ D800 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0308 ÷ D800 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0020 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] SPACE (Other) ÷ [0.3] +÷ 0600 × 0308 ÷ 0020 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0600 ÷ 000D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0600 × 0308 ÷ 000D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0600 ÷ 000A ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0600 × 0308 ÷ 000A ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0600 ÷ 0001 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0308 ÷ 0001 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0300 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0600 × 0308 × 0300 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0600 × 0600 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0600 × 0308 ÷ 0600 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0600 × 0903 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0600 × 0308 × 0903 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0600 × 1100 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0600 × 0308 ÷ 1100 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0600 × 1160 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0600 × 0308 ÷ 1160 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0600 × 11A8 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0600 × 0308 ÷ 11A8 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0600 × AC00 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0600 × 0308 ÷ AC00 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0600 × AC01 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0600 × 0308 ÷ AC01 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0600 × 1F1E6 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0600 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0600 × 261D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0600 × 0308 ÷ 261D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0600 × 1F3FB ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0600 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0600 × 200D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0600 × 0308 × 200D ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0600 × 2640 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0600 × 0308 ÷ 2640 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0600 × 1F466 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] BOY (EBG) ÷ [0.3] +÷ 0600 × 0308 ÷ 1F466 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0600 × 0378 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.2] (Other) ÷ [0.3] +÷ 0600 × 0308 ÷ 0378 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0600 ÷ D800 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0600 × 0308 ÷ D800 ÷ # ÷ [0.2] ARABIC NUMBER SIGN (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 ÷ 0020 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0903 × 0308 ÷ 0020 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0903 ÷ 000D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (CR) ÷ [0.3] +÷ 0903 × 0308 ÷ 000D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0903 ÷ 000A ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (LF) ÷ [0.3] +÷ 0903 × 0308 ÷ 000A ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0903 ÷ 0001 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0308 ÷ 0001 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0300 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0903 × 0308 × 0300 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0903 ÷ 0600 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0903 × 0308 ÷ 0600 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0903 × 0903 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0903 × 0308 × 0903 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0903 ÷ 1100 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0903 × 0308 ÷ 1100 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0903 ÷ 1160 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0903 × 0308 ÷ 1160 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0903 ÷ 11A8 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0903 × 0308 ÷ 11A8 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0903 ÷ AC00 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0903 × 0308 ÷ AC00 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0903 ÷ AC01 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0903 × 0308 ÷ AC01 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0903 ÷ 1F1E6 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0903 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0903 ÷ 261D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0903 × 0308 ÷ 261D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0903 ÷ 1F3FB ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0903 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0903 × 200D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0903 × 0308 × 200D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0903 ÷ 2640 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0903 × 0308 ÷ 2640 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0903 ÷ 1F466 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0903 × 0308 ÷ 1F466 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0903 ÷ 0378 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] (Other) ÷ [0.3] +÷ 0903 × 0308 ÷ 0378 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0903 ÷ D800 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0308 ÷ D800 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 ÷ 0020 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 ÷ 000D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (CR) ÷ [0.3] +÷ 1100 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1100 ÷ 000A ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (LF) ÷ [0.3] +÷ 1100 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1100 ÷ 0001 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0300 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1100 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1100 ÷ 0600 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1100 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1100 × 0903 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1100 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1100 × 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1100 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1100 × 1160 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1100 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1100 ÷ 11A8 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1100 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1100 × AC00 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1100 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1100 × AC01 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1100 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1100 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1100 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1100 ÷ 261D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1100 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1100 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1100 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1100 × 200D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1100 × 0308 × 200D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1100 ÷ 2640 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1100 × 0308 ÷ 2640 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1100 ÷ 1F466 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1100 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1100 ÷ 0378 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] (Other) ÷ [0.3] +÷ 1100 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1100 ÷ D800 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 ÷ 0020 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1160 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1160 ÷ 000D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (CR) ÷ [0.3] +÷ 1160 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1160 ÷ 000A ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (LF) ÷ [0.3] +÷ 1160 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1160 ÷ 0001 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0300 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1160 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1160 ÷ 0600 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1160 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1160 × 0903 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1160 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1160 ÷ 1100 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1160 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1160 × 1160 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [7.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1160 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1160 × 11A8 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1160 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1160 ÷ AC00 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1160 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1160 ÷ AC01 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1160 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1160 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1160 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1160 ÷ 261D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1160 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1160 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1160 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1160 × 200D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1160 × 0308 × 200D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1160 ÷ 2640 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1160 × 0308 ÷ 2640 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1160 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1160 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1160 ÷ 0378 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] (Other) ÷ [0.3] +÷ 1160 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1160 ÷ D800 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 ÷ 0020 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 11A8 ÷ 000D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (CR) ÷ [0.3] +÷ 11A8 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 11A8 ÷ 000A ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (LF) ÷ [0.3] +÷ 11A8 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 11A8 ÷ 0001 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0300 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 11A8 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 11A8 ÷ 0600 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 11A8 × 0903 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 11A8 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 11A8 ÷ 1160 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 11A8 × 11A8 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 11A8 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 11A8 ÷ AC00 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 11A8 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 11A8 ÷ AC01 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 11A8 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 11A8 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 11A8 ÷ 261D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 11A8 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 11A8 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 11A8 × 200D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 11A8 × 0308 × 200D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 11A8 ÷ 2640 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 11A8 × 0308 ÷ 2640 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 11A8 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 11A8 ÷ 0378 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] (Other) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 11A8 ÷ D800 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC00 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC00 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (CR) ÷ [0.3] +÷ AC00 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ AC00 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (LF) ÷ [0.3] +÷ AC00 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ AC00 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC00 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC00 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC00 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC00 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC00 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC00 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC00 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC00 × 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC00 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC00 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC00 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC00 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC00 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC00 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC00 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC00 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC00 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC00 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC00 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC00 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC00 × 0308 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC00 ÷ 2640 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ AC00 × 0308 ÷ 2640 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ AC00 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC00 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC00 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] (Other) ÷ [0.3] +÷ AC00 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ AC00 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC01 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC01 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (CR) ÷ [0.3] +÷ AC01 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ AC01 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (LF) ÷ [0.3] +÷ AC01 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ AC01 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC01 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC01 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC01 × 0308 ÷ 0600 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ AC01 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC01 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC01 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC01 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC01 × 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC01 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC01 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC01 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC01 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC01 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC01 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC01 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ AC01 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC01 × 0308 ÷ 261D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ AC01 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC01 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ AC01 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC01 × 0308 × 200D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ AC01 ÷ 2640 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ AC01 × 0308 ÷ 2640 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ AC01 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC01 × 0308 ÷ 1F466 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ AC01 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] (Other) ÷ [0.3] +÷ AC01 × 0308 ÷ 0378 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ AC01 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0308 ÷ D800 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 ÷ 0020 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0020 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F1E6 ÷ 000D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 000D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F1E6 ÷ 000A ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 000A ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F1E6 ÷ 0001 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0001 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 × 0300 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F1E6 × 0308 × 0300 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F1E6 ÷ 0600 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0600 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F1E6 × 0903 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F1E6 × 0308 × 0903 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F1E6 ÷ 1100 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1100 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F1E6 ÷ 1160 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1160 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F1E6 ÷ 11A8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 11A8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F1E6 ÷ AC00 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ AC00 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F1E6 ÷ AC01 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ AC01 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F1E6 × 1F1E6 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [12.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F1E6 ÷ 261D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 261D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F1E6 ÷ 1F3FB ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F1E6 × 200D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F1E6 × 0308 × 200D ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F1E6 ÷ 2640 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 2640 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1F1E6 ÷ 1F466 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 1F466 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F1E6 ÷ 0378 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ 0378 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F1E6 ÷ D800 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F1E6 × 0308 ÷ D800 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D ÷ 0020 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 261D × 0308 ÷ 0020 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 261D ÷ 000D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (CR) ÷ [0.3] +÷ 261D × 0308 ÷ 000D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 261D ÷ 000A ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (LF) ÷ [0.3] +÷ 261D × 0308 ÷ 000A ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 261D ÷ 0001 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D × 0308 ÷ 0001 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D × 0300 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 261D × 0308 × 0300 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 261D ÷ 0600 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 261D × 0308 ÷ 0600 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 261D × 0903 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 261D × 0308 × 0903 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 261D ÷ 1100 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 261D × 0308 ÷ 1100 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 261D ÷ 1160 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 261D × 0308 ÷ 1160 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 261D ÷ 11A8 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 261D × 0308 ÷ 11A8 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 261D ÷ AC00 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 261D × 0308 ÷ AC00 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 261D ÷ AC01 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 261D × 0308 ÷ AC01 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 261D ÷ 1F1E6 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 261D × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 261D ÷ 261D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 261D × 0308 ÷ 261D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 261D × 1F3FB ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 261D × 0308 × 1F3FB ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 261D × 200D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 261D × 0308 × 200D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 261D ÷ 2640 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 261D × 0308 ÷ 2640 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 261D ÷ 1F466 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 261D × 0308 ÷ 1F466 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 261D ÷ 0378 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [999.0] (Other) ÷ [0.3] +÷ 261D × 0308 ÷ 0378 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 261D ÷ D800 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) ÷ [5.0] (Control) ÷ [0.3] +÷ 261D × 0308 ÷ D800 ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB ÷ 0020 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0020 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F3FB ÷ 000D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 000D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F3FB ÷ 000A ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 000A ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F3FB ÷ 0001 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0001 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB × 0300 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F3FB × 0308 × 0300 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F3FB ÷ 0600 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0600 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F3FB × 0903 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F3FB × 0308 × 0903 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F3FB ÷ 1100 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1100 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F3FB ÷ 1160 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1160 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F3FB ÷ 11A8 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 11A8 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F3FB ÷ AC00 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F3FB × 0308 ÷ AC00 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F3FB ÷ AC01 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F3FB × 0308 ÷ AC01 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F3FB ÷ 1F1E6 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F3FB ÷ 261D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 261D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F3FB ÷ 1F3FB ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1F3FB ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F3FB × 200D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F3FB × 0308 × 200D ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F3FB ÷ 2640 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 2640 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1F3FB ÷ 1F466 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 1F466 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F3FB ÷ 0378 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F3FB × 0308 ÷ 0378 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F3FB ÷ D800 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F3FB × 0308 ÷ D800 ÷ # ÷ [0.2] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D ÷ 0020 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 200D × 0308 ÷ 0020 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 200D ÷ 000D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (CR) ÷ [0.3] +÷ 200D × 0308 ÷ 000D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 200D ÷ 000A ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (LF) ÷ [0.3] +÷ 200D × 0308 ÷ 000A ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 200D ÷ 0001 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D × 0308 ÷ 0001 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D × 0300 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 200D × 0308 × 0300 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 200D ÷ 0600 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 200D × 0308 ÷ 0600 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 200D × 0903 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 200D × 0308 × 0903 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 200D ÷ 1100 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 200D × 0308 ÷ 1100 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 200D ÷ 1160 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 200D × 0308 ÷ 1160 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 200D ÷ 11A8 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 200D × 0308 ÷ 11A8 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 200D ÷ AC00 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 200D × 0308 ÷ AC00 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 200D ÷ AC01 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 200D × 0308 ÷ AC01 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 200D ÷ 1F1E6 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 200D × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 200D ÷ 261D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 200D × 0308 ÷ 261D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 200D ÷ 1F3FB ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 0308 ÷ 1F3FB ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 200D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 200D × 0308 × 200D ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 200D × 2640 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 200D × 0308 ÷ 2640 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 200D × 1F466 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] BOY (EBG) ÷ [0.3] +÷ 200D × 0308 ÷ 1F466 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 200D ÷ 0378 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] (Other) ÷ [0.3] +÷ 200D × 0308 ÷ 0378 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 200D ÷ D800 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) ÷ [5.0] (Control) ÷ [0.3] +÷ 200D × 0308 ÷ D800 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 2640 ÷ 0020 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 2640 × 0308 ÷ 0020 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 2640 ÷ 000D ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [5.0] (CR) ÷ [0.3] +÷ 2640 × 0308 ÷ 000D ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 2640 ÷ 000A ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [5.0] (LF) ÷ [0.3] +÷ 2640 × 0308 ÷ 000A ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 2640 ÷ 0001 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [5.0] (Control) ÷ [0.3] +÷ 2640 × 0308 ÷ 0001 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 2640 × 0300 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 2640 × 0308 × 0300 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 2640 ÷ 0600 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 2640 × 0308 ÷ 0600 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 2640 × 0903 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 2640 × 0308 × 0903 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 2640 ÷ 1100 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 2640 × 0308 ÷ 1100 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 2640 ÷ 1160 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 2640 × 0308 ÷ 1160 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 2640 ÷ 11A8 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 2640 × 0308 ÷ 11A8 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 2640 ÷ AC00 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 2640 × 0308 ÷ AC00 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 2640 ÷ AC01 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 2640 × 0308 ÷ AC01 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 2640 ÷ 1F1E6 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 2640 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 2640 ÷ 261D ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 2640 × 0308 ÷ 261D ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 2640 ÷ 1F3FB ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 2640 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 2640 × 200D ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 2640 × 0308 × 200D ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 2640 ÷ 2640 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 2640 × 0308 ÷ 2640 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 2640 ÷ 1F466 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 2640 × 0308 ÷ 1F466 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 2640 ÷ 0378 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [999.0] (Other) ÷ [0.3] +÷ 2640 × 0308 ÷ 0378 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 2640 ÷ D800 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) ÷ [5.0] (Control) ÷ [0.3] +÷ 2640 × 0308 ÷ D800 ÷ # ÷ [0.2] FEMALE SIGN (Glue_After_Zwj) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 ÷ 0020 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0020 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1F466 ÷ 000D ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F466 × 0308 ÷ 000D ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1F466 ÷ 000A ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F466 × 0308 ÷ 000A ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1F466 ÷ 0001 ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0001 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 × 0300 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F466 × 0308 × 0300 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1F466 ÷ 0600 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0600 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 1F466 × 0903 ÷ # ÷ [0.2] BOY (EBG) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F466 × 0308 × 0903 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1F466 ÷ 1100 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1100 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F466 ÷ 1160 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1160 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1F466 ÷ 11A8 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F466 × 0308 ÷ 11A8 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1F466 ÷ AC00 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F466 × 0308 ÷ AC00 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1F466 ÷ AC01 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F466 × 0308 ÷ AC01 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1F466 ÷ 1F1E6 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 1F466 ÷ 261D ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F466 × 0308 ÷ 261D ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F466 × 1F3FB ÷ # ÷ [0.2] BOY (EBG) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F466 × 0308 × 1F3FB ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 1F466 × 200D ÷ # ÷ [0.2] BOY (EBG) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F466 × 0308 × 200D ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 1F466 ÷ 2640 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1F466 × 0308 ÷ 2640 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 1F466 ÷ 1F466 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F466 × 0308 ÷ 1F466 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 1F466 ÷ 0378 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F466 × 0308 ÷ 0378 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 1F466 ÷ D800 ÷ # ÷ [0.2] BOY (EBG) ÷ [5.0] (Control) ÷ [0.3] +÷ 1F466 × 0308 ÷ D800 ÷ # ÷ [0.2] BOY (EBG) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 ÷ 0020 ÷ # ÷ [0.2] (Other) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0378 × 0308 ÷ 0020 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0378 ÷ 000D ÷ # ÷ [0.2] (Other) ÷ [5.0] (CR) ÷ [0.3] +÷ 0378 × 0308 ÷ 000D ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0378 ÷ 000A ÷ # ÷ [0.2] (Other) ÷ [5.0] (LF) ÷ [0.3] +÷ 0378 × 0308 ÷ 000A ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0378 ÷ 0001 ÷ # ÷ [0.2] (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 × 0308 ÷ 0001 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 × 0300 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0378 × 0308 × 0300 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0378 ÷ 0600 ÷ # ÷ [0.2] (Other) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0378 × 0308 ÷ 0600 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ 0378 × 0903 ÷ # ÷ [0.2] (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0378 × 0308 × 0903 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0378 ÷ 1100 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0378 × 0308 ÷ 1100 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0378 ÷ 1160 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0378 × 0308 ÷ 1160 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0378 ÷ 11A8 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0378 × 0308 ÷ 11A8 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0378 ÷ AC00 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0378 × 0308 ÷ AC00 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0378 ÷ AC01 ÷ # ÷ [0.2] (Other) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0378 × 0308 ÷ AC01 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0378 ÷ 1F1E6 ÷ # ÷ [0.2] (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0378 × 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ 0378 ÷ 261D ÷ # ÷ [0.2] (Other) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0378 × 0308 ÷ 261D ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 0378 ÷ 1F3FB ÷ # ÷ [0.2] (Other) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0378 × 0308 ÷ 1F3FB ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 0378 × 200D ÷ # ÷ [0.2] (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0378 × 0308 × 200D ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0378 ÷ 2640 ÷ # ÷ [0.2] (Other) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0378 × 0308 ÷ 2640 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 0378 ÷ 1F466 ÷ # ÷ [0.2] (Other) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0378 × 0308 ÷ 1F466 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ 0378 ÷ 0378 ÷ # ÷ [0.2] (Other) ÷ [999.0] (Other) ÷ [0.3] +÷ 0378 × 0308 ÷ 0378 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ 0378 ÷ D800 ÷ # ÷ [0.2] (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0378 × 0308 ÷ D800 ÷ # ÷ [0.2] (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ D800 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ D800 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] (CR) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ D800 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] (LF) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ D800 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ D800 ÷ 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ D800 ÷ 0308 × 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ D800 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0600 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) ÷ [0.3] +÷ D800 ÷ 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ D800 ÷ 0308 × 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ D800 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ D800 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ D800 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ D800 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ D800 ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ D800 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ D800 ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ D800 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1F1E6 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3] +÷ D800 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 261D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ D800 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1F3FB ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ D800 ÷ 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ D800 ÷ 0308 × 200D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ D800 ÷ 2640 ÷ # ÷ [0.2] (Control) ÷ [4.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 2640 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ D800 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] BOY (EBG) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 1F466 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] BOY (EBG) ÷ [0.3] +÷ D800 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Other) ÷ [0.3] +÷ D800 ÷ 0308 ÷ 0378 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] (Other) ÷ [0.3] +÷ D800 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ D800 ÷ 0308 ÷ D800 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D × 000A ÷ 0061 ÷ 000A ÷ 0308 ÷ # ÷ [0.2] (CR) × [3.0] (LF) ÷ [4.0] LATIN SMALL LETTER A (Other) ÷ [5.0] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [0.3] +÷ 0061 × 0308 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [0.3] +÷ 0020 × 200D ÷ 0646 ÷ # ÷ [0.2] SPACE (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] ARABIC LETTER NOON (Other) ÷ [0.3] +÷ 0646 × 200D ÷ 0020 ÷ # ÷ [0.2] ARABIC LETTER NOON (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 × 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 × 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1F1E6 × 1F1E7 ÷ 1F1E8 ÷ 0062 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 1F1E7 ÷ 1F1E8 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 1F1E7 × 200D ÷ 1F1E8 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 200D ÷ 1F1E7 × 1F1E8 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 1F1E6 × 1F1E7 ÷ 1F1E8 × 1F1E9 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER B (RI) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER C (RI) × [13.0] REGIONAL INDICATOR SYMBOL LETTER D (RI) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 × 200D ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.0] ZERO WIDTH JOINER (ZWJ) ÷ [0.3] +÷ 0061 × 0308 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 × 0903 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 0061 ÷ 0600 × 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (Other) ÷ [999.0] ARABIC NUMBER SIGN (Prepend) × [9.2] LATIN SMALL LETTER B (Other) ÷ [0.3] +÷ 261D × 1F3FB ÷ 261D ÷ # ÷ [0.2] WHITE UP POINTING INDEX (E_Base) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [999.0] WHITE UP POINTING INDEX (E_Base) ÷ [0.3] +÷ 1F466 × 1F3FB ÷ # ÷ [0.2] BOY (EBG) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 1F466 × 1F3FB ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] BOY (EBG) × [10.0] EMOJI MODIFIER FITZPATRICK TYPE-1-2 (E_Modifier) ÷ [0.3] +÷ 200D × 2640 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] FEMALE SIGN (Glue_After_Zwj) ÷ [0.3] +÷ 200D × 1F466 ÷ # ÷ [0.2] ZERO WIDTH JOINER (ZWJ) × [11.0] BOY (EBG) ÷ [0.3] +÷ 1F466 ÷ 1F466 ÷ # ÷ [0.2] BOY (EBG) ÷ [999.0] BOY (EBG) ÷ [0.3] +# +# Lines: 822 +# +# EOF diff --git a/node_modules/grapheme-splitter/tests/grapheme_splitter_tests.js b/node_modules/grapheme-splitter/tests/grapheme_splitter_tests.js new file mode 100644 index 000000000..3cba5599f --- /dev/null +++ b/node_modules/grapheme-splitter/tests/grapheme_splitter_tests.js @@ -0,0 +1,83 @@ +const fs = require('fs') +const test = require('tape') + +const GraphemeSplitter = require('../index') + +function ucs2encode(array) { + return array.map( value => { + let output = ''; + + if (value > 0xFFFF) { + value -= 0x10000; + output += String.fromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + + output += String.fromCharCode(value); + return output; + }).join(''); +} + +function testDataFromLine(line) { + const codePoints = line.split(/\s*[×÷]\s*/).map(c => parseInt(c, 16)); + const input = ucs2encode(codePoints); + + const expected = line.split(/\s*÷\s*/) .map(sequence => { + const codePoints = sequence.split(/\s*×\s*/).map(c => parseInt(c, 16)) + return ucs2encode(codePoints) + }); + + return { input, expected }; +} + +const testData = fs.readFileSync('tests/GraphemeBreakTest.txt', 'utf-8') + .split('\n') + .filter(line => + line != null && line.length > 0 && !line.startsWith('#')) + .map(line => line.split('#')[0]) + .map(testDataFromLine); + +// --------------------------------------------------------------------------- +// Test cases +// --------------------------------------------------------------------------- +test('splitGraphemes returns properly split list from string', t => { + const splitter = new GraphemeSplitter(); + + t.plan(testData.length); + + testData.forEach( ({ input, expected }) => { + const result = splitter.splitGraphemes(input); + + t.deepLooseEqual(result, expected); + }); + + t.end(); +}); + +test('iterateGraphemes returns properly split iterator from string', t => { + const splitter = new GraphemeSplitter(); + + t.plan(testData.length); + + testData.forEach( ({ input, expected }) => { + const result = splitter.iterateGraphemes(input); + + t.deepLooseEqual([...result], expected); + }); + + t.end(); +}); + +test('countGraphemes returns the correct number of graphemes in string', t => { + const splitter = new GraphemeSplitter(); + + t.plan(testData.length); + + testData.forEach( ({ input, expected }) => { + const result = splitter.countGraphemes(input); + + t.equal(result, expected.length); + }); + + t.end(); +}); diff --git a/node_modules/ignore/CHANGELOG.md b/node_modules/ignore/CHANGELOG.md deleted file mode 100644 index 2b250132c..000000000 --- a/node_modules/ignore/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -# `node-ignore` 4 ChangeLog - -# 4.x - -## 2018-06-22, Version 4.0.0 - -- **SEMVER-MAJOR**: Drop support for node < 6 by default. -- **FEATURE**: supports the missing character ranges and sets, such as `*.[a-z]` and `*.[jJ][pP][gG]` -- **FEATURE**: new option: `ignorecase` to make `ignore` case sensitive. -- **FEATURE**: supports question mark which matches a single character. -- **PATCH**: fixes typescript declaration. - -## ~ 2018-08-09, Version 4.0.1 - 4.0.5 - -- **PATCH**: updates README.md about frequent asked quesions from github issues. - -## 2018-08-12, Version 4.0.6 - -- **PATCH**: `Object.prototype` methods will not ruin the result any more. diff --git a/node_modules/ignore/LICENSE-MIT b/node_modules/ignore/LICENSE-MIT old mode 100755 new mode 100644 diff --git a/node_modules/ignore/README.md b/node_modules/ignore/README.md old mode 100755 new mode 100644 index c4d8230cc..50d88822a --- a/node_modules/ignore/README.md +++ b/node_modules/ignore/README.md @@ -8,9 +8,9 @@ - + Build Status @@ -35,11 +35,19 @@ # ignore -`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore). -Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. +`ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore). -##### Tested on +Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec. + +To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`. + +To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way. + +### Tested on + +`ignore` is fully tested, and has more than **five hundreds** of unit tests. - Linux + Node: `0.8` - `7.x` - Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. @@ -52,10 +60,15 @@ Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in no - [Usage](#usage) - [`Pathname` Conventions](#pathname-conventions) -- [Guide for 2.x -> 3.x](#upgrade-2x---3x) -- [Guide for 3.x -> 4.x](#upgrade-3x---4x) - See Also: - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. +- [Upgrade Guide](#upgrade-guide) + +## Install + +```sh +npm i ignore +``` ## Usage @@ -123,7 +136,7 @@ Notice that a line starting with `'#'`(hash) is treated as a comment. Put a back ```js ignore().add('#abc').ignores('#abc') // false -ignore().add('\#abc').ignores('#abc') // true +ignore().add('\\#abc').ignores('#abc') // true ``` `pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: @@ -152,7 +165,7 @@ if (fs.existsSync(filename)) { instead. -## .filter(paths: Array): Array +## .filter(paths: Array<Pathname>): Array<Pathname> ```ts type Pathname = string @@ -166,13 +179,13 @@ Filters the given array of pathnames, and returns the filtered array. #### 1. `Pathname` should be a `path.relative()`d pathname -`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. +`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory, ```js -// WRONG +// WRONG, an error will be thrown ig.ignores('./abc') -// WRONG, for it will never happen. +// WRONG, for it will never happen, and an error will be thrown // If the gitignore rule locates at the root directory, // `'/abc'` should be changed to `'abc'`. // ``` @@ -180,6 +193,9 @@ ig.ignores('./abc') // ``` ig.ignores('/abc') +// WRONG, that it is an absolute path on Windows, an error will be thrown +ig.ignores('C:\\abc') + // Right ig.ignores('abc') @@ -212,6 +228,26 @@ Then the `paths` might be like this: ] ``` +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so for the example below: + +```js +// First, we add a ignore pattern to ignore a directory +ig.add('config/') + +// `ig` does NOT know if 'config', in the real world, +// is a normal file, directory or something. + +ig.ignores('config') +// `ig` treats `config` as a file, so it returns `false` + +ig.ignores('config/') +// returns `true` +``` + +Specially for people who develop some library based on `node-ignore`, it is important to understand that. + Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: ```js @@ -230,21 +266,6 @@ glob('**', { }) ``` -#### 2. filenames and dirnames - -`node-ignore` does NO `fs.stat` during path matching, so for the example below: - -```js -ig.add('config/') - -// `ig` does NOT know if 'config' is a normal file, directory or something -ig.ignores('config') // And it returns `false` - -ig.ignores('config/') // returns `true` -``` - -Specially for people who develop some library based on `node-ignore`, it is important to understand that. - ## .ignores(pathname: Pathname): boolean > new in 3.2.0 @@ -261,9 +282,37 @@ Creates a filter function which could filter an array of paths with `Array.proto Returns `function(path)` the filter function. -## `options.ignorecase` since 4.0.0 +## .test(pathname: Pathname) since 5.0.0 + +Returns `TestResult` + +```ts +interface TestResult { + ignored: boolean + // true if the `pathname` is finally unignored by some negative pattern + unignored: boolean +} +``` + +- `{ignored: true, unignored: false}`: the `pathname` is ignored +- `{ignored: false, unignored: true}`: the `pathname` is unignored +- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules. + +## static `ignore.isPathValid(pathname): boolean` since 5.0.0 + +Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname). -Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (default value), otherwise case sensitive. +This method is **NOT** used to check if an ignore pattern is valid. + +```js +ignore.isPathValid('./foo') // false +``` + +## ignore(options) + +### `options.ignorecase` since 4.0.0 + +Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive. ```js const ig = ignore({ @@ -275,15 +324,65 @@ ig.add('*.png') ig.ignores('*.PNG') // false ``` +### `options.ignoreCase?: boolean` since 5.2.0 + +Which is alternative to `options.ignoreCase` + +### `options.allowRelativePaths?: boolean` since 5.2.0 + +This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions). + +However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior + +```js +ignore({ + allowRelativePaths: true +}).ignores('../foo/bar.js') // And it will not throw +``` + **** # Upgrade Guide -## Upgrade 2.x -> 3.x +## Upgrade 4.x -> 5.x -- All `options` of 2.x are unnecessary and removed, so just remove them. -- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. -- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. +Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory. + +While `ignore < 5.0.0` did not make sure what the return value was, as well as + +```ts +.ignores(pathname: Pathname): boolean + +.filter(pathnames: Array): Array + +.createFilter(): (pathname: Pathname) => boolean + +.test(pathname: Pathname): {ignored: boolean, unignored: boolean} +``` + +See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details. + +If there are invalid pathnames, the conversion and filtration should be done by users. + +```js +import {isPathValid} from 'ignore' // introduced in 5.0.0 + +const paths = [ + // invalid + ////////////////// + '', + false, + '../foo', + '.', + ////////////////// + + // valid + 'foo' +] +.filter(isValidPath) + +ig.filter(paths) +``` ## Upgrade 3.x -> 4.x @@ -293,6 +392,12 @@ Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node var ignore = require('ignore/legacy') ``` +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + **** # Collaborators diff --git a/node_modules/ignore/index.d.ts b/node_modules/ignore/index.d.ts index be9d5f8ea..520eafa77 100644 --- a/node_modules/ignore/index.d.ts +++ b/node_modules/ignore/index.d.ts @@ -1,16 +1,17 @@ -interface Ignore { - /** - * Adds a rule rules to the current manager. - * @param {string | Ignore} pattern - * @returns IgnoreBase - */ - add(pattern: string | Ignore): Ignore +type Pathname = string + +interface TestResult { + ignored: boolean + unignored: boolean +} + +export interface Ignore { /** - * Adds several rules to the current manager. + * Adds one or several rules to the current manager. * @param {string[]} patterns * @returns IgnoreBase */ - add(patterns: (string | Ignore)[]): Ignore + add(patterns: string | Ignore | readonly (string | Ignore)[]): this /** * Filters the given array of pathnames, and returns the filtered array. @@ -18,23 +19,34 @@ interface Ignore { * @param paths the array of paths to be filtered. * @returns The filtered array of paths */ - filter(paths: string[]): string[] + filter(pathnames: readonly Pathname[]): Pathname[] + /** * Creates a filter function which could filter * an array of paths with Array.prototype.filter. */ - createFilter(): (path: string) => boolean + createFilter(): (pathname: Pathname) => boolean /** * Returns Boolean whether pathname should be ignored. * @param {string} pathname a path to check * @returns boolean */ - ignores(pathname: string): boolean + ignores(pathname: Pathname): boolean + + /** + * Returns whether pathname should be ignored or unignored + * @param {string} pathname a path to check + * @returns TestResult + */ + test(pathname: Pathname): TestResult } interface Options { ignorecase?: boolean + // For compatibility + ignoreCase?: boolean + allowRelativePaths?: boolean } /** @@ -42,4 +54,8 @@ interface Options { */ declare function ignore(options?: Options): Ignore +declare namespace ignore { + export function isPathValid (pathname: string): boolean +} + export default ignore diff --git a/node_modules/ignore/index.js b/node_modules/ignore/index.js old mode 100755 new mode 100644 index 62c5cf71e..a25577f7f --- a/node_modules/ignore/index.js +++ b/node_modules/ignore/index.js @@ -1,24 +1,42 @@ // A simple implementation of make-array -function make_array (subject) { +function makeArray (subject) { return Array.isArray(subject) ? subject : [subject] } -const REGEX_BLANK_LINE = /^\s+$/ -const REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/ -const REGEX_LEADING_EXCAPED_HASH = /^\\#/ +const EMPTY = '' +const SPACE = ' ' +const ESCAPE = '\\' +const REGEX_TEST_BLANK_LINE = /^\s+$/ +const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/ +const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/ +const REGEX_SPLITALL_CRLF = /\r?\n/g +// /foo, +// ./foo, +// ../foo, +// . +// .. +const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/ + const SLASH = '/' -const KEY_IGNORE = typeof Symbol !== 'undefined' - ? Symbol.for('node-ignore') - /* istanbul ignore next */ - : 'node-ignore' + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +let TMP_KEY_IGNORE = 'node-ignore' +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol.for('node-ignore') +} +const KEY_IGNORE = TMP_KEY_IGNORE const define = (object, key, value) => Object.defineProperty(object, key, {value}) const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g +const RETURN_FALSE = () => false + // Sanitize the range of a regular expression // The cases are complicated, see test cases for details const sanitizeRange = range => range.replace( @@ -27,9 +45,15 @@ const sanitizeRange = range => range.replace( ? match // Invalid range (out of order) which is ok for gitignore rules but // fatal for JavaScript regular expression, so eliminate it. - : '' + : EMPTY ) +// See fixtures #59 +const cleanRangeBackSlash = slashes => { + const {length} = slashes + return slashes.slice(0, length - length % 2) +} + // > If the pattern ends with a slash, // > it is removed for the purpose of the following description, // > but it would only find a match with a directory. @@ -41,7 +65,7 @@ const sanitizeRange = range => range.replace( // you could use option `mark: true` with `glob` // '`foo/`' should not continue with the '`..`' -const DEFAULT_REPLACER_PREFIX = [ +const REPLACERS = [ // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ @@ -50,14 +74,14 @@ const DEFAULT_REPLACER_PREFIX = [ // (a \ ) -> (a ) /\\?\s+$/, match => match.indexOf('\\') === 0 - ? ' ' - : '' + ? SPACE + : EMPTY ], // replace (\ ) with ' ' [ /\\\s/g, - () => ' ' + () => SPACE ], // Escape metacharacters @@ -78,19 +102,10 @@ const DEFAULT_REPLACER_PREFIX = [ // > - the opening curly brace {, // > These special characters are often called "metacharacters". [ - /[\\^$.|*+(){]/g, + /[\\$.|*+(){^]/g, match => `\\${match}` ], - [ - // > [abc] matches any character inside the brackets - // > (in this case a, b, or c); - /\[([^\]/]*)($|\])/g, - (match, p1, p2) => p2 === ']' - ? `[${sanitizeRange(p1)}]` - : `\\${match}` - ], - [ // > a question mark (?) matches a single character /(?!\\)\?/g, @@ -124,10 +139,8 @@ const DEFAULT_REPLACER_PREFIX = [ // '**/foo' <-> 'foo' () => '^(?:.*\\/)?' - ] -] + ], -const DEFAULT_REPLACER_SUFFIX = [ // starting [ // there will be no leading '/' @@ -135,11 +148,20 @@ const DEFAULT_REPLACER_SUFFIX = [ // If starts with '**', adding a '^' to the regular expression also works /^(?=[^^])/, function startingReplacer () { + // If has a slash `/` at the beginning or middle return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 // > If the pattern does not contain a slash /, // > Git treats it as a shell glob pattern // Actually, if there is only a trailing slash, // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. ? '(?:^|\\/)' // > Otherwise, Git treats the pattern as a shell glob suitable for @@ -157,7 +179,7 @@ const DEFAULT_REPLACER_SUFFIX = [ // should not use '*', or it will be replaced by the next replacer // Check if it is not the last `'/**'` - (match, index, str) => index + 6 < str.length + (_, index, str) => index + 6 < str.length // case: /**/ // > A slash followed by two consecutive asterisks then a slash matches @@ -173,130 +195,159 @@ const DEFAULT_REPLACER_SUFFIX = [ : '\\/.+' ], - // intermediate wildcards + // normal intermediate wildcards [ // Never replace escaped '*' // ignore rule '\*' will match the path '*' // 'abc.*/' -> go - // 'abc.*' -> skip this rule - /(^|[^\\]+)\\\*(?=.+)/g, + // 'abc.*' -> skip this rule, + // coz trailing single wildcard will be handed by [trailing wildcard] + /(^|[^\\]+)(\\\*)+(?=.+)/g, // '*.js' matches '.js' // '*.js' doesn't match 'abc' - (match, p1) => `${p1}[^\\/]*` + (_, p1, p2) => { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + const unescaped = p2.replace(/\\\*/g, '[^\\/]*') + return p1 + unescaped + } ], - // trailing wildcard [ - /(\^|\\\/)?\\\*$/, - (match, p1) => { - const prefix = p1 - // '\^': - // '/*' does not match '' - // '/*' does not match everything - - // '\\\/': - // 'abc/*' does not match 'abc/' - ? `${p1}[^/]+` - - // 'a*' matches 'a' - // 'a*' matches 'aa' - : '[^/]*' - - return `${prefix}(?=$|\\/$)` - } + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE ], [ - // unescape - /\\\\\\/g, - () => '\\' - ] -] + // '\\\\' -> '\\' + /\\\\/g, + () => ESCAPE + ], -const POSITIVE_REPLACERS = [ - ...DEFAULT_REPLACER_PREFIX, - - // 'f' - // matches - // - /f(end) - // - /f/ - // - (start)f(end) - // - (start)f/ - // doesn't match - // - oof - // - foo - // pseudo: - // -> (^|/)f(/|$) + [ + // > The range notation, e.g. [a-zA-Z], + // > can be used to match one of the characters in a range. + + // `\` is escaped by step 3 + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` + : close === ']' + ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? `[${sanitizeRange(range)}${endEscape}]` + // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' + : '[]' + ], // ending [ // 'js' will not match 'js.' // 'ab' will not match 'abc' - /(?:[^*/])$/, + /(?:[^*])$/, + + // WTF! + // https://git-scm.com/docs/gitignore + // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) + // which re-fixes #24, #38 + + // > If there is a separator at the end of the pattern then the pattern + // > will only match directories, otherwise the pattern can match both + // > files and directories. // 'js*' will not match 'a.js' // 'js/' will not match 'a.js' // 'js' will match 'a.js' and 'a.js/' - match => `${match}(?=$|\\/)` + match => /\/$/.test(match) + // foo/ will not match 'foo' + ? `${match}$` + // foo matches 'foo' and 'foo/' + : `${match}(?=$|\\/$)` ], - ...DEFAULT_REPLACER_SUFFIX -] + // trailing wildcard + [ + /(\^|\\\/)?\\\*$/, + (_, p1) => { + const prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything -const NEGATIVE_REPLACERS = [ - ...DEFAULT_REPLACER_PREFIX, + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` - // #24, #38 - // The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) - // A negative pattern without a trailing wildcard should not - // re-include the things inside that directory. + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' - // eg: - // ['node_modules/*', '!node_modules'] - // should ignore `node_modules/a.js` - [ - /(?:[^*])$/, - match => `${match}(?=$|\\/$)` + return `${prefix}(?=$|\\/$)` + } ], - - ...DEFAULT_REPLACER_SUFFIX ] // A simple cache, because an ignore rule only has only one certain meaning -const cache = Object.create(null) +const regexCache = Object.create(null) // @param {pattern} -const make_regex = (pattern, negative, ignorecase) => { - const r = cache[pattern] - if (r) { - return r +const makeRegex = (pattern, ignoreCase) => { + let source = regexCache[pattern] + + if (!source) { + source = REPLACERS.reduce( + (prev, current) => prev.replace(current[0], current[1].bind(pattern)), + pattern + ) + regexCache[pattern] = source } - const replacers = negative - ? NEGATIVE_REPLACERS - : POSITIVE_REPLACERS - - const source = replacers.reduce( - (prev, current) => prev.replace(current[0], current[1].bind(pattern)), - pattern - ) - - return cache[pattern] = ignorecase + return ignoreCase ? new RegExp(source, 'i') : new RegExp(source) } +const isString = subject => typeof subject === 'string' + // > A blank line matches no files, so it can serve as a separator for readability. const checkPattern = pattern => pattern - && typeof pattern === 'string' - && !REGEX_BLANK_LINE.test(pattern) + && isString(pattern) + && !REGEX_TEST_BLANK_LINE.test(pattern) + && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) // > A line starting with # serves as a comment. && pattern.indexOf('#') !== 0 -const createRule = (pattern, ignorecase) => { +const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF) + +class IgnoreRule { + constructor ( + origin, + pattern, + negative, + regex + ) { + this.origin = origin + this.pattern = pattern + this.negative = negative + this.regex = regex + } +} + +const createRule = (pattern, ignoreCase) => { const origin = pattern let negative = false @@ -309,44 +360,98 @@ const createRule = (pattern, ignorecase) => { pattern = pattern // > Put a backslash ("\") in front of the first "!" for patterns that // > begin with a literal "!", for example, `"\!important!.txt"`. - .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that // > begin with a hash. - .replace(REGEX_LEADING_EXCAPED_HASH, '#') + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#') - const regex = make_regex(pattern, negative, ignorecase) + const regex = makeRegex(pattern, ignoreCase) - return { + return new IgnoreRule( origin, pattern, negative, regex + ) +} + +const throwError = (message, Ctor) => { + throw new Ctor(message) +} + +const checkPath = (path, originalPath, doThrow) => { + if (!isString(path)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ) + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow(`path must not be empty`, TypeError) } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + const r = '`path.relative()`d' + return doThrow( + `path should be a ${r} string, but got "${originalPath}"`, + RangeError + ) + } + + return true } -class IgnoreBase { +const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path) + +checkPath.isNotRelative = isNotRelative +checkPath.convert = p => p + +class Ignore { constructor ({ - ignorecase = true + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false } = {}) { - this._rules = [] - this._ignorecase = ignorecase define(this, KEY_IGNORE, true) + + this._rules = [] + this._ignoreCase = ignoreCase + this._allowRelativePaths = allowRelativePaths this._initCache() } _initCache () { - this._cache = Object.create(null) + this._ignoreCache = Object.create(null) + this._testCache = Object.create(null) } - // @param {Array.|string|Ignore} pattern - add (pattern) { - this._added = false + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } - if (typeof pattern === 'string') { - pattern = pattern.split(/\r?\n/g) + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignoreCase) + this._added = true + this._rules.push(rule) } + } - make_array(pattern).forEach(this._addPattern, this) + // @param {Array | string | Ignore} pattern + add (pattern) { + this._added = false + + makeArray( + isString(pattern) + ? splitPattern(pattern) + : pattern + ).forEach(this._addPattern, this) // Some rules have just added to the ignore, // making the behavior changed. @@ -362,41 +467,69 @@ class IgnoreBase { return this.add(pattern) } - _addPattern (pattern) { - // #32 - if (pattern && pattern[KEY_IGNORE]) { - this._rules = this._rules.concat(pattern._rules) - this._added = true - return - } + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X - if (checkPattern(pattern)) { - const rule = createRule(pattern, this._ignorecase) - this._added = true - this._rules.push(rule) - } - } + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen - filter (paths) { - return make_array(paths).filter(path => this._filter(path)) - } + // @param {boolean} whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. - createFilter () { - return path => this._filter(path) - } + // @returns {TestResult} true if a file is ignored + _testOne (path, checkUnignored) { + let ignored = false + let unignored = false - ignores (path) { - return !this._filter(path) - } + this._rules.forEach(rule => { + const {negative} = rule + if ( + unignored === negative && ignored !== unignored + || negative && !ignored && !unignored && !checkUnignored + ) { + return + } + + const matched = rule.regex.test(path) - // @returns `Boolean` true if the `path` is NOT ignored - _filter (path, slices) { - if (!path) { - return false + if (matched) { + ignored = !negative + unignored = negative + } + }) + + return { + ignored, + unignored } + } - if (path in this._cache) { - return this._cache[path] + // @returns {TestResult} + _test (originalPath, cache, checkUnignored, slices) { + const path = originalPath + // Supports nullable path + && checkPath.convert(originalPath) + + checkPath( + path, + originalPath, + this._allowRelativePaths + ? RETURN_FALSE + : throwError + ) + + return this._t(path, cache, checkUnignored, slices) + } + + _t (path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path] } if (!slices) { @@ -407,37 +540,59 @@ class IgnoreBase { slices.pop() - return this._cache[path] = slices.length + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._testOne(path, checkUnignored) + } + + const parent = this._t( + slices.join(SLASH) + SLASH, + cache, + checkUnignored, + slices + ) + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored // > It is not possible to re-include a file if a parent directory of // > that file is excluded. - // If the path contains a parent directory, check the parent first - ? this._filter(slices.join(SLASH) + SLASH, slices) - && this._test(path) + ? parent + : this._testOne(path, checkUnignored) + } - // Or only test the path - : this._test(path) + ignores (path) { + return this._test(path, this._ignoreCache, false).ignored } - // @returns {Boolean} true if a file is NOT ignored - _test (path) { - // Explicitly define variable type by setting matched to `0` - let matched = 0 + createFilter () { + return path => !this.ignores(path) + } - this._rules.forEach(rule => { - // if matched = true, then we only test negative rules - // if matched = false, then we test non-negative rules - if (!(matched ^ rule.negative)) { - matched = rule.negative ^ rule.regex.test(path) - } - }) + filter (paths) { + return makeArray(paths).filter(this.createFilter()) + } - return !matched + // @returns {TestResult} + test (path) { + return this._test(path, this._testCache, true) } } +const factory = options => new Ignore(options) + +const isPathValid = path => + checkPath(path && checkPath.convert(path), path, RETURN_FALSE) + +factory.isPathValid = isPathValid + +// Fixes typescript +factory.default = factory + +module.exports = factory + // Windows // -------------------------------------------------------------- -/* istanbul ignore if */ +/* istanbul ignore if */ if ( // Detect `process` so that it can run in browsers. typeof process !== 'undefined' @@ -446,18 +601,18 @@ if ( || process.platform === 'win32' ) ) { - const filter = IgnoreBase.prototype._filter - /* eslint no-control-regex: "off" */ - const make_posix = str => /^\\\\\?\\/.test(str) - || /[^\x00-\x80]+/.test(str) + const makePosix = str => /^\\\\\?\\/.test(str) + || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, '/') - IgnoreBase.prototype._filter = function filterWin32 (path, slices) { - path = make_posix(path) - return filter.call(this, path, slices) - } -} + checkPath.convert = makePosix -module.exports = options => new IgnoreBase(options) + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i + checkPath.isNotRelative = path => + REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) + || isNotRelative(path) +} diff --git a/node_modules/ignore/legacy.js b/node_modules/ignore/legacy.js index 14f377d77..8518b7c51 100644 --- a/node_modules/ignore/legacy.js +++ b/node_modules/ignore/legacy.js @@ -1,27 +1,47 @@ -'use strict'; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +"use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - // A simple implementation of make-array -function make_array(subject) { +function makeArray(subject) { return Array.isArray(subject) ? subject : [subject]; } - -var REGEX_BLANK_LINE = /^\s+$/; -var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/; -var REGEX_LEADING_EXCAPED_HASH = /^\\#/; +var EMPTY = ''; +var SPACE = ' '; +var ESCAPE = '\\'; +var REGEX_TEST_BLANK_LINE = /^\s+$/; +var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; +var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; +var REGEX_SPLITALL_CRLF = /\r?\n/g; +// /foo, +// ./foo, +// ../foo, +// . +// .. +var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; var SLASH = '/'; -var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') -/* istanbul ignore next */ -: 'node-ignore'; +// Do not use ternary expression here, since "istanbul ignore next" is buggy +var TMP_KEY_IGNORE = 'node-ignore'; +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol["for"]('node-ignore'); +} +var KEY_IGNORE = TMP_KEY_IGNORE; var define = function define(object, key, value) { - return Object.defineProperty(object, key, { value }); + return Object.defineProperty(object, key, { + value: value + }); }; - var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; +var RETURN_FALSE = function RETURN_FALSE() { + return false; +}; // Sanitize the range of a regular expression // The cases are complicated, see test cases for details @@ -30,10 +50,16 @@ var sanitizeRange = function sanitizeRange(range) { return from.charCodeAt(0) <= to.charCodeAt(0) ? match // Invalid range (out of order) which is ok for gitignore rules but // fatal for JavaScript regular expression, so eliminate it. - : ''; + : EMPTY; }); }; +// See fixtures #59 +var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) { + var length = slashes.length; + return slashes.slice(0, length - length % 2); +}; + // > If the pattern ends with a slash, // > it is removed for the purpose of the following description, // > but it would only find a match with a directory. @@ -45,22 +71,19 @@ var sanitizeRange = function sanitizeRange(range) { // you could use option `mark: true` with `glob` // '`foo/`' should not continue with the '`..`' -var DEFAULT_REPLACER_PREFIX = [ - +var REPLACERS = [ // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) // (a ) -> (a) // (a \ ) -> (a ) /\\?\s+$/, function (match) { - return match.indexOf('\\') === 0 ? ' ' : ''; + return match.indexOf('\\') === 0 ? SPACE : EMPTY; }], - // replace (\ ) with ' ' [/\\\s/g, function () { - return ' '; + return SPACE; }], - // Escape metacharacters // which is written down by users but means special for regular expressions. @@ -78,29 +101,21 @@ var DEFAULT_REPLACER_PREFIX = [ // > - and the opening square bracket [, // > - the opening curly brace {, // > These special characters are often called "metacharacters". -[/[\\^$.|*+(){]/g, function (match) { - return `\\${match}`; -}], [ -// > [abc] matches any character inside the brackets -// > (in this case a, b, or c); -/\[([^\]/]*)($|\])/g, function (match, p1, p2) { - return p2 === ']' ? `[${sanitizeRange(p1)}]` : `\\${match}`; +[/[\\$.|*+(){^]/g, function (match) { + return "\\".concat(match); }], [ // > a question mark (?) matches a single character /(?!\\)\?/g, function () { return '[^/]'; }], - // leading slash [ - // > A leading slash matches the beginning of the pathname. // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". // A leading slash matches the beginning of the pathname /^\//, function () { return '^'; }], - // replace special metacharacter slash after the leading slash [/\//g, function () { return '\\/'; @@ -112,41 +127,45 @@ var DEFAULT_REPLACER_PREFIX = [ // > under directory "foo". // Notice that the '*'s have been replaced as '\\*' /^\^*\\\*\\\*\\\//, - // '**/foo' <-> 'foo' function () { return '^(?:.*\\/)?'; -}]]; - -var DEFAULT_REPLACER_SUFFIX = [ +}], // starting [ // there will be no leading '/' // (which has been replaced by section "leading slash") // If starts with '**', adding a '^' to the regular expression also works /^(?=[^^])/, function startingReplacer() { + // If has a slash `/` at the beginning or middle return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 // > If the pattern does not contain a slash /, // > Git treats it as a shell glob pattern // Actually, if there is only a trailing slash, // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. ? '(?:^|\\/)' // > Otherwise, Git treats the pattern as a shell glob suitable for // > consumption by fnmatch(3) : '^'; }], - // two globstars [ // Use lookahead assertions so that we could match more than one `'/**'` /\\\/\\\*\\\*(?=\\\/|$)/g, - // Zero, one or several directories // should not use '*', or it will be replaced by the next replacer // Check if it is not the last `'/**'` -function (match, index, str) { +function (_, index, str) { return index + 6 < str.length // case: /**/ @@ -162,113 +181,125 @@ function (match, index, str) { // #21: everything inside but it should not include the current folder : '\\/.+'; }], - -// intermediate wildcards +// normal intermediate wildcards [ // Never replace escaped '*' // ignore rule '\*' will match the path '*' // 'abc.*/' -> go -// 'abc.*' -> skip this rule -/(^|[^\\]+)\\\*(?=.+)/g, - +// 'abc.*' -> skip this rule, +// coz trailing single wildcard will be handed by [trailing wildcard] +/(^|[^\\]+)(\\\*)+(?=.+)/g, // '*.js' matches '.js' // '*.js' doesn't match 'abc' -function (match, p1) { - return `${p1}[^\\/]*`; +function (_, p1, p2) { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + var unescaped = p2.replace(/\\\*/g, '[^\\/]*'); + return p1 + unescaped; +}], [ +// unescape, revert step 3 except for back slash +// For example, if a user escape a '\\*', +// after step 3, the result will be '\\\\\\*' +/\\\\\\(?=[$.|*+(){^])/g, function () { + return ESCAPE; +}], [ +// '\\\\' -> '\\' +/\\\\/g, function () { + return ESCAPE; +}], [ +// > The range notation, e.g. [a-zA-Z], +// > can be used to match one of the characters in a range. + +// `\` is escaped by step 3 +/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) { + return leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' : '[]'; }], +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*])$/, +// WTF! +// https://git-scm.com/docs/gitignore +// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) +// which re-fixes #24, #38 + +// > If there is a separator at the end of the pattern then the pattern +// > will only match directories, otherwise the pattern can match both +// > files and directories. +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return /\/$/.test(match) + // foo/ will not match 'foo' + ? "".concat(match, "$") // foo matches 'foo' and 'foo/' + : "".concat(match, "(?=$|\\/$)"); +}], // trailing wildcard -[/(\^|\\\/)?\\\*$/, function (match, p1) { +[/(\^|\\\/)?\\\*$/, function (_, p1) { var prefix = p1 // '\^': - // '/*' does not match '' + // '/*' does not match EMPTY // '/*' does not match everything // '\\\/': // 'abc/*' does not match 'abc/' - ? `${p1}[^/]+` - - // 'a*' matches 'a' + ? "".concat(p1, "[^/]+") // 'a*' matches 'a' // 'a*' matches 'aa' : '[^/]*'; - - return `${prefix}(?=$|\\/$)`; -}], [ -// unescape -/\\\\\\/g, function () { - return '\\'; + return "".concat(prefix, "(?=$|\\/$)"); }]]; -var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ - -// 'f' -// matches -// - /f(end) -// - /f/ -// - (start)f(end) -// - (start)f/ -// doesn't match -// - oof -// - foo -// pseudo: -// -> (^|/)f(/|$) - -// ending -[ -// 'js' will not match 'js.' -// 'ab' will not match 'abc' -/(?:[^*/])$/, - -// 'js*' will not match 'a.js' -// 'js/' will not match 'a.js' -// 'js' will match 'a.js' and 'a.js/' -function (match) { - return `${match}(?=$|\\/)`; -}]], DEFAULT_REPLACER_SUFFIX); - -var NEGATIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ - -// #24, #38 -// The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) -// A negative pattern without a trailing wildcard should not -// re-include the things inside that directory. - -// eg: -// ['node_modules/*', '!node_modules'] -// should ignore `node_modules/a.js` -[/(?:[^*])$/, function (match) { - return `${match}(?=$|\\/$)`; -}]], DEFAULT_REPLACER_SUFFIX); - // A simple cache, because an ignore rule only has only one certain meaning -var cache = Object.create(null); +var regexCache = Object.create(null); // @param {pattern} -var make_regex = function make_regex(pattern, negative, ignorecase) { - var r = cache[pattern]; - if (r) { - return r; +var makeRegex = function makeRegex(pattern, ignoreCase) { + var source = regexCache[pattern]; + if (!source) { + source = REPLACERS.reduce(function (prev, current) { + return prev.replace(current[0], current[1].bind(pattern)); + }, pattern); + regexCache[pattern] = source; } - - var replacers = negative ? NEGATIVE_REPLACERS : POSITIVE_REPLACERS; - - var source = replacers.reduce(function (prev, current) { - return prev.replace(current[0], current[1].bind(pattern)); - }, pattern); - - return cache[pattern] = ignorecase ? new RegExp(source, 'i') : new RegExp(source); + return ignoreCase ? new RegExp(source, 'i') : new RegExp(source); +}; +var isString = function isString(subject) { + return typeof subject === 'string'; }; // > A blank line matches no files, so it can serve as a separator for readability. var checkPattern = function checkPattern(pattern) { - return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) + return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) // > A line starting with # serves as a comment. && pattern.indexOf('#') !== 0; }; - -var createRule = function createRule(pattern, ignorecase) { +var splitPattern = function splitPattern(pattern) { + return pattern.split(REGEX_SPLITALL_CRLF); +}; +var IgnoreRule = /*#__PURE__*/_createClass(function IgnoreRule(origin, pattern, negative, regex) { + _classCallCheck(this, IgnoreRule); + this.origin = origin; + this.pattern = pattern; + this.negative = negative; + this.regex = regex; +}); +var createRule = function createRule(pattern, ignoreCase) { var origin = pattern; var negative = false; @@ -277,190 +308,232 @@ var createRule = function createRule(pattern, ignorecase) { negative = true; pattern = pattern.substr(1); } - pattern = pattern // > Put a backslash ("\") in front of the first "!" for patterns that // > begin with a literal "!", for example, `"\!important!.txt"`. - .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that // > begin with a hash. - .replace(REGEX_LEADING_EXCAPED_HASH, '#'); + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); + var regex = makeRegex(pattern, ignoreCase); + return new IgnoreRule(origin, pattern, negative, regex); +}; +var throwError = function throwError(message, Ctor) { + throw new Ctor(message); +}; +var checkPath = function checkPath(path, originalPath, doThrow) { + if (!isString(path)) { + return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError); + } - var regex = make_regex(pattern, negative, ignorecase); + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow("path must not be empty", TypeError); + } - return { - origin, - pattern, - negative, - regex - }; + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + var r = '`path.relative()`d'; + return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError); + } + return true; }; - -var IgnoreBase = function () { - function IgnoreBase() { +var isNotRelative = function isNotRelative(path) { + return REGEX_TEST_INVALID_PATH.test(path); +}; +checkPath.isNotRelative = isNotRelative; +checkPath.convert = function (p) { + return p; +}; +var Ignore = /*#__PURE__*/function () { + function Ignore() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$ignorecase = _ref.ignorecase, - ignorecase = _ref$ignorecase === undefined ? true : _ref$ignorecase; - - _classCallCheck(this, IgnoreBase); - - this._rules = []; - this._ignorecase = ignorecase; + _ref$ignorecase = _ref.ignorecase, + ignorecase = _ref$ignorecase === void 0 ? true : _ref$ignorecase, + _ref$ignoreCase = _ref.ignoreCase, + ignoreCase = _ref$ignoreCase === void 0 ? ignorecase : _ref$ignoreCase, + _ref$allowRelativePat = _ref.allowRelativePaths, + allowRelativePaths = _ref$allowRelativePat === void 0 ? false : _ref$allowRelativePat; + _classCallCheck(this, Ignore); define(this, KEY_IGNORE, true); + this._rules = []; + this._ignoreCase = ignoreCase; + this._allowRelativePaths = allowRelativePaths; this._initCache(); } - - _createClass(IgnoreBase, [{ - key: '_initCache', + _createClass(Ignore, [{ + key: "_initCache", value: function _initCache() { - this._cache = Object.create(null); + this._ignoreCache = Object.create(null); + this._testCache = Object.create(null); + } + }, { + key: "_addPattern", + value: function _addPattern(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + if (checkPattern(pattern)) { + var rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } } - // @param {Array.|string|Ignore} pattern - + // @param {Array | string | Ignore} pattern }, { - key: 'add', + key: "add", value: function add(pattern) { this._added = false; - - if (typeof pattern === 'string') { - pattern = pattern.split(/\r?\n/g); - } - - make_array(pattern).forEach(this._addPattern, this); + makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this); // Some rules have just added to the ignore, // making the behavior changed. if (this._added) { this._initCache(); } - return this; } // legacy - }, { - key: 'addPattern', + key: "addPattern", value: function addPattern(pattern) { return this.add(pattern); } - }, { - key: '_addPattern', - value: function _addPattern(pattern) { - // #32 - if (pattern && pattern[KEY_IGNORE]) { - this._rules = this._rules.concat(pattern._rules); - this._added = true; - return; - } - if (checkPattern(pattern)) { - var rule = createRule(pattern, this._ignorecase); - this._added = true; - this._rules.push(rule); - } - } - }, { - key: 'filter', - value: function filter(paths) { - var _this = this; + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X - return make_array(paths).filter(function (path) { - return _this._filter(path); - }); - } - }, { - key: 'createFilter', - value: function createFilter() { - var _this2 = this; + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen - return function (path) { - return _this2._filter(path); + // @param {boolean} whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + + // @returns {TestResult} true if a file is ignored + }, { + key: "_testOne", + value: function _testOne(path, checkUnignored) { + var ignored = false; + var unignored = false; + this._rules.forEach(function (rule) { + var negative = rule.negative; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + var matched = rule.regex.test(path); + if (matched) { + ignored = !negative; + unignored = negative; + } + }); + return { + ignored: ignored, + unignored: unignored }; } + + // @returns {TestResult} }, { - key: 'ignores', - value: function ignores(path) { - return !this._filter(path); + key: "_test", + value: function _test(originalPath, cache, checkUnignored, slices) { + var path = originalPath + // Supports nullable path + && checkPath.convert(originalPath); + checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError); + return this._t(path, cache, checkUnignored, slices); } - - // @returns `Boolean` true if the `path` is NOT ignored - }, { - key: '_filter', - value: function _filter(path, slices) { - if (!path) { - return false; - } - - if (path in this._cache) { - return this._cache[path]; + key: "_t", + value: function _t(path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path]; } - if (!slices) { // path/to/a.js // ['path', 'to', 'a.js'] slices = path.split(SLASH); } - slices.pop(); - return this._cache[path] = slices.length + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._testOne(path, checkUnignored); + } + var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored // > It is not possible to re-include a file if a parent directory of // > that file is excluded. - // If the path contains a parent directory, check the parent first - ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) - - // Or only test the path - : this._test(path); + ? parent : this._testOne(path, checkUnignored); } - - // @returns {Boolean} true if a file is NOT ignored - }, { - key: '_test', - value: function _test(path) { - // Explicitly define variable type by setting matched to `0` - var matched = 0; - - this._rules.forEach(function (rule) { - // if matched = true, then we only test negative rules - // if matched = false, then we test non-negative rules - if (!(matched ^ rule.negative)) { - matched = rule.negative ^ rule.regex.test(path); - } - }); + key: "ignores", + value: function ignores(path) { + return this._test(path, this._ignoreCache, false).ignored; + } + }, { + key: "createFilter", + value: function createFilter() { + var _this = this; + return function (path) { + return !_this.ignores(path); + }; + } + }, { + key: "filter", + value: function filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } - return !matched; + // @returns {TestResult} + }, { + key: "test", + value: function test(path) { + return this._test(path, this._testCache, true); } }]); - - return IgnoreBase; + return Ignore; }(); +var factory = function factory(options) { + return new Ignore(options); +}; +var isPathValid = function isPathValid(path) { + return checkPath(path && checkPath.convert(path), path, RETURN_FALSE); +}; +factory.isPathValid = isPathValid; + +// Fixes typescript +factory["default"] = factory; +module.exports = factory; // Windows // -------------------------------------------------------------- -/* istanbul ignore if */ - - +/* istanbul ignore if */ if ( // Detect `process` so that it can run in browsers. typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { - var filter = IgnoreBase.prototype._filter; - /* eslint no-control-regex: "off" */ - var make_posix = function make_posix(str) { - return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') - ); + var makePosix = function makePosix(str) { + return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/'); }; + checkPath.convert = makePosix; - IgnoreBase.prototype._filter = function filterWin32(path, slices) { - path = make_posix(path); - return filter.call(this, path, slices); + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + var REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = function (path) { + return REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path); }; } - -module.exports = function (options) { - return new IgnoreBase(options); -}; diff --git a/node_modules/ignore/package.json b/node_modules/ignore/package.json index 0151d0470..fe5498df0 100644 --- a/node_modules/ignore/package.json +++ b/node_modules/ignore/package.json @@ -1,62 +1,35 @@ { - "_from": "ignore@^4.0.6", - "_id": "ignore@4.0.6", - "_inBundle": false, - "_integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "_location": "/ignore", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ignore@^4.0.6", - "name": "ignore", - "escapedName": "ignore", - "rawSpec": "^4.0.6", - "saveSpec": null, - "fetchSpec": "^4.0.6" - }, - "_requiredBy": [ - "/@eslint/eslintrc", - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "_shasum": "750e3db5862087b4737ebac8207ffd1ef27b25fc", - "_spec": "ignore@^4.0.6", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "kael" - }, - "bugs": { - "url": "https://github.com/kaelzhang/node-ignore/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Ignore is a manager and filter for .gitignore rules.", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.7.0", - "codecov": "^3.0.4", - "eslint": "^5.3.0", - "eslint-config-ostai": "^1.3.2", - "eslint-plugin-import": "^2.13.0", - "mkdirp": "^0.5.1", - "pre-suf": "^1.1.0", - "rimraf": "^2.6.2", - "spawn-sync": "^2.0.0", - "tap": "^12.0.1", - "tmp": "0.0.33", - "typescript": "^3.0.1" - }, - "engines": { - "node": ">= 4" - }, + "name": "ignore", + "version": "5.2.4", + "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", "files": [ "legacy.js", "index.js", "index.d.ts", "LICENSE-MIT" ], - "homepage": "https://github.com/kaelzhang/node-ignore#readme", + "scripts": { + "prepublishOnly": "npm run build", + "build": "babel -o legacy.js index.js", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts --lib ES6", + "test:ts": "node ./test/ts/simple.js", + "tap": "tap --reporter classic", + "test:git": "npm run tap test/git-check-ignore.js", + "test:ignore": "npm run tap test/ignore.js", + "test:others": "npm run tap test/others.js", + "test:cases": "npm run tap test/*.js -- --coverage", + "test:no-coverage": "npm run tap test/*.js -- --no-check-coverage", + "test:only": "npm run test:lint && npm run test:tsc && npm run test:ts && npm run test:cases", + "test": "npm run test:only", + "test:win32": "IGNORE_TEST_WIN32=1 npm run test", + "report": "tap --coverage-report=html", + "posttest": "npm run report && codecov" + }, + "repository": { + "type": "git", + "url": "git@github.com:kaelzhang/node-ignore.git" + }, "keywords": [ "ignore", ".gitignore", @@ -72,22 +45,29 @@ "asterisks", "regular-expression" ], + "author": "kael", "license": "MIT", - "name": "ignore", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" }, - "scripts": { - "build": "babel -o legacy.js index.js", - "posttest": "tap --coverage-report=html && codecov", - "prepublish": "npm run build", - "test": "npm run test-no-cov", - "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", - "test:git": "tap test/git-check-ignore.js", - "test:ignore": "tap test/ignore.js --coverage", - "test:lint": "eslint .", - "test:tsc": "tsc ./test/ts/simple.ts" + "devDependencies": { + "@babel/cli": "^7.19.3", + "@babel/core": "^7.20.5", + "@babel/preset-env": "^7.20.2", + "codecov": "^3.8.2", + "debug": "^4.3.4", + "eslint": "^8.30.0", + "eslint-config-ostai": "^3.0.0", + "eslint-plugin-import": "^2.26.0", + "mkdirp": "^1.0.4", + "pre-suf": "^1.1.1", + "rimraf": "^3.0.2", + "spawn-sync": "^2.0.0", + "tap": "^16.3.2", + "tmp": "0.2.1", + "typescript": "^4.9.4" }, - "version": "4.0.6" + "engines": { + "node": ">= 4" + } } diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json index da16a7303..7a908369d 100644 --- a/node_modules/is-extglob/package.json +++ b/node_modules/is-extglob/package.json @@ -1,48 +1,28 @@ { - "_from": "is-extglob@^2.1.1", - "_id": "is-extglob@2.1.1", - "_inBundle": false, - "_integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "_location": "/is-extglob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-extglob@^2.1.1", - "name": "is-extglob", - "escapedName": "is-extglob", - "rawSpec": "^2.1.1", - "saveSpec": null, - "fetchSpec": "^2.1.1" + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" }, - "_requiredBy": [ - "/is-glob" + "license": "MIT", + "files": [ + "index.js" ], - "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "_shasum": "a88c02535791f02ed37c76a1b9ea9773c833f8c2", - "_spec": "is-extglob@^2.1.1", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/is-glob", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" + "main": "index.js", + "engines": { + "node": ">=0.10.0" }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-extglob/issues" + "scripts": { + "test": "mocha" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns true if a string has an extglob.", "devDependencies": { "gulp-format-md": "^0.1.10", "mocha": "^3.0.2" }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-extglob", "keywords": [ "bash", "braces", @@ -62,16 +42,6 @@ "string", "test" ], - "license": "MIT", - "main": "index.js", - "name": "is-extglob", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-extglob.git" - }, - "scripts": { - "test": "mocha" - }, "verb": { "toc": false, "layout": "default", @@ -95,6 +65,5 @@ "lint": { "reflinks": true } - }, - "version": "2.1.1" + } } diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md index 59444ebe6..740724b27 100644 --- a/node_modules/is-glob/README.md +++ b/node_modules/is-glob/README.md @@ -1,4 +1,4 @@ -# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Linux Build Status](https://img.shields.io/travis/micromatch/is-glob.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/is-glob) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/is-glob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/is-glob) +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) > Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js index 55826510c..620f563ec 100644 --- a/node_modules/is-glob/index.js +++ b/node_modules/is-glob/index.js @@ -7,8 +7,128 @@ var isExtglob = require('is-extglob'); var chars = { '{': '}', '(': ')', '[': ']'}; -var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; -var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; module.exports = function isGlob(str, options) { if (typeof str !== 'string' || str === '') { @@ -19,30 +139,12 @@ module.exports = function isGlob(str, options) { return true; } - var regex = strictRegex; - var match; + var check = strictCheck; - // optionally relax regex + // optionally relax check if (options && options.strict === false) { - regex = relaxedRegex; + check = relaxedCheck; } - while ((match = regex.exec(str))) { - if (match[2]) return true; - var idx = match.index + match[0].length; - - // if an open bracket/brace/paren is escaped, - // set the index to the next closing character - var open = match[1]; - var close = open ? chars[open] : null; - if (open && close) { - var n = str.indexOf(close, idx); - if (n !== -1) { - idx = n + 1; - } - } - - str = str.slice(idx); - } - return false; + return check(str); }; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json index 56b0b378b..858af0378 100644 --- a/node_modules/is-glob/package.json +++ b/node_modules/is-glob/package.json @@ -1,66 +1,36 @@ { - "_from": "is-glob@^4.0.0", - "_id": "is-glob@4.0.1", - "_inBundle": false, - "_integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "_location": "/is-glob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-glob@^4.0.0", - "name": "is-glob", - "escapedName": "is-glob", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/eslint", - "/glob-parent" + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" ], - "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "_shasum": "7567dbe9f2f5e2467bc77ab83c4a29482407a5dc", - "_spec": "is-glob@^4.0.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, + "repository": "micromatch/is-glob", "bugs": { "url": "https://github.com/micromatch/is-glob/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Daniel Perez", - "url": "https://tuvistavie.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } + "license": "MIT", + "files": [ + "index.js" ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, "dependencies": { "is-extglob": "^2.1.1" }, - "deprecated": false, - "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", "devDependencies": { "gulp-format-md": "^0.1.10", "mocha": "^3.0.2" }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/micromatch/is-glob", "keywords": [ "bash", "braces", @@ -80,16 +50,6 @@ "string", "test" ], - "license": "MIT", - "main": "index.js", - "name": "is-glob", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/is-glob.git" - }, - "scripts": { - "test": "mocha" - }, "verb": { "layout": "default", "plugins": [ @@ -117,6 +77,5 @@ "verb", "vinyl" ] - }, - "version": "4.0.1" + } } diff --git a/node_modules/is-path-inside/index.d.ts b/node_modules/is-path-inside/index.d.ts new file mode 100644 index 000000000..5cc3d804d --- /dev/null +++ b/node_modules/is-path-inside/index.d.ts @@ -0,0 +1,27 @@ +/** +Check if a path is inside another path. + +Note that relative paths are resolved against `process.cwd()` to make them absolute. + +_Important:_ This package is meant for use with path manipulation. It does not check if the paths exist nor does it resolve symlinks. You should not use this as a security mechanism to guard against access to certain places on the file system. + +@example +``` +import isPathInside = require('is-path-inside'); + +isPathInside('a/b/c', 'a/b'); +//=> true + +isPathInside('a/b/c', 'x/y'); +//=> false + +isPathInside('a/b/c', 'a/b/c'); +//=> false + +isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus'); +//=> true +``` +*/ +declare function isPathInside(childPath: string, parentPath: string): boolean; + +export = isPathInside; diff --git a/node_modules/is-path-inside/index.js b/node_modules/is-path-inside/index.js new file mode 100644 index 000000000..28ed79c0f --- /dev/null +++ b/node_modules/is-path-inside/index.js @@ -0,0 +1,12 @@ +'use strict'; +const path = require('path'); + +module.exports = (childPath, parentPath) => { + const relation = path.relative(parentPath, childPath); + return Boolean( + relation && + relation !== '..' && + !relation.startsWith(`..${path.sep}`) && + relation !== path.resolve(childPath) + ); +}; diff --git a/node_modules/is-path-inside/license b/node_modules/is-path-inside/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/is-path-inside/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/is-path-inside/package.json b/node_modules/is-path-inside/package.json new file mode 100644 index 000000000..88c154ae7 --- /dev/null +++ b/node_modules/is-path-inside/package.json @@ -0,0 +1,36 @@ +{ + "name": "is-path-inside", + "version": "3.0.3", + "description": "Check if a path is inside another path", + "license": "MIT", + "repository": "sindresorhus/is-path-inside", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "inside", + "folder", + "directory", + "dir", + "file", + "resolve" + ], + "devDependencies": { + "ava": "^2.1.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-path-inside/readme.md b/node_modules/is-path-inside/readme.md new file mode 100644 index 000000000..e8c4f928e --- /dev/null +++ b/node_modules/is-path-inside/readme.md @@ -0,0 +1,63 @@ +# is-path-inside + +> Check if a path is inside another path + + +## Install + +``` +$ npm install is-path-inside +``` + + +## Usage + +```js +const isPathInside = require('is-path-inside'); + +isPathInside('a/b/c', 'a/b'); +//=> true + +isPathInside('a/b/c', 'x/y'); +//=> false + +isPathInside('a/b/c', 'a/b/c'); +//=> false + +isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus'); +//=> true +``` + + +## API + +### isPathInside(childPath, parentPath) + +Note that relative paths are resolved against `process.cwd()` to make them absolute. + +**Important:** This package is meant for use with path manipulation. It does not check if the paths exist nor does it resolve symlinks. You should not use this as a security mechanism to guard against access to certain places on the file system. + +#### childPath + +Type: `string` + +The path that should be inside `parentPath`. + +#### parentPath + +Type: `string` + +The path that should contain `childPath`. + + +--- + +
+ + 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/js-sdsl/CHANGELOG.md b/node_modules/js-sdsl/CHANGELOG.md new file mode 100644 index 000000000..3156f94be --- /dev/null +++ b/node_modules/js-sdsl/CHANGELOG.md @@ -0,0 +1,211 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on Keep a Changelog and this project adheres to Semantic Versioning. + +## [4.3.0] - 2023.01.20 + +### Added + +- Add public member `container` to `Iterator` which means the container that the iterator pointed to. + +### Changed + +- Reimplement `Queue`, separate `Queue` from `Deque`. + +## [4.2.0] - 2022.11.20 + +### Changed + +- Optimized the structure of class `TreeNodeEnableIndex`. +- Change the `iterator access denied` error message to reduce the packing size. +- Change the internal storage of the hash container to the form of a linked list, traversing in insertion order. +- Standardize hash container. Make it extends from `Container` and add general functions. +- Refactor `LinkList` to do optimization. + +### Added + +- Add public `length` property to all the container. +- Add returned value to `pop` function including `popBack` and `popFront` to all the container which has such function. +- Add returned value to `eraseElementByKey` which means whether erase successfully. +- Add returned value to `push` or `insert` function which means the size of the container. + +### Fixed + +- Fixed wrong error type when `updateKeyByIterator`. +- Fixed wrong iterator was returned when erase tree reverse iterator. + +## [4.2.0-beta.1] - 2022.11.06 + +### Changed + +- Remove all the arrow function to optimize. +- Modify `HashContainer` implementation to optimize. + +## [4.2.0-beta.0] - 2022.10.30 + +### Added + +- Add `ts` sourcemap for debug mode. +- Add `this` param for `forEach` function. +- Support single package umd build. + +### Changed + +- Changed the packaging method of isolation packages release and the method of the member export. + +## [4.1.5] - 2022.09.30 + +### Added + +- Add `find`, `remove`, `updateItem` and `toArray` functions to `PriorityQueue`. +- Support single package release (use scope @js-sdsl). + +## [4.1.5-beta.1] - 2022.09.23 + +### Fixed + +- Get wrong tree index when size is 0. + +## [4.1.5-beta.0] - 2022.09.23 + +### Added + +- Add `index` property to tree iterator which represents the sequential index of the iterator in the tree. + +### Changed + +- Minimal optimization with private properties mangling, macro inlining and const enum. +- Private properties are now mangled. +- Remove `checkWithinAccessParams` function. +- Constants of `HashContainer` are moved to `HashContainerConst` const enum. +- The iteratorType parameter in the constructor now changed from `boolean` type to `IteratorType` const enum type. +- The type of `TreeNode.color` is now changed from `boolean` to `TreeNodeColor` const enum. +- Turn some member exports into export-only types. + +### Fixed + +- Fixed wrong iterator error message. + +## [4.1.4] - 2022.09.07 + +### Added + +- Add some notes. + +### Changed + +- Optimize hash container. +- Abstracting out the hash container. + +### Fixed + +- Fixed tree get height function return one larger than the real height. +- Tree-shaking not work in ES module. +- `Queue` and `Deque` should return `undefined` when container is empty. + +## [4.1.4-beta.0] - 2022.08.31 + +### Added + +- Add function update key by iterator. +- Add iterator copy function to get a copy of itself. +- Add insert by iterator hint function in tree container. + +### Changed + +- Changed OrderedMap's iterator pointer get from `Object.defineProperty'` to `Proxy`. +- Improve iterator performance by remove some judgment. +- Change iterator type description from `normal` and `reverse` to boolean. + +## [4.1.2-beta.0] - 2022.08.27 + +### Added + +- Make `SequentialContainer` and `TreeBaseContainer` export in the index. + +### Changed + +- Change rbTree binary search from recursive to loop implementation (don't effect using). +- Reduce memory waste during deque initialization. + +### Fixed + +- Fixed priority queue not dereference on pop. + +## [4.1.1] - 2022.08.23 + +### Fixed + +- Forgot to reset root node on rotation in red-black tree delete operation. +- Fix iterator invalidation after tree container removes iterator. + +## [4.1.0] - 2022.08.21 + +### Changed + +- Change some functions from recursive to loop implementation (don't effect using). +- Change some iterator function parameter type. +- Change commonjs target to `es6`. +- Change `Deque` from sequential queue to circular queue. +- Optimize so many places (don't affect using). + +### Fixed + +- Fix `Vector` length bugs. + +## [4.0.3] - 2022-08-13 + +### Changed + +- Change `if (this.empty())` to `if (!this.length)`. +- Change some unit test. +- Change class type and optimized type design. + +### Fixed + +- Fix can push undefined to deque. + +## [4.0.0] - 2022-07-30 + +### Changed + +- Remove InternalError error as much as possible (don't affect using). +- Change `HashSet` api `eraseElementByValue`'s name to `eraseElementByKey`. +- Change some unit tests to improve coverage (don't affect using). + +## [4.0.0-beta.0] - 2022-07-24 + +### Added + +- Complete test examples (don't effect using). +- The error thrown is standardized, you can catch it according to the error type. + +### Changed + +- Refactor all container from function to class (don't affect using). +- Abstracting tree containers and hash containers, change `Set`'s and `Map`'s name to `OrderedSet` and `OrderedMap` to distinguish it from the official container. +- Change `OrderedSet` api `eraseElementByValue`'s name to `eraseElementByKey`. + +### Fixed + +- Fixed so many bugs. + +## [3.0.0-beta.0] - 2022-04-29 + +### Added + +- Bidirectional iterator is provided for all containers except Stack, Queue, HashSet and HashMap. +- Added begin, end, rBegin and rEnd functions to some containers for using iterator. +- Added `eraseElementByIterator` function. + +### Changed + +- Changed Pair type `T, K` to `K, V` (don't affect using). +- Changed `find`, `lowerBound`, `upperBound`, `reverseLowerBound` and `reverseUpperBound` function's returned value to `Iterator`. + +### Fixed + +- Fixed an error when the insert value was 0. +- Fixed the problem that the lower version browser does not recognize symbol Compilation error caused by iterator. diff --git a/node_modules/table/node_modules/json-schema-traverse/LICENSE b/node_modules/js-sdsl/LICENSE similarity index 96% rename from node_modules/table/node_modules/json-schema-traverse/LICENSE rename to node_modules/js-sdsl/LICENSE index 7f1543566..d46bd7ee7 100644 --- a/node_modules/table/node_modules/json-schema-traverse/LICENSE +++ b/node_modules/js-sdsl/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Evgeny Poberezkin +Copyright (c) 2021 Zilong Yao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/js-sdsl/README.md b/node_modules/js-sdsl/README.md new file mode 100644 index 000000000..dfa6dc8b8 --- /dev/null +++ b/node_modules/js-sdsl/README.md @@ -0,0 +1,296 @@ +

+ + js-sdsl logo + +

+ +

A javascript standard data structure library which benchmark against C++ STL

+ +

+ NPM Version + Build Status + Coverage Status + GITHUB Star + NPM Downloads + Gzip Size + Rate this package + MIT-license + GITHUB-language +

+ +

English | 简体中文

+ +## ✨ Included data structures + +- **Stack** - first in last out stack. +- **Queue** - first in first out queue. +- **PriorityQueue** - heap-implemented priority queue. +- **Vector** - protected array, cannot to operate properties like `length` directly. +- **LinkList** - linked list of non-contiguous memory addresses. +- **Deque** - double-ended-queue, O(1) time complexity to `unshift` or getting elements by index. +- **OrderedSet** - sorted set which implemented by red black tree. +- **OrderedMap** - sorted map which implemented by red black tree. +- **HashSet** - refer to the [polyfill of ES6 Set](https://github.com/rousan/collections-es6). +- **HashMap** - refer to the [polyfill of ES6 Map](https://github.com/rousan/collections-es6). + +## ⚔️ Benchmark + +We are benchmarking against other popular data structure libraries. In some ways we're better than the best library. See [benchmark](https://js-sdsl.org/#/test/benchmark-analyze). + +## 🖥 Supported platforms + + + + + + + + + + + + + + + + + + +
+ IE / Edge +
IE / Edge
+
+ Firefox +
Firefox
+
+ Chrome +
Chrome
+
+ Safari +
Safari
+
+ Opera +
Opera
+
+ NodeJs +
NodeJs
+
Edge 123149103610
+ +## 📦 Download + +Download directly by cdn: + +- [js-sdsl.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.js) (for development) +- [js-sdsl.min.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js) (for production) + +Or install js-sdsl using npm: + +```bash +npm install js-sdsl +``` + +Or you can download the isolation packages containing only the containers you want: + +| package | npm | size | docs | +|---------------------------------------------------|-----------------------------------------------------------------------|------------------------------------------------------------------|-----------------------------| +| [@js-sdsl/stack][stack-package] | [![NPM Package][stack-npm-version]][stack-npm-link] | [![GZIP Size][stack-umd-size]][stack-umd-link] | [link][stack-docs] | +| [@js-sdsl/queue][queue-package] | [![NPM Package][queue-npm-version]][queue-npm-link] | [![GZIP Size][queue-umd-size]][queue-umd-link] | [link][queue-docs] | +| [@js-sdsl/priority-queue][priority-queue-package] | [![NPM Package][priority-queue-npm-version]][priority-queue-npm-link] | [![GZIP Size][priority-queue-umd-size]][priority-queue-umd-link] | [link][priority-queue-docs] | +| [@js-sdsl/vector][vector-package] | [![NPM Package][vector-npm-version]][vector-npm-link] | [![GZIP Size][vector-umd-size]][vector-umd-link] | [link][vector-docs] | +| [@js-sdsl/link-list][link-list-package] | [![NPM Package][link-list-npm-version]][link-list-npm-link] | [![GZIP Size][link-list-umd-size]][link-list-umd-link] | [link][link-list-docs] | +| [@js-sdsl/deque][deque-package] | [![NPM Package][deque-npm-version]][deque-npm-link] | [![GZIP Size][deque-umd-size]][deque-umd-link] | [link][deque-docs] | +| [@js-sdsl/ordered-set][ordered-set-package] | [![NPM Package][ordered-set-npm-version]][ordered-set-npm-link] | [![GZIP Size][ordered-set-umd-size]][ordered-set-umd-link] | [link][ordered-set-docs] | +| [@js-sdsl/ordered-map][ordered-map-package] | [![NPM Package][ordered-map-npm-version]][ordered-map-npm-link] | [![GZIP Size][ordered-map-umd-size]][ordered-map-umd-link] | [link][ordered-map-docs] | +| [@js-sdsl/hash-set][hash-set-package] | [![NPM Package][hash-set-npm-version]][hash-set-npm-link] | [![GZIP Size][hash-set-umd-size]][hash-set-umd-link] | [link][hash-set-docs] | +| [@js-sdsl/hash-map][hash-map-package] | [![NPM Package][hash-map-npm-version]][hash-map-npm-link] | [![GZIP Size][hash-map-umd-size]][hash-map-umd-link] | [link][hash-map-docs] | + +## 🪒 Usage + +You can visit our [official website](https://js-sdsl.org/) to get more information. + +To help you have a better use, we also provide this [API document](https://js-sdsl.org/js-sdsl/index.html). + +For previous versions of the documentation, please visit: + +`https://js-sdsl.org/js-sdsl/previous/v${version}/index.html` + +E.g. + +[https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html](https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html) + +### For browser + +```html + + +``` + +### For npm + +```javascript +// esModule +import { OrderedMap } from 'js-sdsl'; +// commonJs +const { OrderedMap } = require('js-sdsl'); +const myOrderedMap = new OrderedMap(); +myOrderedMap.setElement(1, 2); +console.log(myOrderedMap.getElementByKey(1)); // 2 +``` + +## 🛠 Test + +### Unit test + +We use [karma](https://karma-runner.github.io/) and [mocha](https://mochajs.org/) frame to do unit tests and synchronize to [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl). You can run `yarn test:unit` command to reproduce it. + +### For performance + +We tested most of the functions for efficiency. You can go to [`gh-pages/performance.md`](https://github.com/js-sdsl/js-sdsl/blob/gh-pages/performance.md) to see our running results or reproduce it with `yarn test:performance` command. + +You can also visit [here](https://js-sdsl.org/#/test/performance-test) to get the result. + +## ⌨️ Development + +Use Gitpod, a free online dev environment for GitHub. + +[![Open in Gippod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/js-sdsl/js-sdsl) + +Or clone locally: + +```bash +$ git clone https://github.com/js-sdsl/js-sdsl.git +$ cd js-sdsl +$ npm install +$ npm run dev # development mode +``` + +Then you can see the output in `dist/cjs` folder. + +## 🤝 Contributing + +Feel free to dive in! Open an issue or submit PRs. It may be helpful to read the [Contributor Guide](https://github.com/js-sdsl/js-sdsl/blob/main/.github/CONTRIBUTING.md). + +### Contributors + +Thanks goes to these wonderful people: + + + + + + + + + + + +

Takatoshi Kondo

💻 ⚠️

noname

💻
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +## ❤️ Sponsors and Backers + +The special thanks to these sponsors or backers because they provided support at a very early stage: + +eslint logo + +Thanks also give to these sponsors or backers: + +[![sponsors](https://opencollective.com/js-sdsl/tiers/sponsors.svg?avatarHeight=36)](https://opencollective.com/js-sdsl#support) + +[![backers](https://opencollective.com/js-sdsl/tiers/backers.svg?avatarHeight=36)](https://opencollective.com/js-sdsl#support) + +## 🪪 License + +[MIT](https://github.com/js-sdsl/js-sdsl/blob/main/LICENSE) © [ZLY201](https://github.com/zly201) + +[stack-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/Stack.ts +[stack-npm-version]: https://img.shields.io/npm/v/@js-sdsl/stack +[stack-npm-link]: https://www.npmjs.com/package/@js-sdsl/stack +[stack-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/stack/dist/umd/stack.min.js?compression=gzip&style=flat-square/ +[stack-umd-link]: https://unpkg.com/@js-sdsl/stack/dist/umd/stack.min.js +[stack-docs]: https://js-sdsl.org/js-sdsl/classes/Stack.html + +[queue-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/Queue.ts +[queue-npm-version]: https://img.shields.io/npm/v/@js-sdsl/queue +[queue-npm-link]: https://www.npmjs.com/package/@js-sdsl/queue +[queue-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/queue/dist/umd/queue.min.js?compression=gzip&style=flat-square/ +[queue-umd-link]: https://unpkg.com/@js-sdsl/queue/dist/umd/queue.min.js +[queue-docs]: https://js-sdsl.org/js-sdsl/classes/Queue.html + +[priority-queue-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/PriorityQueue.ts +[priority-queue-npm-version]: https://img.shields.io/npm/v/@js-sdsl/priority-queue +[priority-queue-npm-link]: https://www.npmjs.com/package/@js-sdsl/priority-queue +[priority-queue-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/priority-queue/dist/umd/priority-queue.min.js?compression=gzip&style=flat-square/ +[priority-queue-umd-link]: https://unpkg.com/@js-sdsl/priority-queue/dist/umd/priority-queue.min.js +[priority-queue-docs]: https://js-sdsl.org/js-sdsl/classes/PriorityQueue.html + +[vector-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/Vector.ts +[vector-npm-version]: https://img.shields.io/npm/v/@js-sdsl/vector +[vector-npm-link]: https://www.npmjs.com/package/@js-sdsl/vector +[vector-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/vector/dist/umd/vector.min.js?compression=gzip&style=flat-square/ +[vector-umd-link]: https://unpkg.com/@js-sdsl/vector/dist/umd/vector.min.js +[vector-docs]: https://js-sdsl.org/js-sdsl/classes/Vector.html + +[link-list-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/LinkList.ts +[link-list-npm-version]: https://img.shields.io/npm/v/@js-sdsl/link-list +[link-list-npm-link]: https://www.npmjs.com/package/@js-sdsl/link-list +[link-list-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/link-list/dist/umd/link-list.min.js?compression=gzip&style=flat-square/ +[link-list-umd-link]: https://unpkg.com/@js-sdsl/link-list/dist/umd/link-list.min.js +[link-list-docs]: https://js-sdsl.org/js-sdsl/classes/LinkList.html + +[deque-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/Deque.ts +[deque-npm-version]: https://img.shields.io/npm/v/@js-sdsl/deque +[deque-npm-link]: https://www.npmjs.com/package/@js-sdsl/deque +[deque-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/deque/dist/umd/deque.min.js?compression=gzip&style=flat-square/ +[deque-umd-link]: https://unpkg.com/@js-sdsl/deque/dist/umd/deque.min.js +[deque-docs]: https://js-sdsl.org/js-sdsl/classes/Deque.html + +[ordered-set-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/TreeContainer/OrderedSet.ts +[ordered-set-npm-version]: https://img.shields.io/npm/v/@js-sdsl/ordered-set +[ordered-set-npm-link]: https://www.npmjs.com/package/@js-sdsl/ordered-set +[ordered-set-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/ordered-set/dist/umd/ordered-set.min.js?compression=gzip&style=flat-square/ +[ordered-set-umd-link]: https://unpkg.com/@js-sdsl/ordered-set/dist/umd/ordered-set.min.js +[ordered-set-docs]: https://js-sdsl.org/js-sdsl/classes/OrderedSet.html + +[ordered-map-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/TreeContainer/OrderedMap.ts +[ordered-map-npm-version]: https://img.shields.io/npm/v/@js-sdsl/ordered-map +[ordered-map-npm-link]: https://www.npmjs.com/package/@js-sdsl/ordered-map +[ordered-map-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/ordered-map/dist/umd/ordered-map.min.js?compression=gzip&style=flat-square/ +[ordered-map-umd-link]: https://unpkg.com/@js-sdsl/ordered-map/dist/umd/ordered-map.min.js +[ordered-map-docs]: https://js-sdsl.org/js-sdsl/classes/OrderedMap.html + +[hash-set-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/HashContainer/HashSet.ts +[hash-set-npm-version]: https://img.shields.io/npm/v/@js-sdsl/hash-set +[hash-set-npm-link]: https://www.npmjs.com/package/@js-sdsl/hash-set +[hash-set-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/hash-set/dist/umd/hash-set.min.js?compression=gzip&style=flat-square/ +[hash-set-umd-link]: https://unpkg.com/@js-sdsl/hash-set/dist/umd/hash-set.min.js +[hash-set-docs]: https://js-sdsl.org/js-sdsl/classes/HashSet.html + +[hash-map-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/HashContainer/HashMap.ts +[hash-map-npm-version]: https://img.shields.io/npm/v/@js-sdsl/hash-map +[hash-map-npm-link]: https://www.npmjs.com/package/@js-sdsl/hash-map +[hash-map-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/hash-map/dist/umd/hash-map.min.js?compression=gzip&style=flat-square/ +[hash-map-umd-link]: https://unpkg.com/@js-sdsl/hash-map/dist/umd/hash-map.min.js +[hash-map-docs]: https://js-sdsl.org/js-sdsl/classes/HashMap.html diff --git a/node_modules/js-sdsl/README.zh-CN.md b/node_modules/js-sdsl/README.zh-CN.md new file mode 100644 index 000000000..72b92eea2 --- /dev/null +++ b/node_modules/js-sdsl/README.zh-CN.md @@ -0,0 +1,298 @@ +

+ + js-sdsl logo + +

+ +

一款参考 C++ STL 实现的 JavaScript 标准数据结构库

+ +

+ NPM Version + Build Status + Coverage Status + GITHUB Star + NPM Downloads + Gzip Size + Rate this package + MIT-license + GITHUB-language +

+ +

English | 简体中文

+ +## ✨ 包含的数据结构 + +- **Stack** - 先进后出的堆栈 +- **Queue** - 先进先出的队列 +- **PriorityQueue** - 堆实现的优先级队列 +- **Vector** - 受保护的数组,不能直接操作像 `length` 这样的属性 +- **LinkList** - 非连续内存地址的链表 +- **Deque** - 双端队列,向前和向后插入元素或按索引获取元素的时间复杂度为 O(1) +- **OrderedSet** - 由红黑树实现的排序集合 +- **OrderedMap** - 由红黑树实现的排序字典 +- **HashSet** - 参考 [ES6 Set polyfill](https://github.com/rousan/collections-es6) 实现的哈希集合 +- **HashMap** - 参考 [ES6 Set polyfill](https://github.com/rousan/collections-es6) 实现的哈希字典 + +## ⚔️ 基准测试 + +我们和其他数据结构库进行了基准测试,在某些场景我们甚至超过了当前最流行的库 + +查看 [benchmark](https://js-sdsl.org/#/zh-cn/test/benchmark-analyze) 以获取更多信息 + +## 🖥 支持的平台 + + + + + + + + + + + + + + + + + + +
+ IE / Edge +
IE / Edge
+
+ Firefox +
Firefox
+
+ Chrome +
Chrome
+
+ Safari +
Safari
+
+ Opera +
Opera
+
+ NodeJs +
NodeJs
+
Edge 123149103610
+ +## 📦 下载 + +使用 cdn 直接引入 + +- [js-sdsl.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.js) (for development) +- [js-sdsl.min.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js) (for production) + +使用 npm 下载 + +```bash +npm install js-sdsl +``` + +或者根据需要安装以下任意单个包 + +| package | npm | size | docs | +|---------------------------------------------------|-----------------------------------------------------------------------|------------------------------------------------------------------|-----------------------------| +| [@js-sdsl/stack][stack-package] | [![NPM Package][stack-npm-version]][stack-npm-link] | [![GZIP Size][stack-umd-size]][stack-umd-link] | [link][stack-docs] | +| [@js-sdsl/queue][queue-package] | [![NPM Package][queue-npm-version]][queue-npm-link] | [![GZIP Size][queue-umd-size]][queue-umd-link] | [link][queue-docs] | +| [@js-sdsl/priority-queue][priority-queue-package] | [![NPM Package][priority-queue-npm-version]][priority-queue-npm-link] | [![GZIP Size][priority-queue-umd-size]][priority-queue-umd-link] | [link][priority-queue-docs] | +| [@js-sdsl/vector][vector-package] | [![NPM Package][vector-npm-version]][vector-npm-link] | [![GZIP Size][vector-umd-size]][vector-umd-link] | [link][vector-docs] | +| [@js-sdsl/link-list][link-list-package] | [![NPM Package][link-list-npm-version]][link-list-npm-link] | [![GZIP Size][link-list-umd-size]][link-list-umd-link] | [link][link-list-docs] | +| [@js-sdsl/deque][deque-package] | [![NPM Package][deque-npm-version]][deque-npm-link] | [![GZIP Size][deque-umd-size]][deque-umd-link] | [link][deque-docs] | +| [@js-sdsl/ordered-set][ordered-set-package] | [![NPM Package][ordered-set-npm-version]][ordered-set-npm-link] | [![GZIP Size][ordered-set-umd-size]][ordered-set-umd-link] | [link][ordered-set-docs] | +| [@js-sdsl/ordered-map][ordered-map-package] | [![NPM Package][ordered-map-npm-version]][ordered-map-npm-link] | [![GZIP Size][ordered-map-umd-size]][ordered-map-umd-link] | [link][ordered-map-docs] | +| [@js-sdsl/hash-set][hash-set-package] | [![NPM Package][hash-set-npm-version]][hash-set-npm-link] | [![GZIP Size][hash-set-umd-size]][hash-set-umd-link] | [link][hash-set-docs] | +| [@js-sdsl/hash-map][hash-map-package] | [![NPM Package][hash-map-npm-version]][hash-map-npm-link] | [![GZIP Size][hash-map-umd-size]][hash-map-umd-link] | [link][hash-map-docs] | + +## 🪒 使用说明 + +您可以[访问我们的主页](https://js-sdsl.org/)获取更多信息 + +并且我们提供了完整的 [API 文档](https://js-sdsl.org/js-sdsl/index.html)供您参考 + +想要查看从前版本的文档,请访问: + +`https://js-sdsl.org/js-sdsl/previous/v${version}/index.html` + +例如: + +[https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html](https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html) + +### 在浏览器中使用 + +```html + + +``` + +### npm 引入 + +```javascript +// esModule +import { OrderedMap } from 'js-sdsl'; +// commonJs +const { OrderedMap } = require('js-sdsl'); +const myOrderedMap = new OrderedMap(); +myOrderedMap.setElement(1, 2); +console.log(myOrderedMap.getElementByKey(1)); // 2 +``` + +## 🛠 测试 + +### 单元测试 + +我们使用 [karma](https://karma-runner.github.io/) 和 [mocha](https://mochajs.org/) 框架进行单元测试,并同步到 [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl) 上,你可以使用 `yarn test:unit` 命令来重建它 + +### 对于性能的校验 + +我们对于编写的所有 API 进行了性能测试,并将结果同步到了 [`gh-pages/performance.md`](https://github.com/js-sdsl/js-sdsl/blob/gh-pages/performance.md) 中,你可以通过 `yarn test:performance` 命令来重现它 + +您也可以访问[我们的网站](https://js-sdsl.org/#/zh-cn/test/performance-test)来获取结果 + +## ⌨️ 开发 + +可以使用 Gitpod 进行在线编辑: + +[![Open in Gippod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/js-sdsl/js-sdsl) + +或者在本地使用以下命令获取源码进行开发: + +```bash +$ git clone https://github.com/js-sdsl/js-sdsl.git +$ cd js-sdsl +$ npm install +$ npm run dev # development mode +``` + +之后您在 `dist/cjs` 文件夹中可以看到在 `dev` 模式下打包生成的产物 + +## 🤝 贡献 + +我们欢迎所有的开发人员提交 issue 或 pull request,阅读[贡献者指南](https://github.com/js-sdsl/js-sdsl/blob/main/.github/CONTRIBUTING.md)可能会有所帮助 + +### 贡献者 + +感谢对本项目做出贡献的开发者们: + + + + + + + + + + + +

Takatoshi Kondo

💻 ⚠️

noname

💻
+ + + + + + +本项目遵循 [all-contributors](https://github.com/all-contributors/all-contributors) 规范。 欢迎任何形式的贡献! + +## ❤️ 赞助者 + +特别鸣谢下列赞助商和支持者们,他们在非常早期的时候为我们提供了支持: + +eslint logo + +同样感谢这些赞助商和支持者们: + +[![sponsors](https://opencollective.com/js-sdsl/tiers/sponsors.svg?avatarHeight=36)](https://opencollective.com/js-sdsl#support) + +[![backers](https://opencollective.com/js-sdsl/tiers/backers.svg?avatarHeight=36)](https://opencollective.com/js-sdsl#support) + +## 🪪 许可证 + +[MIT](https://github.com/js-sdsl/js-sdsl/blob/main/LICENSE) © [ZLY201](https://github.com/zly201) + +[stack-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/Stack.ts +[stack-npm-version]: https://img.shields.io/npm/v/@js-sdsl/stack +[stack-npm-link]: https://www.npmjs.com/package/@js-sdsl/stack +[stack-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/stack/dist/umd/stack.min.js?compression=gzip&style=flat-square/ +[stack-umd-link]: https://unpkg.com/@js-sdsl/stack/dist/umd/stack.min.js +[stack-docs]: https://js-sdsl.org/js-sdsl/classes/Stack.html + +[queue-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/Queue.ts +[queue-npm-version]: https://img.shields.io/npm/v/@js-sdsl/queue +[queue-npm-link]: https://www.npmjs.com/package/@js-sdsl/queue +[queue-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/queue/dist/umd/queue.min.js?compression=gzip&style=flat-square/ +[queue-umd-link]: https://unpkg.com/@js-sdsl/queue/dist/umd/queue.min.js +[queue-docs]: https://js-sdsl.org/js-sdsl/classes/Queue.html + +[priority-queue-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/PriorityQueue.ts +[priority-queue-npm-version]: https://img.shields.io/npm/v/@js-sdsl/priority-queue +[priority-queue-npm-link]: https://www.npmjs.com/package/@js-sdsl/priority-queue +[priority-queue-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/priority-queue/dist/umd/priority-queue.min.js?compression=gzip&style=flat-square/ +[priority-queue-umd-link]: https://unpkg.com/@js-sdsl/priority-queue/dist/umd/priority-queue.min.js +[priority-queue-docs]: https://js-sdsl.org/js-sdsl/classes/PriorityQueue.html + +[vector-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/Vector.ts +[vector-npm-version]: https://img.shields.io/npm/v/@js-sdsl/vector +[vector-npm-link]: https://www.npmjs.com/package/@js-sdsl/vector +[vector-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/vector/dist/umd/vector.min.js?compression=gzip&style=flat-square/ +[vector-umd-link]: https://unpkg.com/@js-sdsl/vector/dist/umd/vector.min.js +[vector-docs]: https://js-sdsl.org/js-sdsl/classes/Vector.html + +[link-list-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/LinkList.ts +[link-list-npm-version]: https://img.shields.io/npm/v/@js-sdsl/link-list +[link-list-npm-link]: https://www.npmjs.com/package/@js-sdsl/link-list +[link-list-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/link-list/dist/umd/link-list.min.js?compression=gzip&style=flat-square/ +[link-list-umd-link]: https://unpkg.com/@js-sdsl/link-list/dist/umd/link-list.min.js +[link-list-docs]: https://js-sdsl.org/js-sdsl/classes/LinkList.html + +[deque-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/Deque.ts +[deque-npm-version]: https://img.shields.io/npm/v/@js-sdsl/deque +[deque-npm-link]: https://www.npmjs.com/package/@js-sdsl/deque +[deque-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/deque/dist/umd/deque.min.js?compression=gzip&style=flat-square/ +[deque-umd-link]: https://unpkg.com/@js-sdsl/deque/dist/umd/deque.min.js +[deque-docs]: https://js-sdsl.org/js-sdsl/classes/Deque.html + +[ordered-set-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/TreeContainer/OrderedSet.ts +[ordered-set-npm-version]: https://img.shields.io/npm/v/@js-sdsl/ordered-set +[ordered-set-npm-link]: https://www.npmjs.com/package/@js-sdsl/ordered-set +[ordered-set-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/ordered-set/dist/umd/ordered-set.min.js?compression=gzip&style=flat-square/ +[ordered-set-umd-link]: https://unpkg.com/@js-sdsl/ordered-set/dist/umd/ordered-set.min.js +[ordered-set-docs]: https://js-sdsl.org/js-sdsl/classes/OrderedSet.html + +[ordered-map-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/TreeContainer/OrderedMap.ts +[ordered-map-npm-version]: https://img.shields.io/npm/v/@js-sdsl/ordered-map +[ordered-map-npm-link]: https://www.npmjs.com/package/@js-sdsl/ordered-map +[ordered-map-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/ordered-map/dist/umd/ordered-map.min.js?compression=gzip&style=flat-square/ +[ordered-map-umd-link]: https://unpkg.com/@js-sdsl/ordered-map/dist/umd/ordered-map.min.js +[ordered-map-docs]: https://js-sdsl.org/js-sdsl/classes/OrderedMap.html + +[hash-set-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/HashContainer/HashSet.ts +[hash-set-npm-version]: https://img.shields.io/npm/v/@js-sdsl/hash-set +[hash-set-npm-link]: https://www.npmjs.com/package/@js-sdsl/hash-set +[hash-set-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/hash-set/dist/umd/hash-set.min.js?compression=gzip&style=flat-square/ +[hash-set-umd-link]: https://unpkg.com/@js-sdsl/hash-set/dist/umd/hash-set.min.js +[hash-set-docs]: https://js-sdsl.org/js-sdsl/classes/HashSet.html + +[hash-map-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/HashContainer/HashMap.ts +[hash-map-npm-version]: https://img.shields.io/npm/v/@js-sdsl/hash-map +[hash-map-npm-link]: https://www.npmjs.com/package/@js-sdsl/hash-map +[hash-map-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/hash-map/dist/umd/hash-map.min.js?compression=gzip&style=flat-square/ +[hash-map-umd-link]: https://unpkg.com/@js-sdsl/hash-map/dist/umd/hash-map.min.js +[hash-map-docs]: https://js-sdsl.org/js-sdsl/classes/HashMap.html diff --git a/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts b/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts new file mode 100644 index 000000000..12e159824 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts @@ -0,0 +1,206 @@ +/** + * @description The iterator type including `NORMAL` and `REVERSE`. + */ +export declare const enum IteratorType { + NORMAL = 0, + REVERSE = 1 +} +export declare abstract class ContainerIterator { + /** + * @description The container pointed to by the iterator. + */ + abstract readonly container: Container; + /** + * @description Iterator's type. + * @example + * console.log(container.end().iteratorType === IteratorType.NORMAL); // true + */ + readonly iteratorType: IteratorType; + /** + * @param iter - The other iterator you want to compare. + * @returns Whether this equals to obj. + * @example + * container.find(1).equals(container.end()); + */ + equals(iter: ContainerIterator): boolean; + /** + * @description Pointers to element. + * @returns The value of the pointer's element. + * @example + * const val = container.begin().pointer; + */ + abstract get pointer(): T; + /** + * @description Set pointer's value (some containers are unavailable). + * @param newValue - The new value you want to set. + * @example + * (>container).begin().pointer = 1; + */ + abstract set pointer(newValue: T); + /** + * @description Move `this` iterator to pre. + * @returns The iterator's self. + * @example + * const iter = container.find(1); // container = [0, 1] + * const pre = iter.pre(); + * console.log(pre === iter); // true + * console.log(pre.equals(iter)); // true + * console.log(pre.pointer, iter.pointer); // 0, 0 + */ + abstract pre(): this; + /** + * @description Move `this` iterator to next. + * @returns The iterator's self. + * @example + * const iter = container.find(1); // container = [1, 2] + * const next = iter.next(); + * console.log(next === iter); // true + * console.log(next.equals(iter)); // true + * console.log(next.pointer, iter.pointer); // 2, 2 + */ + abstract next(): this; + /** + * @description Get a copy of itself. + * @returns The copy of self. + * @example + * const iter = container.find(1); // container = [1, 2] + * const next = iter.copy().next(); + * console.log(next === iter); // false + * console.log(next.equals(iter)); // false + * console.log(next.pointer, iter.pointer); // 2, 1 + */ + abstract copy(): ContainerIterator; +} +export declare abstract class Base { + /** + * @returns The size of the container. + * @example + * const container = new Vector([1, 2]); + * console.log(container.length); // 2 + */ + get length(): number; + /** + * @returns The size of the container. + * @example + * const container = new Vector([1, 2]); + * console.log(container.size()); // 2 + */ + size(): number; + /** + * @returns Whether the container is empty. + * @example + * container.clear(); + * console.log(container.empty()); // true + */ + empty(): boolean; + /** + * @description Clear the container. + * @example + * container.clear(); + * console.log(container.empty()); // true + */ + abstract clear(): void; +} +export declare abstract class Container extends Base { + /** + * @returns Iterator pointing to the beginning element. + * @example + * const begin = container.begin(); + * const end = container.end(); + * for (const it = begin; !it.equals(end); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract begin(): ContainerIterator; + /** + * @returns Iterator pointing to the super end like c++. + * @example + * const begin = container.begin(); + * const end = container.end(); + * for (const it = begin; !it.equals(end); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract end(): ContainerIterator; + /** + * @returns Iterator pointing to the end element. + * @example + * const rBegin = container.rBegin(); + * const rEnd = container.rEnd(); + * for (const it = rBegin; !it.equals(rEnd); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract rBegin(): ContainerIterator; + /** + * @returns Iterator pointing to the super begin like c++. + * @example + * const rBegin = container.rBegin(); + * const rEnd = container.rEnd(); + * for (const it = rBegin; !it.equals(rEnd); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract rEnd(): ContainerIterator; + /** + * @returns The first element of the container. + */ + abstract front(): T | undefined; + /** + * @returns The last element of the container. + */ + abstract back(): T | undefined; + /** + * @param element - The element you want to find. + * @returns An iterator pointing to the element if found, or super end if not found. + * @example + * container.find(1).equals(container.end()); + */ + abstract find(element: T): ContainerIterator; + /** + * @description Iterate over all elements in the container. + * @param callback - Callback function like Array.forEach. + * @example + * container.forEach((element, index) => console.log(element, index)); + */ + abstract forEach(callback: (element: T, index: number, container: Container) => void): void; + /** + * @description Gets the value of the element at the specified position. + * @example + * const val = container.getElementByPos(-1); // throw a RangeError + */ + abstract getElementByPos(pos: number): T; + /** + * @description Removes the element at the specified position. + * @param pos - The element's position you want to remove. + * @returns The container length after erasing. + * @example + * container.eraseElementByPos(-1); // throw a RangeError + */ + abstract eraseElementByPos(pos: number): number; + /** + * @description Removes element by iterator and move `iter` to next. + * @param iter - The iterator you want to erase. + * @returns The next iterator. + * @example + * container.eraseElementByIterator(container.begin()); + * container.eraseElementByIterator(container.end()); // throw a RangeError + */ + abstract eraseElementByIterator(iter: ContainerIterator): ContainerIterator; + /** + * @description Using for `for...of` syntax like Array. + * @example + * for (const element of container) { + * console.log(element); + * } + */ + abstract [Symbol.iterator](): Generator; +} +/** + * @description The initial data type passed in when initializing the container. + */ +export declare type initContainer = { + size?: number | (() => number); + length?: number; + forEach: (callback: (el: T) => void) => void; +}; diff --git a/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js b/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js new file mode 100644 index 000000000..4c8c99100 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.ContainerIterator = exports.Container = exports.Base = void 0; + +class ContainerIterator { + constructor(t = 0) { + this.iteratorType = t; + } + equals(t) { + return this.o === t.o; + } +} + +exports.ContainerIterator = ContainerIterator; + +class Base { + constructor() { + this.i = 0; + } + get length() { + return this.i; + } + size() { + return this.i; + } + empty() { + return this.i === 0; + } +} + +exports.Base = Base; + +class Container extends Base {} + +exports.Container = Container; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js.map b/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js.map new file mode 100644 index 000000000..bb30fa9b6 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/ContainerBase/index.js","../../src/container/ContainerBase/index.ts"],"names":["Object","defineProperty","exports","value","ContainerIterator","Container","Base","constructor","iteratorType","this","equals","iter","_node","_length","length","size","empty"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,oBAAoBF,QAAQG,YAAYH,QAAQI,YAAY;;ACG9D,MAAgBF;IAkBpBG,YAAsBC,IAAY;QAChCC,KAAKD,eAAeA;ADrBpB;IC6BFE,OAAOC;QACL,OAAOF,KAAKG,MAAUD,EAAKC;ADrB3B;;;ACsEHV,QAAAE,oBAAAA;;AAEK,MAAgBE;IAAtBC;QAKYE,KAAAI,IAAU;AAmCtB;IA5BMC;QACF,OAAOL,KAAKI;ADnEZ;IC2EFE;QACE,OAAON,KAAKI;ADnEZ;IC2EFG;QACE,OAAOP,KAAKI,MAAY;ADnExB;;;AC4EHX,QAAAI,OAAAA;;AAEK,MAAgBD,kBAAqBC;;AAgG1CJ,QAAAG,YAAAA","file":"index.js","sourcesContent":["export class ContainerIterator {\n /**\n * @internal\n */\n constructor(iteratorType = 0 /* IteratorType.NORMAL */) {\n this.iteratorType = iteratorType;\n }\n /**\n * @param iter - The other iterator you want to compare.\n * @returns Whether this equals to obj.\n * @example\n * container.find(1).equals(container.end());\n */\n equals(iter) {\n return this._node === iter._node;\n }\n}\nexport class Base {\n constructor() {\n /**\n * @description Container's size.\n * @internal\n */\n this._length = 0;\n }\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.length); // 2\n */\n get length() {\n return this._length;\n }\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.size()); // 2\n */\n size() {\n return this._length;\n }\n /**\n * @returns Whether the container is empty.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n empty() {\n return this._length === 0;\n }\n}\nexport class Container extends Base {\n}\n","/**\n * @description The iterator type including `NORMAL` and `REVERSE`.\n */\nexport const enum IteratorType {\n NORMAL = 0,\n REVERSE = 1\n}\n\nexport abstract class ContainerIterator {\n /**\n * @description The container pointed to by the iterator.\n */\n abstract readonly container: Container;\n /**\n * @internal\n */\n abstract _node: unknown;\n /**\n * @description Iterator's type.\n * @example\n * console.log(container.end().iteratorType === IteratorType.NORMAL); // true\n */\n readonly iteratorType: IteratorType;\n /**\n * @internal\n */\n protected constructor(iteratorType = IteratorType.NORMAL) {\n this.iteratorType = iteratorType;\n }\n /**\n * @param iter - The other iterator you want to compare.\n * @returns Whether this equals to obj.\n * @example\n * container.find(1).equals(container.end());\n */\n equals(iter: ContainerIterator) {\n return this._node === iter._node;\n }\n /**\n * @description Pointers to element.\n * @returns The value of the pointer's element.\n * @example\n * const val = container.begin().pointer;\n */\n abstract get pointer(): T;\n /**\n * @description Set pointer's value (some containers are unavailable).\n * @param newValue - The new value you want to set.\n * @example\n * (>container).begin().pointer = 1;\n */\n abstract set pointer(newValue: T);\n /**\n * @description Move `this` iterator to pre.\n * @returns The iterator's self.\n * @example\n * const iter = container.find(1); // container = [0, 1]\n * const pre = iter.pre();\n * console.log(pre === iter); // true\n * console.log(pre.equals(iter)); // true\n * console.log(pre.pointer, iter.pointer); // 0, 0\n */\n abstract pre(): this;\n /**\n * @description Move `this` iterator to next.\n * @returns The iterator's self.\n * @example\n * const iter = container.find(1); // container = [1, 2]\n * const next = iter.next();\n * console.log(next === iter); // true\n * console.log(next.equals(iter)); // true\n * console.log(next.pointer, iter.pointer); // 2, 2\n */\n abstract next(): this;\n /**\n * @description Get a copy of itself.\n * @returns The copy of self.\n * @example\n * const iter = container.find(1); // container = [1, 2]\n * const next = iter.copy().next();\n * console.log(next === iter); // false\n * console.log(next.equals(iter)); // false\n * console.log(next.pointer, iter.pointer); // 2, 1\n */\n abstract copy(): ContainerIterator;\n}\n\nexport abstract class Base {\n /**\n * @description Container's size.\n * @internal\n */\n protected _length = 0;\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.length); // 2\n */\n get length() {\n return this._length;\n }\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.size()); // 2\n */\n size() {\n return this._length;\n }\n /**\n * @returns Whether the container is empty.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n empty() {\n return this._length === 0;\n }\n /**\n * @description Clear the container.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n abstract clear(): void;\n}\n\nexport abstract class Container extends Base {\n /**\n * @returns Iterator pointing to the beginning element.\n * @example\n * const begin = container.begin();\n * const end = container.end();\n * for (const it = begin; !it.equals(end); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract begin(): ContainerIterator;\n /**\n * @returns Iterator pointing to the super end like c++.\n * @example\n * const begin = container.begin();\n * const end = container.end();\n * for (const it = begin; !it.equals(end); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract end(): ContainerIterator;\n /**\n * @returns Iterator pointing to the end element.\n * @example\n * const rBegin = container.rBegin();\n * const rEnd = container.rEnd();\n * for (const it = rBegin; !it.equals(rEnd); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract rBegin(): ContainerIterator;\n /**\n * @returns Iterator pointing to the super begin like c++.\n * @example\n * const rBegin = container.rBegin();\n * const rEnd = container.rEnd();\n * for (const it = rBegin; !it.equals(rEnd); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract rEnd(): ContainerIterator;\n /**\n * @returns The first element of the container.\n */\n abstract front(): T | undefined;\n /**\n * @returns The last element of the container.\n */\n abstract back(): T | undefined;\n /**\n * @param element - The element you want to find.\n * @returns An iterator pointing to the element if found, or super end if not found.\n * @example\n * container.find(1).equals(container.end());\n */\n abstract find(element: T): ContainerIterator;\n /**\n * @description Iterate over all elements in the container.\n * @param callback - Callback function like Array.forEach.\n * @example\n * container.forEach((element, index) => console.log(element, index));\n */\n abstract forEach(callback: (element: T, index: number, container: Container) => void): void;\n /**\n * @description Gets the value of the element at the specified position.\n * @example\n * const val = container.getElementByPos(-1); // throw a RangeError\n */\n abstract getElementByPos(pos: number): T;\n /**\n * @description Removes the element at the specified position.\n * @param pos - The element's position you want to remove.\n * @returns The container length after erasing.\n * @example\n * container.eraseElementByPos(-1); // throw a RangeError\n */\n abstract eraseElementByPos(pos: number): number;\n /**\n * @description Removes element by iterator and move `iter` to next.\n * @param iter - The iterator you want to erase.\n * @returns The next iterator.\n * @example\n * container.eraseElementByIterator(container.begin());\n * container.eraseElementByIterator(container.end()); // throw a RangeError\n */\n abstract eraseElementByIterator(\n iter: ContainerIterator\n ): ContainerIterator;\n /**\n * @description Using for `for...of` syntax like Array.\n * @example\n * for (const element of container) {\n * console.log(element);\n * }\n */\n abstract [Symbol.iterator](): Generator;\n}\n\n/**\n * @description The initial data type passed in when initializing the container.\n */\nexport type initContainer = {\n size?: number | (() => number);\n length?: number;\n forEach: (callback: (el: T) => void) => void;\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts b/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts new file mode 100644 index 000000000..43aa866c7 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts @@ -0,0 +1,29 @@ +import { Container, ContainerIterator } from "../../ContainerBase"; +export declare type HashLinkNode = { + _key: K; + _value: V; + _pre: HashLinkNode; + _next: HashLinkNode; +}; +export declare abstract class HashContainerIterator extends ContainerIterator { + abstract readonly container: HashContainer; + pre(): this; + next(): this; +} +export declare abstract class HashContainer extends Container { + /** + * @description Unique symbol used to tag object. + */ + readonly HASH_TAG: symbol; + clear(): void; + /** + * @description Remove the element of the specified key. + * @param key - The key you want to remove. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns Whether erase successfully. + */ + eraseElementByKey(key: K, isObject?: boolean): boolean; + eraseElementByIterator(iter: HashContainerIterator): HashContainerIterator; + eraseElementByPos(pos: number): number; +} diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js b/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js new file mode 100644 index 000000000..387cb6036 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js @@ -0,0 +1,188 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.HashContainerIterator = exports.HashContainer = void 0; + +var _ContainerBase = require("../../ContainerBase"); + +var _checkObject = _interopRequireDefault(require("../../../utils/checkObject")); + +var _throwError = require("../../../utils/throwError"); + +function _interopRequireDefault(t) { + return t && t.t ? t : { + default: t + }; +} + +class HashContainerIterator extends _ContainerBase.ContainerIterator { + constructor(t, e, i) { + super(i); + this.o = t; + this.h = e; + if (this.iteratorType === 0) { + this.pre = function() { + if (this.o.L === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.L; + return this; + }; + this.next = function() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.B; + return this; + }; + } else { + this.pre = function() { + if (this.o.B === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.B; + return this; + }; + this.next = function() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.L; + return this; + }; + } + } +} + +exports.HashContainerIterator = HashContainerIterator; + +class HashContainer extends _ContainerBase.Container { + constructor() { + super(); + this.H = []; + this.g = {}; + this.HASH_TAG = Symbol("@@HASH_TAG"); + Object.setPrototypeOf(this.g, null); + this.h = {}; + this.h.L = this.h.B = this.p = this._ = this.h; + } + V(t) { + const {L: e, B: i} = t; + e.B = i; + i.L = e; + if (t === this.p) { + this.p = i; + } + if (t === this._) { + this._ = e; + } + this.i -= 1; + } + M(t, e, i) { + if (i === undefined) i = (0, _checkObject.default)(t); + let s; + if (i) { + const i = t[this.HASH_TAG]; + if (i !== undefined) { + this.H[i].l = e; + return this.i; + } + Object.defineProperty(t, this.HASH_TAG, { + value: this.H.length, + configurable: true + }); + s = { + u: t, + l: e, + L: this._, + B: this.h + }; + this.H.push(s); + } else { + const i = this.g[t]; + if (i) { + i.l = e; + return this.i; + } + s = { + u: t, + l: e, + L: this._, + B: this.h + }; + this.g[t] = s; + } + if (this.i === 0) { + this.p = s; + this.h.B = s; + } else { + this._.B = s; + } + this._ = s; + this.h.L = s; + return ++this.i; + } + I(t, e) { + if (e === undefined) e = (0, _checkObject.default)(t); + if (e) { + const e = t[this.HASH_TAG]; + if (e === undefined) return this.h; + return this.H[e]; + } else { + return this.g[t] || this.h; + } + } + clear() { + const t = this.HASH_TAG; + this.H.forEach((function(e) { + delete e.u[t]; + })); + this.H = []; + this.g = {}; + Object.setPrototypeOf(this.g, null); + this.i = 0; + this.p = this._ = this.h.L = this.h.B = this.h; + } + eraseElementByKey(t, e) { + let i; + if (e === undefined) e = (0, _checkObject.default)(t); + if (e) { + const e = t[this.HASH_TAG]; + if (e === undefined) return false; + delete t[this.HASH_TAG]; + i = this.H[e]; + delete this.H[e]; + } else { + i = this.g[t]; + if (i === undefined) return false; + delete this.g[t]; + } + this.V(i); + return true; + } + eraseElementByIterator(t) { + const e = t.o; + if (e === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.V(e); + return t.next(); + } + eraseElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + let e = this.p; + while (t--) { + e = e.B; + } + this.V(e); + return this.i; + } +} + +exports.HashContainer = HashContainer; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js.map b/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js.map new file mode 100644 index 000000000..7d7c49ebf --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/HashContainer/Base/index.js","../../src/container/HashContainer/Base/index.ts"],"names":["Object","defineProperty","exports","value","HashContainerIterator","HashContainer","_ContainerBase","require","_checkObject","_interopRequireDefault","_throwError","obj","__esModule","default","ContainerIterator","constructor","node","header","iteratorType","super","this","_node","_header","pre","_pre","throwIteratorAccessError","next","_next","Container","_objMap","_originMap","HASH_TAG","Symbol","setPrototypeOf","_head","_tail","_eraseNode","L","B","_length","_set","key","isObject","undefined","checkObject","newTail","index","_value","length","configurable","_key","push","_findElementNode","clear","forEach","el","eraseElementByKey","eraseElementByIterator","iter","eraseElementByPos","pos","RangeError"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,wBAAwBF,QAAQG,qBAAqB;;ACL7D,IAAAC,iBAAAC,QAAA;;AACA,IAAAC,eAAAC,uBAAAF,QAAA;;AAEA,IAAAG,cAAAH,QAAA;;AAA8D,SAAAE,uBAAAE;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAE,SAAAF;;AAAA;;AASxD,MAAgBP,8BAAoCU,eAAAA;IAaxDC,YACEC,GACAC,GACAC;QAEAC,MAAMD;QACNE,KAAKC,IAAQL;QACbI,KAAKE,IAAUL;QACf,IAAIG,KAAKF,iBAAY,GAA0B;YAC7CE,KAAKG,MAAM;gBACT,IAAIH,KAAKC,EAAMG,MAASJ,KAAKE,GAAS;qBACpC,GAAAG,YAAAA;ADpBM;gBCsBRL,KAAKC,IAAQD,KAAKC,EAAMG;gBACxB,OAAOJ;ADpBH;YCsBNA,KAAKM,OAAO;gBACV,IAAIN,KAAKC,MAAUD,KAAKE,GAAS;qBAC/B,GAAAG,YAAAA;ADpBM;gBCsBRL,KAAKC,IAAQD,KAAKC,EAAMM;gBACxB,OAAOP;ADpBH;AACJ,eCqBG;YACLA,KAAKG,MAAM;gBACT,IAAIH,KAAKC,EAAMM,MAAUP,KAAKE,GAAS;qBACrC,GAAAG,YAAAA;ADnBM;gBCqBRL,KAAKC,IAAQD,KAAK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L,EAAKrB,KAAKW;YAC1D,IAAIe,MAAUH,WAAW,OAAO;mBACSF,EAAKrB,KAAKW;YACnDf,IAAOI,KAAKS,EAAQiB;mBACb1B,KAAKS,EAAQiB;AD5BlB,eC6BG;YACL9B,IAAOI,KAAKU,EAA4BW;YACxC,IAAIzB,MAAS2B,WAAW,OAAO;mBACxBvB,KAAKU,EAA4BW;AD1BtC;QC4BJrB,KAAKgB,EAAWpB;QAChB,OAAO;AD1BP;IC4BFyC,uBAAuBC;QACrB,MAAM1C,IAAO0C,EAAKrC;QAClB,IAAIL,MAASI,KAAKE,GAAS;aACzB,GAAAG,YAAAA;AD1BE;QC4BJL,KAAKgB,EAAWpB;QAChB,OAAO0C,EAAKhC;AD1BZ;IC4BFiC,kBAAkBC;QD1BZ,IC2BsBA,IAAG,KAAHA,IAAQxC,KAAKmB,IAAO,GAvN5C;YAAG,MAAS,IAAIsB;AD8Ld;QC0BJ,IAAI7C,IAAOI,KAAKc;QAChB,OAAO0B,KAAO;YACZ5C,IAAOA,EAAKW;ADxBV;QC0BJP,KAAKgB,EAAWpB;QAChB,OAAOI,KAAKmB;ADxBZ;;;AC0BHrC,QAAAG,gBAAAA","file":"index.js","sourcesContent":["import { Container, ContainerIterator } from \"../../ContainerBase\";\nimport checkObject from \"../../../utils/checkObject\";\nimport $checkWithinAccessParams from \"../../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nexport class HashContainerIterator extends ContainerIterator {\n /**\n * @internal\n */\n constructor(node, header, iteratorType) {\n super(iteratorType);\n this._node = node;\n this._header = header;\n if (this.iteratorType === 0 /* IteratorType.NORMAL */) {\n this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n }\n else {\n this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n }\n}\nexport class HashContainer extends Container {\n /**\n * @internal\n */\n constructor() {\n super();\n /**\n * @internal\n */\n this._objMap = [];\n /**\n * @internal\n */\n this._originMap = {};\n /**\n * @description Unique symbol used to tag object.\n */\n this.HASH_TAG = Symbol('@@HASH_TAG');\n Object.setPrototypeOf(this._originMap, null);\n this._header = {};\n this._header._pre = this._header._next = this._head = this._tail = this._header;\n }\n /**\n * @internal\n */\n _eraseNode(node) {\n const { _pre, _next } = node;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n }\n /**\n * @internal\n */\n _set(key, value, isObject) {\n if (isObject === undefined)\n isObject = checkObject(key);\n let newTail;\n if (isObject) {\n const index = key[this.HASH_TAG];\n if (index !== undefined) {\n this._objMap[index]._value = value;\n return this._length;\n }\n Object.defineProperty(key, this.HASH_TAG, {\n value: this._objMap.length,\n configurable: true\n });\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._objMap.push(newTail);\n }\n else {\n const node = this._originMap[key];\n if (node) {\n node._value = value;\n return this._length;\n }\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._originMap[key] = newTail;\n }\n if (this._length === 0) {\n this._head = newTail;\n this._header._next = newTail;\n }\n else {\n this._tail._next = newTail;\n }\n this._tail = newTail;\n this._header._pre = newTail;\n return ++this._length;\n }\n /**\n * @internal\n */\n _findElementNode(key, isObject) {\n if (isObject === undefined)\n isObject = checkObject(key);\n if (isObject) {\n const index = key[this.HASH_TAG];\n if (index === undefined)\n return this._header;\n return this._objMap[index];\n }\n else {\n return this._originMap[key] || this._header;\n }\n }\n clear() {\n const HASH_TAG = this.HASH_TAG;\n this._objMap.forEach(function (el) {\n delete el._key[HASH_TAG];\n });\n this._objMap = [];\n this._originMap = {};\n Object.setPrototypeOf(this._originMap, null);\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n }\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns Whether erase successfully.\n */\n eraseElementByKey(key, isObject) {\n let node;\n if (isObject === undefined)\n isObject = checkObject(key);\n if (isObject) {\n const index = key[this.HASH_TAG];\n if (index === undefined)\n return false;\n delete key[this.HASH_TAG];\n node = this._objMap[index];\n delete this._objMap[index];\n }\n else {\n node = this._originMap[key];\n if (node === undefined)\n return false;\n delete this._originMap[key];\n }\n this._eraseNode(node);\n return true;\n }\n eraseElementByIterator(iter) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n this._eraseNode(node);\n return iter.next();\n }\n eraseElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n this._eraseNode(node);\n return this._length;\n }\n}\n","import { Container, ContainerIterator, IteratorType } from '@/container/ContainerBase';\nimport checkObject from '@/utils/checkObject';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nexport type HashLinkNode = {\n _key: K,\n _value: V,\n _pre: HashLinkNode,\n _next: HashLinkNode\n}\n\nexport abstract class HashContainerIterator extends ContainerIterator {\n abstract readonly container: HashContainer;\n /**\n * @internal\n */\n _node: HashLinkNode;\n /**\n * @internal\n */\n protected readonly _header: HashLinkNode;\n /**\n * @internal\n */\n protected constructor(\n node: HashLinkNode,\n header: HashLinkNode,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = node;\n this._header = header;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n }\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n\nexport abstract class HashContainer extends Container {\n /**\n * @internal\n */\n protected _objMap: HashLinkNode[] = [];\n /**\n * @internal\n */\n protected _originMap: Record> = {};\n /**\n * @internal\n */\n protected _head: HashLinkNode;\n /**\n * @internal\n */\n protected _tail: HashLinkNode;\n /**\n * @internal\n */\n protected readonly _header: HashLinkNode;\n /**\n * @description Unique symbol used to tag object.\n */\n readonly HASH_TAG = Symbol('@@HASH_TAG');\n /**\n * @internal\n */\n protected constructor() {\n super();\n Object.setPrototypeOf(this._originMap, null);\n this._header = >{};\n this._header._pre = this._header._next = this._head = this._tail = this._header;\n }\n /**\n * @internal\n */\n protected _eraseNode(node: HashLinkNode) {\n const { _pre, _next } = node;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n }\n /**\n * @internal\n */\n protected _set(key: K, value?: V, isObject?: boolean) {\n if (isObject === undefined) isObject = checkObject(key);\n let newTail;\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n if (index !== undefined) {\n this._objMap[index]._value = value;\n return this._length;\n }\n Object.defineProperty(key, this.HASH_TAG, {\n value: this._objMap.length,\n configurable: true\n });\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._objMap.push(newTail);\n } else {\n const node = this._originMap[key];\n if (node) {\n node._value = value;\n return this._length;\n }\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._originMap[key] = newTail;\n }\n if (this._length === 0) {\n this._head = newTail;\n this._header._next = newTail;\n } else {\n this._tail._next = newTail;\n }\n this._tail = newTail;\n this._header._pre = newTail;\n return ++this._length;\n }\n /**\n * @internal\n */\n protected _findElementNode(key: K, isObject?: boolean) {\n if (isObject === undefined) isObject = checkObject(key);\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n if (index === undefined) return this._header;\n return this._objMap[index];\n } else {\n return this._originMap[key] || this._header;\n }\n }\n clear() {\n const HASH_TAG = this.HASH_TAG;\n this._objMap.forEach(function (el) {\n delete (>el._key)[HASH_TAG];\n });\n this._objMap = [];\n this._originMap = {};\n Object.setPrototypeOf(this._originMap, null);\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n }\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns Whether erase successfully.\n */\n eraseElementByKey(key: K, isObject?: boolean) {\n let node;\n if (isObject === undefined) isObject = checkObject(key);\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n if (index === undefined) return false;\n delete (>key)[this.HASH_TAG];\n node = this._objMap[index];\n delete this._objMap[index];\n } else {\n node = this._originMap[key];\n if (node === undefined) return false;\n delete this._originMap[key];\n }\n this._eraseNode(node);\n return true;\n }\n eraseElementByIterator(iter: HashContainerIterator) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n this._eraseNode(node);\n return iter.next();\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n this._eraseNode(node);\n return this._length;\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts new file mode 100644 index 000000000..1b78025bc --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts @@ -0,0 +1,49 @@ +import { initContainer, IteratorType } from "../ContainerBase"; +import { HashContainer, HashContainerIterator, HashLinkNode } from "./Base"; +declare class HashMapIterator extends HashContainerIterator { + readonly container: HashMap; + constructor(node: HashLinkNode, header: HashLinkNode, container: HashMap, iteratorType?: IteratorType); + get pointer(): [K, V]; + copy(): HashMapIterator; + equals(iter: HashMapIterator): boolean; +} +export type { HashMapIterator }; +declare class HashMap extends HashContainer { + constructor(container?: initContainer<[K, V]>); + begin(): HashMapIterator; + end(): HashMapIterator; + rBegin(): HashMapIterator; + rEnd(): HashMapIterator; + front(): [K, V] | undefined; + back(): [K, V] | undefined; + /** + * @description Insert a key-value pair or set value by the given key. + * @param key - The key want to insert. + * @param value - The value want to set. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns The size of container after setting. + */ + setElement(key: K, value: V, isObject?: boolean): number; + /** + * @description Get the value of the element of the specified key. + * @param key - The key want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @example + * const val = container.getElementByKey(1); + */ + getElementByKey(key: K, isObject?: boolean): V | undefined; + getElementByPos(pos: number): [K, V]; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ + find(key: K, isObject?: boolean): HashMapIterator; + forEach(callback: (element: [K, V], index: number, hashMap: HashMap) => void): void; + [Symbol.iterator](): Generator<[K, V], void, unknown>; +} +export default HashMap; diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js new file mode 100644 index 000000000..7bbae243c --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js @@ -0,0 +1,125 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = require("./Base"); + +var _checkObject = _interopRequireDefault(require("../../utils/checkObject")); + +var _throwError = require("../../utils/throwError"); + +function _interopRequireDefault(t) { + return t && t.t ? t : { + default: t + }; +} + +class HashMapIterator extends _Base.HashContainerIterator { + constructor(t, e, r, s) { + super(t, e, s); + this.container = r; + } + get pointer() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + const t = this; + return new Proxy([], { + get(e, r) { + if (r === "0") return t.o.u; else if (r === "1") return t.o.l; + }, + set(e, r, s) { + if (r !== "1") { + throw new TypeError("props must be 1"); + } + t.o.l = s; + return true; + } + }); + } + copy() { + return new HashMapIterator(this.o, this.h, this.container, this.iteratorType); + } +} + +class HashMap extends _Base.HashContainer { + constructor(t = []) { + super(); + const e = this; + t.forEach((function(t) { + e.setElement(t[0], t[1]); + })); + } + begin() { + return new HashMapIterator(this.p, this.h, this); + } + end() { + return new HashMapIterator(this.h, this.h, this); + } + rBegin() { + return new HashMapIterator(this._, this.h, this, 1); + } + rEnd() { + return new HashMapIterator(this.h, this.h, this, 1); + } + front() { + if (this.i === 0) return; + return [ this.p.u, this.p.l ]; + } + back() { + if (this.i === 0) return; + return [ this._.u, this._.l ]; + } + setElement(t, e, r) { + return this.M(t, e, r); + } + getElementByKey(t, e) { + if (e === undefined) e = (0, _checkObject.default)(t); + if (e) { + const e = t[this.HASH_TAG]; + return e !== undefined ? this.H[e].l : undefined; + } + const r = this.g[t]; + return r ? r.l : undefined; + } + getElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + let e = this.p; + while (t--) { + e = e.B; + } + return [ e.u, e.l ]; + } + find(t, e) { + const r = this.I(t, e); + return new HashMapIterator(r, this.h, this); + } + forEach(t) { + let e = 0; + let r = this.p; + while (r !== this.h) { + t([ r.u, r.l ], e++, this); + r = r.B; + } + } + [Symbol.iterator]() { + return function*() { + let t = this.p; + while (t !== this.h) { + yield [ t.u, t.l ]; + t = t.B; + } + }.bind(this)(); + } +} + +var _default = HashMap; + +exports.default = _default; +//# sourceMappingURL=HashMap.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js.map b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js.map new file mode 100644 index 000000000..da5e27a57 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/HashContainer/HashMap.js","../../src/container/HashContainer/HashMap.ts"],"names":["Object","defineProperty","exports","value","default","_Base","require","_checkObject","_interopRequireDefault","_throwError","obj","__esModule","HashMapIterator","HashContainerIterator","constructor","node","header","container","iteratorType","super","this","pointer","_node","_header","throwIteratorAccessError","self","Proxy","get","_","props","_key","_value","set","newValue","TypeError","copy","HashMap","HashContainer","forEach","el","setElement","begin","_head","end","rBegin","_tail","rEnd","front","_length","back","key","isObject","_set","getElementByKey","undefined","checkObject","index","HASH_TAG","_objMap","_originMap","getElementByPos","pos","RangeError","_next","find","_findElementNode","callback","Symbol","iterator","bind","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACJvB,IAAAC,QAAAC,QAAA;;AACA,IAAAC,eAAAC,uBAAAF,QAAA;;AAEA,IAAAG,cAAAH,QAAA;;AAA8D,SAAAE,uBAAAE;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAN,SAAAM;;AAAA;;AAE9D,MAAME,wBAA8BC,MAAAA;IAElCC,YACEC,GACAC,GACAC,GACAC;QAEAC,MAAMJ,GAAMC,GAAQE;QACpBE,KAAKH,YAAYA;ADPjB;ICSEI;QACF,IAAID,KAAKE,MAAUF,KAAKG,GAAS;aAC/B,GAAAC,YAAAA;ADPE;QCSJ,MAAMC,IAAOL;QACb,OAAO,IAAIM,MAAuB,IAAI;YACpCC,IAAIC,GAAGC;gBACL,IAAIA,MAAU,KAA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KAAKqC;YAC1D,OAAOD,MAAUF,YAAYlC,KAAKsC,EAAQF,GAAOzB,IAASuB;ADPxD;QCSJ,MAAMvC,IAAOK,KAAKuC,EAA4BT;QAC9C,OAAOnC,IAAOA,EAAKgB,IAASuB;ADP5B;ICSFM,gBAAgBC;QDPV,ICQsBA,IAAG,KAAHA,IAAQzC,KAAK4B,IAAO,GAhG3C;YAAE,MAAU,IAAIc;AD0Ff;QCOJ,IAAI/C,IAAOK,KAAKsB;QAChB,OAAOmB,KAAO;YACZ9C,IAAOA,EAAKgD;ADLV;QCOJ,OAAe,EAAChD,EAAKe,GAAMf,EAAKgB;ADLhC;ICcFiC,KAAKd,GAAQC;QACX,MAAMpC,IAAOK,KAAK6C,EAAiBf,GAAKC;QACxC,OAAO,IAAIvC,gBAAsBG,GAAMK,KAAKG,GAASH;ADLrD;ICOFkB,QAAQ4B;QACN,IAAIV,IAAQ;QACZ,IAAIzC,IAAOK,KAAKsB;QAChB,OAAO3B,MAASK,KAAKG,GAAS;YAC5B2C,EAAiB,EAACnD,EAAKe,GAAMf,EAAKgB,KAASyB,KAASpC;YACpDL,IAAOA,EAAKgD;ADLV;AACJ;ICOF,CAACI,OAAOC;QACN,OAAO;YACL,IAAIrD,IAAOK,KAAKsB;YAChB,OAAO3B,MAASK,KAAKG,GAAS;sBACd,EAACR,EAAKe,GAAMf,EAAKgB;gBAC/BhB,IAAOA,EAAKgD;ADLR;AACJ,UCMFM,KAAKjD,KANA;ADCP;;;ACOH,IAAAkD,WAEclC;;AAAOlC,QAAAE,UAAAkE","file":"HashMap.js","sourcesContent":["import { HashContainer, HashContainerIterator } from \"./Base\";\nimport checkObject from \"../../utils/checkObject\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nclass HashMapIterator extends HashContainerIterator {\n constructor(node, header, container, iteratorType) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n const self = this;\n return new Proxy([], {\n get(_, props) {\n if (props === '0')\n return self._node._key;\n else if (props === '1')\n return self._node._value;\n },\n set(_, props, newValue) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n }\n copy() {\n return new HashMapIterator(this._node, this._header, this.container, this.iteratorType);\n }\n}\nclass HashMap extends HashContainer {\n constructor(container = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n }\n begin() {\n return new HashMapIterator(this._head, this._header, this);\n }\n end() {\n return new HashMapIterator(this._header, this._header, this);\n }\n rBegin() {\n return new HashMapIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new HashMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n if (this._length === 0)\n return;\n return [this._head._key, this._head._value];\n }\n back() {\n if (this._length === 0)\n return;\n return [this._tail._key, this._tail._value];\n }\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after setting.\n */\n setElement(key, value, isObject) {\n return this._set(key, value, isObject);\n }\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The key want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @example\n * const val = container.getElementByKey(1);\n */\n getElementByKey(key, isObject) {\n if (isObject === undefined)\n isObject = checkObject(key);\n if (isObject) {\n const index = key[this.HASH_TAG];\n return index !== undefined ? this._objMap[index]._value : undefined;\n }\n const node = this._originMap[key];\n return node ? node._value : undefined;\n }\n getElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n return [node._key, node._value];\n }\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n find(key, isObject) {\n const node = this._findElementNode(key, isObject);\n return new HashMapIterator(node, this._header, this);\n }\n forEach(callback) {\n let index = 0;\n let node = this._head;\n while (node !== this._header) {\n callback([node._key, node._value], index++, this);\n node = node._next;\n }\n }\n [Symbol.iterator]() {\n return function* () {\n let node = this._head;\n while (node !== this._header) {\n yield [node._key, node._value];\n node = node._next;\n }\n }.bind(this)();\n }\n}\nexport default HashMap;\n","import { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { HashContainer, HashContainerIterator, HashLinkNode } from '@/container/HashContainer/Base';\nimport checkObject from '@/utils/checkObject';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass HashMapIterator extends HashContainerIterator {\n readonly container: HashMap;\n constructor(\n node: HashLinkNode,\n header: HashLinkNode,\n container: HashMap,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n const self = this;\n return new Proxy(<[K, V]>[], {\n get(_, props: '0' | '1') {\n if (props === '0') return self._node._key;\n else if (props === '1') return self._node._value;\n },\n set(_, props: '1', newValue: V) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n }\n copy() {\n return new HashMapIterator(this._node, this._header, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: HashMapIterator): boolean;\n}\n\nexport type { HashMapIterator };\n\nclass HashMap extends HashContainer {\n constructor(container: initContainer<[K, V]> = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n }\n begin() {\n return new HashMapIterator(this._head, this._header, this);\n }\n end() {\n return new HashMapIterator(this._header, this._header, this);\n }\n rBegin() {\n return new HashMapIterator(this._tail, this._header, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new HashMapIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front() {\n if (this._length === 0) return;\n return <[K, V]>[this._head._key, this._head._value];\n }\n back() {\n if (this._length === 0) return;\n return <[K, V]>[this._tail._key, this._tail._value];\n }\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after setting.\n */\n setElement(key: K, value: V, isObject?: boolean) {\n return this._set(key, value, isObject);\n }\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The key want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @example\n * const val = container.getElementByKey(1);\n */\n getElementByKey(key: K, isObject?: boolean) {\n if (isObject === undefined) isObject = checkObject(key);\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n return index !== undefined ? this._objMap[index]._value : undefined;\n }\n const node = this._originMap[key];\n return node ? node._value : undefined;\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n return <[K, V]>[node._key, node._value];\n }\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n find(key: K, isObject?: boolean) {\n const node = this._findElementNode(key, isObject);\n return new HashMapIterator(node, this._header, this);\n }\n forEach(callback: (element: [K, V], index: number, hashMap: HashMap) => void) {\n let index = 0;\n let node = this._head;\n while (node !== this._header) {\n callback(<[K, V]>[node._key, node._value], index++, this);\n node = node._next;\n }\n }\n [Symbol.iterator]() {\n return function * (this: HashMap) {\n let node = this._head;\n while (node !== this._header) {\n yield <[K, V]>[node._key, node._value];\n node = node._next;\n }\n }.bind(this)();\n }\n}\n\nexport default HashMap;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts new file mode 100644 index 000000000..345fe5ab5 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts @@ -0,0 +1,39 @@ +import { initContainer, IteratorType } from "../ContainerBase"; +import { HashContainer, HashContainerIterator, HashLinkNode } from "./Base"; +declare class HashSetIterator extends HashContainerIterator { + readonly container: HashSet; + constructor(node: HashLinkNode, header: HashLinkNode, container: HashSet, iteratorType?: IteratorType); + get pointer(): K; + copy(): HashSetIterator; + equals(iter: HashSetIterator): boolean; +} +export type { HashSetIterator }; +declare class HashSet extends HashContainer { + constructor(container?: initContainer); + begin(): HashSetIterator; + end(): HashSetIterator; + rBegin(): HashSetIterator; + rEnd(): HashSetIterator; + front(): K | undefined; + back(): K | undefined; + /** + * @description Insert element to set. + * @param key - The key want to insert. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns The size of container after inserting. + */ + insert(key: K, isObject?: boolean): number; + getElementByPos(pos: number): K; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ + find(key: K, isObject?: boolean): HashSetIterator; + forEach(callback: (element: K, index: number, container: HashSet) => void): void; + [Symbol.iterator](): Generator; +} +export default HashSet; diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js new file mode 100644 index 000000000..6c75f3386 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js @@ -0,0 +1,94 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = require("./Base"); + +var _throwError = require("../../utils/throwError"); + +class HashSetIterator extends _Base.HashContainerIterator { + constructor(t, e, r, s) { + super(t, e, s); + this.container = r; + } + get pointer() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + return this.o.u; + } + copy() { + return new HashSetIterator(this.o, this.h, this.container, this.iteratorType); + } +} + +class HashSet extends _Base.HashContainer { + constructor(t = []) { + super(); + const e = this; + t.forEach((function(t) { + e.insert(t); + })); + } + begin() { + return new HashSetIterator(this.p, this.h, this); + } + end() { + return new HashSetIterator(this.h, this.h, this); + } + rBegin() { + return new HashSetIterator(this._, this.h, this, 1); + } + rEnd() { + return new HashSetIterator(this.h, this.h, this, 1); + } + front() { + return this.p.u; + } + back() { + return this._.u; + } + insert(t, e) { + return this.M(t, undefined, e); + } + getElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + let e = this.p; + while (t--) { + e = e.B; + } + return e.u; + } + find(t, e) { + const r = this.I(t, e); + return new HashSetIterator(r, this.h, this); + } + forEach(t) { + let e = 0; + let r = this.p; + while (r !== this.h) { + t(r.u, e++, this); + r = r.B; + } + } + [Symbol.iterator]() { + return function*() { + let t = this.p; + while (t !== this.h) { + yield t.u; + t = t.B; + } + }.bind(this)(); + } +} + +var _default = HashSet; + +exports.default = _default; +//# sourceMappingURL=HashSet.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js.map b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js.map new file mode 100644 index 000000000..15c71916e --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/HashContainer/HashSet.js","../../src/container/HashContainer/HashSet.ts"],"names":["Object","defineProperty","exports","value","default","_Base","require","_throwError","HashSetIterator","HashContainerIterator","constructor","node","header","container","iteratorType","super","this","pointer","_node","_header","throwIteratorAccessError","_key","copy","HashSet","HashContainer","self","forEach","el","insert","begin","_head","end","rBegin","_tail","rEnd","front","back","key","isObject","_set","undefined","getElementByPos","pos","_length","RangeError","_next","find","_findElementNode","callback","index","Symbol","iterator","bind","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACJvB,IAAAC,QAAAC,QAAA;;AAEA,IAAAC,cAAAD,QAAA;;AAEA,MAAME,wBAA2BC,MAAAA;IAE/BC,YACEC,GACAC,GACAC,GACAC;QAEAC,MAAMJ,GAAMC,GAAQE;QACpBE,KAAKH,YAAYA;ADPjB;ICSEI;QACF,IAAID,KAAKE,MAAUF,KAAKG,GAAS;aAC/B,GAAAC,YAAAA;ADPE;QCSJ,OAAOJ,KAAKE,EAAMG;ADPlB;ICSFC;QACE,OAAO,IAAId,gBAAmBQ,KAAKE,GAAOF,KAAKG,GAASH,KAAKH,WAAWG,KAAKF;ADP7E;;;ACeJ,MAAMS,gBAAmBC,MAAAA;IACvBd,YAAYG,IAA8B;QACxCE;QACA,MAAMU,IAAOT;QACbH,EAAUa,SAAQ,SAAUC;YAC1BF,EAAKG,OAAOD;ADZV;AACJ;ICcFE;QACE,OAAO,IAAIrB,gBAAmBQ,KAAKc,GAAOd,KAAKG,GAASH;ADZxD;ICcFe;QACE,OAAO,IAAIvB,gBAAmBQ,KAAKG,GAASH,KAAKG,GAASH;ADZ1D;ICcFgB;QACE,OAAO,IAAIxB,gBAAmBQ,KAAKiB,GAAOjB,KAAKG,GAASH,MAAI;ADZ5D;ICcFkB;QACE,OAAO,IAAI1B,gBAAmBQ,KAAKG,GAASH,KAAKG,GAASH,MAAI;ADZ9D;ICcFmB;QACE,OAAOnB,KAAKc,EAAMT;ADZlB;ICcFe;QACE,OAAOpB,KAAKiB,EAAMZ;ADZlB;ICqBFO,OAAOS,GAAQC;QACb,OAAOtB,KAAKuB,EAAKF,GAAKG,WAAWF;ADZjC;ICcFG,gBAAgBC;QDZV,ICasBA,IAAG,KAAHA,IAAQ1B,KAAK2B,IAAO,GA/DI;YAAE,MAAU,IAChEC;ADmDM;QCYJ,IAAIjC,IAAOK,KAAKc;QAChB,OAAOY,KAAO;YACZ/B,IAAOA,EAAKkC;ADVV;QCYJ,OAAOlC,EAAKU;ADVZ;ICmBFyB,KAAKT,GAAQC;QACX,MAAM3B,IAAOK,KAAK+B,EAAiBV,GAAKC;QACxC,OAAO,IAAI9B,gBAAmBG,GAAMK,KAAKG,GAASH;ADVlD;ICYFU,QAAQsB;QACN,IAAIC,IAAQ;QACZ,IAAItC,IAAOK,KAAKc;QAChB,OAAOnB,MAASK,KAAKG,GAAS;YAC5B6B,EAASrC,EAAKU,GAAM4B,KAASjC;YAC7BL,IAAOA,EAAKkC;ADVV;AACJ;ICYF,CAACK,OAAOC;QACN,OAAO;YACL,IAAIxC,IAAOK,KAAKc;YAChB,OAAOnB,MAASK,KAAKG,GAAS;sBACtBR,EAAKU;gBACXV,IAAOA,EAAKkC;ADVR;AACJ,UCWFO,KAAKpC,KANA;ADJP;;;ACYH,IAAAqC,WAEc9B;;AAAOrB,QAAAE,UAAAiD","file":"HashSet.js","sourcesContent":["import { HashContainer, HashContainerIterator } from \"./Base\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nclass HashSetIterator extends HashContainerIterator {\n constructor(node, header, container, iteratorType) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key;\n }\n copy() {\n return new HashSetIterator(this._node, this._header, this.container, this.iteratorType);\n }\n}\nclass HashSet extends HashContainer {\n constructor(container = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.insert(el);\n });\n }\n begin() {\n return new HashSetIterator(this._head, this._header, this);\n }\n end() {\n return new HashSetIterator(this._header, this._header, this);\n }\n rBegin() {\n return new HashSetIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new HashSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n return this._head._key;\n }\n back() {\n return this._tail._key;\n }\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after inserting.\n */\n insert(key, isObject) {\n return this._set(key, undefined, isObject);\n }\n getElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n return node._key;\n }\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n find(key, isObject) {\n const node = this._findElementNode(key, isObject);\n return new HashSetIterator(node, this._header, this);\n }\n forEach(callback) {\n let index = 0;\n let node = this._head;\n while (node !== this._header) {\n callback(node._key, index++, this);\n node = node._next;\n }\n }\n [Symbol.iterator]() {\n return function* () {\n let node = this._head;\n while (node !== this._header) {\n yield node._key;\n node = node._next;\n }\n }.bind(this)();\n }\n}\nexport default HashSet;\n","import { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { HashContainer, HashContainerIterator, HashLinkNode } from '@/container/HashContainer/Base';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass HashSetIterator extends HashContainerIterator {\n readonly container: HashSet;\n constructor(\n node: HashLinkNode,\n header: HashLinkNode,\n container: HashSet,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key;\n }\n copy() {\n return new HashSetIterator(this._node, this._header, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: HashSetIterator): boolean;\n}\n\nexport type { HashSetIterator };\n\nclass HashSet extends HashContainer {\n constructor(container: initContainer = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.insert(el);\n });\n }\n begin() {\n return new HashSetIterator(this._head, this._header, this);\n }\n end() {\n return new HashSetIterator(this._header, this._header, this);\n }\n rBegin() {\n return new HashSetIterator(this._tail, this._header, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new HashSetIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front(): K | undefined {\n return this._head._key;\n }\n back(): K | undefined {\n return this._tail._key;\n }\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after inserting.\n */\n insert(key: K, isObject?: boolean) {\n return this._set(key, undefined, isObject);\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n return node._key;\n }\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n find(key: K, isObject?: boolean) {\n const node = this._findElementNode(key, isObject);\n return new HashSetIterator(node, this._header, this);\n }\n forEach(callback: (element: K, index: number, container: HashSet) => void) {\n let index = 0;\n let node = this._head;\n while (node !== this._header) {\n callback(node._key, index++, this);\n node = node._next;\n }\n }\n [Symbol.iterator]() {\n return function * (this: HashSet) {\n let node = this._head;\n while (node !== this._header) {\n yield node._key;\n node = node._next;\n }\n }.bind(this)();\n }\n}\n\nexport default HashSet;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts new file mode 100644 index 000000000..8937bef03 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts @@ -0,0 +1,79 @@ +import { Base, initContainer } from "../ContainerBase"; +declare class PriorityQueue extends Base { + /** + * @description PriorityQueue's constructor. + * @param container - Initialize container, must have a forEach function. + * @param cmp - Compare function. + * @param copy - When the container is an array, you can choose to directly operate on the original object of + * the array or perform a shallow copy. The default is shallow copy. + * @example + * new PriorityQueue(); + * new PriorityQueue([1, 2, 3]); + * new PriorityQueue([1, 2, 3], (x, y) => x - y); + * new PriorityQueue([1, 2, 3], (x, y) => x - y, false); + */ + constructor(container?: initContainer, cmp?: (x: T, y: T) => number, copy?: boolean); + clear(): void; + /** + * @description Push element into a container in order. + * @param item - The element you want to push. + * @returns The size of heap after pushing. + * @example + * queue.push(1); + */ + push(item: T): void; + /** + * @description Removes the top element. + * @returns The element you popped. + * @example + * queue.pop(); + */ + pop(): T | undefined; + /** + * @description Accesses the top element. + * @example + * const top = queue.top(); + */ + top(): T | undefined; + /** + * @description Check if element is in heap. + * @param item - The item want to find. + * @returns Whether element is in heap. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * console.log(que.find(obj)); // true + */ + find(item: T): boolean; + /** + * @description Remove specified item from heap. + * @param item - The item want to remove. + * @returns Whether remove success. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * que.remove(obj); + */ + remove(item: T): boolean; + /** + * @description Update item and it's pos in the heap. + * @param item - The item want to update. + * @returns Whether update success. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * obj.id = 2; + * que.updateItem(obj); + */ + updateItem(item: T): boolean; + /** + * @returns Return a copy array of heap. + * @example + * const arr = queue.toArray(); + */ + toArray(): T[]; +} +export default PriorityQueue; diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js new file mode 100644 index 000000000..e90fa09ad --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js @@ -0,0 +1,118 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _ContainerBase = require("../ContainerBase"); + +class PriorityQueue extends _ContainerBase.Base { + constructor(t = [], s = function(t, s) { + if (t > s) return -1; + if (t < s) return 1; + return 0; + }, i = true) { + super(); + this.v = s; + if (Array.isArray(t)) { + this.C = i ? [ ...t ] : t; + } else { + this.C = []; + const s = this; + t.forEach((function(t) { + s.C.push(t); + })); + } + this.i = this.C.length; + const e = this.i >> 1; + for (let t = this.i - 1 >> 1; t >= 0; --t) { + this.k(t, e); + } + } + m(t) { + const s = this.C[t]; + while (t > 0) { + const i = t - 1 >> 1; + const e = this.C[i]; + if (this.v(e, s) <= 0) break; + this.C[t] = e; + t = i; + } + this.C[t] = s; + } + k(t, s) { + const i = this.C[t]; + while (t < s) { + let s = t << 1 | 1; + const e = s + 1; + let h = this.C[s]; + if (e < this.i && this.v(h, this.C[e]) > 0) { + s = e; + h = this.C[e]; + } + if (this.v(h, i) >= 0) break; + this.C[t] = h; + t = s; + } + this.C[t] = i; + } + clear() { + this.i = 0; + this.C.length = 0; + } + push(t) { + this.C.push(t); + this.m(this.i); + this.i += 1; + } + pop() { + if (this.i === 0) return; + const t = this.C[0]; + const s = this.C.pop(); + this.i -= 1; + if (this.i) { + this.C[0] = s; + this.k(0, this.i >> 1); + } + return t; + } + top() { + return this.C[0]; + } + find(t) { + return this.C.indexOf(t) >= 0; + } + remove(t) { + const s = this.C.indexOf(t); + if (s < 0) return false; + if (s === 0) { + this.pop(); + } else if (s === this.i - 1) { + this.C.pop(); + this.i -= 1; + } else { + this.C.splice(s, 1, this.C.pop()); + this.i -= 1; + this.m(s); + this.k(s, this.i >> 1); + } + return true; + } + updateItem(t) { + const s = this.C.indexOf(t); + if (s < 0) return false; + this.m(s); + this.k(s, this.i >> 1); + return true; + } + toArray() { + return [ ...this.C ]; + } +} + +var _default = PriorityQueue; + +exports.default = _default; +//# sourceMappingURL=PriorityQueue.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js.map b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js.map new file mode 100644 index 000000000..727c18921 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/OtherContainer/PriorityQueue.js","../../src/container/OtherContainer/PriorityQueue.ts"],"names":["Object","defineProperty","exports","value","default","_ContainerBase","require","PriorityQueue","Base","constructor","container","cmp","x","y","copy","super","this","_cmp","Array","isArray","_priorityQueue","self","forEach","el","push","_length","length","halfLength","parent","_pushDown","_pushUp","pos","item","parentItem","left","right","minItem","clear","pop","last","top","find","indexOf","remove","index","splice","updateItem","toArray","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,iBAAAC,QAAA;;AAEA,MAAMC,sBAAyBC,eAAAA;IAqB7BC,YACEC,IAA8B,IAC9BC,IACA,SAAUC,GAAMC;QACd,IAAID,IAAIC,GAAG,QAAQ;QACnB,IAAID,IAAIC,GAAG,OAAO;QAClB,OAAO;ADTT,OCWAC,IAAO;QAEPC;QACAC,KAAKC,IAAON;QACZ,IAAIO,MAAMC,QAAQT,IAAY;YAC5BM,KAAKI,IAAiBN,IAAO,KAAIJ,MAAaA;ADX5C,eCYG;YACLM,KAAKI,IAAiB;YACtB,MAAMC,IAAOL;YACbN,EAAUY,SAAQ,SAAUC;gBAC1BF,EAAKD,EAAeI,KAAKD;ADVrB;AACJ;QCYJP,KAAKS,IAAUT,KAAKI,EAAeM;QACnC,MAAMC,IAAaX,KAAKS,KAAW;QACnC,KAAK,IAAIG,IAAUZ,KAAKS,IAAU,KAAM,GAAGG,K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OAAOxB,KAAKI,EAAe;ADT3B;ICqBFqB,KAAKT;QACH,OAAOhB,KAAKI,EAAesB,QAAQV,MAAS;ADT5C;ICqBFW,OAAOX;QACL,MAAMY,IAAQ5B,KAAKI,EAAesB,QAAQV;QAC1C,IAAIY,IAAQ,GAAG,OAAO;QACtB,IAAIA,MAAU,GAAG;YACf5B,KAAKsB;ADRH,eCSG,IAAIM,MAAU5B,KAAKS,IAAU,GAAG;YACrCT,KAAKI,EAAekB;YACpBtB,KAAKS,KAAW;ADPd,eCQG;YACLT,KAAKI,EAAeyB,OAAOD,GAAO,GAAG5B,KAAKI,EAAekB;YACzDtB,KAAKS,KAAW;YAChBT,KAAKc,EAAQc;YACb5B,KAAKa,EAAUe,GAAO5B,KAAKS,KAAW;ADNpC;QCQJ,OAAO;ADNP;ICmBFqB,WAAWd;QACT,MAAMY,IAAQ5B,KAAKI,EAAesB,QAAQV;QAC1C,IAAIY,IAAQ,GAAG,OAAO;QACtB5B,KAAKc,EAAQc;QACb5B,KAAKa,EAAUe,GAAO5B,KAAKS,KAAW;QACtC,OAAO;ADLP;ICYFsB;QACE,OAAO,KAAI/B,KAAKI;ADLhB;;;ACOH,IAAA4B,WAEczC;;AAAaL,QAAAE,UAAA4C","file":"PriorityQueue.js","sourcesContent":["import { Base } from \"../ContainerBase\";\nclass PriorityQueue extends Base {\n /**\n * @description PriorityQueue's constructor.\n * @param container - Initialize container, must have a forEach function.\n * @param cmp - Compare function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n * @example\n * new PriorityQueue();\n * new PriorityQueue([1, 2, 3]);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y, false);\n */\n constructor(container = [], cmp = function (x, y) {\n if (x > y)\n return -1;\n if (x < y)\n return 1;\n return 0;\n }, copy = true) {\n super();\n this._cmp = cmp;\n if (Array.isArray(container)) {\n this._priorityQueue = copy ? [...container] : container;\n }\n else {\n this._priorityQueue = [];\n const self = this;\n container.forEach(function (el) {\n self._priorityQueue.push(el);\n });\n }\n this._length = this._priorityQueue.length;\n const halfLength = this._length >> 1;\n for (let parent = (this._length - 1) >> 1; parent >= 0; --parent) {\n this._pushDown(parent, halfLength);\n }\n }\n /**\n * @internal\n */\n _pushUp(pos) {\n const item = this._priorityQueue[pos];\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const parentItem = this._priorityQueue[parent];\n if (this._cmp(parentItem, item) <= 0)\n break;\n this._priorityQueue[pos] = parentItem;\n pos = parent;\n }\n this._priorityQueue[pos] = item;\n }\n /**\n * @internal\n */\n _pushDown(pos, halfLength) {\n const item = this._priorityQueue[pos];\n while (pos < halfLength) {\n let left = pos << 1 | 1;\n const right = left + 1;\n let minItem = this._priorityQueue[left];\n if (right < this._length &&\n this._cmp(minItem, this._priorityQueue[right]) > 0) {\n left = right;\n minItem = this._priorityQueue[right];\n }\n if (this._cmp(minItem, item) >= 0)\n break;\n this._priorityQueue[pos] = minItem;\n pos = left;\n }\n this._priorityQueue[pos] = item;\n }\n clear() {\n this._length = 0;\n this._priorityQueue.length = 0;\n }\n /**\n * @description Push element into a container in order.\n * @param item - The element you want to push.\n * @returns The size of heap after pushing.\n * @example\n * queue.push(1);\n */\n push(item) {\n this._priorityQueue.push(item);\n this._pushUp(this._length);\n this._length += 1;\n }\n /**\n * @description Removes the top element.\n * @returns The element you popped.\n * @example\n * queue.pop();\n */\n pop() {\n if (this._length === 0)\n return;\n const value = this._priorityQueue[0];\n const last = this._priorityQueue.pop();\n this._length -= 1;\n if (this._length) {\n this._priorityQueue[0] = last;\n this._pushDown(0, this._length >> 1);\n }\n return value;\n }\n /**\n * @description Accesses the top element.\n * @example\n * const top = queue.top();\n */\n top() {\n return this._priorityQueue[0];\n }\n /**\n * @description Check if element is in heap.\n * @param item - The item want to find.\n * @returns Whether element is in heap.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * console.log(que.find(obj)); // true\n */\n find(item) {\n return this._priorityQueue.indexOf(item) >= 0;\n }\n /**\n * @description Remove specified item from heap.\n * @param item - The item want to remove.\n * @returns Whether remove success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * que.remove(obj);\n */\n remove(item) {\n const index = this._priorityQueue.indexOf(item);\n if (index < 0)\n return false;\n if (index === 0) {\n this.pop();\n }\n else if (index === this._length - 1) {\n this._priorityQueue.pop();\n this._length -= 1;\n }\n else {\n this._priorityQueue.splice(index, 1, this._priorityQueue.pop());\n this._length -= 1;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n }\n return true;\n }\n /**\n * @description Update item and it's pos in the heap.\n * @param item - The item want to update.\n * @returns Whether update success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * obj.id = 2;\n * que.updateItem(obj);\n */\n updateItem(item) {\n const index = this._priorityQueue.indexOf(item);\n if (index < 0)\n return false;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n return true;\n }\n /**\n * @returns Return a copy array of heap.\n * @example\n * const arr = queue.toArray();\n */\n toArray() {\n return [...this._priorityQueue];\n }\n}\nexport default PriorityQueue;\n","import { Base, initContainer } from '@/container/ContainerBase';\n\nclass PriorityQueue extends Base {\n /**\n * @internal\n */\n private readonly _priorityQueue: T[];\n /**\n * @internal\n */\n private readonly _cmp: (x: T, y: T) => number;\n /**\n * @description PriorityQueue's constructor.\n * @param container - Initialize container, must have a forEach function.\n * @param cmp - Compare function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n * @example\n * new PriorityQueue();\n * new PriorityQueue([1, 2, 3]);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y, false);\n */\n constructor(\n container: initContainer = [],\n cmp: (x: T, y: T) => number =\n function (x: T, y: T) {\n if (x > y) return -1;\n if (x < y) return 1;\n return 0;\n },\n copy = true\n ) {\n super();\n this._cmp = cmp;\n if (Array.isArray(container)) {\n this._priorityQueue = copy ? [...container] : container;\n } else {\n this._priorityQueue = [];\n const self = this;\n container.forEach(function (el) {\n self._priorityQueue.push(el);\n });\n }\n this._length = this._priorityQueue.length;\n const halfLength = this._length >> 1;\n for (let parent = (this._length - 1) >> 1; parent >= 0; --parent) {\n this._pushDown(parent, halfLength);\n }\n }\n /**\n * @internal\n */\n private _pushUp(pos: number) {\n const item = this._priorityQueue[pos];\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const parentItem = this._priorityQueue[parent];\n if (this._cmp(parentItem, item) <= 0) break;\n this._priorityQueue[pos] = parentItem;\n pos = parent;\n }\n this._priorityQueue[pos] = item;\n }\n /**\n * @internal\n */\n private _pushDown(pos: number, halfLength: number) {\n const item = this._priorityQueue[pos];\n while (pos < halfLength) {\n let left = pos << 1 | 1;\n const right = left + 1;\n let minItem = this._priorityQueue[left];\n if (\n right < this._length &&\n this._cmp(minItem, this._priorityQueue[right]) > 0\n ) {\n left = right;\n minItem = this._priorityQueue[right];\n }\n if (this._cmp(minItem, item) >= 0) break;\n this._priorityQueue[pos] = minItem;\n pos = left;\n }\n this._priorityQueue[pos] = item;\n }\n clear() {\n this._length = 0;\n this._priorityQueue.length = 0;\n }\n /**\n * @description Push element into a container in order.\n * @param item - The element you want to push.\n * @returns The size of heap after pushing.\n * @example\n * queue.push(1);\n */\n push(item: T) {\n this._priorityQueue.push(item);\n this._pushUp(this._length);\n this._length += 1;\n }\n /**\n * @description Removes the top element.\n * @returns The element you popped.\n * @example\n * queue.pop();\n */\n pop() {\n if (this._length === 0) return;\n const value = this._priorityQueue[0];\n const last = this._priorityQueue.pop()!;\n this._length -= 1;\n if (this._length) {\n this._priorityQueue[0] = last;\n this._pushDown(0, this._length >> 1);\n }\n return value;\n }\n /**\n * @description Accesses the top element.\n * @example\n * const top = queue.top();\n */\n top(): T | undefined {\n return this._priorityQueue[0];\n }\n /**\n * @description Check if element is in heap.\n * @param item - The item want to find.\n * @returns Whether element is in heap.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * console.log(que.find(obj)); // true\n */\n find(item: T) {\n return this._priorityQueue.indexOf(item) >= 0;\n }\n /**\n * @description Remove specified item from heap.\n * @param item - The item want to remove.\n * @returns Whether remove success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * que.remove(obj);\n */\n remove(item: T) {\n const index = this._priorityQueue.indexOf(item);\n if (index < 0) return false;\n if (index === 0) {\n this.pop();\n } else if (index === this._length - 1) {\n this._priorityQueue.pop();\n this._length -= 1;\n } else {\n this._priorityQueue.splice(index, 1, this._priorityQueue.pop()!);\n this._length -= 1;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n }\n return true;\n }\n /**\n * @description Update item and it's pos in the heap.\n * @param item - The item want to update.\n * @returns Whether update success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * obj.id = 2;\n * que.updateItem(obj);\n */\n updateItem(item: T) {\n const index = this._priorityQueue.indexOf(item);\n if (index < 0) return false;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n return true;\n }\n /**\n * @returns Return a copy array of heap.\n * @example\n * const arr = queue.toArray();\n */\n toArray() {\n return [...this._priorityQueue];\n }\n}\n\nexport default PriorityQueue;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts new file mode 100644 index 000000000..8df4e1740 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts @@ -0,0 +1,22 @@ +import { Base, initContainer } from "../ContainerBase"; +declare class Queue extends Base { + constructor(container?: initContainer); + clear(): void; + /** + * @description Inserts element to queue's end. + * @param element - The element you want to push to the front. + * @returns The container length after pushing. + */ + push(element: T): number; + /** + * @description Removes the first element. + * @returns The element you popped. + */ + pop(): T | undefined; + /** + * @description Access the first element. + * @returns The first element. + */ + front(): T | undefined; +} +export default Queue; diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js new file mode 100644 index 000000000..cd09701fa --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _ContainerBase = require("../ContainerBase"); + +class Queue extends _ContainerBase.Base { + constructor(t = []) { + super(); + this.j = 0; + this.q = []; + const s = this; + t.forEach((function(t) { + s.push(t); + })); + } + clear() { + this.q = []; + this.i = this.j = 0; + } + push(t) { + const s = this.q.length; + if (this.j / s > .5 && this.j + this.i >= s && s > 4096) { + const s = this.i; + for (let t = 0; t < s; ++t) { + this.q[t] = this.q[this.j + t]; + } + this.j = 0; + this.q[this.i] = t; + } else this.q[this.j + this.i] = t; + return ++this.i; + } + pop() { + if (this.i === 0) return; + const t = this.q[this.j++]; + this.i -= 1; + return t; + } + front() { + if (this.i === 0) return; + return this.q[this.j]; + } +} + +var _default = Queue; + +exports.default = _default; +//# sourceMappingURL=Queue.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js.map b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js.map new file mode 100644 index 000000000..64c962665 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/OtherContainer/Queue.js","../../src/container/OtherContainer/Queue.ts"],"names":["Object","defineProperty","exports","value","default","_ContainerBase","require","Queue","Base","constructor","container","super","this","_first","_queue","self","forEach","el","push","clear","_length","element","capacity","length","i","pop","front","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,iBAAAC,QAAA;;AAOA,MAAMC,cAAiBC,eAAAA;IASrBC,YAAYC,IAA8B;QACxCC;QANMC,KAAAC,IAAS;QAITD,KAAAE,IAAc;QAGpB,MAAMC,IAAOH;QACbF,EAAUM,SAAQ,SAAUC;YAC1BF,EAAKG,KAAKD;ADLR;AACJ;ICOFE;QACEP,KAAKE,IAAS;QACdF,KAAKQ,IAAUR,KAAKC,IAAS;ADL7B;ICYFK,KAAKG;QACH,MAAMC,IAAWV,KAAKE,EAAOS;QAC7B,IACGX,KAAKC,IAASS,IAAS,MACvBV,KAAKC,IAASD,KAAKQ,KAAYE,KAChCA,IAAQ,MACR;YACA,MAAMC,IAASX,KAAKQ;YACpB,KAAK,IAAII,IAAI,GAAGA,IAAID,KAAUC,GAAG;gBAC/BZ,KAAKE,EAAOU,KAAKZ,KAAKE,EAAOF,KAAKC,IAASW;ADPvC;YCSNZ,KAAKC,IAAS;YACdD,KAAKE,EAAOF,KAAKQ,KAAWC;ADP1B,eCQGT,KAAKE,EAAOF,KAAKC,IAASD,KAAKQ,KAAWC;QACjD,SAAST,KAAKQ;ADLd;ICWFK;QACE,IAAIb,KAAKQ,MAAY,GAAG;QACxB,MAAMH,IAAKL,KAAKE,EAAOF,KAAKC;QAC5BD,KAAKQ,KAAW;QAChB,OAAOH;ADJP;ICUFS;QACE,IAAId,KAAKQ,MAAY,GAAG;QACxB,OAAOR,KAAKE,EAAOF,KAAKC;ADHxB;;;ACKH,IAAAc,WAEcpB;;AAAKL,QAAAE,UAAAuB","file":"Queue.js","sourcesContent":["import { Base } from \"../ContainerBase\";\nclass Queue extends Base {\n constructor(container = []) {\n super();\n /**\n * @internal\n */\n this._first = 0;\n /**\n * @internal\n */\n this._queue = [];\n const self = this;\n container.forEach(function (el) {\n self.push(el);\n });\n }\n clear() {\n this._queue = [];\n this._length = this._first = 0;\n }\n /**\n * @description Inserts element to queue's end.\n * @param element - The element you want to push to the front.\n * @returns The container length after pushing.\n */\n push(element) {\n const capacity = this._queue.length;\n if ((this._first / capacity) > 0.5 /* QUEUE_CONSTANT.ALLOCATE_SIGMA */ &&\n (this._first + this._length) >= capacity &&\n capacity > 4096 /* QUEUE_CONSTANT.MIN_ALLOCATE_SIZE */) {\n const length = this._length;\n for (let i = 0; i < length; ++i) {\n this._queue[i] = this._queue[this._first + i];\n }\n this._first = 0;\n this._queue[this._length] = element;\n }\n else\n this._queue[this._first + this._length] = element;\n return ++this._length;\n }\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n pop() {\n if (this._length === 0)\n return;\n const el = this._queue[this._first++];\n this._length -= 1;\n return el;\n }\n /**\n * @description Access the first element.\n * @returns The first element.\n */\n front() {\n if (this._length === 0)\n return;\n return this._queue[this._first];\n }\n}\nexport default Queue;\n","import { Base, initContainer } from '@/container/ContainerBase';\n\nconst enum QUEUE_CONSTANT {\n ALLOCATE_SIGMA = 0.5,\n MIN_ALLOCATE_SIZE = (1 << 12)\n}\n\nclass Queue extends Base {\n /**\n * @internal\n */\n private _first = 0;\n /**\n * @internal\n */\n private _queue: T[] = [];\n constructor(container: initContainer = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.push(el);\n });\n }\n clear() {\n this._queue = [];\n this._length = this._first = 0;\n }\n /**\n * @description Inserts element to queue's end.\n * @param element - The element you want to push to the front.\n * @returns The container length after pushing.\n */\n push(element: T) {\n const capacity = this._queue.length;\n if (\n (this._first / capacity) > QUEUE_CONSTANT.ALLOCATE_SIGMA &&\n (this._first + this._length) >= capacity &&\n capacity > QUEUE_CONSTANT.MIN_ALLOCATE_SIZE\n ) {\n const length = this._length;\n for (let i = 0; i < length; ++i) {\n this._queue[i] = this._queue[this._first + i];\n }\n this._first = 0;\n this._queue[this._length] = element;\n } else this._queue[this._first + this._length] = element;\n return ++this._length;\n }\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n pop() {\n if (this._length === 0) return;\n const el = this._queue[this._first++];\n this._length -= 1;\n return el;\n }\n /**\n * @description Access the first element.\n * @returns The first element.\n */\n front(): T | undefined {\n if (this._length === 0) return;\n return this._queue[this._first];\n }\n}\n\nexport default Queue;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts new file mode 100644 index 000000000..3b8fac177 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts @@ -0,0 +1,22 @@ +import { Base, initContainer } from "../ContainerBase"; +declare class Stack extends Base { + constructor(container?: initContainer); + clear(): void; + /** + * @description Insert element to stack's end. + * @description The element you want to push to the back. + * @returns The container length after erasing. + */ + push(element: T): number; + /** + * @description Removes the end element. + * @returns The element you popped. + */ + pop(): T | undefined; + /** + * @description Accesses the end element. + * @returns The last element. + */ + top(): T | undefined; +} +export default Stack; diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js new file mode 100644 index 000000000..80b8b7b5b --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _ContainerBase = require("../ContainerBase"); + +class Stack extends _ContainerBase.Base { + constructor(t = []) { + super(); + this.S = []; + const s = this; + t.forEach((function(t) { + s.push(t); + })); + } + clear() { + this.i = 0; + this.S = []; + } + push(t) { + this.S.push(t); + this.i += 1; + return this.i; + } + pop() { + if (this.i === 0) return; + this.i -= 1; + return this.S.pop(); + } + top() { + return this.S[this.i - 1]; + } +} + +var _default = Stack; + +exports.default = _default; +//# sourceMappingURL=Stack.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js.map b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js.map new file mode 100644 index 000000000..ef54f2aa3 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/OtherContainer/Stack.js","../../src/container/OtherContainer/Stack.ts"],"names":["Object","defineProperty","exports","value","default","_ContainerBase","require","Stack","Base","constructor","container","super","this","_stack","self","forEach","el","push","clear","_length","element","pop","top","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,iBAAAC,QAAA;;AAEA,MAAMC,cAAiBC,eAAAA;IAKrBC,YAAYC,IAA8B;QACxCC;QAFMC,KAAAC,IAAc;QAGpB,MAAMC,IAAOF;QACbF,EAAUK,SAAQ,SAAUC;YAC1BF,EAAKG,KAAKD;ADAR;AACJ;ICEFE;QACEN,KAAKO,IAAU;QACfP,KAAKC,IAAS;ADAd;ICOFI,KAAKG;QACHR,KAAKC,EAAOI,KAAKG;QACjBR,KAAKO,KAAW;QAChB,OAAOP,KAAKO;ADAZ;ICMFE;QACE,IAAIT,KAAKO,MAAY,GAAG;QACxBP,KAAKO,KAAW;QAChB,OAAOP,KAAKC,EAAOQ;ADCnB;ICKFC;QACE,OAAOV,KAAKC,EAAOD,KAAKO,IAAU;ADClC;;;ACCH,IAAAI,WAEchB;;AAAKL,QAAAE,UAAAmB","file":"Stack.js","sourcesContent":["import { Base } from \"../ContainerBase\";\nclass Stack extends Base {\n constructor(container = []) {\n super();\n /**\n * @internal\n */\n this._stack = [];\n const self = this;\n container.forEach(function (el) {\n self.push(el);\n });\n }\n clear() {\n this._length = 0;\n this._stack = [];\n }\n /**\n * @description Insert element to stack's end.\n * @description The element you want to push to the back.\n * @returns The container length after erasing.\n */\n push(element) {\n this._stack.push(element);\n this._length += 1;\n return this._length;\n }\n /**\n * @description Removes the end element.\n * @returns The element you popped.\n */\n pop() {\n if (this._length === 0)\n return;\n this._length -= 1;\n return this._stack.pop();\n }\n /**\n * @description Accesses the end element.\n * @returns The last element.\n */\n top() {\n return this._stack[this._length - 1];\n }\n}\nexport default Stack;\n","import { Base, initContainer } from '@/container/ContainerBase';\n\nclass Stack extends Base {\n /**\n * @internal\n */\n private _stack: T[] = [];\n constructor(container: initContainer = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.push(el);\n });\n }\n clear() {\n this._length = 0;\n this._stack = [];\n }\n /**\n * @description Insert element to stack's end.\n * @description The element you want to push to the back.\n * @returns The container length after erasing.\n */\n push(element: T) {\n this._stack.push(element);\n this._length += 1;\n return this._length;\n }\n /**\n * @description Removes the end element.\n * @returns The element you popped.\n */\n pop() {\n if (this._length === 0) return;\n this._length -= 1;\n return this._stack.pop();\n }\n /**\n * @description Accesses the end element.\n * @returns The last element.\n */\n top(): T | undefined {\n return this._stack[this._length - 1];\n }\n}\n\nexport default Stack;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts new file mode 100644 index 000000000..f9480ee9b --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts @@ -0,0 +1,9 @@ +import { ContainerIterator } from "../../ContainerBase"; +import SequentialContainer from "./index"; +export declare abstract class RandomIterator extends ContainerIterator { + abstract readonly container: SequentialContainer; + get pointer(): T; + set pointer(newValue: T); + pre(): this; + next(): this; +} diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js new file mode 100644 index 000000000..509d2265f --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.RandomIterator = void 0; + +var _ContainerBase = require("../../ContainerBase"); + +var _throwError = require("../../../utils/throwError"); + +class RandomIterator extends _ContainerBase.ContainerIterator { + constructor(t, r) { + super(r); + this.o = t; + if (this.iteratorType === 0) { + this.pre = function() { + if (this.o === 0) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o -= 1; + return this; + }; + this.next = function() { + if (this.o === this.container.size()) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o += 1; + return this; + }; + } else { + this.pre = function() { + if (this.o === this.container.size() - 1) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o += 1; + return this; + }; + this.next = function() { + if (this.o === -1) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o -= 1; + return this; + }; + } + } + get pointer() { + return this.container.getElementByPos(this.o); + } + set pointer(t) { + this.container.setElementByPos(this.o, t); + } +} + +exports.RandomIterator = RandomIterator; +//# sourceMappingURL=RandomIterator.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js.map b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js.map new file mode 100644 index 000000000..24077f3aa --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Base/RandomIterator.js","../../src/container/SequentialContainer/Base/RandomIterator.ts"],"names":["Object","defineProperty","exports","value","RandomIterator","_ContainerBase","require","_throwError","ContainerIterator","constructor","index","iteratorType","super","this","_node","pre","throwIteratorAccessError","next","container","size","pointer","getElementByPos","newValue","setElementByPos"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,sBAAsB;;ACL9B,IAAAC,iBAAAC,QAAA;;AAEA,IAAAC,cAAAD,QAAA;;AAEM,MAAgBF,uBAA0BI,eAAAA;IAS9CC,YACEC,GACAC;QAEAC,MAAMD;QACNE,KAAKC,IAAQJ;QACb,IAAIG,KAAKF,iBAAY,GAA0B;YAC7CE,KAAKE,MAAM;gBACT,IAAIF,KAAKC,MAAU,GAAG;qBACpB,GAAAE,YAAAA;ADTM;gBCWRH,KAAKC,KAAS;gBACd,OAAOD;ADTH;YCWNA,KAAKI,OAAO;gBACV,IAAIJ,KAAKC,MAAUD,KAAKK,UAAUC,QAAQ;qBACxC,GAAAH,YAAAA;ADTM;gBCWRH,KAAKC,KAAS;gBACd,OAAOD;ADTH;AACJ,eCUG;YACLA,KAAKE,MAAM;gBACT,IAAIF,KAAKC,MAAUD,KAAKK,UAAUC,SAAS,GAAG;qBAC5C,GAAAH,YAAAA;ADRM;gBCURH,KAAKC,KAAS;gBACd,OAAOD;ADRH;YCUNA,KAAKI,OAAO;gBACV,IAAIJ,KAAKC,OAAW,GAAG;qBACrB,GAAAE,YAAAA;ADRM;gBCURH,KAAKC,KAAS;gBACd,OAAOD;ADRH;AACJ;AACJ;ICUEO;QACF,OAAOP,KAAKK,UAAUG,gBAAgBR,KAAKC;ADR3C;ICUEM,YAAQE;QACVT,KAAKK,UAAUK,gBAAgBV,KAAKC,GAAOQ;ADR3C;;;ACcHpB,QAAAE,iBAAAA","file":"RandomIterator.js","sourcesContent":["import { ContainerIterator } from \"../../ContainerBase\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nexport class RandomIterator extends ContainerIterator {\n /**\n * @internal\n */\n constructor(index, iteratorType) {\n super(iteratorType);\n this._node = index;\n if (this.iteratorType === 0 /* IteratorType.NORMAL */) {\n this.pre = function () {\n if (this._node === 0) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n this.next = function () {\n if (this._node === this.container.size()) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n }\n else {\n this.pre = function () {\n if (this._node === this.container.size() - 1) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n this.next = function () {\n if (this._node === -1) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n }\n }\n get pointer() {\n return this.container.getElementByPos(this._node);\n }\n set pointer(newValue) {\n this.container.setElementByPos(this._node, newValue);\n }\n}\n","import { ContainerIterator, IteratorType } from '@/container/ContainerBase';\nimport SequentialContainer from '@/container/SequentialContainer/Base/index';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nexport abstract class RandomIterator extends ContainerIterator {\n abstract readonly container: SequentialContainer;\n /**\n * @internal\n */\n _node: number;\n /**\n * @internal\n */\n protected constructor(\n index: number,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = index;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node === 0) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n this.next = function () {\n if (this._node === this.container.size()) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node === this.container.size() - 1) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n this.next = function () {\n if (this._node === -1) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n }\n }\n get pointer() {\n return this.container.getElementByPos(this._node);\n }\n set pointer(newValue: T) {\n this.container.setElementByPos(this._node, newValue);\n }\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts new file mode 100644 index 000000000..c1b40975c --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts @@ -0,0 +1,67 @@ +import { Container } from "../../ContainerBase"; +declare abstract class SequentialContainer extends Container { + /** + * @description Push the element to the back. + * @param element - The element you want to push. + * @returns The size of container after pushing. + */ + abstract pushBack(element: T): number; + /** + * @description Removes the last element. + * @returns The element you popped. + */ + abstract popBack(): T | undefined; + /** + * @description Sets element by position. + * @param pos - The position you want to change. + * @param element - The element's value you want to update. + * @example + * container.setElementByPos(-1, 1); // throw a RangeError + */ + abstract setElementByPos(pos: number, element: T): void; + /** + * @description Removes the elements of the specified value. + * @param value - The value you want to remove. + * @returns The size of container after erasing. + * @example + * container.eraseElementByValue(-1); + */ + abstract eraseElementByValue(value: T): number; + /** + * @description Insert several elements after the specified position. + * @param pos - The position you want to insert. + * @param element - The element you want to insert. + * @param num - The number of elements you want to insert (default 1). + * @returns The size of container after inserting. + * @example + * const container = new Vector([1, 2, 3]); + * container.insert(1, 4); // [1, 4, 2, 3] + * container.insert(1, 5, 3); // [1, 5, 5, 5, 4, 2, 3] + */ + abstract insert(pos: number, element: T, num?: number): number; + /** + * @description Reverses the container. + * @example + * const container = new Vector([1, 2, 3]); + * container.reverse(); // [3, 2, 1] + */ + abstract reverse(): void; + /** + * @description Removes the duplication of elements in the container. + * @returns The size of container after inserting. + * @example + * const container = new Vector([1, 1, 3, 2, 2, 5, 5, 2]); + * container.unique(); // [1, 3, 2, 5, 2] + */ + abstract unique(): number; + /** + * @description Sort the container. + * @param cmp - Comparison function to sort. + * @example + * const container = new Vector([3, 1, 10]); + * container.sort(); // [1, 10, 3] + * container.sort((x, y) => x - y); // [1, 3, 10] + */ + abstract sort(cmp?: (x: T, y: T) => number): void; +} +export default SequentialContainer; diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js new file mode 100644 index 000000000..e24008177 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _ContainerBase = require("../../ContainerBase"); + +class SequentialContainer extends _ContainerBase.Container {} + +var _default = SequentialContainer; + +exports.default = _default; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js.map b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js.map new file mode 100644 index 000000000..730db263d --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Base/index.js","../../src/container/SequentialContainer/Base/index.ts"],"names":["Object","defineProperty","exports","value","default","_ContainerBase","require","SequentialContainer","Container","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,iBAAAC,QAAA;;AAEA,MAAeC,4BAA+BC,eAAAA;;AAgE7C,IAAAC,WAEcF;;AAAmBL,QAAAE,UAAAK","file":"index.js","sourcesContent":[null,"import { Container } from '@/container/ContainerBase';\n\nabstract class SequentialContainer extends Container {\n /**\n * @description Push the element to the back.\n * @param element - The element you want to push.\n * @returns The size of container after pushing.\n */\n abstract pushBack(element: T): number;\n /**\n * @description Removes the last element.\n * @returns The element you popped.\n */\n abstract popBack(): T | undefined;\n /**\n * @description Sets element by position.\n * @param pos - The position you want to change.\n * @param element - The element's value you want to update.\n * @example\n * container.setElementByPos(-1, 1); // throw a RangeError\n */\n abstract setElementByPos(pos: number, element: T): void;\n /**\n * @description Removes the elements of the specified value.\n * @param value - The value you want to remove.\n * @returns The size of container after erasing.\n * @example\n * container.eraseElementByValue(-1);\n */\n abstract eraseElementByValue(value: T): number;\n /**\n * @description Insert several elements after the specified position.\n * @param pos - The position you want to insert.\n * @param element - The element you want to insert.\n * @param num - The number of elements you want to insert (default 1).\n * @returns The size of container after inserting.\n * @example\n * const container = new Vector([1, 2, 3]);\n * container.insert(1, 4); // [1, 4, 2, 3]\n * container.insert(1, 5, 3); // [1, 5, 5, 5, 4, 2, 3]\n */\n abstract insert(pos: number, element: T, num?: number): number;\n /**\n * @description Reverses the container.\n * @example\n * const container = new Vector([1, 2, 3]);\n * container.reverse(); // [3, 2, 1]\n */\n abstract reverse(): void;\n /**\n * @description Removes the duplication of elements in the container.\n * @returns The size of container after inserting.\n * @example\n * const container = new Vector([1, 1, 3, 2, 2, 5, 5, 2]);\n * container.unique(); // [1, 3, 2, 5, 2]\n */\n abstract unique(): number;\n /**\n * @description Sort the container.\n * @param cmp - Comparison function to sort.\n * @example\n * const container = new Vector([3, 1, 10]);\n * container.sort(); // [1, 10, 3]\n * container.sort((x, y) => x - y); // [1, 3, 10]\n */\n abstract sort(cmp?: (x: T, y: T) => number): void;\n}\n\nexport default SequentialContainer;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts new file mode 100644 index 000000000..cf63bda47 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts @@ -0,0 +1,58 @@ +import SequentialContainer from './Base'; +import { IteratorType, initContainer } from "../ContainerBase"; +import { RandomIterator } from "./Base/RandomIterator"; +declare class DequeIterator extends RandomIterator { + readonly container: Deque; + constructor(node: number, container: Deque, iteratorType?: IteratorType); + copy(): DequeIterator; + equals(iter: DequeIterator): boolean; +} +export type { DequeIterator }; +declare class Deque extends SequentialContainer { + constructor(container?: initContainer, _bucketSize?: number); + clear(): void; + begin(): DequeIterator; + end(): DequeIterator; + rBegin(): DequeIterator; + rEnd(): DequeIterator; + front(): T | undefined; + back(): T | undefined; + pushBack(element: T): number; + popBack(): T | undefined; + /** + * @description Push the element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + pushFront(element: T): number; + /** + * @description Remove the _first element. + * @returns The element you popped. + */ + popFront(): T | undefined; + getElementByPos(pos: number): T; + setElementByPos(pos: number, element: T): void; + insert(pos: number, element: T, num?: number): number; + /** + * @description Remove all elements after the specified position (excluding the specified position). + * @param pos - The previous position of the first removed element. + * @returns The size of the container after cutting. + * @example + * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1] + */ + cut(pos: number): number; + eraseElementByPos(pos: number): number; + eraseElementByValue(value: T): number; + eraseElementByIterator(iter: DequeIterator): DequeIterator; + find(element: T): DequeIterator; + reverse(): void; + unique(): number; + sort(cmp?: (x: T, y: T) => number): void; + /** + * @description Remove as much useless space as possible. + */ + shrinkToFit(): void; + forEach(callback: (element: T, index: number, deque: Deque) => void): void; + [Symbol.iterator](): Generator; +} +export default Deque; diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js new file mode 100644 index 000000000..924b1b2b3 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js @@ -0,0 +1,338 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = _interopRequireDefault(require("./Base")); + +var _RandomIterator = require("./Base/RandomIterator"); + +function _interopRequireDefault(t) { + return t && t.t ? t : { + default: t + }; +} + +class DequeIterator extends _RandomIterator.RandomIterator { + constructor(t, i, s) { + super(t, s); + this.container = i; + } + copy() { + return new DequeIterator(this.o, this.container, this.iteratorType); + } +} + +class Deque extends _Base.default { + constructor(t = [], i = 1 << 12) { + super(); + this.j = 0; + this.D = 0; + this.R = 0; + this.N = 0; + this.P = 0; + this.A = []; + const s = (() => { + if (typeof t.length === "number") return t.length; + if (typeof t.size === "number") return t.size; + if (typeof t.size === "function") return t.size(); + throw new TypeError("Cannot get the length or size of the container"); + })(); + this.F = i; + this.P = Math.max(Math.ceil(s / this.F), 1); + for (let t = 0; t < this.P; ++t) { + this.A.push(new Array(this.F)); + } + const h = Math.ceil(s / this.F); + this.j = this.R = (this.P >> 1) - (h >> 1); + this.D = this.N = this.F - s % this.F >> 1; + const e = this; + t.forEach((function(t) { + e.pushBack(t); + })); + } + T() { + const t = []; + const i = Math.max(this.P >> 1, 1); + for (let s = 0; s < i; ++s) { + t[s] = new Array(this.F); + } + for (let i = this.j; i < this.P; ++i) { + t[t.length] = this.A[i]; + } + for (let i = 0; i < this.R; ++i) { + t[t.length] = this.A[i]; + } + t[t.length] = [ ...this.A[this.R] ]; + this.j = i; + this.R = t.length - 1; + for (let s = 0; s < i; ++s) { + t[t.length] = new Array(this.F); + } + this.A = t; + this.P = t.length; + } + O(t) { + const i = this.D + t + 1; + const s = i % this.F; + let h = s - 1; + let e = this.j + (i - s) / this.F; + if (s === 0) e -= 1; + e %= this.P; + if (h < 0) h += this.F; + return { + curNodeBucketIndex: e, + curNodePointerIndex: h + }; + } + clear() { + this.A = [ new Array(this.F) ]; + this.P = 1; + this.j = this.R = this.i = 0; + this.D = this.N = this.F >> 1; + } + begin() { + return new DequeIterator(0, this); + } + end() { + return new DequeIterator(this.i, this); + } + rBegin() { + return new DequeIterator(this.i - 1, this, 1); + } + rEnd() { + return new DequeIterator(-1, this, 1); + } + front() { + if (this.i === 0) return; + return this.A[this.j][this.D]; + } + back() { + if (this.i === 0) return; + return this.A[this.R][this.N]; + } + pushBack(t) { + if (this.i) { + if (this.N < this.F - 1) { + this.N += 1; + } else if (this.R < this.P - 1) { + this.R += 1; + this.N = 0; + } else { + this.R = 0; + this.N = 0; + } + if (this.R === this.j && this.N === this.D) this.T(); + } + this.i += 1; + this.A[this.R][this.N] = t; + return this.i; + } + popBack() { + if (this.i === 0) return; + const t = this.A[this.R][this.N]; + if (this.i !== 1) { + if (this.N > 0) { + this.N -= 1; + } else if (this.R > 0) { + this.R -= 1; + this.N = this.F - 1; + } else { + this.R = this.P - 1; + this.N = this.F - 1; + } + } + this.i -= 1; + return t; + } + pushFront(t) { + if (this.i) { + if (this.D > 0) { + this.D -= 1; + } else if (this.j > 0) { + this.j -= 1; + this.D = this.F - 1; + } else { + this.j = this.P - 1; + this.D = this.F - 1; + } + if (this.j === this.R && this.D === this.N) this.T(); + } + this.i += 1; + this.A[this.j][this.D] = t; + return this.i; + } + popFront() { + if (this.i === 0) return; + const t = this.A[this.j][this.D]; + if (this.i !== 1) { + if (this.D < this.F - 1) { + this.D += 1; + } else if (this.j < this.P - 1) { + this.j += 1; + this.D = 0; + } else { + this.j = 0; + this.D = 0; + } + } + this.i -= 1; + return t; + } + getElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + const {curNodeBucketIndex: i, curNodePointerIndex: s} = this.O(t); + return this.A[i][s]; + } + setElementByPos(t, i) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + const {curNodeBucketIndex: s, curNodePointerIndex: h} = this.O(t); + this.A[s][h] = i; + } + insert(t, i, s = 1) { + if (t < 0 || t > this.i) { + throw new RangeError; + } + if (t === 0) { + while (s--) this.pushFront(i); + } else if (t === this.i) { + while (s--) this.pushBack(i); + } else { + const h = []; + for (let i = t; i < this.i; ++i) { + h.push(this.getElementByPos(i)); + } + this.cut(t - 1); + for (let t = 0; t < s; ++t) this.pushBack(i); + for (let t = 0; t < h.length; ++t) this.pushBack(h[t]); + } + return this.i; + } + cut(t) { + if (t < 0) { + this.clear(); + return 0; + } + const {curNodeBucketIndex: i, curNodePointerIndex: s} = this.O(t); + this.R = i; + this.N = s; + this.i = t + 1; + return this.i; + } + eraseElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + if (t === 0) this.popFront(); else if (t === this.i - 1) this.popBack(); else { + const i = []; + for (let s = t + 1; s < this.i; ++s) { + i.push(this.getElementByPos(s)); + } + this.cut(t); + this.popBack(); + const s = this; + i.forEach((function(t) { + s.pushBack(t); + })); + } + return this.i; + } + eraseElementByValue(t) { + if (this.i === 0) return 0; + const i = []; + for (let s = 0; s < this.i; ++s) { + const h = this.getElementByPos(s); + if (h !== t) i.push(h); + } + const s = i.length; + for (let t = 0; t < s; ++t) this.setElementByPos(t, i[t]); + return this.cut(s - 1); + } + eraseElementByIterator(t) { + const i = t.o; + this.eraseElementByPos(i); + t = t.next(); + return t; + } + find(t) { + for (let i = 0; i < this.i; ++i) { + if (this.getElementByPos(i) === t) { + return new DequeIterator(i, this); + } + } + return this.end(); + } + reverse() { + let t = 0; + let i = this.i - 1; + while (t < i) { + const s = this.getElementByPos(t); + this.setElementByPos(t, this.getElementByPos(i)); + this.setElementByPos(i, s); + t += 1; + i -= 1; + } + } + unique() { + if (this.i <= 1) { + return this.i; + } + let t = 1; + let i = this.getElementByPos(0); + for (let s = 1; s < this.i; ++s) { + const h = this.getElementByPos(s); + if (h !== i) { + i = h; + this.setElementByPos(t++, h); + } + } + while (this.i > t) this.popBack(); + return this.i; + } + sort(t) { + const i = []; + for (let t = 0; t < this.i; ++t) { + i.push(this.getElementByPos(t)); + } + i.sort(t); + for (let t = 0; t < this.i; ++t) this.setElementByPos(t, i[t]); + } + shrinkToFit() { + if (this.i === 0) return; + const t = []; + this.forEach((function(i) { + t.push(i); + })); + this.P = Math.max(Math.ceil(this.i / this.F), 1); + this.i = this.j = this.R = this.D = this.N = 0; + this.A = []; + for (let t = 0; t < this.P; ++t) { + this.A.push(new Array(this.F)); + } + for (let i = 0; i < t.length; ++i) this.pushBack(t[i]); + } + forEach(t) { + for (let i = 0; i < this.i; ++i) { + t(this.getElementByPos(i), i, this); + } + } + [Symbol.iterator]() { + return function*() { + for (let t = 0; t < this.i; ++t) { + yield this.getElementByPos(t); + } + }.bind(this)(); + } +} + +var _default = Deque; + +exports.default = _default; +//# sourceMappingURL=Deque.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js.map b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js.map new file mode 100644 index 000000000..2b05b7d94 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Deque.js","../../src/container/SequentialContainer/Deque.ts"],"names":["Object","defineProperty","exports","value","default","_Base","_interopRequireDefault","require","_RandomIterator","obj","__esModule","DequeIterator","RandomIterator","constructor","node","container","iteratorType","super","this","copy","_node","Deque","SequentialContainer","_bucketSize","_first","_curFirst","_last","_curLast","_bucketNum","_map","_length","length","size","TypeError","Math","max","ceil","i","push","Array","needBucketNum","self","forEach","element","pushBack","_reAllocate","newMap","addBucketNum","_getElementIndex","pos","offset","offsetRemainder","curNodePointerIndex","curNodeBucketIndex","clear","begin","end","rBegin","rEnd","front","back","popBack","pushFront","popFront","getElementByPos","RangeError","setElementByPos","insert","num","arr","cut","eraseElementByPos","el","eraseElementByValue","eraseElementByIterator","iter","next","find","reverse","l","r","tmp","unique","index","pre","cur","sort","cmp","shrinkToFit","callback","Symbol","iterator","bind","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,QAAAC,uBAAAC,QAAA;;AAEA,IAAAC,kBAAAD,QAAA;;AAAqF,SAAAD,uBAAAG;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAL,SAAAK;;AAAA;;AAIrF,MAAME,sBAAyBC,gBAAAA;IAE7BC,YAAYC,GAAcC,GAAqBC;QAC7CC,MAAMH,GAAME;QACZE,KAAKH,YAAYA;ADFjB;ICIFI;QACE,OAAO,IAAIR,cAAiBO,KAAKE,GAAOF,KAAKH,WAAWG,KAAKF;ADF7D;;;ACUJ,MAAMK,cAAiBC,MAAAA;IA6BrBT,YAAYE,IAA8B,IAAIQ,IAAe,KAAK;QAChEN;QA1BMC,KAAAM,IAAS;QAITN,KAAAO,IAAY;QAIZP,KAAAQ,IAAQ;QAIRR,KAAAS,IAAW;QAIXT,KAAAU,IAAa;QAQbV,KAAAW,IAAc;QAGpB,MAAMC,IAAO;YDXL,WCtC6Cf,EACvDgB,WAAM,UAAc,OAgDiBhB,EAhDCgB;YDuC5B,WCvCgDhB,EAEtDiB,SAAI,UAAc,OA8CejB,EA9CGiB;YDuC9B,WCtCHjB,EAAWiB,SAAI,YAChB,OA4C+BjB,EA5CbiB;YAAO,MAAQ,IAAIC,UAAU;ADwC9C,UCIQ;QACbf,KAAKK,IAAcA;QACnBL,KAAKU,IAAaM,KAAKC,IAAID,KAAKE,KAAKN,IAAUZ,KAAKK,IAAc;QAClE,KAAK,IAAIc,IAAI,GAA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D,KAAKwB,SAAQ,SAAU8B;YACrBH,EAAI/B,KAAKkC;ADuBP;QCrBJtD,KAAKU,IAAaM,KAAKC,IAAID,KAAKE,KAAKlB,KAAKY,IAAUZ,KAAKK,IAAc;QACvEL,KAAKY,IAAUZ,KAAKM,IAASN,KAAKQ,IAAQR,KAAKO,IAAYP,KAAKS,IAAW;QAC3ET,KAAKW,IAAO;QACZ,KAAK,IAAIQ,IAAI,GAAGA,IAAInB,KAAKU,KAAcS,GAAG;YACxCnB,KAAKW,EAAKS,KAAK,IAAIC,MAAMrB,KAAKK;ADuB5B;QCrBJ,KAAK,IAAIc,IAAI,GAAGA,IAAIgC,EAAItC,UAAUM,GAAGnB,KAAK0B,SAASyB,EAAIhC;ADwBvD;ICtBFK,QAAQ+C;QACN,KAAK,IAAIpD,IAAI,GAAGA,IAAInB,KAAKY,KAAWO,GAAG;YACrCoD,EAASvE,KAAK8C,gBAAgB3B,IAAIA,GAAGnB;ADwBnC;AACJ;ICtBF,CAACwE,OAAOC;QACN,OAAO;YACL,KAAK,IAAItD,IAAI,GAAGA,IAAInB,KAAKY,KAAWO,GAAG;sBAC/BnB,KAAK8C,gBAAgB3B;ADwBvB;AACJ,UCvBFuD,KAAK1E,KAJA;AD4BP;;;ACtBH,IAAA2E,WAEcxE;;AAAKnB,QAAAE,UAAAyF","file":"Deque.js","sourcesContent":["import SequentialContainer from './Base';\nimport { RandomIterator } from \"./Base/RandomIterator\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport $getContainerSize from \"../../utils/getContainerSize.macro\";\nclass DequeIterator extends RandomIterator {\n constructor(node, container, iteratorType) {\n super(node, iteratorType);\n this.container = container;\n }\n copy() {\n return new DequeIterator(this._node, this.container, this.iteratorType);\n }\n}\nclass Deque extends SequentialContainer {\n constructor(container = [], _bucketSize = (1 << 12)) {\n super();\n /**\n * @internal\n */\n this._first = 0;\n /**\n * @internal\n */\n this._curFirst = 0;\n /**\n * @internal\n */\n this._last = 0;\n /**\n * @internal\n */\n this._curLast = 0;\n /**\n * @internal\n */\n this._bucketNum = 0;\n /**\n * @internal\n */\n this._map = [];\n const _length = (() => {\n if (typeof container.length === \"number\")\n return container.length;\n if (typeof container.size === \"number\")\n return container.size;\n if (typeof container.size === \"function\")\n return container.size();\n throw new TypeError(\"Cannot get the length or size of the container\");\n })();\n this._bucketSize = _bucketSize;\n this._bucketNum = Math.max(Math.ceil(_length / this._bucketSize), 1);\n for (let i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n const needBucketNum = Math.ceil(_length / this._bucketSize);\n this._first = this._last = (this._bucketNum >> 1) - (needBucketNum >> 1);\n this._curFirst = this._curLast = (this._bucketSize - _length % this._bucketSize) >> 1;\n const self = this;\n container.forEach(function (element) {\n self.pushBack(element);\n });\n }\n /**\n * @description Growth the Deque.\n * @internal\n */\n _reAllocate() {\n const newMap = [];\n const addBucketNum = Math.max(this._bucketNum >> 1, 1);\n for (let i = 0; i < addBucketNum; ++i) {\n newMap[i] = new Array(this._bucketSize);\n }\n for (let i = this._first; i < this._bucketNum; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n for (let i = 0; i < this._last; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n newMap[newMap.length] = [...this._map[this._last]];\n this._first = addBucketNum;\n this._last = newMap.length - 1;\n for (let i = 0; i < addBucketNum; ++i) {\n newMap[newMap.length] = new Array(this._bucketSize);\n }\n this._map = newMap;\n this._bucketNum = newMap.length;\n }\n /**\n * @description Get the bucket position of the element and the pointer position by index.\n * @param pos - The element's index.\n * @internal\n */\n _getElementIndex(pos) {\n const offset = this._curFirst + pos + 1;\n const offsetRemainder = offset % this._bucketSize;\n let curNodePointerIndex = offsetRemainder - 1;\n let curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize;\n if (offsetRemainder === 0)\n curNodeBucketIndex -= 1;\n curNodeBucketIndex %= this._bucketNum;\n if (curNodePointerIndex < 0)\n curNodePointerIndex += this._bucketSize;\n return { curNodeBucketIndex, curNodePointerIndex };\n }\n clear() {\n this._map = [new Array(this._bucketSize)];\n this._bucketNum = 1;\n this._first = this._last = this._length = 0;\n this._curFirst = this._curLast = this._bucketSize >> 1;\n }\n begin() {\n return new DequeIterator(0, this);\n }\n end() {\n return new DequeIterator(this._length, this);\n }\n rBegin() {\n return new DequeIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new DequeIterator(-1, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n if (this._length === 0)\n return;\n return this._map[this._first][this._curFirst];\n }\n back() {\n if (this._length === 0)\n return;\n return this._map[this._last][this._curLast];\n }\n pushBack(element) {\n if (this._length) {\n if (this._curLast < this._bucketSize - 1) {\n this._curLast += 1;\n }\n else if (this._last < this._bucketNum - 1) {\n this._last += 1;\n this._curLast = 0;\n }\n else {\n this._last = 0;\n this._curLast = 0;\n }\n if (this._last === this._first &&\n this._curLast === this._curFirst)\n this._reAllocate();\n }\n this._length += 1;\n this._map[this._last][this._curLast] = element;\n return this._length;\n }\n popBack() {\n if (this._length === 0)\n return;\n const value = this._map[this._last][this._curLast];\n if (this._length !== 1) {\n if (this._curLast > 0) {\n this._curLast -= 1;\n }\n else if (this._last > 0) {\n this._last -= 1;\n this._curLast = this._bucketSize - 1;\n }\n else {\n this._last = this._bucketNum - 1;\n this._curLast = this._bucketSize - 1;\n }\n }\n this._length -= 1;\n return value;\n }\n /**\n * @description Push the element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n pushFront(element) {\n if (this._length) {\n if (this._curFirst > 0) {\n this._curFirst -= 1;\n }\n else if (this._first > 0) {\n this._first -= 1;\n this._curFirst = this._bucketSize - 1;\n }\n else {\n this._first = this._bucketNum - 1;\n this._curFirst = this._bucketSize - 1;\n }\n if (this._first === this._last &&\n this._curFirst === this._curLast)\n this._reAllocate();\n }\n this._length += 1;\n this._map[this._first][this._curFirst] = element;\n return this._length;\n }\n /**\n * @description Remove the _first element.\n * @returns The element you popped.\n */\n popFront() {\n if (this._length === 0)\n return;\n const value = this._map[this._first][this._curFirst];\n if (this._length !== 1) {\n if (this._curFirst < this._bucketSize - 1) {\n this._curFirst += 1;\n }\n else if (this._first < this._bucketNum - 1) {\n this._first += 1;\n this._curFirst = 0;\n }\n else {\n this._first = 0;\n this._curFirst = 0;\n }\n }\n this._length -= 1;\n return value;\n }\n getElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n const { curNodeBucketIndex, curNodePointerIndex } = this._getElementIndex(pos);\n return this._map[curNodeBucketIndex][curNodePointerIndex];\n }\n setElementByPos(pos, element) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n const { curNodeBucketIndex, curNodePointerIndex } = this._getElementIndex(pos);\n this._map[curNodeBucketIndex][curNodePointerIndex] = element;\n }\n insert(pos, element, num = 1) {\n if (pos < 0 || pos > this._length) {\n throw new RangeError();\n }\n if (pos === 0) {\n while (num--)\n this.pushFront(element);\n }\n else if (pos === this._length) {\n while (num--)\n this.pushBack(element);\n }\n else {\n const arr = [];\n for (let i = pos; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos - 1);\n for (let i = 0; i < num; ++i)\n this.pushBack(element);\n for (let i = 0; i < arr.length; ++i)\n this.pushBack(arr[i]);\n }\n return this._length;\n }\n /**\n * @description Remove all elements after the specified position (excluding the specified position).\n * @param pos - The previous position of the first removed element.\n * @returns The size of the container after cutting.\n * @example\n * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1]\n */\n cut(pos) {\n if (pos < 0) {\n this.clear();\n return 0;\n }\n const { curNodeBucketIndex, curNodePointerIndex } = this._getElementIndex(pos);\n this._last = curNodeBucketIndex;\n this._curLast = curNodePointerIndex;\n this._length = pos + 1;\n return this._length;\n }\n eraseElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n if (pos === 0)\n this.popFront();\n else if (pos === this._length - 1)\n this.popBack();\n else {\n const arr = [];\n for (let i = pos + 1; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos);\n this.popBack();\n const self = this;\n arr.forEach(function (el) {\n self.pushBack(el);\n });\n }\n return this._length;\n }\n eraseElementByValue(value) {\n if (this._length === 0)\n return 0;\n const arr = [];\n for (let i = 0; i < this._length; ++i) {\n const element = this.getElementByPos(i);\n if (element !== value)\n arr.push(element);\n }\n const _length = arr.length;\n for (let i = 0; i < _length; ++i)\n this.setElementByPos(i, arr[i]);\n return this.cut(_length - 1);\n }\n eraseElementByIterator(iter) {\n const _node = iter._node;\n this.eraseElementByPos(_node);\n iter = iter.next();\n return iter;\n }\n find(element) {\n for (let i = 0; i < this._length; ++i) {\n if (this.getElementByPos(i) === element) {\n return new DequeIterator(i, this);\n }\n }\n return this.end();\n }\n reverse() {\n let l = 0;\n let r = this._length - 1;\n while (l < r) {\n const tmp = this.getElementByPos(l);\n this.setElementByPos(l, this.getElementByPos(r));\n this.setElementByPos(r, tmp);\n l += 1;\n r -= 1;\n }\n }\n unique() {\n if (this._length <= 1) {\n return this._length;\n }\n let index = 1;\n let pre = this.getElementByPos(0);\n for (let i = 1; i < this._length; ++i) {\n const cur = this.getElementByPos(i);\n if (cur !== pre) {\n pre = cur;\n this.setElementByPos(index++, cur);\n }\n }\n while (this._length > index)\n this.popBack();\n return this._length;\n }\n sort(cmp) {\n const arr = [];\n for (let i = 0; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n arr.sort(cmp);\n for (let i = 0; i < this._length; ++i)\n this.setElementByPos(i, arr[i]);\n }\n /**\n * @description Remove as much useless space as possible.\n */\n shrinkToFit() {\n if (this._length === 0)\n return;\n const arr = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1);\n this._length = this._first = this._last = this._curFirst = this._curLast = 0;\n this._map = [];\n for (let i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n for (let i = 0; i < arr.length; ++i)\n this.pushBack(arr[i]);\n }\n forEach(callback) {\n for (let i = 0; i < this._length; ++i) {\n callback(this.getElementByPos(i), i, this);\n }\n }\n [Symbol.iterator]() {\n return function* () {\n for (let i = 0; i < this._length; ++i) {\n yield this.getElementByPos(i);\n }\n }.bind(this)();\n }\n}\nexport default Deque;\n","import SequentialContainer from './Base';\nimport { IteratorType, initContainer } from '@/container/ContainerBase';\nimport { RandomIterator } from '@/container/SequentialContainer/Base/RandomIterator';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport $getContainerSize from '@/utils/getContainerSize.macro';\n\nclass DequeIterator extends RandomIterator {\n readonly container: Deque;\n constructor(node: number, container: Deque, iteratorType?: IteratorType) {\n super(node, iteratorType);\n this.container = container;\n }\n copy() {\n return new DequeIterator(this._node, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: DequeIterator): boolean;\n}\n\nexport type { DequeIterator };\n\nclass Deque extends SequentialContainer {\n /**\n * @internal\n */\n private _first = 0;\n /**\n * @internal\n */\n private _curFirst = 0;\n /**\n * @internal\n */\n private _last = 0;\n /**\n * @internal\n */\n private _curLast = 0;\n /**\n * @internal\n */\n private _bucketNum = 0;\n /**\n * @internal\n */\n private readonly _bucketSize: number;\n /**\n * @internal\n */\n private _map: T[][] = [];\n constructor(container: initContainer = [], _bucketSize = (1 << 12)) {\n super();\n const _length = $getContainerSize!(container);\n this._bucketSize = _bucketSize;\n this._bucketNum = Math.max(Math.ceil(_length / this._bucketSize), 1);\n for (let i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n const needBucketNum = Math.ceil(_length / this._bucketSize);\n this._first = this._last = (this._bucketNum >> 1) - (needBucketNum >> 1);\n this._curFirst = this._curLast = (this._bucketSize - _length % this._bucketSize) >> 1;\n const self = this;\n container.forEach(function (element) {\n self.pushBack(element);\n });\n }\n /**\n * @description Growth the Deque.\n * @internal\n */\n private _reAllocate() {\n const newMap = [];\n const addBucketNum = Math.max(this._bucketNum >> 1, 1);\n for (let i = 0; i < addBucketNum; ++i) {\n newMap[i] = new Array(this._bucketSize);\n }\n for (let i = this._first; i < this._bucketNum; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n for (let i = 0; i < this._last; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n newMap[newMap.length] = [...this._map[this._last]];\n this._first = addBucketNum;\n this._last = newMap.length - 1;\n for (let i = 0; i < addBucketNum; ++i) {\n newMap[newMap.length] = new Array(this._bucketSize);\n }\n this._map = newMap;\n this._bucketNum = newMap.length;\n }\n /**\n * @description Get the bucket position of the element and the pointer position by index.\n * @param pos - The element's index.\n * @internal\n */\n private _getElementIndex(pos: number) {\n const offset = this._curFirst + pos + 1;\n const offsetRemainder = offset % this._bucketSize;\n let curNodePointerIndex = offsetRemainder - 1;\n let curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize;\n if (offsetRemainder === 0) curNodeBucketIndex -= 1;\n curNodeBucketIndex %= this._bucketNum;\n if (curNodePointerIndex < 0) curNodePointerIndex += this._bucketSize;\n return { curNodeBucketIndex, curNodePointerIndex };\n }\n clear() {\n this._map = [new Array(this._bucketSize)];\n this._bucketNum = 1;\n this._first = this._last = this._length = 0;\n this._curFirst = this._curLast = this._bucketSize >> 1;\n }\n begin() {\n return new DequeIterator(0, this);\n }\n end() {\n return new DequeIterator(this._length, this);\n }\n rBegin() {\n return new DequeIterator(this._length - 1, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new DequeIterator(-1, this, IteratorType.REVERSE);\n }\n front(): T | undefined {\n if (this._length === 0) return;\n return this._map[this._first][this._curFirst];\n }\n back(): T | undefined {\n if (this._length === 0) return;\n return this._map[this._last][this._curLast];\n }\n pushBack(element: T) {\n if (this._length) {\n if (this._curLast < this._bucketSize - 1) {\n this._curLast += 1;\n } else if (this._last < this._bucketNum - 1) {\n this._last += 1;\n this._curLast = 0;\n } else {\n this._last = 0;\n this._curLast = 0;\n }\n if (\n this._last === this._first &&\n this._curLast === this._curFirst\n ) this._reAllocate();\n }\n this._length += 1;\n this._map[this._last][this._curLast] = element;\n return this._length;\n }\n popBack() {\n if (this._length === 0) return;\n const value = this._map[this._last][this._curLast];\n if (this._length !== 1) {\n if (this._curLast > 0) {\n this._curLast -= 1;\n } else if (this._last > 0) {\n this._last -= 1;\n this._curLast = this._bucketSize - 1;\n } else {\n this._last = this._bucketNum - 1;\n this._curLast = this._bucketSize - 1;\n }\n }\n this._length -= 1;\n return value;\n }\n /**\n * @description Push the element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n pushFront(element: T) {\n if (this._length) {\n if (this._curFirst > 0) {\n this._curFirst -= 1;\n } else if (this._first > 0) {\n this._first -= 1;\n this._curFirst = this._bucketSize - 1;\n } else {\n this._first = this._bucketNum - 1;\n this._curFirst = this._bucketSize - 1;\n }\n if (\n this._first === this._last &&\n this._curFirst === this._curLast\n ) this._reAllocate();\n }\n this._length += 1;\n this._map[this._first][this._curFirst] = element;\n return this._length;\n }\n /**\n * @description Remove the _first element.\n * @returns The element you popped.\n */\n popFront() {\n if (this._length === 0) return;\n const value = this._map[this._first][this._curFirst];\n if (this._length !== 1) {\n if (this._curFirst < this._bucketSize - 1) {\n this._curFirst += 1;\n } else if (this._first < this._bucketNum - 1) {\n this._first += 1;\n this._curFirst = 0;\n } else {\n this._first = 0;\n this._curFirst = 0;\n }\n }\n this._length -= 1;\n return value;\n }\n getElementByPos(pos: number): T {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n const {\n curNodeBucketIndex,\n curNodePointerIndex\n } = this._getElementIndex(pos);\n return this._map[curNodeBucketIndex][curNodePointerIndex]!;\n }\n setElementByPos(pos: number, element: T) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n const {\n curNodeBucketIndex,\n curNodePointerIndex\n } = this._getElementIndex(pos);\n this._map[curNodeBucketIndex][curNodePointerIndex] = element;\n }\n insert(pos: number, element: T, num = 1) {\n $checkWithinAccessParams!(pos, 0, this._length);\n if (pos === 0) {\n while (num--) this.pushFront(element);\n } else if (pos === this._length) {\n while (num--) this.pushBack(element);\n } else {\n const arr: T[] = [];\n for (let i = pos; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos - 1);\n for (let i = 0; i < num; ++i) this.pushBack(element);\n for (let i = 0; i < arr.length; ++i) this.pushBack(arr[i]);\n }\n return this._length;\n }\n /**\n * @description Remove all elements after the specified position (excluding the specified position).\n * @param pos - The previous position of the first removed element.\n * @returns The size of the container after cutting.\n * @example\n * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1]\n */\n cut(pos: number) {\n if (pos < 0) {\n this.clear();\n return 0;\n }\n const {\n curNodeBucketIndex,\n curNodePointerIndex\n } = this._getElementIndex(pos);\n this._last = curNodeBucketIndex;\n this._curLast = curNodePointerIndex;\n this._length = pos + 1;\n return this._length;\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n if (pos === 0) this.popFront();\n else if (pos === this._length - 1) this.popBack();\n else {\n const arr = [];\n for (let i = pos + 1; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos);\n this.popBack();\n const self = this;\n arr.forEach(function (el) {\n self.pushBack(el);\n });\n }\n return this._length;\n }\n eraseElementByValue(value: T) {\n if (this._length === 0) return 0;\n const arr: T[] = [];\n for (let i = 0; i < this._length; ++i) {\n const element = this.getElementByPos(i);\n if (element !== value) arr.push(element);\n }\n const _length = arr.length;\n for (let i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]);\n return this.cut(_length - 1);\n }\n eraseElementByIterator(iter: DequeIterator) {\n const _node = iter._node;\n this.eraseElementByPos(_node);\n iter = iter.next();\n return iter;\n }\n find(element: T) {\n for (let i = 0; i < this._length; ++i) {\n if (this.getElementByPos(i) === element) {\n return new DequeIterator(i, this);\n }\n }\n return this.end();\n }\n reverse() {\n let l = 0; let r = this._length - 1;\n while (l < r) {\n const tmp = this.getElementByPos(l);\n this.setElementByPos(l, this.getElementByPos(r));\n this.setElementByPos(r, tmp);\n l += 1;\n r -= 1;\n }\n }\n unique() {\n if (this._length <= 1) {\n return this._length;\n }\n let index = 1;\n let pre = this.getElementByPos(0);\n for (let i = 1; i < this._length; ++i) {\n const cur = this.getElementByPos(i);\n if (cur !== pre) {\n pre = cur;\n this.setElementByPos(index++, cur);\n }\n }\n while (this._length > index) this.popBack();\n return this._length;\n }\n sort(cmp?: (x: T, y: T) => number) {\n const arr: T[] = [];\n for (let i = 0; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n arr.sort(cmp);\n for (let i = 0; i < this._length; ++i) this.setElementByPos(i, arr[i]);\n }\n /**\n * @description Remove as much useless space as possible.\n */\n shrinkToFit() {\n if (this._length === 0) return;\n const arr: T[] = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1);\n this._length = this._first = this._last = this._curFirst = this._curLast = 0;\n this._map = [];\n for (let i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n for (let i = 0; i < arr.length; ++i) this.pushBack(arr[i]);\n }\n forEach(callback: (element: T, index: number, deque: Deque) => void) {\n for (let i = 0; i < this._length; ++i) {\n callback(this.getElementByPos(i), i, this);\n }\n }\n [Symbol.iterator]() {\n return function * (this: Deque) {\n for (let i = 0; i < this._length; ++i) {\n yield this.getElementByPos(i);\n }\n }.bind(this)();\n }\n}\n\nexport default Deque;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts new file mode 100644 index 000000000..1aca8646b --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts @@ -0,0 +1,58 @@ +import SequentialContainer from './Base'; +import { ContainerIterator, initContainer } from "../ContainerBase"; +declare class LinkListIterator extends ContainerIterator { + readonly container: LinkList; + get pointer(): T; + set pointer(newValue: T); + copy(): LinkListIterator; + equals(iter: LinkListIterator): boolean; + pre(): this; + next(): this; +} +export type { LinkListIterator }; +declare class LinkList extends SequentialContainer { + constructor(container?: initContainer); + clear(): void; + begin(): LinkListIterator; + end(): LinkListIterator; + rBegin(): LinkListIterator; + rEnd(): LinkListIterator; + front(): T | undefined; + back(): T | undefined; + getElementByPos(pos: number): T; + eraseElementByPos(pos: number): number; + eraseElementByValue(_value: T): number; + eraseElementByIterator(iter: LinkListIterator): LinkListIterator; + pushBack(element: T): number; + popBack(): T | undefined; + /** + * @description Push an element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + pushFront(element: T): number; + /** + * @description Removes the first element. + * @returns The element you popped. + */ + popFront(): T | undefined; + setElementByPos(pos: number, element: T): void; + insert(pos: number, element: T, num?: number): number; + find(element: T): LinkListIterator; + reverse(): void; + unique(): number; + sort(cmp?: (x: T, y: T) => number): void; + /** + * @description Merges two sorted lists. + * @param list - The other list you want to merge (must be sorted). + * @returns The size of list after merging. + * @example + * const linkA = new LinkList([1, 3, 5]); + * const linkB = new LinkList([2, 4, 6]); + * linkA.merge(linkB); // [1, 2, 3, 4, 5]; + */ + merge(list: LinkList): number; + forEach(callback: (element: T, index: number, list: LinkList) => void): void; + [Symbol.iterator](): Generator; +} +export default LinkList; diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js new file mode 100644 index 000000000..068a8573d --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js @@ -0,0 +1,330 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = _interopRequireDefault(require("./Base")); + +var _ContainerBase = require("../ContainerBase"); + +var _throwError = require("../../utils/throwError"); + +function _interopRequireDefault(t) { + return t && t.t ? t : { + default: t + }; +} + +class LinkListIterator extends _ContainerBase.ContainerIterator { + constructor(t, i, s, r) { + super(r); + this.o = t; + this.h = i; + this.container = s; + if (this.iteratorType === 0) { + this.pre = function() { + if (this.o.L === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.L; + return this; + }; + this.next = function() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.B; + return this; + }; + } else { + this.pre = function() { + if (this.o.B === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.B; + return this; + }; + this.next = function() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.L; + return this; + }; + } + } + get pointer() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + return this.o.l; + } + set pointer(t) { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o.l = t; + } + copy() { + return new LinkListIterator(this.o, this.h, this.container, this.iteratorType); + } +} + +class LinkList extends _Base.default { + constructor(t = []) { + super(); + this.h = {}; + this.p = this._ = this.h.L = this.h.B = this.h; + const i = this; + t.forEach((function(t) { + i.pushBack(t); + })); + } + V(t) { + const {L: i, B: s} = t; + i.B = s; + s.L = i; + if (t === this.p) { + this.p = s; + } + if (t === this._) { + this._ = i; + } + this.i -= 1; + } + G(t, i) { + const s = i.B; + const r = { + l: t, + L: i, + B: s + }; + i.B = r; + s.L = r; + if (i === this.h) { + this.p = r; + } + if (s === this.h) { + this._ = r; + } + this.i += 1; + } + clear() { + this.i = 0; + this.p = this._ = this.h.L = this.h.B = this.h; + } + begin() { + return new LinkListIterator(this.p, this.h, this); + } + end() { + return new LinkListIterator(this.h, this.h, this); + } + rBegin() { + return new LinkListIterator(this._, this.h, this, 1); + } + rEnd() { + return new LinkListIterator(this.h, this.h, this, 1); + } + front() { + return this.p.l; + } + back() { + return this._.l; + } + getElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + let i = this.p; + while (t--) { + i = i.B; + } + return i.l; + } + eraseElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + let i = this.p; + while (t--) { + i = i.B; + } + this.V(i); + return this.i; + } + eraseElementByValue(t) { + let i = this.p; + while (i !== this.h) { + if (i.l === t) { + this.V(i); + } + i = i.B; + } + return this.i; + } + eraseElementByIterator(t) { + const i = t.o; + if (i === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + t = t.next(); + this.V(i); + return t; + } + pushBack(t) { + this.G(t, this._); + return this.i; + } + popBack() { + if (this.i === 0) return; + const t = this._.l; + this.V(this._); + return t; + } + pushFront(t) { + this.G(t, this.h); + return this.i; + } + popFront() { + if (this.i === 0) return; + const t = this.p.l; + this.V(this.p); + return t; + } + setElementByPos(t, i) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + let s = this.p; + while (t--) { + s = s.B; + } + s.l = i; + } + insert(t, i, s = 1) { + if (t < 0 || t > this.i) { + throw new RangeError; + } + if (s <= 0) return this.i; + if (t === 0) { + while (s--) this.pushFront(i); + } else if (t === this.i) { + while (s--) this.pushBack(i); + } else { + let r = this.p; + for (let i = 1; i < t; ++i) { + r = r.B; + } + const e = r.B; + this.i += s; + while (s--) { + r.B = { + l: i, + L: r + }; + r.B.L = r; + r = r.B; + } + r.B = e; + e.L = r; + } + return this.i; + } + find(t) { + let i = this.p; + while (i !== this.h) { + if (i.l === t) { + return new LinkListIterator(i, this.h, this); + } + i = i.B; + } + return this.end(); + } + reverse() { + if (this.i <= 1) return; + let t = this.p; + let i = this._; + let s = 0; + while (s << 1 < this.i) { + const r = t.l; + t.l = i.l; + i.l = r; + t = t.B; + i = i.L; + s += 1; + } + } + unique() { + if (this.i <= 1) { + return this.i; + } + let t = this.p; + while (t !== this.h) { + let i = t; + while (i.B !== this.h && i.l === i.B.l) { + i = i.B; + this.i -= 1; + } + t.B = i.B; + t.B.L = t; + t = t.B; + } + return this.i; + } + sort(t) { + if (this.i <= 1) return; + const i = []; + this.forEach((function(t) { + i.push(t); + })); + i.sort(t); + let s = this.p; + i.forEach((function(t) { + s.l = t; + s = s.B; + })); + } + merge(t) { + const i = this; + if (this.i === 0) { + t.forEach((function(t) { + i.pushBack(t); + })); + } else { + let s = this.p; + t.forEach((function(t) { + while (s !== i.h && s.l <= t) { + s = s.B; + } + i.G(t, s.L); + })); + } + return this.i; + } + forEach(t) { + let i = this.p; + let s = 0; + while (i !== this.h) { + t(i.l, s++, this); + i = i.B; + } + } + [Symbol.iterator]() { + return function*() { + if (this.i === 0) return; + let t = this.p; + while (t !== this.h) { + yield t.l; + t = t.B; + } + }.bind(this)(); + } +} + +var _default = LinkList; + +exports.default = _default; +//# sourceMappingURL=LinkList.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js.map b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js.map new file mode 100644 index 000000000..203dd3f61 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/LinkList.js","../../src/container/SequentialContainer/LinkList.ts"],"names":["Object","defineProperty","exports","value","default","_Base","_interopRequireDefault","require","_ContainerBase","_throwError","obj","__esModule","LinkListIterator","ContainerIterator","constructor","_node","_header","container","iteratorType","super","this","pre","_pre","throwIteratorAccessError","next","_next","pointer","_value","newValue","copy","LinkList","SequentialContainer","_head","_tail","self","forEach","el","pushBack","_eraseNode","node","L","B","_length","_insertNode","clear","begin","end","rBegin","rEnd","front","back","getElementByPos","pos","RangeError","curNode","eraseElementByPos","eraseElementByValue","eraseElementByIterator","iter","element","popBack","pushFront","popFront","setElementByPos","insert","num","i","find","reverse","pHead","pTail","cnt","tmp","unique","tmpNode","sort","cmp","arr","push","merge","list","callback","index","Symbol","iterator","bind","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,QAAAC,uBAAAC,QAAA;;AACA,IAAAC,iBAAAD,QAAA;;AAEA,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C,SAAQ,SAAUwB;YACpBL,EAAQ3B,IAASgC;YACjBL,IAAUA,EAAQ7B;ADzBhB;AACJ;ICoCFsD,MAAMC;QACJ,MAAM9C,IAAOd;QACb,IAAIA,KAAKsB,MAAY,GAAG;YACtBsC,EAAK7C,SAAQ,SAAUC;gBACrBF,EAAKG,SAASD;ADzBV;AACJ,eC0BG;YACL,IAAIkB,IAAUlC,KAAKY;YACnBgD,EAAK7C,SAAQ,SAAUC;gBACrB,OACEkB,MAAYpB,EAAKlB,KACjBsC,EAAQ3B,KAAUS,GAClB;oBACAkB,IAAUA,EAAQ7B;AD1BZ;gBC4BRS,EAAKS,EAAYP,GAAIkB,EAAQhC;AD1BzB;AACJ;QC4BJ,OAAOF,KAAKsB;AD1BZ;IC4BFP,QAAQ8C;QACN,IAAI3B,IAAUlC,KAAKY;QACnB,IAAIkD,IAAQ;QACZ,OAAO5B,MAAYlC,KAAKJ,GAAS;YAC/BiE,EAAS3B,EAAQ3B,GAAQuD,KAAS9D;YAClCkC,IAAUA,EAAQ7B;AD1BhB;AACJ;IC4BF,CAAC0D,OAAOC;QACN,OAAO;YACL,IAAIhE,KAAKsB,MAAY,GAAG;YACxB,IAAIY,IAAUlC,KAAKY;YACnB,OAAOsB,MAAYlC,KAAKJ,GAAS;sBACzBsC,EAAQ3B;gBACd2B,IAAUA,EAAQ7B;ADzBd;AACJ,UC0BF4D,KAAKjE,KAPA;ADlBP;;;AC2BH,IAAAkE,WAEcxD;;AAAQ5B,QAAAE,UAAAkF","file":"LinkList.js","sourcesContent":["import SequentialContainer from './Base';\nimport { ContainerIterator } from \"../ContainerBase\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nclass LinkListIterator extends ContainerIterator {\n /**\n * @internal\n */\n constructor(_node, _header, container, iteratorType) {\n super(iteratorType);\n this._node = _node;\n this._header = _header;\n this.container = container;\n if (this.iteratorType === 0 /* IteratorType.NORMAL */) {\n this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n }\n else {\n this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._value;\n }\n set pointer(newValue) {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node._value = newValue;\n }\n copy() {\n return new LinkListIterator(this._node, this._header, this.container, this.iteratorType);\n }\n}\nclass LinkList extends SequentialContainer {\n constructor(container = []) {\n super();\n this._header = {};\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n const self = this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n }\n /**\n * @internal\n */\n _eraseNode(node) {\n const { _pre, _next } = node;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n }\n /**\n * @internal\n */\n _insertNode(value, pre) {\n const next = pre._next;\n const node = {\n _value: value,\n _pre: pre,\n _next: next\n };\n pre._next = node;\n next._pre = node;\n if (pre === this._header) {\n this._head = node;\n }\n if (next === this._header) {\n this._tail = node;\n }\n this._length += 1;\n }\n clear() {\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n }\n begin() {\n return new LinkListIterator(this._head, this._header, this);\n }\n end() {\n return new LinkListIterator(this._header, this._header, this);\n }\n rBegin() {\n return new LinkListIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new LinkListIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n return this._head._value;\n }\n back() {\n return this._tail._value;\n }\n getElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n return curNode._value;\n }\n eraseElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n this._eraseNode(curNode);\n return this._length;\n }\n eraseElementByValue(_value) {\n let curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === _value) {\n this._eraseNode(curNode);\n }\n curNode = curNode._next;\n }\n return this._length;\n }\n eraseElementByIterator(iter) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n iter = iter.next();\n this._eraseNode(node);\n return iter;\n }\n pushBack(element) {\n this._insertNode(element, this._tail);\n return this._length;\n }\n popBack() {\n if (this._length === 0)\n return;\n const value = this._tail._value;\n this._eraseNode(this._tail);\n return value;\n }\n /**\n * @description Push an element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n pushFront(element) {\n this._insertNode(element, this._header);\n return this._length;\n }\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n popFront() {\n if (this._length === 0)\n return;\n const value = this._head._value;\n this._eraseNode(this._head);\n return value;\n }\n setElementByPos(pos, element) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n curNode._value = element;\n }\n insert(pos, element, num = 1) {\n if (pos < 0 || pos > this._length) {\n throw new RangeError();\n }\n if (num <= 0)\n return this._length;\n if (pos === 0) {\n while (num--)\n this.pushFront(element);\n }\n else if (pos === this._length) {\n while (num--)\n this.pushBack(element);\n }\n else {\n let curNode = this._head;\n for (let i = 1; i < pos; ++i) {\n curNode = curNode._next;\n }\n const next = curNode._next;\n this._length += num;\n while (num--) {\n curNode._next = {\n _value: element,\n _pre: curNode\n };\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n curNode._next = next;\n next._pre = curNode;\n }\n return this._length;\n }\n find(element) {\n let curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === element) {\n return new LinkListIterator(curNode, this._header, this);\n }\n curNode = curNode._next;\n }\n return this.end();\n }\n reverse() {\n if (this._length <= 1)\n return;\n let pHead = this._head;\n let pTail = this._tail;\n let cnt = 0;\n while ((cnt << 1) < this._length) {\n const tmp = pHead._value;\n pHead._value = pTail._value;\n pTail._value = tmp;\n pHead = pHead._next;\n pTail = pTail._pre;\n cnt += 1;\n }\n }\n unique() {\n if (this._length <= 1) {\n return this._length;\n }\n let curNode = this._head;\n while (curNode !== this._header) {\n let tmpNode = curNode;\n while (tmpNode._next !== this._header &&\n tmpNode._value === tmpNode._next._value) {\n tmpNode = tmpNode._next;\n this._length -= 1;\n }\n curNode._next = tmpNode._next;\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n return this._length;\n }\n sort(cmp) {\n if (this._length <= 1)\n return;\n const arr = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n arr.sort(cmp);\n let curNode = this._head;\n arr.forEach(function (element) {\n curNode._value = element;\n curNode = curNode._next;\n });\n }\n /**\n * @description Merges two sorted lists.\n * @param list - The other list you want to merge (must be sorted).\n * @returns The size of list after merging.\n * @example\n * const linkA = new LinkList([1, 3, 5]);\n * const linkB = new LinkList([2, 4, 6]);\n * linkA.merge(linkB); // [1, 2, 3, 4, 5];\n */\n merge(list) {\n const self = this;\n if (this._length === 0) {\n list.forEach(function (el) {\n self.pushBack(el);\n });\n }\n else {\n let curNode = this._head;\n list.forEach(function (el) {\n while (curNode !== self._header &&\n curNode._value <= el) {\n curNode = curNode._next;\n }\n self._insertNode(el, curNode._pre);\n });\n }\n return this._length;\n }\n forEach(callback) {\n let curNode = this._head;\n let index = 0;\n while (curNode !== this._header) {\n callback(curNode._value, index++, this);\n curNode = curNode._next;\n }\n }\n [Symbol.iterator]() {\n return function* () {\n if (this._length === 0)\n return;\n let curNode = this._head;\n while (curNode !== this._header) {\n yield curNode._value;\n curNode = curNode._next;\n }\n }.bind(this)();\n }\n}\nexport default LinkList;\n","import SequentialContainer from './Base';\nimport { ContainerIterator, initContainer, IteratorType } from '@/container/ContainerBase';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\ntype LinkNode = {\n _value: T;\n _pre: LinkNode;\n _next: LinkNode;\n}\n\nclass LinkListIterator extends ContainerIterator {\n readonly container: LinkList;\n /**\n * @internal\n */\n _node: LinkNode;\n /**\n * @internal\n */\n private readonly _header: LinkNode;\n /**\n * @internal\n */\n constructor(\n _node: LinkNode,\n _header: LinkNode,\n container: LinkList,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = _node;\n this._header = _header;\n this.container = container;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._value;\n }\n set pointer(newValue: T) {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node._value = newValue;\n }\n copy() {\n return new LinkListIterator(this._node, this._header, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: LinkListIterator): boolean;\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n\nexport type { LinkListIterator };\n\nclass LinkList extends SequentialContainer {\n /**\n * @internal\n */\n private _head: LinkNode;\n /**\n * @internal\n */\n private _tail: LinkNode;\n /**\n * @internal\n */\n private readonly _header: LinkNode;\n constructor(container: initContainer = []) {\n super();\n this._header = >{};\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n const self = this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n }\n /**\n * @internal\n */\n private _eraseNode(node: LinkNode) {\n const { _pre, _next } = node;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n }\n /**\n * @internal\n */\n private _insertNode(value: T, pre: LinkNode) {\n const next = pre._next;\n const node = {\n _value: value,\n _pre: pre,\n _next: next\n };\n pre._next = node;\n next._pre = node;\n if (pre === this._header) {\n this._head = node;\n }\n if (next === this._header) {\n this._tail = node;\n }\n this._length += 1;\n }\n clear() {\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n }\n begin() {\n return new LinkListIterator(this._head, this._header, this);\n }\n end() {\n return new LinkListIterator(this._header, this._header, this);\n }\n rBegin() {\n return new LinkListIterator(this._tail, this._header, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new LinkListIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front(): T | undefined {\n return this._head._value;\n }\n back(): T | undefined {\n return this._tail._value;\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n return curNode._value;\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n this._eraseNode(curNode);\n return this._length;\n }\n eraseElementByValue(_value: T) {\n let curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === _value) {\n this._eraseNode(curNode);\n }\n curNode = curNode._next;\n }\n return this._length;\n }\n eraseElementByIterator(iter: LinkListIterator) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n iter = iter.next();\n this._eraseNode(node);\n return iter;\n }\n pushBack(element: T) {\n this._insertNode(element, this._tail);\n return this._length;\n }\n popBack() {\n if (this._length === 0) return;\n const value = this._tail._value;\n this._eraseNode(this._tail);\n return value;\n }\n /**\n * @description Push an element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n pushFront(element: T) {\n this._insertNode(element, this._header);\n return this._length;\n }\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n popFront() {\n if (this._length === 0) return;\n const value = this._head._value;\n this._eraseNode(this._head);\n return value;\n }\n setElementByPos(pos: number, element: T) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n curNode._value = element;\n }\n insert(pos: number, element: T, num = 1) {\n $checkWithinAccessParams!(pos, 0, this._length);\n if (num <= 0) return this._length;\n if (pos === 0) {\n while (num--) this.pushFront(element);\n } else if (pos === this._length) {\n while (num--) this.pushBack(element);\n } else {\n let curNode = this._head;\n for (let i = 1; i < pos; ++i) {\n curNode = curNode._next;\n }\n const next = curNode._next;\n this._length += num;\n while (num--) {\n curNode._next = >{\n _value: element,\n _pre: curNode\n };\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n curNode._next = next;\n next._pre = curNode;\n }\n return this._length;\n }\n find(element: T) {\n let curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === element) {\n return new LinkListIterator(curNode, this._header, this);\n }\n curNode = curNode._next;\n }\n return this.end();\n }\n reverse() {\n if (this._length <= 1) return;\n let pHead = this._head;\n let pTail = this._tail;\n let cnt = 0;\n while ((cnt << 1) < this._length) {\n const tmp = pHead._value;\n pHead._value = pTail._value;\n pTail._value = tmp;\n pHead = pHead._next;\n pTail = pTail._pre;\n cnt += 1;\n }\n }\n unique() {\n if (this._length <= 1) {\n return this._length;\n }\n let curNode = this._head;\n while (curNode !== this._header) {\n let tmpNode = curNode;\n while (\n tmpNode._next !== this._header &&\n tmpNode._value === tmpNode._next._value\n ) {\n tmpNode = tmpNode._next;\n this._length -= 1;\n }\n curNode._next = tmpNode._next;\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n return this._length;\n }\n sort(cmp?: (x: T, y: T) => number) {\n if (this._length <= 1) return;\n const arr: T[] = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n arr.sort(cmp);\n let curNode: LinkNode = this._head;\n arr.forEach(function (element) {\n curNode._value = element;\n curNode = curNode._next;\n });\n }\n /**\n * @description Merges two sorted lists.\n * @param list - The other list you want to merge (must be sorted).\n * @returns The size of list after merging.\n * @example\n * const linkA = new LinkList([1, 3, 5]);\n * const linkB = new LinkList([2, 4, 6]);\n * linkA.merge(linkB); // [1, 2, 3, 4, 5];\n */\n merge(list: LinkList) {\n const self = this;\n if (this._length === 0) {\n list.forEach(function (el) {\n self.pushBack(el);\n });\n } else {\n let curNode = this._head;\n list.forEach(function (el) {\n while (\n curNode !== self._header &&\n curNode._value <= el\n ) {\n curNode = curNode._next;\n }\n self._insertNode(el, curNode._pre);\n });\n }\n return this._length;\n }\n forEach(callback: (element: T, index: number, list: LinkList) => void) {\n let curNode = this._head;\n let index = 0;\n while (curNode !== this._header) {\n callback(curNode._value, index++, this);\n curNode = curNode._next;\n }\n }\n [Symbol.iterator]() {\n return function * (this: LinkList) {\n if (this._length === 0) return;\n let curNode = this._head;\n while (curNode !== this._header) {\n yield curNode._value;\n curNode = curNode._next;\n }\n }.bind(this)();\n }\n}\n\nexport default LinkList;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts new file mode 100644 index 000000000..d26df418f --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts @@ -0,0 +1,40 @@ +import SequentialContainer from './Base'; +import { initContainer, IteratorType } from "../ContainerBase"; +import { RandomIterator } from "./Base/RandomIterator"; +declare class VectorIterator extends RandomIterator { + container: Vector; + constructor(node: number, container: Vector, iteratorType?: IteratorType); + copy(): VectorIterator; + equals(iter: VectorIterator): boolean; +} +export type { VectorIterator }; +declare class Vector extends SequentialContainer { + /** + * @param container - Initialize container, must have a forEach function. + * @param copy - When the container is an array, you can choose to directly operate on the original object of + * the array or perform a shallow copy. The default is shallow copy. + */ + constructor(container?: initContainer, copy?: boolean); + clear(): void; + begin(): VectorIterator; + end(): VectorIterator; + rBegin(): VectorIterator; + rEnd(): VectorIterator; + front(): T | undefined; + back(): T | undefined; + getElementByPos(pos: number): T; + eraseElementByPos(pos: number): number; + eraseElementByValue(value: T): number; + eraseElementByIterator(iter: VectorIterator): VectorIterator; + pushBack(element: T): number; + popBack(): T | undefined; + setElementByPos(pos: number, element: T): void; + insert(pos: number, element: T, num?: number): number; + find(element: T): VectorIterator; + reverse(): void; + unique(): number; + sort(cmp?: (x: T, y: T) => number): void; + forEach(callback: (element: T, index: number, vector: Vector) => void): void; + [Symbol.iterator](): Generator; +} +export default Vector; diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js new file mode 100644 index 000000000..b61d3a919 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js @@ -0,0 +1,158 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = _interopRequireDefault(require("./Base")); + +var _RandomIterator = require("./Base/RandomIterator"); + +function _interopRequireDefault(t) { + return t && t.t ? t : { + default: t + }; +} + +class VectorIterator extends _RandomIterator.RandomIterator { + constructor(t, r, e) { + super(t, e); + this.container = r; + } + copy() { + return new VectorIterator(this.o, this.container, this.iteratorType); + } +} + +class Vector extends _Base.default { + constructor(t = [], r = true) { + super(); + if (Array.isArray(t)) { + this.J = r ? [ ...t ] : t; + this.i = t.length; + } else { + this.J = []; + const r = this; + t.forEach((function(t) { + r.pushBack(t); + })); + } + } + clear() { + this.i = 0; + this.J.length = 0; + } + begin() { + return new VectorIterator(0, this); + } + end() { + return new VectorIterator(this.i, this); + } + rBegin() { + return new VectorIterator(this.i - 1, this, 1); + } + rEnd() { + return new VectorIterator(-1, this, 1); + } + front() { + return this.J[0]; + } + back() { + return this.J[this.i - 1]; + } + getElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + return this.J[t]; + } + eraseElementByPos(t) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + this.J.splice(t, 1); + this.i -= 1; + return this.i; + } + eraseElementByValue(t) { + let r = 0; + for (let e = 0; e < this.i; ++e) { + if (this.J[e] !== t) { + this.J[r++] = this.J[e]; + } + } + this.i = this.J.length = r; + return this.i; + } + eraseElementByIterator(t) { + const r = t.o; + t = t.next(); + this.eraseElementByPos(r); + return t; + } + pushBack(t) { + this.J.push(t); + this.i += 1; + return this.i; + } + popBack() { + if (this.i === 0) return; + this.i -= 1; + return this.J.pop(); + } + setElementByPos(t, r) { + if (t < 0 || t > this.i - 1) { + throw new RangeError; + } + this.J[t] = r; + } + insert(t, r, e = 1) { + if (t < 0 || t > this.i) { + throw new RangeError; + } + this.J.splice(t, 0, ...new Array(e).fill(r)); + this.i += e; + return this.i; + } + find(t) { + for (let r = 0; r < this.i; ++r) { + if (this.J[r] === t) { + return new VectorIterator(r, this); + } + } + return this.end(); + } + reverse() { + this.J.reverse(); + } + unique() { + let t = 1; + for (let r = 1; r < this.i; ++r) { + if (this.J[r] !== this.J[r - 1]) { + this.J[t++] = this.J[r]; + } + } + this.i = this.J.length = t; + return this.i; + } + sort(t) { + this.J.sort(t); + } + forEach(t) { + for (let r = 0; r < this.i; ++r) { + t(this.J[r], r, this); + } + } + [Symbol.iterator]() { + return function*() { + yield* this.J; + }.bind(this)(); + } +} + +var _default = Vector; + +exports.default = _default; +//# sourceMappingURL=Vector.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js.map b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js.map new file mode 100644 index 000000000..608c69199 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Vector.js","../../src/container/SequentialContainer/Vector.ts"],"names":["Object","defineProperty","exports","value","default","_Base","_interopRequireDefault","require","_RandomIterator","obj","__esModule","VectorIterator","RandomIterator","constructor","node","container","iteratorType","super","this","copy","_node","Vector","SequentialContainer","Array","isArray","_vector","_length","length","self","forEach","el","pushBack","clear","begin","end","rBegin","rEnd","front","back","getElementByPos","pos","RangeError","eraseElementByPos","splice","eraseElementByValue","index","i","eraseElementByIterator","iter","next","element","push","popBack","pop","setElementByPos","insert","num","fill","find","reverse","unique","sort","cmp","callback","Symbol","iterator","bind","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,QAAAC,uBAAAC,QAAA;;AAEA,IAAAC,kBAAAD,QAAA;;AAAqF,SAAAD,uBAAAG;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAL,SAAAK;;AAAA;;AAGrF,MAAME,uBAA0BC,gBAAAA;IAE9BC,YAAYC,GAAcC,GAAsBC;QAC9CC,MAAMH,GAAME;QACZE,KAAKH,YAAYA;ADFjB;ICIFI;QACE,OAAO,IAAIR,eAAkBO,KAAKE,GAAOF,KAAKH,WAAWG,KAAKF;ADF9D;;;ACUJ,MAAMK,eAAkBC,MAAAA;IAUtBT,YAAYE,IAA8B,IAAII,IAAO;QACnDF;QACA,IAAIM,MAAMC,QAAQT,IAAY;YAC5BG,KAAKO,IAAUN,IAAO,KAAIJ,MAAaA;YACvCG,KAAKQ,IAAUX,EAAUY;ADXvB,eCYG;YACLT,KAAKO,IAAU;YACf,MAAMG,IAAOV;YACbH,EAAUc,SAAQ,SAAUC;gBAC1BF,EAAKG,SAASD;ADVV;AACJ;AACJ;ICYFE;QACEd,KAAKQ,IAAU;QACfR,KAAKO,EAAQE,SAAS;ADVtB;ICYFM;QACE,OAAO,IAAItB,eAAkB,GAA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IAAAiD,WAEc9C;;AAAMnB,QAAAE,UAAA+D","file":"Vector.js","sourcesContent":["import SequentialContainer from './Base';\nimport { RandomIterator } from \"./Base/RandomIterator\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nclass VectorIterator extends RandomIterator {\n constructor(node, container, iteratorType) {\n super(node, iteratorType);\n this.container = container;\n }\n copy() {\n return new VectorIterator(this._node, this.container, this.iteratorType);\n }\n}\nclass Vector extends SequentialContainer {\n /**\n * @param container - Initialize container, must have a forEach function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n */\n constructor(container = [], copy = true) {\n super();\n if (Array.isArray(container)) {\n this._vector = copy ? [...container] : container;\n this._length = container.length;\n }\n else {\n this._vector = [];\n const self = this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n }\n }\n clear() {\n this._length = 0;\n this._vector.length = 0;\n }\n begin() {\n return new VectorIterator(0, this);\n }\n end() {\n return new VectorIterator(this._length, this);\n }\n rBegin() {\n return new VectorIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new VectorIterator(-1, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n return this._vector[0];\n }\n back() {\n return this._vector[this._length - 1];\n }\n getElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n return this._vector[pos];\n }\n eraseElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n this._vector.splice(pos, 1);\n this._length -= 1;\n return this._length;\n }\n eraseElementByValue(value) {\n let index = 0;\n for (let i = 0; i < this._length; ++i) {\n if (this._vector[i] !== value) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n }\n eraseElementByIterator(iter) {\n const _node = iter._node;\n iter = iter.next();\n this.eraseElementByPos(_node);\n return iter;\n }\n pushBack(element) {\n this._vector.push(element);\n this._length += 1;\n return this._length;\n }\n popBack() {\n if (this._length === 0)\n return;\n this._length -= 1;\n return this._vector.pop();\n }\n setElementByPos(pos, element) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n this._vector[pos] = element;\n }\n insert(pos, element, num = 1) {\n if (pos < 0 || pos > this._length) {\n throw new RangeError();\n }\n this._vector.splice(pos, 0, ...new Array(num).fill(element));\n this._length += num;\n return this._length;\n }\n find(element) {\n for (let i = 0; i < this._length; ++i) {\n if (this._vector[i] === element) {\n return new VectorIterator(i, this);\n }\n }\n return this.end();\n }\n reverse() {\n this._vector.reverse();\n }\n unique() {\n let index = 1;\n for (let i = 1; i < this._length; ++i) {\n if (this._vector[i] !== this._vector[i - 1]) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n }\n sort(cmp) {\n this._vector.sort(cmp);\n }\n forEach(callback) {\n for (let i = 0; i < this._length; ++i) {\n callback(this._vector[i], i, this);\n }\n }\n [Symbol.iterator]() {\n return function* () {\n yield* this._vector;\n }.bind(this)();\n }\n}\nexport default Vector;\n","import SequentialContainer from './Base';\nimport { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { RandomIterator } from '@/container/SequentialContainer/Base/RandomIterator';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\n\nclass VectorIterator extends RandomIterator {\n container: Vector;\n constructor(node: number, container: Vector, iteratorType?: IteratorType) {\n super(node, iteratorType);\n this.container = container;\n }\n copy() {\n return new VectorIterator(this._node, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: VectorIterator): boolean;\n}\n\nexport type { VectorIterator };\n\nclass Vector extends SequentialContainer {\n /**\n * @internal\n */\n private readonly _vector: T[];\n /**\n * @param container - Initialize container, must have a forEach function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n */\n constructor(container: initContainer = [], copy = true) {\n super();\n if (Array.isArray(container)) {\n this._vector = copy ? [...container] : container;\n this._length = container.length;\n } else {\n this._vector = [];\n const self = this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n }\n }\n clear() {\n this._length = 0;\n this._vector.length = 0;\n }\n begin() {\n return new VectorIterator(0, this);\n }\n end() {\n return new VectorIterator(this._length, this);\n }\n rBegin() {\n return new VectorIterator(this._length - 1, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new VectorIterator(-1, this, IteratorType.REVERSE);\n }\n front(): T | undefined {\n return this._vector[0];\n }\n back(): T | undefined {\n return this._vector[this._length - 1];\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n return this._vector[pos];\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n this._vector.splice(pos, 1);\n this._length -= 1;\n return this._length;\n }\n eraseElementByValue(value: T) {\n let index = 0;\n for (let i = 0; i < this._length; ++i) {\n if (this._vector[i] !== value) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n }\n eraseElementByIterator(iter: VectorIterator) {\n const _node = iter._node;\n iter = iter.next();\n this.eraseElementByPos(_node);\n return iter;\n }\n pushBack(element: T) {\n this._vector.push(element);\n this._length += 1;\n return this._length;\n }\n popBack() {\n if (this._length === 0) return;\n this._length -= 1;\n return this._vector.pop();\n }\n setElementByPos(pos: number, element: T) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n this._vector[pos] = element;\n }\n insert(pos: number, element: T, num = 1) {\n $checkWithinAccessParams!(pos, 0, this._length);\n this._vector.splice(pos, 0, ...new Array(num).fill(element));\n this._length += num;\n return this._length;\n }\n find(element: T) {\n for (let i = 0; i < this._length; ++i) {\n if (this._vector[i] === element) {\n return new VectorIterator(i, this);\n }\n }\n return this.end();\n }\n reverse() {\n this._vector.reverse();\n }\n unique() {\n let index = 1;\n for (let i = 1; i < this._length; ++i) {\n if (this._vector[i] !== this._vector[i - 1]) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n }\n sort(cmp?: (x: T, y: T) => number) {\n this._vector.sort(cmp);\n }\n forEach(callback: (element: T, index: number, vector: Vector) => void) {\n for (let i = 0; i < this._length; ++i) {\n callback(this._vector[i], i, this);\n }\n }\n [Symbol.iterator]() {\n return function * (this: Vector) {\n yield * this._vector;\n }.bind(this)();\n }\n}\n\nexport default Vector;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts new file mode 100644 index 000000000..e6288572a --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts @@ -0,0 +1,18 @@ +import { ContainerIterator } from "../../ContainerBase"; +import TreeContainer from "./index"; +declare abstract class TreeIterator extends ContainerIterator { + abstract readonly container: TreeContainer; + /** + * @description Get the sequential index of the iterator in the tree container.
+ * Note: + * This function only takes effect when the specified tree container `enableIndex = true`. + * @returns The index subscript of the node in the tree. + * @example + * const st = new OrderedSet([1, 2, 3], true); + * console.log(st.begin().next().index); // 1 + */ + get index(): number; + pre(): this; + next(): this; +} +export default TreeIterator; diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js new file mode 100644 index 000000000..f238b856b --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js @@ -0,0 +1,80 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _ContainerBase = require("../../ContainerBase"); + +var _throwError = require("../../../utils/throwError"); + +class TreeIterator extends _ContainerBase.ContainerIterator { + constructor(t, r, i) { + super(i); + this.o = t; + this.h = r; + if (this.iteratorType === 0) { + this.pre = function() { + if (this.o === this.h.U) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.L(); + return this; + }; + this.next = function() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.B(); + return this; + }; + } else { + this.pre = function() { + if (this.o === this.h.W) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.B(); + return this; + }; + this.next = function() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + this.o = this.o.L(); + return this; + }; + } + } + get index() { + let t = this.o; + const r = this.h.tt; + if (t === this.h) { + if (r) { + return r.rt - 1; + } + return 0; + } + let i = 0; + if (t.U) { + i += t.U.rt; + } + while (t !== r) { + const r = t.tt; + if (t === r.W) { + i += 1; + if (r.U) { + i += r.U.rt; + } + } + t = r; + } + return i; + } +} + +var _default = TreeIterator; + +exports.default = _default; +//# sourceMappingURL=TreeIterator.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js.map b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js.map new file mode 100644 index 000000000..f5c9714af --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/Base/TreeIterator.js","../../src/container/TreeContainer/Base/TreeIterator.ts"],"names":["Object","defineProperty","exports","value","default","_ContainerBase","require","_throwError","TreeIterator","ContainerIterator","constructor","node","header","iteratorType","super","this","_node","_header","pre","_left","throwIteratorAccessError","_pre","next","_next","_right","index","root","_parent","_subTreeSize","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACHvB,IAAAC,iBAAAC,QAAA;;AAEA,IAAAC,cAAAD,QAAA;;AAEA,MAAeE,qBAA2BC,eAAAA;IAaxCC,YACEC,GACAC,GACAC;QAEAC,MAAMD;QACNE,KAAKC,IAAQL;QACbI,KAAKE,IAAUL;QACf,IAAIG,KAAKF,iBAAY,GAA0B;YAC7CE,KAAKG,MAAM;gBACT,IAAIH,KAAKC,MAAUD,KAAKE,EAAQE,GAAO;qBACrC,GAAAC,YAAAA;ADhBM;gBCkBRL,KAAKC,IAAQD,KAAKC,EAAMK;gBACxB,OAAON;ADhBH;YCmBNA,KAAKO,OAAO;gBACV,IAAIP,KAAKC,MAAUD,KAAKE,GAAS;qBAC/B,GAAAG,YAAAA;ADjBM;gBCmBRL,KAAKC,IAAQD,KAAKC,EAAMO;gBACxB,OAAOR;ADjBH;AACJ,eCkBG;YACLA,KAAKG,MAAM;gBACT,IAAIH,KAAKC,MAAUD,KAAKE,EAAQO,GAAQ;qBACtC,GAAAJ,YAAAA;ADhBM;gBCkBRL,KAAKC,IAAQD,KAAKC,EAAMO;gBACxB,OAAOR;ADhBH;YCmBNA,KAAKO,OAAO;gBACV,IAAIP,KAAKC,MAAUD,KAAKE,GAAS;qBAC/B,GAAAG,YAAAA;ADjBM;gBCmBRL,KAAKC,IAAQD,KAAKC,EAAMK;gBACxB,OAAON;ADjBH;AACJ;AACJ;IC4BEU;QACF,IAAIT,IAAQD,KAAKC;QACjB,MAAMU,IAAOX,KAAKE,EAAQU;QAC1B,IAAIX,MAAUD,KAAKE,GAAS;YAC1B,IAAIS,GAAM;gBACR,OAAOA,EAAKE,KAAe;ADjBvB;YCmBN,OAAO;ADjBL;QCmBJ,IAAIH,IAAQ;QACZ,IAAIT,EAAMG,GAAO;YACfM,KAAUT,EAAMG,EAAoCS;ADjBlD;QCmBJ,OAAOZ,MAAUU,GAAM;YACrB,MAAMC,IAAUX,EAAMW;YACtB,IAAIX,MAAUW,EAAQH,GAAQ;gBAC5BC,KAAS;gBACT,IAAIE,EAAQR,GAAO;oBACjBM,KAAUE,EAAQR,EAAoCS;ADjBhD;AACJ;YCmBNZ,IAAQW;ADjBN;QCmBJ,OAAOF;ADjBP;;;ACuBH,IAAAI,WAEcrB;;AAAYN,QAAAE,UAAAyB","file":"TreeIterator.js","sourcesContent":["import { ContainerIterator } from \"../../ContainerBase\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nclass TreeIterator extends ContainerIterator {\n /**\n * @internal\n */\n constructor(node, header, iteratorType) {\n super(iteratorType);\n this._node = node;\n this._header = header;\n if (this.iteratorType === 0 /* IteratorType.NORMAL */) {\n this.pre = function () {\n if (this._node === this._header._left) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n }\n else {\n this.pre = function () {\n if (this._node === this._header._right) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n }\n }\n /**\n * @description Get the sequential index of the iterator in the tree container.
\n * Note:\n * This function only takes effect when the specified tree container `enableIndex = true`.\n * @returns The index subscript of the node in the tree.\n * @example\n * const st = new OrderedSet([1, 2, 3], true);\n * console.log(st.begin().next().index); // 1\n */\n get index() {\n let _node = this._node;\n const root = this._header._parent;\n if (_node === this._header) {\n if (root) {\n return root._subTreeSize - 1;\n }\n return 0;\n }\n let index = 0;\n if (_node._left) {\n index += _node._left._subTreeSize;\n }\n while (_node !== root) {\n const _parent = _node._parent;\n if (_node === _parent._right) {\n index += 1;\n if (_parent._left) {\n index += _parent._left._subTreeSize;\n }\n }\n _node = _parent;\n }\n return index;\n }\n}\nexport default TreeIterator;\n","import { TreeNode } from './TreeNode';\nimport type { TreeNodeEnableIndex } from './TreeNode';\nimport { ContainerIterator, IteratorType } from '@/container/ContainerBase';\nimport TreeContainer from '@/container/TreeContainer/Base/index';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nabstract class TreeIterator extends ContainerIterator {\n abstract readonly container: TreeContainer;\n /**\n * @internal\n */\n _node: TreeNode;\n /**\n * @internal\n */\n protected _header: TreeNode;\n /**\n * @internal\n */\n protected constructor(\n node: TreeNode,\n header: TreeNode,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = node;\n this._header = header;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node === this._header._left) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node === this._header._right) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n }\n }\n /**\n * @description Get the sequential index of the iterator in the tree container.
\n * Note:\n * This function only takes effect when the specified tree container `enableIndex = true`.\n * @returns The index subscript of the node in the tree.\n * @example\n * const st = new OrderedSet([1, 2, 3], true);\n * console.log(st.begin().next().index); // 1\n */\n get index() {\n let _node = this._node as TreeNodeEnableIndex;\n const root = this._header._parent as TreeNodeEnableIndex;\n if (_node === this._header) {\n if (root) {\n return root._subTreeSize - 1;\n }\n return 0;\n }\n let index = 0;\n if (_node._left) {\n index += (_node._left as TreeNodeEnableIndex)._subTreeSize;\n }\n while (_node !== root) {\n const _parent = _node._parent as TreeNodeEnableIndex;\n if (_node === _parent._right) {\n index += 1;\n if (_parent._left) {\n index += (_parent._left as TreeNodeEnableIndex)._subTreeSize;\n }\n }\n _node = _parent;\n }\n return index;\n }\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n\nexport default TreeIterator;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts new file mode 100644 index 000000000..d0aec5050 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts @@ -0,0 +1,47 @@ +export declare const enum TreeNodeColor { + RED = 1, + BLACK = 0 +} +export declare class TreeNode { + _color: TreeNodeColor; + _key: K | undefined; + _value: V | undefined; + _left: TreeNode | undefined; + _right: TreeNode | undefined; + _parent: TreeNode | undefined; + constructor(key?: K, value?: V); + /** + * @description Get the pre node. + * @returns TreeNode about the pre node. + */ + _pre(): TreeNode; + /** + * @description Get the next node. + * @returns TreeNode about the next node. + */ + _next(): TreeNode; + /** + * @description Rotate left. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateLeft(): TreeNode; + /** + * @description Rotate right. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateRight(): TreeNode; +} +export declare class TreeNodeEnableIndex extends TreeNode { + _subTreeSize: number; + /** + * @description Rotate left and do recount. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateLeft(): TreeNodeEnableIndex; + /** + * @description Rotate right and do recount. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateRight(): TreeNodeEnableIndex; + _recount(): void; +} diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js new file mode 100644 index 000000000..108fcf1fb --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js @@ -0,0 +1,115 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.TreeNodeEnableIndex = exports.TreeNode = void 0; + +class TreeNode { + constructor(e, t) { + this.ee = 1; + this.u = undefined; + this.l = undefined; + this.U = undefined; + this.W = undefined; + this.tt = undefined; + this.u = e; + this.l = t; + } + L() { + let e = this; + if (e.ee === 1 && e.tt.tt === e) { + e = e.W; + } else if (e.U) { + e = e.U; + while (e.W) { + e = e.W; + } + } else { + let t = e.tt; + while (t.U === e) { + e = t; + t = e.tt; + } + e = t; + } + return e; + } + B() { + let e = this; + if (e.W) { + e = e.W; + while (e.U) { + e = e.U; + } + return e; + } else { + let t = e.tt; + while (t.W === e) { + e = t; + t = e.tt; + } + if (e.W !== t) { + return t; + } else return e; + } + } + te() { + const e = this.tt; + const t = this.W; + const s = t.U; + if (e.tt === this) e.tt = t; else if (e.U === this) e.U = t; else e.W = t; + t.tt = e; + t.U = this; + this.tt = t; + this.W = s; + if (s) s.tt = this; + return t; + } + se() { + const e = this.tt; + const t = this.U; + const s = t.W; + if (e.tt === this) e.tt = t; else if (e.U === this) e.U = t; else e.W = t; + t.tt = e; + t.W = this; + this.tt = t; + this.U = s; + if (s) s.tt = this; + return t; + } +} + +exports.TreeNode = TreeNode; + +class TreeNodeEnableIndex extends TreeNode { + constructor() { + super(...arguments); + this.rt = 1; + } + te() { + const e = super.te(); + this.ie(); + e.ie(); + return e; + } + se() { + const e = super.se(); + this.ie(); + e.ie(); + return e; + } + ie() { + this.rt = 1; + if (this.U) { + this.rt += this.U.rt; + } + if (this.W) { + this.rt += this.W.rt; + } + } +} + +exports.TreeNodeEnableIndex = TreeNodeEnableIndex; +//# sourceMappingURL=TreeNode.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js.map b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js.map new file mode 100644 index 000000000..0a115c6bd --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/Base/TreeNode.js","../../src/container/TreeContainer/Base/TreeNode.ts"],"names":["Object","defineProperty","exports","value","TreeNodeEnableIndex","TreeNode","constructor","key","this","_color","_key","undefined","_value","_left","_right","_parent","_pre","preNode","pre","_next","nextNode","_rotateLeft","PP","V","R","_rotateRight","F","K","super","arguments","_subTreeSize","parent","_recount"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,sBAAsBF,QAAQG,gBAAgB;;ACAhD,MAAOA;IAOXC,YAAYC,GAASJ;QANrBK,KAAAC,KAAM;QACND,KAAAE,IAAsBC;QACtBH,KAAAI,IAAwBD;QACxBH,KAAAK,IAAoCF;QACpCH,KAAAM,IAAqCH;QACrCH,KAAAO,KAAsCJ;QAEpCH,KAAKE,I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UW,QACjC,IAAIJ,EAAGT,MAAUL,MAAMc,EAAGT,IAAQa,QAClCJ,EAAGR,IAASY;QAEjBA,EAAEX,KAAUO;QACZI,EAAEZ,IAASN;QAEXA,KAAKO,KAAUW;QACflB,KAAKK,IAAQc;QAEb,IAAIA,GAAGA,EAAEZ,KAAUP;QAEnB,OAAOkB;ADHP;;;ACKHxB,QAAAG,WAAAA;;AAEK,MAAOD,4BAAkCC;IAA/CC;QDHQsB,SAASC;QCIfrB,KAAAsB,KAAe;AA8BjB;IAzBET;QACE,MAAMU,IAASH,MAAMP;QACrBb,KAAKwB;QACLD,EAAOC;QACP,OAAOD;ADDP;ICOFN;QACE,MAAMM,IAASH,MAAMH;QACrBjB,KAAKwB;QACLD,EAAOC;QACP,OAAOD;ADDP;ICGFC;QACExB,KAAKsB,KAAe;QACpB,IAAItB,KAAKK,GAAO;YACdL,KAAKsB,MAAiBtB,KAAKK,EAAoCiB;ADD7D;QCGJ,IAAItB,KAAKM,GAAQ;YACfN,KAAKsB,MAAiBtB,KAAKM,EAAqCgB;ADD9D;AACJ;;;ACGH5B,QAAAE,sBAAAA","file":"TreeNode.js","sourcesContent":["export class TreeNode {\n constructor(key, value) {\n this._color = 1 /* TreeNodeColor.RED */;\n this._key = undefined;\n this._value = undefined;\n this._left = undefined;\n this._right = undefined;\n this._parent = undefined;\n this._key = key;\n this._value = value;\n }\n /**\n * @description Get the pre node.\n * @returns TreeNode about the pre node.\n */\n _pre() {\n let preNode = this;\n if (preNode._color === 1 /* TreeNodeColor.RED */ &&\n preNode._parent._parent === preNode) {\n preNode = preNode._right;\n }\n else if (preNode._left) {\n preNode = preNode._left;\n while (preNode._right) {\n preNode = preNode._right;\n }\n }\n else {\n let pre = preNode._parent;\n while (pre._left === preNode) {\n preNode = pre;\n pre = preNode._parent;\n }\n preNode = pre;\n }\n return preNode;\n }\n /**\n * @description Get the next node.\n * @returns TreeNode about the next node.\n */\n _next() {\n let nextNode = this;\n if (nextNode._right) {\n nextNode = nextNode._right;\n while (nextNode._left) {\n nextNode = nextNode._left;\n }\n return nextNode;\n }\n else {\n let pre = nextNode._parent;\n while (pre._right === nextNode) {\n nextNode = pre;\n pre = nextNode._parent;\n }\n if (nextNode._right !== pre) {\n return pre;\n }\n else\n return nextNode;\n }\n }\n /**\n * @description Rotate left.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateLeft() {\n const PP = this._parent;\n const V = this._right;\n const R = V._left;\n if (PP._parent === this)\n PP._parent = V;\n else if (PP._left === this)\n PP._left = V;\n else\n PP._right = V;\n V._parent = PP;\n V._left = this;\n this._parent = V;\n this._right = R;\n if (R)\n R._parent = this;\n return V;\n }\n /**\n * @description Rotate right.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateRight() {\n const PP = this._parent;\n const F = this._left;\n const K = F._right;\n if (PP._parent === this)\n PP._parent = F;\n else if (PP._left === this)\n PP._left = F;\n else\n PP._right = F;\n F._parent = PP;\n F._right = this;\n this._parent = F;\n this._left = K;\n if (K)\n K._parent = this;\n return F;\n }\n}\nexport class TreeNodeEnableIndex extends TreeNode {\n constructor() {\n super(...arguments);\n this._subTreeSize = 1;\n }\n /**\n * @description Rotate left and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateLeft() {\n const parent = super._rotateLeft();\n this._recount();\n parent._recount();\n return parent;\n }\n /**\n * @description Rotate right and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateRight() {\n const parent = super._rotateRight();\n this._recount();\n parent._recount();\n return parent;\n }\n _recount() {\n this._subTreeSize = 1;\n if (this._left) {\n this._subTreeSize += this._left._subTreeSize;\n }\n if (this._right) {\n this._subTreeSize += this._right._subTreeSize;\n }\n }\n}\n","export const enum TreeNodeColor {\n RED = 1,\n BLACK = 0\n}\n\nexport class TreeNode {\n _color = TreeNodeColor.RED;\n _key: K | undefined = undefined;\n _value: V | undefined = undefined;\n _left: TreeNode | undefined = undefined;\n _right: TreeNode | undefined = undefined;\n _parent: TreeNode | undefined = undefined;\n constructor(key?: K, value?: V) {\n this._key = key;\n this._value = value;\n }\n /**\n * @description Get the pre node.\n * @returns TreeNode about the pre node.\n */\n _pre() {\n let preNode: TreeNode = this;\n if (\n preNode._color === TreeNodeColor.RED &&\n preNode._parent!._parent === preNode\n ) {\n preNode = preNode._right!;\n } else if (preNode._left) {\n preNode = preNode._left;\n while (preNode._right) {\n preNode = preNode._right;\n }\n } else {\n let pre = preNode._parent!;\n while (pre._left === preNode) {\n preNode = pre;\n pre = preNode._parent!;\n }\n preNode = pre;\n }\n return preNode;\n }\n /**\n * @description Get the next node.\n * @returns TreeNode about the next node.\n */\n _next() {\n let nextNode: TreeNode = this;\n if (nextNode._right) {\n nextNode = nextNode._right;\n while (nextNode._left) {\n nextNode = nextNode._left;\n }\n return nextNode;\n } else {\n let pre = nextNode._parent!;\n while (pre._right === nextNode) {\n nextNode = pre;\n pre = nextNode._parent!;\n }\n if (nextNode._right !== pre) {\n return pre;\n } else return nextNode;\n }\n }\n /**\n * @description Rotate left.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateLeft() {\n const PP = this._parent!;\n const V = this._right!;\n const R = V._left;\n\n if (PP._parent === this) PP._parent = V;\n else if (PP._left === this) PP._left = V;\n else PP._right = V;\n\n V._parent = PP;\n V._left = this;\n\n this._parent = V;\n this._right = R;\n\n if (R) R._parent = this;\n\n return V;\n }\n /**\n * @description Rotate right.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateRight() {\n const PP = this._parent!;\n const F = this._left!;\n const K = F._right;\n\n if (PP._parent === this) PP._parent = F;\n else if (PP._left === this) PP._left = F;\n else PP._right = F;\n\n F._parent = PP;\n F._right = this;\n\n this._parent = F;\n this._left = K;\n\n if (K) K._parent = this;\n\n return F;\n }\n}\n\nexport class TreeNodeEnableIndex extends TreeNode {\n _subTreeSize = 1;\n /**\n * @description Rotate left and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateLeft() {\n const parent = super._rotateLeft() as TreeNodeEnableIndex;\n this._recount();\n parent._recount();\n return parent;\n }\n /**\n * @description Rotate right and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateRight() {\n const parent = super._rotateRight() as TreeNodeEnableIndex;\n this._recount();\n parent._recount();\n return parent;\n }\n _recount() {\n this._subTreeSize = 1;\n if (this._left) {\n this._subTreeSize += (this._left as TreeNodeEnableIndex)._subTreeSize;\n }\n if (this._right) {\n this._subTreeSize += (this._right as TreeNodeEnableIndex)._subTreeSize;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts new file mode 100644 index 000000000..96e4792d2 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts @@ -0,0 +1,58 @@ +import type TreeIterator from './TreeIterator'; +import { Container } from "../../ContainerBase"; +declare abstract class TreeContainer extends Container { + clear(): void; + /** + * @description Update node's key by iterator. + * @param iter - The iterator you want to change. + * @param key - The key you want to update. + * @returns Whether the modification is successful. + * @example + * const st = new orderedSet([1, 2, 5]); + * const iter = st.find(2); + * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5] + */ + updateKeyByIterator(iter: TreeIterator, key: K): boolean; + eraseElementByPos(pos: number): number; + /** + * @description Remove the element of the specified key. + * @param key - The key you want to remove. + * @returns Whether erase successfully. + */ + eraseElementByKey(key: K): boolean; + eraseElementByIterator(iter: TreeIterator): TreeIterator; + forEach(callback: (element: K | [K, V], index: number, tree: TreeContainer) => void): void; + getElementByPos(pos: number): K | [K, V]; + /** + * @description Get the height of the tree. + * @returns Number about the height of the RB-tree. + */ + getHeight(): number; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element less than the given key. + */ + abstract reverseUpperBound(key: K): TreeIterator; + /** + * @description Union the other tree to self. + * @param other - The other tree container you want to merge. + * @returns The size of the tree after union. + */ + abstract union(other: TreeContainer): number; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element not greater than the given key. + */ + abstract reverseLowerBound(key: K): TreeIterator; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element not less than the given key. + */ + abstract lowerBound(key: K): TreeIterator; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element greater than the given key. + */ + abstract upperBound(key: K): TreeIterator; +} +export default TreeContainer; diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js new file mode 100644 index 000000000..1ba006929 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js @@ -0,0 +1,514 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _TreeNode = require("./TreeNode"); + +var _ContainerBase = require("../../ContainerBase"); + +var _throwError = require("../../../utils/throwError"); + +class TreeContainer extends _ContainerBase.Container { + constructor(e = function(e, t) { + if (e < t) return -1; + if (e > t) return 1; + return 0; + }, t = false) { + super(); + this.Y = undefined; + this.v = e; + if (t) { + this.re = _TreeNode.TreeNodeEnableIndex; + this.M = function(e, t, i) { + const s = this.ne(e, t, i); + if (s) { + let e = s.tt; + while (e !== this.h) { + e.rt += 1; + e = e.tt; + } + const t = this.he(s); + if (t) { + const {parentNode: e, grandParent: i, curNode: s} = t; + e.ie(); + i.ie(); + s.ie(); + } + } + return this.i; + }; + this.V = function(e) { + let t = this.fe(e); + while (t !== this.h) { + t.rt -= 1; + t = t.tt; + } + }; + } else { + this.re = _TreeNode.TreeNode; + this.M = function(e, t, i) { + const s = this.ne(e, t, i); + if (s) this.he(s); + return this.i; + }; + this.V = this.fe; + } + this.h = new this.re; + } + X(e, t) { + let i = this.h; + while (e) { + const s = this.v(e.u, t); + if (s < 0) { + e = e.W; + } else if (s > 0) { + i = e; + e = e.U; + } else return e; + } + return i; + } + Z(e, t) { + let i = this.h; + while (e) { + const s = this.v(e.u, t); + if (s <= 0) { + e = e.W; + } else { + i = e; + e = e.U; + } + } + return i; + } + $(e, t) { + let i = this.h; + while (e) { + const s = this.v(e.u, t); + if (s < 0) { + i = e; + e = e.W; + } else if (s > 0) { + e = e.U; + } else return e; + } + return i; + } + rr(e, t) { + let i = this.h; + while (e) { + const s = this.v(e.u, t); + if (s < 0) { + i = e; + e = e.W; + } else { + e = e.U; + } + } + return i; + } + ue(e) { + while (true) { + const t = e.tt; + if (t === this.h) return; + if (e.ee === 1) { + e.ee = 0; + return; + } + if (e === t.U) { + const i = t.W; + if (i.ee === 1) { + i.ee = 0; + t.ee = 1; + if (t === this.Y) { + this.Y = t.te(); + } else t.te(); + } else { + if (i.W && i.W.ee === 1) { + i.ee = t.ee; + t.ee = 0; + i.W.ee = 0; + if (t === this.Y) { + this.Y = t.te(); + } else t.te(); + return; + } else if (i.U && i.U.ee === 1) { + i.ee = 1; + i.U.ee = 0; + i.se(); + } else { + i.ee = 1; + e = t; + } + } + } else { + const i = t.U; + if (i.ee === 1) { + i.ee = 0; + t.ee = 1; + if (t === this.Y) { + this.Y = t.se(); + } else t.se(); + } else { + if (i.U && i.U.ee === 1) { + i.ee = t.ee; + t.ee = 0; + i.U.ee = 0; + if (t === this.Y) { + this.Y = t.se(); + } else t.se(); + return; + } else if (i.W && i.W.ee === 1) { + i.ee = 1; + i.W.ee = 0; + i.te(); + } else { + i.ee = 1; + e = t; + } + } + } + } + } + fe(e) { + if (this.i === 1) { + this.clear(); + return this.h; + } + let t = e; + while (t.U || t.W) { + if (t.W) { + t = t.W; + while (t.U) t = t.U; + } else { + t = t.U; + } + [e.u, t.u] = [ t.u, e.u ]; + [e.l, t.l] = [ t.l, e.l ]; + e = t; + } + if (this.h.U === t) { + this.h.U = t.tt; + } else if (this.h.W === t) { + this.h.W = t.tt; + } + this.ue(t); + const i = t.tt; + if (t === i.U) { + i.U = undefined; + } else i.W = undefined; + this.i -= 1; + this.Y.ee = 0; + return i; + } + oe(e, t) { + if (e === undefined) return false; + const i = this.oe(e.U, t); + if (i) return true; + if (t(e)) return true; + return this.oe(e.W, t); + } + he(e) { + while (true) { + const t = e.tt; + if (t.ee === 0) return; + const i = t.tt; + if (t === i.U) { + const s = i.W; + if (s && s.ee === 1) { + s.ee = t.ee = 0; + if (i === this.Y) return; + i.ee = 1; + e = i; + continue; + } else if (e === t.W) { + e.ee = 0; + if (e.U) e.U.tt = t; + if (e.W) e.W.tt = i; + t.W = e.U; + i.U = e.W; + e.U = t; + e.W = i; + if (i === this.Y) { + this.Y = e; + this.h.tt = e; + } else { + const t = i.tt; + if (t.U === i) { + t.U = e; + } else t.W = e; + } + e.tt = i.tt; + t.tt = e; + i.tt = e; + i.ee = 1; + return { + parentNode: t, + grandParent: i, + curNode: e + }; + } else { + t.ee = 0; + if (i === this.Y) { + this.Y = i.se(); + } else i.se(); + i.ee = 1; + } + } else { + const s = i.U; + if (s && s.ee === 1) { + s.ee = t.ee = 0; + if (i === this.Y) return; + i.ee = 1; + e = i; + continue; + } else if (e === t.U) { + e.ee = 0; + if (e.U) e.U.tt = i; + if (e.W) e.W.tt = t; + i.W = e.U; + t.U = e.W; + e.U = i; + e.W = t; + if (i === this.Y) { + this.Y = e; + this.h.tt = e; + } else { + const t = i.tt; + if (t.U === i) { + t.U = e; + } else t.W = e; + } + e.tt = i.tt; + t.tt = e; + i.tt = e; + i.ee = 1; + return { + parentNode: t, + grandParent: i, + curNode: e + }; + } else { + t.ee = 0; + if (i === this.Y) { + this.Y = i.te(); + } else i.te(); + i.ee = 1; + } + } + return; + } + } + ne(e, t, i) { + if (this.Y === undefined) { + this.i += 1; + this.Y = new this.re(e, t); + this.Y.ee = 0; + this.Y.tt = this.h; + this.h.tt = this.Y; + this.h.U = this.Y; + this.h.W = this.Y; + return; + } + let s; + const r = this.h.U; + const n = this.v(r.u, e); + if (n === 0) { + r.l = t; + return; + } else if (n > 0) { + r.U = new this.re(e, t); + r.U.tt = r; + s = r.U; + this.h.U = s; + } else { + const r = this.h.W; + const n = this.v(r.u, e); + if (n === 0) { + r.l = t; + return; + } else if (n < 0) { + r.W = new this.re(e, t); + r.W.tt = r; + s = r.W; + this.h.W = s; + } else { + if (i !== undefined) { + const r = i.o; + if (r !== this.h) { + const i = this.v(r.u, e); + if (i === 0) { + r.l = t; + return; + } else if (i > 0) { + const i = r.L(); + const n = this.v(i.u, e); + if (n === 0) { + i.l = t; + return; + } else if (n < 0) { + s = new this.re(e, t); + if (i.W === undefined) { + i.W = s; + s.tt = i; + } else { + r.U = s; + s.tt = r; + } + } + } + } + } + if (s === undefined) { + s = this.Y; + while (true) { + const i = this.v(s.u, e); + if (i > 0) { + if (s.U === undefined) { + s.U = new this.re(e, t); + s.U.tt = s; + s = s.U; + break; + } + s = s.U; + } else if (i < 0) { + if (s.W === undefined) { + s.W = new this.re(e, t); + s.W.tt = s; + s = s.W; + break; + } + s = s.W; + } else { + s.l = t; + return; + } + } + } + } + } + this.i += 1; + return s; + } + I(e, t) { + while (e) { + const i = this.v(e.u, t); + if (i < 0) { + e = e.W; + } else if (i > 0) { + e = e.U; + } else return e; + } + return e || this.h; + } + clear() { + this.i = 0; + this.Y = undefined; + this.h.tt = undefined; + this.h.U = this.h.W = undefined; + } + updateKeyByIterator(e, t) { + const i = e.o; + if (i === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + if (this.i === 1) { + i.u = t; + return true; + } + if (i === this.h.U) { + if (this.v(i.B().u, t) > 0) { + i.u = t; + return true; + } + return false; + } + if (i === this.h.W) { + if (this.v(i.L().u, t) < 0) { + i.u = t; + return true; + } + return false; + } + const s = i.L().u; + if (this.v(s, t) >= 0) return false; + const r = i.B().u; + if (this.v(r, t) <= 0) return false; + i.u = t; + return true; + } + eraseElementByPos(e) { + if (e < 0 || e > this.i - 1) { + throw new RangeError; + } + let t = 0; + const i = this; + this.oe(this.Y, (function(s) { + if (e === t) { + i.V(s); + return true; + } + t += 1; + return false; + })); + return this.i; + } + eraseElementByKey(e) { + if (this.i === 0) return false; + const t = this.I(this.Y, e); + if (t === this.h) return false; + this.V(t); + return true; + } + eraseElementByIterator(e) { + const t = e.o; + if (t === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + const i = t.W === undefined; + const s = e.iteratorType === 0; + if (s) { + if (i) e.next(); + } else { + if (!i || t.U === undefined) e.next(); + } + this.V(t); + return e; + } + forEach(e) { + let t = 0; + for (const i of this) e(i, t++, this); + } + getElementByPos(e) { + if (e < 0 || e > this.i - 1) { + throw new RangeError; + } + let t; + let i = 0; + for (const s of this) { + if (i === e) { + t = s; + break; + } + i += 1; + } + return t; + } + getHeight() { + if (this.i === 0) return 0; + const traversal = function(e) { + if (!e) return 0; + return Math.max(traversal(e.U), traversal(e.W)) + 1; + }; + return traversal(this.Y); + } +} + +var _default = TreeContainer; + +exports.default = _default; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js.map b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js.map new file mode 100644 index 000000000..f3219db71 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/Base/index.js","../../src/container/TreeContainer/Base/index.ts"],"names":["Object","defineProperty","exports","value","default","_TreeNode","require","_ContainerBase","_throwError","TreeContainer","Container","constructor","cmp","x","y","enableIndex","super","this","_root","undefined","_cmp","_TreeNodeClass","TreeNodeEnableIndex","_set","key","hint","curNode","_preSet","p","_parent","_header","_subTreeSize","nodeList","_insertNodeSelfBalance","parentNode","grandParent","_recount","_length","_eraseNode","_preEraseNode","TreeNode","_lowerBound","resNode","cmpResult","_key","_right","_left","_upperBound","_reverseLowerBound","_reverseUpperBound","_eraseNodeSelfBalance","_color","brother","_rotateLeft","_rotateRight","clear","swapNode","_value","_inOrderTraversal","callback","ifReturn","uncle","GP","minNode","compareToMin","maxNode","compareToMax","iterNode","_node","iterCmpRes","preNode","_pre","preCmpRes","_findElementNode","updateKeyByIterator","iter","node","throwIteratorAccessError","_next","preKey","nextKey","eraseElementByPos","pos","RangeError","index","self","eraseElementByKey","eraseElementByIterator","hasNoRight","isNormal","iteratorType","next","forEach","element","getElementByPos","res","getHeight","traversal","Math","max","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACJvB,IAAAC,YAAAC,QAAA;;AACA,IAAAC,iBAAAD,QAAA;;AAEA,IAAAE,cAAAF,QAAA;;AAEA,MAAeG,sBAA4BC,eAAAA;IA4BzCC,YACEC,IACA,SAAUC,GAAMC;QACd,IAAID,IAAIC,GAAG,QAAQ;QACnB,IAAID,IAAIC,GAAG,OAAO;QAClB,OAAO;ADzBT,OC2BAC,IAAc;QAEdC;QAjCQC,KAAAC,IAAoCC;QAkC5CF,KAAKG,IAAOR;QACZ,IAAIG,GAAa;YACfE,KAAKI,KAAiBC,UAAAA;YACtBL,KAAKM,IAAO,SAAUC,GAAKrB,GAAOsB;gBAChC,MAAMC,IAAUT,KAAKU,GAAQH,GAAKrB,GAAOsB;gBACzC,IAAIC,GAAS;oBACX,IAAIE,IAAIF,EAAQG;oBAChB,OAAOD,MAAMX,KAAKa,GAAS;wBACzBF,EAAEG,MAAgB;wBAClBH,IAAIA,EAAEC;ADvBE;oBCyBV,MAAMG,IAAWf,KAAKgB,GAAuBP;oBAC7C,IAAIM,GAAU;wBACZ,OAAME,YACJA,GAAUC,aACVA,GAAWT,SACXA,KACEM;wBACJE,EAAWE;wBACXD,EAAYC;wBACZV,EAAQU;AD3BA;AACJ;gBC6BR,OAAOnB,KAAKoB;AD3BR;YC6BNpB,KAAKqB,IAAa,SAAUZ;gBAC1B,IAAIE,IAAIX,KAAKsB,GAAcb;gBAC3B,OAAOE,MAAMX,KAAKa,GAAS;oBACzBF,EAAEG,MAAgB;oBAClBH,IAAIA,EAAEC;AD3BA;AACJ;AACJ,eC4BG;YACLZ,KAAKI,KAAiBmB,UAAAA;YACtBvB,KAAKM,IAAO,SAAU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QACJ,IAAIX,IAAQ;QACZ,KAAK,MAAMS,KAAW5E,MAAM;YAC1B,IAAImE,MAAUF,GAAK;gBACjBa,IAAMF;gBACN;ADgDI;YC9CNT,KAAS;ADgDP;QC9CJ,OAAmBW;ADgDnB;IC1CFC;QACE,IAAI/E,KAAKoB,MAAY,GAAG,OAAO;QAC/B,MAAM4D,YACJ,SAAUvE;YACR,KAAKA,GAAS,OAAO;YACrB,OAAOwE,KAAKC,IAAIF,UAAUvE,EAAQoB,IAAQmD,UAAUvE,EAAQmB,MAAW;ADiDvE;QC/CJ,OAAOoD,UAAUhF,KAAKC;ADiDtB;;;ACrBH,IAAAkF,WAEc3F;;AAAaP,QAAAE,UAAAgG","file":"index.js","sourcesContent":["import { TreeNode, TreeNodeEnableIndex } from './TreeNode';\nimport { Container } from \"../../ContainerBase\";\nimport $checkWithinAccessParams from \"../../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nclass TreeContainer extends Container {\n /**\n * @internal\n */\n constructor(cmp = function (x, y) {\n if (x < y)\n return -1;\n if (x > y)\n return 1;\n return 0;\n }, enableIndex = false) {\n super();\n /**\n * @internal\n */\n this._root = undefined;\n this._cmp = cmp;\n if (enableIndex) {\n this._TreeNodeClass = TreeNodeEnableIndex;\n this._set = function (key, value, hint) {\n const curNode = this._preSet(key, value, hint);\n if (curNode) {\n let p = curNode._parent;\n while (p !== this._header) {\n p._subTreeSize += 1;\n p = p._parent;\n }\n const nodeList = this._insertNodeSelfBalance(curNode);\n if (nodeList) {\n const { parentNode, grandParent, curNode } = nodeList;\n parentNode._recount();\n grandParent._recount();\n curNode._recount();\n }\n }\n return this._length;\n };\n this._eraseNode = function (curNode) {\n let p = this._preEraseNode(curNode);\n while (p !== this._header) {\n p._subTreeSize -= 1;\n p = p._parent;\n }\n };\n }\n else {\n this._TreeNodeClass = TreeNode;\n this._set = function (key, value, hint) {\n const curNode = this._preSet(key, value, hint);\n if (curNode)\n this._insertNodeSelfBalance(curNode);\n return this._length;\n };\n this._eraseNode = this._preEraseNode;\n }\n this._header = new this._TreeNodeClass();\n }\n /**\n * @internal\n */\n _lowerBound(curNode, key) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n }\n else if (cmpResult > 0) {\n resNode = curNode;\n curNode = curNode._left;\n }\n else\n return curNode;\n }\n return resNode;\n }\n /**\n * @internal\n */\n _upperBound(curNode, key) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key, key);\n if (cmpResult <= 0) {\n curNode = curNode._right;\n }\n else {\n resNode = curNode;\n curNode = curNode._left;\n }\n }\n return resNode;\n }\n /**\n * @internal\n */\n _reverseLowerBound(curNode, key) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n }\n else if (cmpResult > 0) {\n curNode = curNode._left;\n }\n else\n return curNode;\n }\n return resNode;\n }\n /**\n * @internal\n */\n _reverseUpperBound(curNode, key) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n }\n else {\n curNode = curNode._left;\n }\n }\n return resNode;\n }\n /**\n * @internal\n */\n _eraseNodeSelfBalance(curNode) {\n while (true) {\n const parentNode = curNode._parent;\n if (parentNode === this._header)\n return;\n if (curNode._color === 1 /* TreeNodeColor.RED */) {\n curNode._color = 0 /* TreeNodeColor.BLACK */;\n return;\n }\n if (curNode === parentNode._left) {\n const brother = parentNode._right;\n if (brother._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 0 /* TreeNodeColor.BLACK */;\n parentNode._color = 1 /* TreeNodeColor.RED */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n }\n else\n parentNode._rotateLeft();\n }\n else {\n if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) {\n brother._color = parentNode._color;\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n brother._right._color = 0 /* TreeNodeColor.BLACK */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n }\n else\n parentNode._rotateLeft();\n return;\n }\n else if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 1 /* TreeNodeColor.RED */;\n brother._left._color = 0 /* TreeNodeColor.BLACK */;\n brother._rotateRight();\n }\n else {\n brother._color = 1 /* TreeNodeColor.RED */;\n curNode = parentNode;\n }\n }\n }\n else {\n const brother = parentNode._left;\n if (brother._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 0 /* TreeNodeColor.BLACK */;\n parentNode._color = 1 /* TreeNodeColor.RED */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n }\n else\n parentNode._rotateRight();\n }\n else {\n if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) {\n brother._color = parentNode._color;\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n brother._left._color = 0 /* TreeNodeColor.BLACK */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n }\n else\n parentNode._rotateRight();\n return;\n }\n else if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 1 /* TreeNodeColor.RED */;\n brother._right._color = 0 /* TreeNodeColor.BLACK */;\n brother._rotateLeft();\n }\n else {\n brother._color = 1 /* TreeNodeColor.RED */;\n curNode = parentNode;\n }\n }\n }\n }\n }\n /**\n * @internal\n */\n _preEraseNode(curNode) {\n if (this._length === 1) {\n this.clear();\n return this._header;\n }\n let swapNode = curNode;\n while (swapNode._left || swapNode._right) {\n if (swapNode._right) {\n swapNode = swapNode._right;\n while (swapNode._left)\n swapNode = swapNode._left;\n }\n else {\n swapNode = swapNode._left;\n }\n [curNode._key, swapNode._key] = [swapNode._key, curNode._key];\n [curNode._value, swapNode._value] = [swapNode._value, curNode._value];\n curNode = swapNode;\n }\n if (this._header._left === swapNode) {\n this._header._left = swapNode._parent;\n }\n else if (this._header._right === swapNode) {\n this._header._right = swapNode._parent;\n }\n this._eraseNodeSelfBalance(swapNode);\n const _parent = swapNode._parent;\n if (swapNode === _parent._left) {\n _parent._left = undefined;\n }\n else\n _parent._right = undefined;\n this._length -= 1;\n this._root._color = 0 /* TreeNodeColor.BLACK */;\n return _parent;\n }\n /**\n * @internal\n */\n _inOrderTraversal(curNode, callback) {\n if (curNode === undefined)\n return false;\n const ifReturn = this._inOrderTraversal(curNode._left, callback);\n if (ifReturn)\n return true;\n if (callback(curNode))\n return true;\n return this._inOrderTraversal(curNode._right, callback);\n }\n /**\n * @internal\n */\n _insertNodeSelfBalance(curNode) {\n while (true) {\n const parentNode = curNode._parent;\n if (parentNode._color === 0 /* TreeNodeColor.BLACK */)\n return;\n const grandParent = parentNode._parent;\n if (parentNode === grandParent._left) {\n const uncle = grandParent._right;\n if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) {\n uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root)\n return;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n curNode = grandParent;\n continue;\n }\n else if (curNode === parentNode._right) {\n curNode._color = 0 /* TreeNodeColor.BLACK */;\n if (curNode._left)\n curNode._left._parent = parentNode;\n if (curNode._right)\n curNode._right._parent = grandParent;\n parentNode._right = curNode._left;\n grandParent._left = curNode._right;\n curNode._left = parentNode;\n curNode._right = grandParent;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n }\n else {\n const GP = grandParent._parent;\n if (GP._left === grandParent) {\n GP._left = curNode;\n }\n else\n GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n return { parentNode, grandParent, curNode };\n }\n else {\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root) {\n this._root = grandParent._rotateRight();\n }\n else\n grandParent._rotateRight();\n grandParent._color = 1 /* TreeNodeColor.RED */;\n }\n }\n else {\n const uncle = grandParent._left;\n if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) {\n uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root)\n return;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n curNode = grandParent;\n continue;\n }\n else if (curNode === parentNode._left) {\n curNode._color = 0 /* TreeNodeColor.BLACK */;\n if (curNode._left)\n curNode._left._parent = grandParent;\n if (curNode._right)\n curNode._right._parent = parentNode;\n grandParent._right = curNode._left;\n parentNode._left = curNode._right;\n curNode._left = grandParent;\n curNode._right = parentNode;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n }\n else {\n const GP = grandParent._parent;\n if (GP._left === grandParent) {\n GP._left = curNode;\n }\n else\n GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n return { parentNode, grandParent, curNode };\n }\n else {\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root) {\n this._root = grandParent._rotateLeft();\n }\n else\n grandParent._rotateLeft();\n grandParent._color = 1 /* TreeNodeColor.RED */;\n }\n }\n return;\n }\n }\n /**\n * @internal\n */\n _preSet(key, value, hint) {\n if (this._root === undefined) {\n this._length += 1;\n this._root = new this._TreeNodeClass(key, value);\n this._root._color = 0 /* TreeNodeColor.BLACK */;\n this._root._parent = this._header;\n this._header._parent = this._root;\n this._header._left = this._root;\n this._header._right = this._root;\n return;\n }\n let curNode;\n const minNode = this._header._left;\n const compareToMin = this._cmp(minNode._key, key);\n if (compareToMin === 0) {\n minNode._value = value;\n return;\n }\n else if (compareToMin > 0) {\n minNode._left = new this._TreeNodeClass(key, value);\n minNode._left._parent = minNode;\n curNode = minNode._left;\n this._header._left = curNode;\n }\n else {\n const maxNode = this._header._right;\n const compareToMax = this._cmp(maxNode._key, key);\n if (compareToMax === 0) {\n maxNode._value = value;\n return;\n }\n else if (compareToMax < 0) {\n maxNode._right = new this._TreeNodeClass(key, value);\n maxNode._right._parent = maxNode;\n curNode = maxNode._right;\n this._header._right = curNode;\n }\n else {\n if (hint !== undefined) {\n const iterNode = hint._node;\n if (iterNode !== this._header) {\n const iterCmpRes = this._cmp(iterNode._key, key);\n if (iterCmpRes === 0) {\n iterNode._value = value;\n return;\n }\n else /* istanbul ignore else */ if (iterCmpRes > 0) {\n const preNode = iterNode._pre();\n const preCmpRes = this._cmp(preNode._key, key);\n if (preCmpRes === 0) {\n preNode._value = value;\n return;\n }\n else if (preCmpRes < 0) {\n curNode = new this._TreeNodeClass(key, value);\n if (preNode._right === undefined) {\n preNode._right = curNode;\n curNode._parent = preNode;\n }\n else {\n iterNode._left = curNode;\n curNode._parent = iterNode;\n }\n }\n }\n }\n }\n if (curNode === undefined) {\n curNode = this._root;\n while (true) {\n const cmpResult = this._cmp(curNode._key, key);\n if (cmpResult > 0) {\n if (curNode._left === undefined) {\n curNode._left = new this._TreeNodeClass(key, value);\n curNode._left._parent = curNode;\n curNode = curNode._left;\n break;\n }\n curNode = curNode._left;\n }\n else if (cmpResult < 0) {\n if (curNode._right === undefined) {\n curNode._right = new this._TreeNodeClass(key, value);\n curNode._right._parent = curNode;\n curNode = curNode._right;\n break;\n }\n curNode = curNode._right;\n }\n else {\n curNode._value = value;\n return;\n }\n }\n }\n }\n }\n this._length += 1;\n return curNode;\n }\n /**\n * @internal\n */\n _findElementNode(curNode, key) {\n while (curNode) {\n const cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n }\n else if (cmpResult > 0) {\n curNode = curNode._left;\n }\n else\n return curNode;\n }\n return curNode || this._header;\n }\n clear() {\n this._length = 0;\n this._root = undefined;\n this._header._parent = undefined;\n this._header._left = this._header._right = undefined;\n }\n /**\n * @description Update node's key by iterator.\n * @param iter - The iterator you want to change.\n * @param key - The key you want to update.\n * @returns Whether the modification is successful.\n * @example\n * const st = new orderedSet([1, 2, 5]);\n * const iter = st.find(2);\n * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5]\n */\n updateKeyByIterator(iter, key) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n if (this._length === 1) {\n node._key = key;\n return true;\n }\n if (node === this._header._left) {\n if (this._cmp(node._next()._key, key) > 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n if (node === this._header._right) {\n if (this._cmp(node._pre()._key, key) < 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n const preKey = node._pre()._key;\n if (this._cmp(preKey, key) >= 0)\n return false;\n const nextKey = node._next()._key;\n if (this._cmp(nextKey, key) <= 0)\n return false;\n node._key = key;\n return true;\n }\n eraseElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let index = 0;\n const self = this;\n this._inOrderTraversal(this._root, function (curNode) {\n if (pos === index) {\n self._eraseNode(curNode);\n return true;\n }\n index += 1;\n return false;\n });\n return this._length;\n }\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @returns Whether erase successfully.\n */\n eraseElementByKey(key) {\n if (this._length === 0)\n return false;\n const curNode = this._findElementNode(this._root, key);\n if (curNode === this._header)\n return false;\n this._eraseNode(curNode);\n return true;\n }\n eraseElementByIterator(iter) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n const hasNoRight = node._right === undefined;\n const isNormal = iter.iteratorType === 0 /* IteratorType.NORMAL */;\n // For the normal iterator, the `next` node will be swapped to `this` node when has right.\n if (isNormal) {\n // So we should move it to next when it's right is null.\n if (hasNoRight)\n iter.next();\n }\n else {\n // For the reverse iterator, only when it doesn't have right and has left the `next` node will be swapped.\n // So when it has right, or it is a leaf node we should move it to `next`.\n if (!hasNoRight || node._left === undefined)\n iter.next();\n }\n this._eraseNode(node);\n return iter;\n }\n forEach(callback) {\n let index = 0;\n for (const element of this)\n callback(element, index++, this);\n }\n getElementByPos(pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n let res;\n let index = 0;\n for (const element of this) {\n if (index === pos) {\n res = element;\n break;\n }\n index += 1;\n }\n return res;\n }\n /**\n * @description Get the height of the tree.\n * @returns Number about the height of the RB-tree.\n */\n getHeight() {\n if (this._length === 0)\n return 0;\n const traversal = function (curNode) {\n if (!curNode)\n return 0;\n return Math.max(traversal(curNode._left), traversal(curNode._right)) + 1;\n };\n return traversal(this._root);\n }\n}\nexport default TreeContainer;\n","import type TreeIterator from './TreeIterator';\nimport { TreeNode, TreeNodeColor, TreeNodeEnableIndex } from './TreeNode';\nimport { Container, IteratorType } from '@/container/ContainerBase';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nabstract class TreeContainer extends Container {\n /**\n * @internal\n */\n protected _root: TreeNode | undefined = undefined;\n /**\n * @internal\n */\n protected _header: TreeNode;\n /**\n * @internal\n */\n protected readonly _cmp: (x: K, y: K) => number;\n /**\n * @internal\n */\n protected readonly _TreeNodeClass: typeof TreeNode | typeof TreeNodeEnableIndex;\n /**\n * @internal\n */\n protected readonly _eraseNode: (curNode: TreeNode) => void;\n /**\n * @internal\n */\n protected _set: (key: K, value: V, hint?: TreeIterator) => number;\n /**\n * @internal\n */\n protected constructor(\n cmp: (x: K, y: K) => number =\n function (x: K, y: K) {\n if (x < y) return -1;\n if (x > y) return 1;\n return 0;\n },\n enableIndex = false\n ) {\n super();\n this._cmp = cmp;\n if (enableIndex) {\n this._TreeNodeClass = TreeNodeEnableIndex;\n this._set = function (key, value, hint) {\n const curNode = this._preSet(key, value, hint);\n if (curNode) {\n let p = curNode._parent as TreeNodeEnableIndex;\n while (p !== this._header) {\n p._subTreeSize += 1;\n p = p._parent as TreeNodeEnableIndex;\n }\n const nodeList = this._insertNodeSelfBalance(curNode);\n if (nodeList) {\n const {\n parentNode,\n grandParent,\n curNode\n } = nodeList as unknown as Record>;\n parentNode._recount();\n grandParent._recount();\n curNode._recount();\n }\n }\n return this._length;\n };\n this._eraseNode = function (curNode) {\n let p = this._preEraseNode(curNode) as TreeNodeEnableIndex;\n while (p !== this._header) {\n p._subTreeSize -= 1;\n p = p._parent as TreeNodeEnableIndex;\n }\n };\n } else {\n this._TreeNodeClass = TreeNode;\n this._set = function (key, value, hint) {\n const curNode = this._preSet(key, value, hint);\n if (curNode) this._insertNodeSelfBalance(curNode);\n return this._length;\n };\n this._eraseNode = this._preEraseNode;\n }\n this._header = new this._TreeNodeClass();\n }\n /**\n * @internal\n */\n protected _lowerBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n } else if (cmpResult > 0) {\n resNode = curNode;\n curNode = curNode._left;\n } else return curNode;\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _upperBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult <= 0) {\n curNode = curNode._right;\n } else {\n resNode = curNode;\n curNode = curNode._left;\n }\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _reverseLowerBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n } else if (cmpResult > 0) {\n curNode = curNode._left;\n } else return curNode;\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _reverseUpperBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n } else {\n curNode = curNode._left;\n }\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _eraseNodeSelfBalance(curNode: TreeNode) {\n while (true) {\n const parentNode = curNode._parent!;\n if (parentNode === this._header) return;\n if (curNode._color === TreeNodeColor.RED) {\n curNode._color = TreeNodeColor.BLACK;\n return;\n }\n if (curNode === parentNode._left) {\n const brother = parentNode._right!;\n if (brother._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.BLACK;\n parentNode._color = TreeNodeColor.RED;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n } else parentNode._rotateLeft();\n } else {\n if (brother._right && brother._right._color === TreeNodeColor.RED) {\n brother._color = parentNode._color;\n parentNode._color = TreeNodeColor.BLACK;\n brother._right._color = TreeNodeColor.BLACK;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n } else parentNode._rotateLeft();\n return;\n } else if (brother._left && brother._left._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.RED;\n brother._left._color = TreeNodeColor.BLACK;\n brother._rotateRight();\n } else {\n brother._color = TreeNodeColor.RED;\n curNode = parentNode;\n }\n }\n } else {\n const brother = parentNode._left!;\n if (brother._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.BLACK;\n parentNode._color = TreeNodeColor.RED;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n } else parentNode._rotateRight();\n } else {\n if (brother._left && brother._left._color === TreeNodeColor.RED) {\n brother._color = parentNode._color;\n parentNode._color = TreeNodeColor.BLACK;\n brother._left._color = TreeNodeColor.BLACK;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n } else parentNode._rotateRight();\n return;\n } else if (brother._right && brother._right._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.RED;\n brother._right._color = TreeNodeColor.BLACK;\n brother._rotateLeft();\n } else {\n brother._color = TreeNodeColor.RED;\n curNode = parentNode;\n }\n }\n }\n }\n }\n /**\n * @internal\n */\n protected _preEraseNode(curNode: TreeNode) {\n if (this._length === 1) {\n this.clear();\n return this._header;\n }\n let swapNode = curNode;\n while (swapNode._left || swapNode._right) {\n if (swapNode._right) {\n swapNode = swapNode._right;\n while (swapNode._left) swapNode = swapNode._left;\n } else {\n swapNode = swapNode._left!;\n }\n [curNode._key, swapNode._key] = [swapNode._key, curNode._key];\n [curNode._value, swapNode._value] = [swapNode._value, curNode._value];\n curNode = swapNode;\n }\n if (this._header._left === swapNode) {\n this._header._left = swapNode._parent;\n } else if (this._header._right === swapNode) {\n this._header._right = swapNode._parent;\n }\n this._eraseNodeSelfBalance(swapNode);\n const _parent = swapNode._parent!;\n if (swapNode === _parent._left) {\n _parent._left = undefined;\n } else _parent._right = undefined;\n this._length -= 1;\n this._root!._color = TreeNodeColor.BLACK;\n return _parent;\n }\n /**\n * @internal\n */\n protected _inOrderTraversal(\n curNode: TreeNode | undefined,\n callback: (curNode: TreeNode) => boolean\n ): boolean {\n if (curNode === undefined) return false;\n const ifReturn = this._inOrderTraversal(curNode._left, callback);\n if (ifReturn) return true;\n if (callback(curNode)) return true;\n return this._inOrderTraversal(curNode._right, callback);\n }\n /**\n * @internal\n */\n protected _insertNodeSelfBalance(curNode: TreeNode) {\n while (true) {\n const parentNode = curNode._parent!;\n if (parentNode._color === TreeNodeColor.BLACK) return;\n const grandParent = parentNode._parent!;\n if (parentNode === grandParent._left) {\n const uncle = grandParent._right;\n if (uncle && uncle._color === TreeNodeColor.RED) {\n uncle._color = parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) return;\n grandParent._color = TreeNodeColor.RED;\n curNode = grandParent;\n continue;\n } else if (curNode === parentNode._right) {\n curNode._color = TreeNodeColor.BLACK;\n if (curNode._left) curNode._left._parent = parentNode;\n if (curNode._right) curNode._right._parent = grandParent;\n parentNode._right = curNode._left;\n grandParent._left = curNode._right;\n curNode._left = parentNode;\n curNode._right = grandParent;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n } else {\n const GP = grandParent._parent!;\n if (GP._left === grandParent) {\n GP._left = curNode;\n } else GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = TreeNodeColor.RED;\n return { parentNode, grandParent, curNode };\n } else {\n parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) {\n this._root = grandParent._rotateRight();\n } else grandParent._rotateRight();\n grandParent._color = TreeNodeColor.RED;\n }\n } else {\n const uncle = grandParent._left;\n if (uncle && uncle._color === TreeNodeColor.RED) {\n uncle._color = parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) return;\n grandParent._color = TreeNodeColor.RED;\n curNode = grandParent;\n continue;\n } else if (curNode === parentNode._left) {\n curNode._color = TreeNodeColor.BLACK;\n if (curNode._left) curNode._left._parent = grandParent;\n if (curNode._right) curNode._right._parent = parentNode;\n grandParent._right = curNode._left;\n parentNode._left = curNode._right;\n curNode._left = grandParent;\n curNode._right = parentNode;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n } else {\n const GP = grandParent._parent!;\n if (GP._left === grandParent) {\n GP._left = curNode;\n } else GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = TreeNodeColor.RED;\n return { parentNode, grandParent, curNode };\n } else {\n parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) {\n this._root = grandParent._rotateLeft();\n } else grandParent._rotateLeft();\n grandParent._color = TreeNodeColor.RED;\n }\n }\n return;\n }\n }\n /**\n * @internal\n */\n protected _preSet(key: K, value?: V, hint?: TreeIterator) {\n if (this._root === undefined) {\n this._length += 1;\n this._root = new this._TreeNodeClass(key, value);\n this._root._color = TreeNodeColor.BLACK;\n this._root._parent = this._header;\n this._header._parent = this._root;\n this._header._left = this._root;\n this._header._right = this._root;\n return;\n }\n let curNode;\n const minNode = this._header._left!;\n const compareToMin = this._cmp(minNode._key!, key);\n if (compareToMin === 0) {\n minNode._value = value;\n return;\n } else if (compareToMin > 0) {\n minNode._left = new this._TreeNodeClass(key, value);\n minNode._left._parent = minNode;\n curNode = minNode._left;\n this._header._left = curNode;\n } else {\n const maxNode = this._header._right!;\n const compareToMax = this._cmp(maxNode._key!, key);\n if (compareToMax === 0) {\n maxNode._value = value;\n return;\n } else if (compareToMax < 0) {\n maxNode._right = new this._TreeNodeClass(key, value);\n maxNode._right._parent = maxNode;\n curNode = maxNode._right;\n this._header._right = curNode;\n } else {\n if (hint !== undefined) {\n const iterNode = hint._node;\n if (iterNode !== this._header) {\n const iterCmpRes = this._cmp(iterNode._key!, key);\n if (iterCmpRes === 0) {\n iterNode._value = value;\n return;\n } else /* istanbul ignore else */ if (iterCmpRes > 0) {\n const preNode = iterNode._pre();\n const preCmpRes = this._cmp(preNode._key!, key);\n if (preCmpRes === 0) {\n preNode._value = value;\n return;\n } else if (preCmpRes < 0) {\n curNode = new this._TreeNodeClass(key, value);\n if (preNode._right === undefined) {\n preNode._right = curNode;\n curNode._parent = preNode;\n } else {\n iterNode._left = curNode;\n curNode._parent = iterNode;\n }\n }\n }\n }\n }\n if (curNode === undefined) {\n curNode = this._root;\n while (true) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult > 0) {\n if (curNode._left === undefined) {\n curNode._left = new this._TreeNodeClass(key, value);\n curNode._left._parent = curNode;\n curNode = curNode._left;\n break;\n }\n curNode = curNode._left;\n } else if (cmpResult < 0) {\n if (curNode._right === undefined) {\n curNode._right = new this._TreeNodeClass(key, value);\n curNode._right._parent = curNode;\n curNode = curNode._right;\n break;\n }\n curNode = curNode._right;\n } else {\n curNode._value = value;\n return;\n }\n }\n }\n }\n }\n this._length += 1;\n return curNode;\n }\n /**\n * @internal\n */\n protected _findElementNode(curNode: TreeNode | undefined, key: K) {\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n } else if (cmpResult > 0) {\n curNode = curNode._left;\n } else return curNode;\n }\n return curNode || this._header;\n }\n clear() {\n this._length = 0;\n this._root = undefined;\n this._header._parent = undefined;\n this._header._left = this._header._right = undefined;\n }\n /**\n * @description Update node's key by iterator.\n * @param iter - The iterator you want to change.\n * @param key - The key you want to update.\n * @returns Whether the modification is successful.\n * @example\n * const st = new orderedSet([1, 2, 5]);\n * const iter = st.find(2);\n * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5]\n */\n updateKeyByIterator(iter: TreeIterator, key: K): boolean {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n if (this._length === 1) {\n node._key = key;\n return true;\n }\n if (node === this._header._left) {\n if (this._cmp(node._next()._key!, key) > 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n if (node === this._header._right) {\n if (this._cmp(node._pre()._key!, key) < 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n const preKey = node._pre()._key!;\n if (this._cmp(preKey, key) >= 0) return false;\n const nextKey = node._next()._key!;\n if (this._cmp(nextKey, key) <= 0) return false;\n node._key = key;\n return true;\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let index = 0;\n const self = this;\n this._inOrderTraversal(\n this._root,\n function (curNode) {\n if (pos === index) {\n self._eraseNode(curNode);\n return true;\n }\n index += 1;\n return false;\n });\n return this._length;\n }\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @returns Whether erase successfully.\n */\n eraseElementByKey(key: K) {\n if (this._length === 0) return false;\n const curNode = this._findElementNode(this._root, key);\n if (curNode === this._header) return false;\n this._eraseNode(curNode);\n return true;\n }\n eraseElementByIterator(iter: TreeIterator) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n const hasNoRight = node._right === undefined;\n const isNormal = iter.iteratorType === IteratorType.NORMAL;\n // For the normal iterator, the `next` node will be swapped to `this` node when has right.\n if (isNormal) {\n // So we should move it to next when it's right is null.\n if (hasNoRight) iter.next();\n } else {\n // For the reverse iterator, only when it doesn't have right and has left the `next` node will be swapped.\n // So when it has right, or it is a leaf node we should move it to `next`.\n if (!hasNoRight || node._left === undefined) iter.next();\n }\n this._eraseNode(node);\n return iter;\n }\n forEach(callback: (element: K | [K, V], index: number, tree: TreeContainer) => void) {\n let index = 0;\n for (const element of this) callback(element, index++, this);\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let res;\n let index = 0;\n for (const element of this) {\n if (index === pos) {\n res = element;\n break;\n }\n index += 1;\n }\n return res;\n }\n /**\n * @description Get the height of the tree.\n * @returns Number about the height of the RB-tree.\n */\n getHeight() {\n if (this._length === 0) return 0;\n const traversal =\n function (curNode: TreeNode | undefined): number {\n if (!curNode) return 0;\n return Math.max(traversal(curNode._left), traversal(curNode._right)) + 1;\n };\n return traversal(this._root);\n }\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element less than the given key.\n */\n abstract reverseUpperBound(key: K): TreeIterator;\n /**\n * @description Union the other tree to self.\n * @param other - The other tree container you want to merge.\n * @returns The size of the tree after union.\n */\n abstract union(other: TreeContainer): number;\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element not greater than the given key.\n */\n abstract reverseLowerBound(key: K): TreeIterator;\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element not less than the given key.\n */\n abstract lowerBound(key: K): TreeIterator;\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element greater than the given key.\n */\n abstract upperBound(key: K): TreeIterator;\n}\n\nexport default TreeContainer;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts new file mode 100644 index 000000000..18c921fab --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts @@ -0,0 +1,62 @@ +import TreeContainer from './Base'; +import TreeIterator from './Base/TreeIterator'; +import { TreeNode } from './Base/TreeNode'; +import { initContainer, IteratorType } from "../ContainerBase"; +declare class OrderedMapIterator extends TreeIterator { + container: OrderedMap; + constructor(node: TreeNode, header: TreeNode, container: OrderedMap, iteratorType?: IteratorType); + get pointer(): [K, V]; + copy(): OrderedMapIterator; + equals(iter: OrderedMapIterator): boolean; +} +export type { OrderedMapIterator }; +declare class OrderedMap extends TreeContainer { + /** + * @param container - The initialization container. + * @param cmp - The compare function. + * @param enableIndex - Whether to enable iterator indexing function. + * @example + * new OrderedMap(); + * new OrderedMap([[0, 1], [2, 1]]); + * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y); + * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true); + */ + constructor(container?: initContainer<[K, V]>, cmp?: (x: K, y: K) => number, enableIndex?: boolean); + begin(): OrderedMapIterator; + end(): OrderedMapIterator; + rBegin(): OrderedMapIterator; + rEnd(): OrderedMapIterator; + front(): [K, V] | undefined; + back(): [K, V] | undefined; + lowerBound(key: K): OrderedMapIterator; + upperBound(key: K): OrderedMapIterator; + reverseLowerBound(key: K): OrderedMapIterator; + reverseUpperBound(key: K): OrderedMapIterator; + /** + * @description Insert a key-value pair or set value by the given key. + * @param key - The key want to insert. + * @param value - The value want to set. + * @param hint - You can give an iterator hint to improve insertion efficiency. + * @return The size of container after setting. + * @example + * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]); + * const iter = mp.begin(); + * mp.setElement(1, 0); + * mp.setElement(3, 0, iter); // give a hint will be faster. + */ + setElement(key: K, value: V, hint?: OrderedMapIterator): number; + find(key: K): OrderedMapIterator; + /** + * @description Get the value of the element of the specified key. + * @param key - The specified key you want to get. + * @example + * const val = container.getElementByKey(1); + */ + getElementByKey(key: K): V | undefined; + union(other: OrderedMap): number; + [Symbol.iterator](): Generator<[K, V], void, unknown>; + eraseElementByIterator(iter: OrderedMapIterator): OrderedMapIterator; + forEach(callback: (element: [K, V], index: number, map: OrderedMap) => void): void; + getElementByPos(pos: number): [K, V]; +} +export default OrderedMap; diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js new file mode 100644 index 000000000..79fdc0280 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js @@ -0,0 +1,127 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = _interopRequireDefault(require("./Base")); + +var _TreeIterator = _interopRequireDefault(require("./Base/TreeIterator")); + +var _throwError = require("../../utils/throwError"); + +function _interopRequireDefault(r) { + return r && r.t ? r : { + default: r + }; +} + +class OrderedMapIterator extends _TreeIterator.default { + constructor(r, t, e, s) { + super(r, t, s); + this.container = e; + } + get pointer() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + const r = this; + return new Proxy([], { + get(t, e) { + if (e === "0") return r.o.u; else if (e === "1") return r.o.l; + }, + set(t, e, s) { + if (e !== "1") { + throw new TypeError("props must be 1"); + } + r.o.l = s; + return true; + } + }); + } + copy() { + return new OrderedMapIterator(this.o, this.h, this.container, this.iteratorType); + } +} + +class OrderedMap extends _Base.default { + constructor(r = [], t, e) { + super(t, e); + const s = this; + r.forEach((function(r) { + s.setElement(r[0], r[1]); + })); + } + * K(r) { + if (r === undefined) return; + yield* this.K(r.U); + yield [ r.u, r.l ]; + yield* this.K(r.W); + } + begin() { + return new OrderedMapIterator(this.h.U || this.h, this.h, this); + } + end() { + return new OrderedMapIterator(this.h, this.h, this); + } + rBegin() { + return new OrderedMapIterator(this.h.W || this.h, this.h, this, 1); + } + rEnd() { + return new OrderedMapIterator(this.h, this.h, this, 1); + } + front() { + if (this.i === 0) return; + const r = this.h.U; + return [ r.u, r.l ]; + } + back() { + if (this.i === 0) return; + const r = this.h.W; + return [ r.u, r.l ]; + } + lowerBound(r) { + const t = this.X(this.Y, r); + return new OrderedMapIterator(t, this.h, this); + } + upperBound(r) { + const t = this.Z(this.Y, r); + return new OrderedMapIterator(t, this.h, this); + } + reverseLowerBound(r) { + const t = this.$(this.Y, r); + return new OrderedMapIterator(t, this.h, this); + } + reverseUpperBound(r) { + const t = this.rr(this.Y, r); + return new OrderedMapIterator(t, this.h, this); + } + setElement(r, t, e) { + return this.M(r, t, e); + } + find(r) { + const t = this.I(this.Y, r); + return new OrderedMapIterator(t, this.h, this); + } + getElementByKey(r) { + const t = this.I(this.Y, r); + return t.l; + } + union(r) { + const t = this; + r.forEach((function(r) { + t.setElement(r[0], r[1]); + })); + return this.i; + } + [Symbol.iterator]() { + return this.K(this.Y); + } +} + +var _default = OrderedMap; + +exports.default = _default; +//# sourceMappingURL=OrderedMap.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js.map b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js.map new file mode 100644 index 000000000..e7bb93625 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/OrderedMap.js","../../src/container/TreeContainer/OrderedMap.ts"],"names":["Object","defineProperty","exports","value","default","_Base","_interopRequireDefault","require","_TreeIterator","_throwError","obj","__esModule","OrderedMapIterator","TreeIterator","constructor","node","header","container","iteratorType","super","this","pointer","_node","_header","throwIteratorAccessError","self","Proxy","get","_","props","_key","_value","set","newValue","TypeError","copy","OrderedMap","TreeContainer","cmp","enableIndex","forEach","el","setElement","K","curNode","undefined","_iterationFunc","_left","_right","begin","end","rBegin","rEnd","front","_length","minNode","back","maxNode","lowerBound","key","resNode","_lowerBound","_root","upperBound","_upperBound","reverseLowerBound","_reverseLowerBound","reverseUpperBound","_reverseUpperBound","hint","_set","find","_findElementNode","getElementByKey","union","other","Symbol","iterator","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,QAAAC,uBAAAC,QAAA;;AACA,IAAAC,gBAAAF,uBAAAC,QAAA;;AAGA,IAAAE,cAAAF,QAAA;;AAA8D,SAAAD,uBAAAI;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAN,SAAAM;;AAAA;;AAE9D,MAAME,2BAAiCC,cAAAA;IAErCC,YACEC,GACAC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AAKiB,WAAWD,EAAG,IAAIA,EAAG;ADxBxB;QC0BJ,OAAOrB,KAAKkC;ADxBZ;IC0BF,CAACsB,OAAOC;QACN,OAAOzD,KAAK0B,EAAe1B,KAAK0C;ADxBhC;;;ACgCH,IAAAgB,WAEc1C;;AAAUlC,QAAAE,UAAA0E","file":"OrderedMap.js","sourcesContent":["import TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nclass OrderedMapIterator extends TreeIterator {\n constructor(node, header, container, iteratorType) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n const self = this;\n return new Proxy([], {\n get(_, props) {\n if (props === '0')\n return self._node._key;\n else if (props === '1')\n return self._node._value;\n },\n set(_, props, newValue) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n }\n copy() {\n return new OrderedMapIterator(this._node, this._header, this.container, this.iteratorType);\n }\n}\nclass OrderedMap extends TreeContainer {\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedMap();\n * new OrderedMap([[0, 1], [2, 1]]);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true);\n */\n constructor(container = [], cmp, enableIndex) {\n super(cmp, enableIndex);\n const self = this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n }\n /**\n * @internal\n */\n *_iterationFunc(curNode) {\n if (curNode === undefined)\n return;\n yield* this._iterationFunc(curNode._left);\n yield [curNode._key, curNode._value];\n yield* this._iterationFunc(curNode._right);\n }\n begin() {\n return new OrderedMapIterator(this._header._left || this._header, this._header, this);\n }\n end() {\n return new OrderedMapIterator(this._header, this._header, this);\n }\n rBegin() {\n return new OrderedMapIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new OrderedMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n if (this._length === 0)\n return;\n const minNode = this._header._left;\n return [minNode._key, minNode._value];\n }\n back() {\n if (this._length === 0)\n return;\n const maxNode = this._header._right;\n return [maxNode._key, maxNode._value];\n }\n lowerBound(key) {\n const resNode = this._lowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n upperBound(key) {\n const resNode = this._upperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n reverseLowerBound(key) {\n const resNode = this._reverseLowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n reverseUpperBound(key) {\n const resNode = this._reverseUpperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]);\n * const iter = mp.begin();\n * mp.setElement(1, 0);\n * mp.setElement(3, 0, iter); // give a hint will be faster.\n */\n setElement(key, value, hint) {\n return this._set(key, value, hint);\n }\n find(key) {\n const curNode = this._findElementNode(this._root, key);\n return new OrderedMapIterator(curNode, this._header, this);\n }\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The specified key you want to get.\n * @example\n * const val = container.getElementByKey(1);\n */\n getElementByKey(key) {\n const curNode = this._findElementNode(this._root, key);\n return curNode._value;\n }\n union(other) {\n const self = this;\n other.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n return this._length;\n }\n [Symbol.iterator]() {\n return this._iterationFunc(this._root);\n }\n}\nexport default OrderedMap;\n","import TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { TreeNode } from './Base/TreeNode';\nimport { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass OrderedMapIterator extends TreeIterator {\n container: OrderedMap;\n constructor(\n node: TreeNode,\n header: TreeNode,\n container: OrderedMap,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n const self = this;\n return new Proxy(<[K, V]>[], {\n get(_, props: '0' | '1') {\n if (props === '0') return self._node._key;\n else if (props === '1') return self._node._value;\n },\n set(_, props: '1', newValue: V) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n }\n copy() {\n return new OrderedMapIterator(\n this._node,\n this._header,\n this.container,\n this.iteratorType\n );\n }\n // @ts-ignore\n equals(iter: OrderedMapIterator): boolean;\n}\n\nexport type { OrderedMapIterator };\n\nclass OrderedMap extends TreeContainer {\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedMap();\n * new OrderedMap([[0, 1], [2, 1]]);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true);\n */\n constructor(\n container: initContainer<[K, V]> = [],\n cmp?: (x: K, y: K) => number,\n enableIndex?: boolean\n ) {\n super(cmp, enableIndex);\n const self = this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n }\n /**\n * @internal\n */\n private * _iterationFunc(\n curNode: TreeNode | undefined\n ): Generator<[K, V], void> {\n if (curNode === undefined) return;\n yield * this._iterationFunc(curNode._left);\n yield <[K, V]>[curNode._key, curNode._value];\n yield * this._iterationFunc(curNode._right);\n }\n begin() {\n return new OrderedMapIterator(this._header._left || this._header, this._header, this);\n }\n end() {\n return new OrderedMapIterator(this._header, this._header, this);\n }\n rBegin() {\n return new OrderedMapIterator(\n this._header._right || this._header,\n this._header,\n this,\n IteratorType.REVERSE\n );\n }\n rEnd() {\n return new OrderedMapIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front() {\n if (this._length === 0) return;\n const minNode = this._header._left!;\n return <[K, V]>[minNode._key, minNode._value];\n }\n back() {\n if (this._length === 0) return;\n const maxNode = this._header._right!;\n return <[K, V]>[maxNode._key, maxNode._value];\n }\n lowerBound(key: K) {\n const resNode = this._lowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n upperBound(key: K) {\n const resNode = this._upperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n reverseLowerBound(key: K) {\n const resNode = this._reverseLowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n reverseUpperBound(key: K) {\n const resNode = this._reverseUpperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]);\n * const iter = mp.begin();\n * mp.setElement(1, 0);\n * mp.setElement(3, 0, iter); // give a hint will be faster.\n */\n setElement(key: K, value: V, hint?: OrderedMapIterator) {\n return this._set(key, value, hint);\n }\n find(key: K) {\n const curNode = this._findElementNode(this._root, key);\n return new OrderedMapIterator(curNode, this._header, this);\n }\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The specified key you want to get.\n * @example\n * const val = container.getElementByKey(1);\n */\n getElementByKey(key: K) {\n const curNode = this._findElementNode(this._root, key);\n return curNode._value;\n }\n union(other: OrderedMap) {\n const self = this;\n other.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n return this._length;\n }\n [Symbol.iterator]() {\n return this._iterationFunc(this._root);\n }\n // @ts-ignore\n eraseElementByIterator(iter: OrderedMapIterator): OrderedMapIterator;\n // @ts-ignore\n forEach(callback: (element: [K, V], index: number, map: OrderedMap) => void): void;\n // @ts-ignore\n getElementByPos(pos: number): [K, V];\n}\n\nexport default OrderedMap;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts new file mode 100644 index 000000000..e946983a8 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts @@ -0,0 +1,54 @@ +import TreeContainer from './Base'; +import TreeIterator from './Base/TreeIterator'; +import { TreeNode } from './Base/TreeNode'; +import { initContainer, IteratorType } from "../ContainerBase"; +declare class OrderedSetIterator extends TreeIterator { + container: OrderedSet; + constructor(node: TreeNode, header: TreeNode, container: OrderedSet, iteratorType?: IteratorType); + get pointer(): NonNullable; + copy(): OrderedSetIterator; + equals(iter: OrderedSetIterator): boolean; +} +export type { OrderedSetIterator }; +declare class OrderedSet extends TreeContainer { + /** + * @param container - The initialization container. + * @param cmp - The compare function. + * @param enableIndex - Whether to enable iterator indexing function. + * @example + * new OrderedSet(); + * new OrderedSet([0, 1, 2]); + * new OrderedSet([0, 1, 2], (x, y) => x - y); + * new OrderedSet([0, 1, 2], (x, y) => x - y, true); + */ + constructor(container?: initContainer, cmp?: (x: K, y: K) => number, enableIndex?: boolean); + begin(): OrderedSetIterator; + end(): OrderedSetIterator; + rBegin(): OrderedSetIterator; + rEnd(): OrderedSetIterator; + front(): K | undefined; + back(): K | undefined; + /** + * @description Insert element to set. + * @param key - The key want to insert. + * @param hint - You can give an iterator hint to improve insertion efficiency. + * @return The size of container after setting. + * @example + * const st = new OrderedSet([2, 4, 5]); + * const iter = st.begin(); + * st.insert(1); + * st.insert(3, iter); // give a hint will be faster. + */ + insert(key: K, hint?: OrderedSetIterator): number; + find(element: K): OrderedSetIterator; + lowerBound(key: K): OrderedSetIterator; + upperBound(key: K): OrderedSetIterator; + reverseLowerBound(key: K): OrderedSetIterator; + reverseUpperBound(key: K): OrderedSetIterator; + union(other: OrderedSet): number; + [Symbol.iterator](): Generator; + eraseElementByIterator(iter: OrderedSetIterator): OrderedSetIterator; + forEach(callback: (element: K, index: number, tree: OrderedSet) => void): void; + getElementByPos(pos: number): K; +} +export default OrderedSet; diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js new file mode 100644 index 000000000..c7af14df2 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = void 0; + +var _Base = _interopRequireDefault(require("./Base")); + +var _TreeIterator = _interopRequireDefault(require("./Base/TreeIterator")); + +var _throwError = require("../../utils/throwError"); + +function _interopRequireDefault(e) { + return e && e.t ? e : { + default: e + }; +} + +class OrderedSetIterator extends _TreeIterator.default { + constructor(e, t, r, i) { + super(e, t, i); + this.container = r; + } + get pointer() { + if (this.o === this.h) { + (0, _throwError.throwIteratorAccessError)(); + } + return this.o.u; + } + copy() { + return new OrderedSetIterator(this.o, this.h, this.container, this.iteratorType); + } +} + +class OrderedSet extends _Base.default { + constructor(e = [], t, r) { + super(t, r); + const i = this; + e.forEach((function(e) { + i.insert(e); + })); + } + * K(e) { + if (e === undefined) return; + yield* this.K(e.U); + yield e.u; + yield* this.K(e.W); + } + begin() { + return new OrderedSetIterator(this.h.U || this.h, this.h, this); + } + end() { + return new OrderedSetIterator(this.h, this.h, this); + } + rBegin() { + return new OrderedSetIterator(this.h.W || this.h, this.h, this, 1); + } + rEnd() { + return new OrderedSetIterator(this.h, this.h, this, 1); + } + front() { + return this.h.U ? this.h.U.u : undefined; + } + back() { + return this.h.W ? this.h.W.u : undefined; + } + insert(e, t) { + return this.M(e, undefined, t); + } + find(e) { + const t = this.I(this.Y, e); + return new OrderedSetIterator(t, this.h, this); + } + lowerBound(e) { + const t = this.X(this.Y, e); + return new OrderedSetIterator(t, this.h, this); + } + upperBound(e) { + const t = this.Z(this.Y, e); + return new OrderedSetIterator(t, this.h, this); + } + reverseLowerBound(e) { + const t = this.$(this.Y, e); + return new OrderedSetIterator(t, this.h, this); + } + reverseUpperBound(e) { + const t = this.rr(this.Y, e); + return new OrderedSetIterator(t, this.h, this); + } + union(e) { + const t = this; + e.forEach((function(e) { + t.insert(e); + })); + return this.i; + } + [Symbol.iterator]() { + return this.K(this.Y); + } +} + +var _default = OrderedSet; + +exports.default = _default; +//# sourceMappingURL=OrderedSet.js.map diff --git a/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js.map b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js.map new file mode 100644 index 000000000..692ca5290 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/OrderedSet.js","../../src/container/TreeContainer/OrderedSet.ts"],"names":["Object","defineProperty","exports","value","default","_Base","_interopRequireDefault","require","_TreeIterator","_throwError","obj","__esModule","OrderedSetIterator","TreeIterator","constructor","node","header","container","iteratorType","super","this","pointer","_node","_header","throwIteratorAccessError","_key","copy","OrderedSet","TreeContainer","cmp","enableIndex","self","forEach","el","insert","K","curNode","undefined","_iterationFunc","_left","_right","begin","end","rBegin","rEnd","front","back","key","hint","_set","find","element","resNode","_findElementNode","_root","lowerBound","_lowerBound","upperBound","_upperBound","reverseLowerBound","_reverseLowerBound","reverseUpperBound","_reverseUpperBound","union","other","_length","Symbol","iterator","_default"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,eAAe;;ACLvB,IAAAC,QAAAC,uBAAAC,QAAA;;AACA,IAAAC,gBAAAF,uBAAAC,QAAA;;AAGA,IAAAE,cAAAF,QAAA;;AAA8D,SAAAD,uBAAAI;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAN,SAAAM;;AAAA;;AAE9D,MAAME,2BAA8BC,cAAAA;IAElCC,YACEC,GACAC,GACAC,GACAC;QA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IAAIvC,mBAAsBwC,GAAShC,KAAKG,GAASH;ADhCxD;ICkCFmC,WAAWR;QACT,MAAMK,IAAUhC,KAAKoC,EAAYpC,KAAKkC,GAAOP;QAC7C,OAAO,IAAInC,mBAAsBwC,GAAShC,KAAKG,GAASH;ADhCxD;ICkCFqC,WAAWV;QACT,MAAMK,IAAUhC,KAAKsC,EAAYtC,KAAKkC,GAAOP;QAC7C,OAAO,IAAInC,mBAAsBwC,GAAShC,KAAKG,GAASH;ADhCxD;ICkCFuC,kBAAkBZ;QAChB,MAAMK,IAAUhC,KAAKwC,EAAmBxC,KAAKkC,GAAOP;QACpD,OAAO,IAAInC,mBAAsBwC,GAAShC,KAAKG,GAASH;ADhCxD;ICkCFyC,kBAAkBd;QAChB,MAAMK,IAAUhC,KAAK0C,GAAmB1C,KAAKkC,GAAOP;QACpD,OAAO,IAAInC,mBAAsBwC,GAAShC,KAAKG,GAASH;ADhCxD;ICkCF2C,MAAMC;QACJ,MAAMjC,IAAOX;QACb4C,EAAMhC,SAAQ,SAAUC;YACtBF,EAAKG,OAAOD;ADhCV;QCkCJ,OAAOb,KAAK6C;ADhCZ;ICkCF,CAACC,OAAOC;QACN,OAAO/C,KAAKkB,EAAelB,KAAKkC;ADhChC;;;ACwCH,IAAAc,WAEczC;;AAAUzB,QAAAE,UAAAgE","file":"OrderedSet.js","sourcesContent":["import TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nclass OrderedSetIterator extends TreeIterator {\n constructor(node, header, container, iteratorType) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key;\n }\n copy() {\n return new OrderedSetIterator(this._node, this._header, this.container, this.iteratorType);\n }\n}\nclass OrderedSet extends TreeContainer {\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedSet();\n * new OrderedSet([0, 1, 2]);\n * new OrderedSet([0, 1, 2], (x, y) => x - y);\n * new OrderedSet([0, 1, 2], (x, y) => x - y, true);\n */\n constructor(container = [], cmp, enableIndex) {\n super(cmp, enableIndex);\n const self = this;\n container.forEach(function (el) {\n self.insert(el);\n });\n }\n /**\n * @internal\n */\n *_iterationFunc(curNode) {\n if (curNode === undefined)\n return;\n yield* this._iterationFunc(curNode._left);\n yield curNode._key;\n yield* this._iterationFunc(curNode._right);\n }\n begin() {\n return new OrderedSetIterator(this._header._left || this._header, this._header, this);\n }\n end() {\n return new OrderedSetIterator(this._header, this._header, this);\n }\n rBegin() {\n return new OrderedSetIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n rEnd() {\n return new OrderedSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n }\n front() {\n return this._header._left ? this._header._left._key : undefined;\n }\n back() {\n return this._header._right ? this._header._right._key : undefined;\n }\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const st = new OrderedSet([2, 4, 5]);\n * const iter = st.begin();\n * st.insert(1);\n * st.insert(3, iter); // give a hint will be faster.\n */\n insert(key, hint) {\n return this._set(key, undefined, hint);\n }\n find(element) {\n const resNode = this._findElementNode(this._root, element);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n lowerBound(key) {\n const resNode = this._lowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n upperBound(key) {\n const resNode = this._upperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n reverseLowerBound(key) {\n const resNode = this._reverseLowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n reverseUpperBound(key) {\n const resNode = this._reverseUpperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n union(other) {\n const self = this;\n other.forEach(function (el) {\n self.insert(el);\n });\n return this._length;\n }\n [Symbol.iterator]() {\n return this._iterationFunc(this._root);\n }\n}\nexport default OrderedSet;\n","import TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { TreeNode } from './Base/TreeNode';\nimport { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass OrderedSetIterator extends TreeIterator {\n container: OrderedSet;\n constructor(\n node: TreeNode,\n header: TreeNode,\n container: OrderedSet,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key!;\n }\n copy() {\n return new OrderedSetIterator(\n this._node,\n this._header,\n this.container,\n this.iteratorType\n );\n }\n // @ts-ignore\n equals(iter: OrderedSetIterator): boolean;\n}\n\nexport type { OrderedSetIterator };\n\nclass OrderedSet extends TreeContainer {\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedSet();\n * new OrderedSet([0, 1, 2]);\n * new OrderedSet([0, 1, 2], (x, y) => x - y);\n * new OrderedSet([0, 1, 2], (x, y) => x - y, true);\n */\n constructor(\n container: initContainer = [],\n cmp?: (x: K, y: K) => number,\n enableIndex?: boolean\n ) {\n super(cmp, enableIndex);\n const self = this;\n container.forEach(function (el) {\n self.insert(el);\n });\n }\n /**\n * @internal\n */\n private * _iterationFunc(\n curNode: TreeNode | undefined\n ): Generator {\n if (curNode === undefined) return;\n yield * this._iterationFunc(curNode._left);\n yield curNode._key!;\n yield * this._iterationFunc(curNode._right);\n }\n begin() {\n return new OrderedSetIterator(\n this._header._left || this._header,\n this._header,\n this\n );\n }\n end() {\n return new OrderedSetIterator(this._header, this._header, this);\n }\n rBegin() {\n return new OrderedSetIterator(\n this._header._right || this._header,\n this._header,\n this,\n IteratorType.REVERSE\n );\n }\n rEnd() {\n return new OrderedSetIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front() {\n return this._header._left ? this._header._left._key : undefined;\n }\n back() {\n return this._header._right ? this._header._right._key : undefined;\n }\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const st = new OrderedSet([2, 4, 5]);\n * const iter = st.begin();\n * st.insert(1);\n * st.insert(3, iter); // give a hint will be faster.\n */\n insert(key: K, hint?: OrderedSetIterator) {\n return this._set(key, undefined, hint);\n }\n find(element: K) {\n const resNode = this._findElementNode(this._root, element);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n lowerBound(key: K) {\n const resNode = this._lowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n upperBound(key: K) {\n const resNode = this._upperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n reverseLowerBound(key: K) {\n const resNode = this._reverseLowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n reverseUpperBound(key: K) {\n const resNode = this._reverseUpperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n union(other: OrderedSet) {\n const self = this;\n other.forEach(function (el) {\n self.insert(el);\n });\n return this._length;\n }\n [Symbol.iterator]() {\n return this._iterationFunc(this._root);\n }\n // @ts-ignore\n eraseElementByIterator(iter: OrderedSetIterator): OrderedSetIterator;\n // @ts-ignore\n forEach(callback: (element: K, index: number, tree: OrderedSet) => void): void;\n // @ts-ignore\n getElementByPos(pos: number): K;\n}\n\nexport default OrderedSet;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/index.d.ts b/node_modules/js-sdsl/dist/cjs/index.d.ts new file mode 100644 index 000000000..a379bce8f --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/index.d.ts @@ -0,0 +1,21 @@ +export { default as Stack } from "./container/OtherContainer/Stack"; +export { default as Queue } from "./container/OtherContainer/Queue"; +export { default as PriorityQueue } from "./container/OtherContainer/PriorityQueue"; +export { default as Vector } from "./container/SequentialContainer/Vector"; +export { default as LinkList } from "./container/SequentialContainer/LinkList"; +export { default as Deque } from "./container/SequentialContainer/Deque"; +export { default as OrderedSet } from "./container/TreeContainer/OrderedSet"; +export { default as OrderedMap } from "./container/TreeContainer/OrderedMap"; +export { default as HashSet } from "./container/HashContainer/HashSet"; +export { default as HashMap } from "./container/HashContainer/HashMap"; +export type { VectorIterator } from "./container/SequentialContainer/Vector"; +export type { LinkListIterator } from "./container/SequentialContainer/LinkList"; +export type { DequeIterator } from "./container/SequentialContainer/Deque"; +export type { OrderedSetIterator } from "./container/TreeContainer/OrderedSet"; +export type { OrderedMapIterator } from "./container/TreeContainer/OrderedMap"; +export type { HashSetIterator } from "./container/HashContainer/HashSet"; +export type { HashMapIterator } from "./container/HashContainer/HashMap"; +export type { IteratorType, Container, ContainerIterator } from "./container/ContainerBase"; +export type { default as SequentialContainer } from "./container/SequentialContainer/Base"; +export type { default as TreeContainer } from "./container/TreeContainer/Base"; +export type { HashContainer } from "./container/HashContainer/Base"; diff --git a/node_modules/js-sdsl/dist/cjs/index.js b/node_modules/js-sdsl/dist/cjs/index.js new file mode 100644 index 000000000..a6d00a48a --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/index.js @@ -0,0 +1,102 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +Object.defineProperty(exports, "Deque", { + enumerable: true, + get: function() { + return _Deque.default; + } +}); + +Object.defineProperty(exports, "HashMap", { + enumerable: true, + get: function() { + return _HashMap.default; + } +}); + +Object.defineProperty(exports, "HashSet", { + enumerable: true, + get: function() { + return _HashSet.default; + } +}); + +Object.defineProperty(exports, "LinkList", { + enumerable: true, + get: function() { + return _LinkList.default; + } +}); + +Object.defineProperty(exports, "OrderedMap", { + enumerable: true, + get: function() { + return _OrderedMap.default; + } +}); + +Object.defineProperty(exports, "OrderedSet", { + enumerable: true, + get: function() { + return _OrderedSet.default; + } +}); + +Object.defineProperty(exports, "PriorityQueue", { + enumerable: true, + get: function() { + return _PriorityQueue.default; + } +}); + +Object.defineProperty(exports, "Queue", { + enumerable: true, + get: function() { + return _Queue.default; + } +}); + +Object.defineProperty(exports, "Stack", { + enumerable: true, + get: function() { + return _Stack.default; + } +}); + +Object.defineProperty(exports, "Vector", { + enumerable: true, + get: function() { + return _Vector.default; + } +}); + +var _Stack = _interopRequireDefault(require("./container/OtherContainer/Stack")); + +var _Queue = _interopRequireDefault(require("./container/OtherContainer/Queue")); + +var _PriorityQueue = _interopRequireDefault(require("./container/OtherContainer/PriorityQueue")); + +var _Vector = _interopRequireDefault(require("./container/SequentialContainer/Vector")); + +var _LinkList = _interopRequireDefault(require("./container/SequentialContainer/LinkList")); + +var _Deque = _interopRequireDefault(require("./container/SequentialContainer/Deque")); + +var _OrderedSet = _interopRequireDefault(require("./container/TreeContainer/OrderedSet")); + +var _OrderedMap = _interopRequireDefault(require("./container/TreeContainer/OrderedMap")); + +var _HashSet = _interopRequireDefault(require("./container/HashContainer/HashSet")); + +var _HashMap = _interopRequireDefault(require("./container/HashContainer/HashMap")); + +function _interopRequireDefault(e) { + return e && e.t ? e : { + default: e + }; +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/cjs/index.js.map b/node_modules/js-sdsl/dist/cjs/index.js.map new file mode 100644 index 000000000..3f0418b72 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","../../src/index.ts"],"names":["Object","defineProperty","exports","value","enumerable","get","_Deque","default","_HashMap","_HashSet","_LinkList","_OrderedMap","_OrderedSet","_PriorityQueue","_Queue","_Stack","_Vector","_interopRequireDefault","require","obj","__esModule"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETH,OAAOC,eAAeC,SAAS,SAAS;IACtCE,YAAY;IACZC,KAAK;QACH,OAAOC,OAAOC;AAChB;;;AAEFP,OAAOC,eAAeC,SAAS,WAAW;IACxCE,YAAY;IACZC,KAAK;QACH,OAAOG,SAASD;AAClB;;;AAEFP,OAAOC,eAAeC,SAAS,WAAW;IACxCE,YAAY;IACZC,KAAK;QACH,OAAOI,SAASF;AAClB;;;AAEFP,OAAOC,eAAeC,SAAS,YAAY;IACzCE,YAAY;IACZC,KAAK;QACH,OAAOK,UAAUH;AACnB;;;AAEFP,OAAOC,eAAeC,SAAS,cAAc;IAC3CE,YAAY;IACZC,KAAK;QACH,OAAOM,YAAYJ;AACrB;;;AAEFP,OAAOC,eAAeC,SAAS,cAAc;IAC3CE,YAAY;IACZC,KAAK;QACH,OAAOO,YAAYL;AACrB;;;AAEFP,OAAOC,eAAeC,SAAS,iBAAiB;IAC9CE,YAAY;IACZC,KAAK;QACH,OAAOQ,eAAeN;AACxB;;;AAEFP,OAAOC,eAAeC,SAAS,SAAS;IACtCE,YAAY;IACZC,KAAK;QACH,OAAOS,OAAOP;AAChB;;;AAEFP,OAAOC,eAAeC,SAAS,SAAS;IACtCE,YAAY;IACZC,KAAK;QACH,OAAOU,OAAOR;AAChB;;;AAEFP,OAAOC,eAAeC,SAAS,UAAU;IACvCE,YAAY;IACZC,KAAK;QACH,OAAOW,QAAQT;AACjB;;;AC/DF,IAAAQ,SAAAE,uBAAAC,QAAA;;AACA,IAAAJ,SAAAG,uBAAAC,QAAA;;AACA,IAAAL,iBAAAI,uBAAAC,QAAA;;AACA,IAAAF,UAAAC,uBAAAC,QAAA;;AACA,IAAAR,YAAAO,uBAAAC,QAAA;;AACA,IAAAZ,SAAAW,uBAAAC,QAAA;;AACA,IAAAN,cAAAK,uBAAAC,QAAA;;AACA,IAAAP,cAAAM,uBAAAC,QAAA;;AACA,IAAAT,WAAAQ,uBAAAC,QAAA;;AACA,IAAAV,WAAAS,uBAAAC,QAAA;;AAAuE,SAAAD,uBAAAE;IAAA,OAAAA,KAAAA,EAAAC,IAAAD,IAAA;QAAAZ,SAAAY;;AAAA","file":"index.js","sourcesContent":[null,"export { default as Stack } from '@/container/OtherContainer/Stack';\nexport { default as Queue } from '@/container/OtherContainer/Queue';\nexport { default as PriorityQueue } from '@/container/OtherContainer/PriorityQueue';\nexport { default as Vector } from '@/container/SequentialContainer/Vector';\nexport { default as LinkList } from '@/container/SequentialContainer/LinkList';\nexport { default as Deque } from '@/container/SequentialContainer/Deque';\nexport { default as OrderedSet } from '@/container/TreeContainer/OrderedSet';\nexport { default as OrderedMap } from '@/container/TreeContainer/OrderedMap';\nexport { default as HashSet } from '@/container/HashContainer/HashSet';\nexport { default as HashMap } from '@/container/HashContainer/HashMap';\nexport type { VectorIterator } from '@/container/SequentialContainer/Vector';\nexport type { LinkListIterator } from '@/container/SequentialContainer/LinkList';\nexport type { DequeIterator } from '@/container/SequentialContainer/Deque';\nexport type { OrderedSetIterator } from '@/container/TreeContainer/OrderedSet';\nexport type { OrderedMapIterator } from '@/container/TreeContainer/OrderedMap';\nexport type { HashSetIterator } from '@/container/HashContainer/HashSet';\nexport type { HashMapIterator } from '@/container/HashContainer/HashMap';\nexport type { IteratorType, Container, ContainerIterator } from '@/container/ContainerBase';\nexport type { default as SequentialContainer } from '@/container/SequentialContainer/Base';\nexport type { default as TreeContainer } from '@/container/TreeContainer/Base';\nexport type { HashContainer } from '@/container/HashContainer/Base';\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/utils/checkObject.d.ts b/node_modules/js-sdsl/dist/cjs/utils/checkObject.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/utils/checkObject.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/js-sdsl/dist/cjs/utils/checkObject.js b/node_modules/js-sdsl/dist/cjs/utils/checkObject.js new file mode 100644 index 000000000..1c93a9048 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/utils/checkObject.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.default = checkObject; + +function checkObject(e) { + const t = typeof e; + return t === "object" && e !== null || t === "function"; +} +//# sourceMappingURL=checkObject.js.map diff --git a/node_modules/js-sdsl/dist/cjs/utils/checkObject.js.map b/node_modules/js-sdsl/dist/cjs/utils/checkObject.js.map new file mode 100644 index 000000000..f8d1fc51c --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/utils/checkObject.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["utils/checkObject.js","../../src/utils/checkObject.ts"],"names":["Object","defineProperty","exports","value","default","checkObject","key","t"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,UAAUC;;ACCJ,SAAUA,YAAeC;IACrC,MAAMC,WAAWD;IACjB,OAAQC,MAAM,YAAYD,MAAQ,QAASC,MAAM;ADCnD","file":"checkObject.js","sourcesContent":["/**\n * @description Determine whether the type of key is `object`.\n * @param key - The key want to check.\n * @returns Whether the type of key is `object`.\n * @internal\n */\nexport default function checkObject(key) {\n const t = typeof key;\n return (t === 'object' && key !== null) || t === 'function';\n}\n","/**\n * @description Determine whether the type of key is `object`.\n * @param key - The key want to check.\n * @returns Whether the type of key is `object`.\n * @internal\n */\nexport default function checkObject(key: T) {\n const t = typeof key;\n return (t === 'object' && key !== null) || t === 'function';\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/cjs/utils/throwError.d.ts b/node_modules/js-sdsl/dist/cjs/utils/throwError.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/utils/throwError.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/js-sdsl/dist/cjs/utils/throwError.js b/node_modules/js-sdsl/dist/cjs/utils/throwError.js new file mode 100644 index 000000000..ea052b9c2 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/utils/throwError.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "t", { + value: true +}); + +exports.throwIteratorAccessError = throwIteratorAccessError; + +function throwIteratorAccessError() { + throw new RangeError("Iterator access denied!"); +} +//# sourceMappingURL=throwError.js.map diff --git a/node_modules/js-sdsl/dist/cjs/utils/throwError.js.map b/node_modules/js-sdsl/dist/cjs/utils/throwError.js.map new file mode 100644 index 000000000..81a5eeba3 --- /dev/null +++ b/node_modules/js-sdsl/dist/cjs/utils/throwError.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["utils/throwError.js","../../src/utils/throwError.ts"],"names":["Object","defineProperty","exports","value","throwIteratorAccessError","RangeError"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,2BAA2BA;;ACD7B,SAAUA;IACd,MAAM,IAAIC,WAAW;ADCvB","file":"throwError.js","sourcesContent":["/**\n * @description Throw an iterator access error.\n * @internal\n */\nexport function throwIteratorAccessError() {\n throw new RangeError('Iterator access denied!');\n}\n","/**\n * @description Throw an iterator access error.\n * @internal\n */\nexport function throwIteratorAccessError() {\n throw new RangeError('Iterator access denied!');\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts b/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts new file mode 100644 index 000000000..12e159824 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts @@ -0,0 +1,206 @@ +/** + * @description The iterator type including `NORMAL` and `REVERSE`. + */ +export declare const enum IteratorType { + NORMAL = 0, + REVERSE = 1 +} +export declare abstract class ContainerIterator { + /** + * @description The container pointed to by the iterator. + */ + abstract readonly container: Container; + /** + * @description Iterator's type. + * @example + * console.log(container.end().iteratorType === IteratorType.NORMAL); // true + */ + readonly iteratorType: IteratorType; + /** + * @param iter - The other iterator you want to compare. + * @returns Whether this equals to obj. + * @example + * container.find(1).equals(container.end()); + */ + equals(iter: ContainerIterator): boolean; + /** + * @description Pointers to element. + * @returns The value of the pointer's element. + * @example + * const val = container.begin().pointer; + */ + abstract get pointer(): T; + /** + * @description Set pointer's value (some containers are unavailable). + * @param newValue - The new value you want to set. + * @example + * (>container).begin().pointer = 1; + */ + abstract set pointer(newValue: T); + /** + * @description Move `this` iterator to pre. + * @returns The iterator's self. + * @example + * const iter = container.find(1); // container = [0, 1] + * const pre = iter.pre(); + * console.log(pre === iter); // true + * console.log(pre.equals(iter)); // true + * console.log(pre.pointer, iter.pointer); // 0, 0 + */ + abstract pre(): this; + /** + * @description Move `this` iterator to next. + * @returns The iterator's self. + * @example + * const iter = container.find(1); // container = [1, 2] + * const next = iter.next(); + * console.log(next === iter); // true + * console.log(next.equals(iter)); // true + * console.log(next.pointer, iter.pointer); // 2, 2 + */ + abstract next(): this; + /** + * @description Get a copy of itself. + * @returns The copy of self. + * @example + * const iter = container.find(1); // container = [1, 2] + * const next = iter.copy().next(); + * console.log(next === iter); // false + * console.log(next.equals(iter)); // false + * console.log(next.pointer, iter.pointer); // 2, 1 + */ + abstract copy(): ContainerIterator; +} +export declare abstract class Base { + /** + * @returns The size of the container. + * @example + * const container = new Vector([1, 2]); + * console.log(container.length); // 2 + */ + get length(): number; + /** + * @returns The size of the container. + * @example + * const container = new Vector([1, 2]); + * console.log(container.size()); // 2 + */ + size(): number; + /** + * @returns Whether the container is empty. + * @example + * container.clear(); + * console.log(container.empty()); // true + */ + empty(): boolean; + /** + * @description Clear the container. + * @example + * container.clear(); + * console.log(container.empty()); // true + */ + abstract clear(): void; +} +export declare abstract class Container extends Base { + /** + * @returns Iterator pointing to the beginning element. + * @example + * const begin = container.begin(); + * const end = container.end(); + * for (const it = begin; !it.equals(end); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract begin(): ContainerIterator; + /** + * @returns Iterator pointing to the super end like c++. + * @example + * const begin = container.begin(); + * const end = container.end(); + * for (const it = begin; !it.equals(end); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract end(): ContainerIterator; + /** + * @returns Iterator pointing to the end element. + * @example + * const rBegin = container.rBegin(); + * const rEnd = container.rEnd(); + * for (const it = rBegin; !it.equals(rEnd); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract rBegin(): ContainerIterator; + /** + * @returns Iterator pointing to the super begin like c++. + * @example + * const rBegin = container.rBegin(); + * const rEnd = container.rEnd(); + * for (const it = rBegin; !it.equals(rEnd); it.next()) { + * doSomething(it.pointer); + * } + */ + abstract rEnd(): ContainerIterator; + /** + * @returns The first element of the container. + */ + abstract front(): T | undefined; + /** + * @returns The last element of the container. + */ + abstract back(): T | undefined; + /** + * @param element - The element you want to find. + * @returns An iterator pointing to the element if found, or super end if not found. + * @example + * container.find(1).equals(container.end()); + */ + abstract find(element: T): ContainerIterator; + /** + * @description Iterate over all elements in the container. + * @param callback - Callback function like Array.forEach. + * @example + * container.forEach((element, index) => console.log(element, index)); + */ + abstract forEach(callback: (element: T, index: number, container: Container) => void): void; + /** + * @description Gets the value of the element at the specified position. + * @example + * const val = container.getElementByPos(-1); // throw a RangeError + */ + abstract getElementByPos(pos: number): T; + /** + * @description Removes the element at the specified position. + * @param pos - The element's position you want to remove. + * @returns The container length after erasing. + * @example + * container.eraseElementByPos(-1); // throw a RangeError + */ + abstract eraseElementByPos(pos: number): number; + /** + * @description Removes element by iterator and move `iter` to next. + * @param iter - The iterator you want to erase. + * @returns The next iterator. + * @example + * container.eraseElementByIterator(container.begin()); + * container.eraseElementByIterator(container.end()); // throw a RangeError + */ + abstract eraseElementByIterator(iter: ContainerIterator): ContainerIterator; + /** + * @description Using for `for...of` syntax like Array. + * @example + * for (const element of container) { + * console.log(element); + * } + */ + abstract [Symbol.iterator](): Generator; +} +/** + * @description The initial data type passed in when initializing the container. + */ +export declare type initContainer = { + size?: number | (() => number); + length?: number; + forEach: (callback: (el: T) => void) => void; +}; diff --git a/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js b/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js new file mode 100644 index 000000000..d5e10db88 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js @@ -0,0 +1,68 @@ +var __extends = this && this.t || function() { + var extendStatics = function(n, t) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(n, t) { + n.__proto__ = t; + } || function(n, t) { + for (var r in t) if (Object.prototype.hasOwnProperty.call(t, r)) n[r] = t[r]; + }; + return extendStatics(n, t); + }; + return function(n, t) { + if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); + extendStatics(n, t); + function __() { + this.constructor = n; + } + n.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __); + }; +}(); + +var ContainerIterator = function() { + function ContainerIterator(n) { + if (n === void 0) { + n = 0; + } + this.iteratorType = n; + } + ContainerIterator.prototype.equals = function(n) { + return this.o === n.o; + }; + return ContainerIterator; +}(); + +export { ContainerIterator }; + +var Base = function() { + function Base() { + this.M = 0; + } + Object.defineProperty(Base.prototype, "length", { + get: function() { + return this.M; + }, + enumerable: false, + configurable: true + }); + Base.prototype.size = function() { + return this.M; + }; + Base.prototype.empty = function() { + return this.M === 0; + }; + return Base; +}(); + +export { Base }; + +var Container = function(n) { + __extends(Container, n); + function Container() { + return n !== null && n.apply(this, arguments) || this; + } + return Container; +}(Base); + +export { Container }; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js.map b/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js.map new file mode 100644 index 000000000..d5ca0d557 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/ContainerBase/index.js","../../src/container/ContainerBase/index.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","ContainerIterator","iteratorType","equals","iter","_node","Base","_length","defineProperty","get","enumerable","configurable","size","empty","Container","_super","apply","arguments"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;Y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AcjC;ACiJnE;IAAA,OAAA8B;AAAA,CAhGA,CAA2CR;;SD7ClCQ","file":"index.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar ContainerIterator = /** @class */ (function () {\n /**\n * @internal\n */\n function ContainerIterator(iteratorType) {\n if (iteratorType === void 0) { iteratorType = 0 /* IteratorType.NORMAL */; }\n this.iteratorType = iteratorType;\n }\n /**\n * @param iter - The other iterator you want to compare.\n * @returns Whether this equals to obj.\n * @example\n * container.find(1).equals(container.end());\n */\n ContainerIterator.prototype.equals = function (iter) {\n return this._node === iter._node;\n };\n return ContainerIterator;\n}());\nexport { ContainerIterator };\nvar Base = /** @class */ (function () {\n function Base() {\n /**\n * @description Container's size.\n * @internal\n */\n this._length = 0;\n }\n Object.defineProperty(Base.prototype, \"length\", {\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.length); // 2\n */\n get: function () {\n return this._length;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.size()); // 2\n */\n Base.prototype.size = function () {\n return this._length;\n };\n /**\n * @returns Whether the container is empty.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n Base.prototype.empty = function () {\n return this._length === 0;\n };\n return Base;\n}());\nexport { Base };\nvar Container = /** @class */ (function (_super) {\n __extends(Container, _super);\n function Container() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Container;\n}(Base));\nexport { Container };\n","/**\n * @description The iterator type including `NORMAL` and `REVERSE`.\n */\nexport const enum IteratorType {\n NORMAL = 0,\n REVERSE = 1\n}\n\nexport abstract class ContainerIterator {\n /**\n * @description The container pointed to by the iterator.\n */\n abstract readonly container: Container;\n /**\n * @internal\n */\n abstract _node: unknown;\n /**\n * @description Iterator's type.\n * @example\n * console.log(container.end().iteratorType === IteratorType.NORMAL); // true\n */\n readonly iteratorType: IteratorType;\n /**\n * @internal\n */\n protected constructor(iteratorType = IteratorType.NORMAL) {\n this.iteratorType = iteratorType;\n }\n /**\n * @param iter - The other iterator you want to compare.\n * @returns Whether this equals to obj.\n * @example\n * container.find(1).equals(container.end());\n */\n equals(iter: ContainerIterator) {\n return this._node === iter._node;\n }\n /**\n * @description Pointers to element.\n * @returns The value of the pointer's element.\n * @example\n * const val = container.begin().pointer;\n */\n abstract get pointer(): T;\n /**\n * @description Set pointer's value (some containers are unavailable).\n * @param newValue - The new value you want to set.\n * @example\n * (>container).begin().pointer = 1;\n */\n abstract set pointer(newValue: T);\n /**\n * @description Move `this` iterator to pre.\n * @returns The iterator's self.\n * @example\n * const iter = container.find(1); // container = [0, 1]\n * const pre = iter.pre();\n * console.log(pre === iter); // true\n * console.log(pre.equals(iter)); // true\n * console.log(pre.pointer, iter.pointer); // 0, 0\n */\n abstract pre(): this;\n /**\n * @description Move `this` iterator to next.\n * @returns The iterator's self.\n * @example\n * const iter = container.find(1); // container = [1, 2]\n * const next = iter.next();\n * console.log(next === iter); // true\n * console.log(next.equals(iter)); // true\n * console.log(next.pointer, iter.pointer); // 2, 2\n */\n abstract next(): this;\n /**\n * @description Get a copy of itself.\n * @returns The copy of self.\n * @example\n * const iter = container.find(1); // container = [1, 2]\n * const next = iter.copy().next();\n * console.log(next === iter); // false\n * console.log(next.equals(iter)); // false\n * console.log(next.pointer, iter.pointer); // 2, 1\n */\n abstract copy(): ContainerIterator;\n}\n\nexport abstract class Base {\n /**\n * @description Container's size.\n * @internal\n */\n protected _length = 0;\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.length); // 2\n */\n get length() {\n return this._length;\n }\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.size()); // 2\n */\n size() {\n return this._length;\n }\n /**\n * @returns Whether the container is empty.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n empty() {\n return this._length === 0;\n }\n /**\n * @description Clear the container.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n abstract clear(): void;\n}\n\nexport abstract class Container extends Base {\n /**\n * @returns Iterator pointing to the beginning element.\n * @example\n * const begin = container.begin();\n * const end = container.end();\n * for (const it = begin; !it.equals(end); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract begin(): ContainerIterator;\n /**\n * @returns Iterator pointing to the super end like c++.\n * @example\n * const begin = container.begin();\n * const end = container.end();\n * for (const it = begin; !it.equals(end); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract end(): ContainerIterator;\n /**\n * @returns Iterator pointing to the end element.\n * @example\n * const rBegin = container.rBegin();\n * const rEnd = container.rEnd();\n * for (const it = rBegin; !it.equals(rEnd); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract rBegin(): ContainerIterator;\n /**\n * @returns Iterator pointing to the super begin like c++.\n * @example\n * const rBegin = container.rBegin();\n * const rEnd = container.rEnd();\n * for (const it = rBegin; !it.equals(rEnd); it.next()) {\n * doSomething(it.pointer);\n * }\n */\n abstract rEnd(): ContainerIterator;\n /**\n * @returns The first element of the container.\n */\n abstract front(): T | undefined;\n /**\n * @returns The last element of the container.\n */\n abstract back(): T | undefined;\n /**\n * @param element - The element you want to find.\n * @returns An iterator pointing to the element if found, or super end if not found.\n * @example\n * container.find(1).equals(container.end());\n */\n abstract find(element: T): ContainerIterator;\n /**\n * @description Iterate over all elements in the container.\n * @param callback - Callback function like Array.forEach.\n * @example\n * container.forEach((element, index) => console.log(element, index));\n */\n abstract forEach(callback: (element: T, index: number, container: Container) => void): void;\n /**\n * @description Gets the value of the element at the specified position.\n * @example\n * const val = container.getElementByPos(-1); // throw a RangeError\n */\n abstract getElementByPos(pos: number): T;\n /**\n * @description Removes the element at the specified position.\n * @param pos - The element's position you want to remove.\n * @returns The container length after erasing.\n * @example\n * container.eraseElementByPos(-1); // throw a RangeError\n */\n abstract eraseElementByPos(pos: number): number;\n /**\n * @description Removes element by iterator and move `iter` to next.\n * @param iter - The iterator you want to erase.\n * @returns The next iterator.\n * @example\n * container.eraseElementByIterator(container.begin());\n * container.eraseElementByIterator(container.end()); // throw a RangeError\n */\n abstract eraseElementByIterator(\n iter: ContainerIterator\n ): ContainerIterator;\n /**\n * @description Using for `for...of` syntax like Array.\n * @example\n * for (const element of container) {\n * console.log(element);\n * }\n */\n abstract [Symbol.iterator](): Generator;\n}\n\n/**\n * @description The initial data type passed in when initializing the container.\n */\nexport type initContainer = {\n size?: number | (() => number);\n length?: number;\n forEach: (callback: (el: T) => void) => void;\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts b/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts new file mode 100644 index 000000000..43aa866c7 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts @@ -0,0 +1,29 @@ +import { Container, ContainerIterator } from "../../ContainerBase"; +export declare type HashLinkNode = { + _key: K; + _value: V; + _pre: HashLinkNode; + _next: HashLinkNode; +}; +export declare abstract class HashContainerIterator extends ContainerIterator { + abstract readonly container: HashContainer; + pre(): this; + next(): this; +} +export declare abstract class HashContainer extends Container { + /** + * @description Unique symbol used to tag object. + */ + readonly HASH_TAG: symbol; + clear(): void; + /** + * @description Remove the element of the specified key. + * @param key - The key you want to remove. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns Whether erase successfully. + */ + eraseElementByKey(key: K, isObject?: boolean): boolean; + eraseElementByIterator(iter: HashContainerIterator): HashContainerIterator; + eraseElementByPos(pos: number): number; +} diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js b/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js new file mode 100644 index 000000000..028b7d484 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js @@ -0,0 +1,201 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, i) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, i) { + t.__proto__ = i; + } || function(t, i) { + for (var r in i) if (Object.prototype.hasOwnProperty.call(i, r)) t[r] = i[r]; + }; + return extendStatics(t, i); + }; + return function(t, i) { + if (typeof i !== "function" && i !== null) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); + extendStatics(t, i); + function __() { + this.constructor = t; + } + t.prototype = i === null ? Object.create(i) : (__.prototype = i.prototype, new __); + }; +}(); + +import { Container, ContainerIterator } from "../../ContainerBase"; + +import checkObject from "../../../utils/checkObject"; + +import { throwIteratorAccessError } from "../../../utils/throwError"; + +var HashContainerIterator = function(t) { + __extends(HashContainerIterator, t); + function HashContainerIterator(i, r, e) { + var n = t.call(this, e) || this; + n.o = i; + n.h = r; + if (n.iteratorType === 0) { + n.pre = function() { + if (this.o.L === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.L; + return this; + }; + n.next = function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.m; + return this; + }; + } else { + n.pre = function() { + if (this.o.m === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.m; + return this; + }; + n.next = function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.L; + return this; + }; + } + return n; + } + return HashContainerIterator; +}(ContainerIterator); + +export { HashContainerIterator }; + +var HashContainer = function(t) { + __extends(HashContainer, t); + function HashContainer() { + var i = t.call(this) || this; + i._ = []; + i.I = {}; + i.HASH_TAG = Symbol("@@HASH_TAG"); + Object.setPrototypeOf(i.I, null); + i.h = {}; + i.h.L = i.h.m = i.H = i.l = i.h; + return i; + } + HashContainer.prototype.G = function(t) { + var i = t.L, r = t.m; + i.m = r; + r.L = i; + if (t === this.H) { + this.H = r; + } + if (t === this.l) { + this.l = i; + } + this.M -= 1; + }; + HashContainer.prototype.v = function(t, i, r) { + if (r === undefined) r = checkObject(t); + var e; + if (r) { + var n = t[this.HASH_TAG]; + if (n !== undefined) { + this._[n].p = i; + return this.M; + } + Object.defineProperty(t, this.HASH_TAG, { + value: this._.length, + configurable: true + }); + e = { + u: t, + p: i, + L: this.l, + m: this.h + }; + this._.push(e); + } else { + var s = this.I[t]; + if (s) { + s.p = i; + return this.M; + } + e = { + u: t, + p: i, + L: this.l, + m: this.h + }; + this.I[t] = e; + } + if (this.M === 0) { + this.H = e; + this.h.m = e; + } else { + this.l.m = e; + } + this.l = e; + this.h.L = e; + return ++this.M; + }; + HashContainer.prototype.g = function(t, i) { + if (i === undefined) i = checkObject(t); + if (i) { + var r = t[this.HASH_TAG]; + if (r === undefined) return this.h; + return this._[r]; + } else { + return this.I[t] || this.h; + } + }; + HashContainer.prototype.clear = function() { + var t = this.HASH_TAG; + this._.forEach((function(i) { + delete i.u[t]; + })); + this._ = []; + this.I = {}; + Object.setPrototypeOf(this.I, null); + this.M = 0; + this.H = this.l = this.h.L = this.h.m = this.h; + }; + HashContainer.prototype.eraseElementByKey = function(t, i) { + var r; + if (i === undefined) i = checkObject(t); + if (i) { + var e = t[this.HASH_TAG]; + if (e === undefined) return false; + delete t[this.HASH_TAG]; + r = this._[e]; + delete this._[e]; + } else { + r = this.I[t]; + if (r === undefined) return false; + delete this.I[t]; + } + this.G(r); + return true; + }; + HashContainer.prototype.eraseElementByIterator = function(t) { + var i = t.o; + if (i === this.h) { + throwIteratorAccessError(); + } + this.G(i); + return t.next(); + }; + HashContainer.prototype.eraseElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var i = this.H; + while (t--) { + i = i.m; + } + this.G(i); + return this.M; + }; + return HashContainer; +}(Container); + +export { HashContainer }; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js.map b/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js.map new file mode 100644 index 000000000..bd0a10df6 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/HashContainer/Base/index.js","../../src/container/HashContainer/Base/index.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","Container","ContainerIterator","checkObject","throwIteratorAccessError","HashContainerIterator","_super","node","header","iteratorType","_this","_node","_header","pre","_pre","next","_next","HashContainer","_objMap","_originMap","HASH_TAG","Symbol","_head","_tail","_eraseNode","_length","_set","key","value","isObject","undefined","newTail","index","_value","defineProperty","length","configurable","_key","push","_findElementNode","clear","forEach","el","eraseElementByKey","eraseElementByIterator","iter","eraseElementByPos","pos","RangeError"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,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,KAAKmC,EAA4BQ;ADLtC;QCOJ3C,KAAKwC,EAAWjB;QAChB,OAAO;ADLP;ICOFU,cAAAxB,UAAAmD,yBAAA,SAAuBC;QACrB,IAAMtC,IAAOsC,EAAKlC;QAClB,IAAIJ,MAASvB,KAAK4B,GAAS;YACzBR;ADLE;QCOJpB,KAAKwC,EAAWjB;QAChB,OAAOsC,EAAK9B;ADLZ;ICOFE,cAAAxB,UAAAqD,oBAAA,SAAkBC;QDLZ,ICMsBA,IAAG,KAAHA,IAAQ/D,KAAKyC,IAAO,GAvN5C;YAAG,MAAS,IAAIuB;ADmNd;QCKJ,IAAIzC,IAAOvB,KAAKsC;QAChB,OAAOyB,KAAO;YACZxC,IAAOA,EAAKS;ADHV;QCKJhC,KAAKwC,EAAWjB;QAChB,OAAOvB,KAAKyC;ADHZ;ICKJ,OAAAR;AAAA,CAjKA,CAAkDhB;;SD+JzCgB","file":"index.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Container, ContainerIterator } from \"../../ContainerBase\";\nimport checkObject from \"../../../utils/checkObject\";\nimport $checkWithinAccessParams from \"../../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nvar HashContainerIterator = /** @class */ (function (_super) {\n __extends(HashContainerIterator, _super);\n /**\n * @internal\n */\n function HashContainerIterator(node, header, iteratorType) {\n var _this = _super.call(this, iteratorType) || this;\n _this._node = node;\n _this._header = header;\n if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {\n _this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n _this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n }\n else {\n _this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n _this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n return _this;\n }\n return HashContainerIterator;\n}(ContainerIterator));\nexport { HashContainerIterator };\nvar HashContainer = /** @class */ (function (_super) {\n __extends(HashContainer, _super);\n /**\n * @internal\n */\n function HashContainer() {\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n _this._objMap = [];\n /**\n * @internal\n */\n _this._originMap = {};\n /**\n * @description Unique symbol used to tag object.\n */\n _this.HASH_TAG = Symbol('@@HASH_TAG');\n Object.setPrototypeOf(_this._originMap, null);\n _this._header = {};\n _this._header._pre = _this._header._next = _this._head = _this._tail = _this._header;\n return _this;\n }\n /**\n * @internal\n */\n HashContainer.prototype._eraseNode = function (node) {\n var _pre = node._pre, _next = node._next;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n };\n /**\n * @internal\n */\n HashContainer.prototype._set = function (key, value, isObject) {\n if (isObject === undefined)\n isObject = checkObject(key);\n var newTail;\n if (isObject) {\n var index = key[this.HASH_TAG];\n if (index !== undefined) {\n this._objMap[index]._value = value;\n return this._length;\n }\n Object.defineProperty(key, this.HASH_TAG, {\n value: this._objMap.length,\n configurable: true\n });\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._objMap.push(newTail);\n }\n else {\n var node = this._originMap[key];\n if (node) {\n node._value = value;\n return this._length;\n }\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._originMap[key] = newTail;\n }\n if (this._length === 0) {\n this._head = newTail;\n this._header._next = newTail;\n }\n else {\n this._tail._next = newTail;\n }\n this._tail = newTail;\n this._header._pre = newTail;\n return ++this._length;\n };\n /**\n * @internal\n */\n HashContainer.prototype._findElementNode = function (key, isObject) {\n if (isObject === undefined)\n isObject = checkObject(key);\n if (isObject) {\n var index = key[this.HASH_TAG];\n if (index === undefined)\n return this._header;\n return this._objMap[index];\n }\n else {\n return this._originMap[key] || this._header;\n }\n };\n HashContainer.prototype.clear = function () {\n var HASH_TAG = this.HASH_TAG;\n this._objMap.forEach(function (el) {\n delete el._key[HASH_TAG];\n });\n this._objMap = [];\n this._originMap = {};\n Object.setPrototypeOf(this._originMap, null);\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n };\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns Whether erase successfully.\n */\n HashContainer.prototype.eraseElementByKey = function (key, isObject) {\n var node;\n if (isObject === undefined)\n isObject = checkObject(key);\n if (isObject) {\n var index = key[this.HASH_TAG];\n if (index === undefined)\n return false;\n delete key[this.HASH_TAG];\n node = this._objMap[index];\n delete this._objMap[index];\n }\n else {\n node = this._originMap[key];\n if (node === undefined)\n return false;\n delete this._originMap[key];\n }\n this._eraseNode(node);\n return true;\n };\n HashContainer.prototype.eraseElementByIterator = function (iter) {\n var node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n this._eraseNode(node);\n return iter.next();\n };\n HashContainer.prototype.eraseElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var node = this._head;\n while (pos--) {\n node = node._next;\n }\n this._eraseNode(node);\n return this._length;\n };\n return HashContainer;\n}(Container));\nexport { HashContainer };\n","import { Container, ContainerIterator, IteratorType } from '@/container/ContainerBase';\nimport checkObject from '@/utils/checkObject';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nexport type HashLinkNode = {\n _key: K,\n _value: V,\n _pre: HashLinkNode,\n _next: HashLinkNode\n}\n\nexport abstract class HashContainerIterator extends ContainerIterator {\n abstract readonly container: HashContainer;\n /**\n * @internal\n */\n _node: HashLinkNode;\n /**\n * @internal\n */\n protected readonly _header: HashLinkNode;\n /**\n * @internal\n */\n protected constructor(\n node: HashLinkNode,\n header: HashLinkNode,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = node;\n this._header = header;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n }\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n\nexport abstract class HashContainer extends Container {\n /**\n * @internal\n */\n protected _objMap: HashLinkNode[] = [];\n /**\n * @internal\n */\n protected _originMap: Record> = {};\n /**\n * @internal\n */\n protected _head: HashLinkNode;\n /**\n * @internal\n */\n protected _tail: HashLinkNode;\n /**\n * @internal\n */\n protected readonly _header: HashLinkNode;\n /**\n * @description Unique symbol used to tag object.\n */\n readonly HASH_TAG = Symbol('@@HASH_TAG');\n /**\n * @internal\n */\n protected constructor() {\n super();\n Object.setPrototypeOf(this._originMap, null);\n this._header = >{};\n this._header._pre = this._header._next = this._head = this._tail = this._header;\n }\n /**\n * @internal\n */\n protected _eraseNode(node: HashLinkNode) {\n const { _pre, _next } = node;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n }\n /**\n * @internal\n */\n protected _set(key: K, value?: V, isObject?: boolean) {\n if (isObject === undefined) isObject = checkObject(key);\n let newTail;\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n if (index !== undefined) {\n this._objMap[index]._value = value;\n return this._length;\n }\n Object.defineProperty(key, this.HASH_TAG, {\n value: this._objMap.length,\n configurable: true\n });\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._objMap.push(newTail);\n } else {\n const node = this._originMap[key];\n if (node) {\n node._value = value;\n return this._length;\n }\n newTail = {\n _key: key,\n _value: value,\n _pre: this._tail,\n _next: this._header\n };\n this._originMap[key] = newTail;\n }\n if (this._length === 0) {\n this._head = newTail;\n this._header._next = newTail;\n } else {\n this._tail._next = newTail;\n }\n this._tail = newTail;\n this._header._pre = newTail;\n return ++this._length;\n }\n /**\n * @internal\n */\n protected _findElementNode(key: K, isObject?: boolean) {\n if (isObject === undefined) isObject = checkObject(key);\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n if (index === undefined) return this._header;\n return this._objMap[index];\n } else {\n return this._originMap[key] || this._header;\n }\n }\n clear() {\n const HASH_TAG = this.HASH_TAG;\n this._objMap.forEach(function (el) {\n delete (>el._key)[HASH_TAG];\n });\n this._objMap = [];\n this._originMap = {};\n Object.setPrototypeOf(this._originMap, null);\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n }\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns Whether erase successfully.\n */\n eraseElementByKey(key: K, isObject?: boolean) {\n let node;\n if (isObject === undefined) isObject = checkObject(key);\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n if (index === undefined) return false;\n delete (>key)[this.HASH_TAG];\n node = this._objMap[index];\n delete this._objMap[index];\n } else {\n node = this._originMap[key];\n if (node === undefined) return false;\n delete this._originMap[key];\n }\n this._eraseNode(node);\n return true;\n }\n eraseElementByIterator(iter: HashContainerIterator) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n this._eraseNode(node);\n return iter.next();\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n this._eraseNode(node);\n return this._length;\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts new file mode 100644 index 000000000..1b78025bc --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts @@ -0,0 +1,49 @@ +import { initContainer, IteratorType } from "../ContainerBase"; +import { HashContainer, HashContainerIterator, HashLinkNode } from "./Base"; +declare class HashMapIterator extends HashContainerIterator { + readonly container: HashMap; + constructor(node: HashLinkNode, header: HashLinkNode, container: HashMap, iteratorType?: IteratorType); + get pointer(): [K, V]; + copy(): HashMapIterator; + equals(iter: HashMapIterator): boolean; +} +export type { HashMapIterator }; +declare class HashMap extends HashContainer { + constructor(container?: initContainer<[K, V]>); + begin(): HashMapIterator; + end(): HashMapIterator; + rBegin(): HashMapIterator; + rEnd(): HashMapIterator; + front(): [K, V] | undefined; + back(): [K, V] | undefined; + /** + * @description Insert a key-value pair or set value by the given key. + * @param key - The key want to insert. + * @param value - The value want to set. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns The size of container after setting. + */ + setElement(key: K, value: V, isObject?: boolean): number; + /** + * @description Get the value of the element of the specified key. + * @param key - The key want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @example + * const val = container.getElementByKey(1); + */ + getElementByKey(key: K, isObject?: boolean): V | undefined; + getElementByPos(pos: number): [K, V]; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ + find(key: K, isObject?: boolean): HashMapIterator; + forEach(callback: (element: [K, V], index: number, hashMap: HashMap) => void): void; + [Symbol.iterator](): Generator<[K, V], void, unknown>; +} +export default HashMap; diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js new file mode 100644 index 000000000..af08bfb77 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js @@ -0,0 +1,248 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, r) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, r) { + t.__proto__ = r; + } || function(t, r) { + for (var n in r) if (Object.prototype.hasOwnProperty.call(r, n)) t[n] = r[n]; + }; + return extendStatics(t, r); + }; + return function(t, r) { + if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); + extendStatics(t, r); + function __() { + this.constructor = t; + } + t.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(t, r) { + var n = { + label: 0, + sent: function() { + if (a[0] & 1) throw a[1]; + return a[1]; + }, + trys: [], + ops: [] + }, e, i, a, s; + return s = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (s[Symbol.iterator] = function() { + return this; + }), s; + function verb(t) { + return function(r) { + return step([ t, r ]); + }; + } + function step(s) { + if (e) throw new TypeError("Generator is already executing."); + while (n) try { + if (e = 1, i && (a = s[0] & 2 ? i["return"] : s[0] ? i["throw"] || ((a = i["return"]) && a.call(i), + 0) : i.next) && !(a = a.call(i, s[1])).done) return a; + if (i = 0, a) s = [ s[0] & 2, a.value ]; + switch (s[0]) { + case 0: + case 1: + a = s; + break; + + case 4: + n.label++; + return { + value: s[1], + done: false + }; + + case 5: + n.label++; + i = s[1]; + s = [ 0 ]; + continue; + + case 7: + s = n.ops.pop(); + n.trys.pop(); + continue; + + default: + if (!(a = n.trys, a = a.length > 0 && a[a.length - 1]) && (s[0] === 6 || s[0] === 2)) { + n = 0; + continue; + } + if (s[0] === 3 && (!a || s[1] > a[0] && s[1] < a[3])) { + n.label = s[1]; + break; + } + if (s[0] === 6 && n.label < a[1]) { + n.label = a[1]; + a = s; + break; + } + if (a && n.label < a[2]) { + n.label = a[2]; + n.ops.push(s); + break; + } + if (a[2]) n.ops.pop(); + n.trys.pop(); + continue; + } + s = r.call(t, n); + } catch (t) { + s = [ 6, t ]; + i = 0; + } finally { + e = a = 0; + } + if (s[0] & 5) throw s[1]; + return { + value: s[0] ? s[1] : void 0, + done: true + }; + } +}; + +import { HashContainer, HashContainerIterator } from "./Base"; + +import checkObject from "../../utils/checkObject"; + +import { throwIteratorAccessError } from "../../utils/throwError"; + +var HashMapIterator = function(t) { + __extends(HashMapIterator, t); + function HashMapIterator(r, n, e, i) { + var a = t.call(this, r, n, i) || this; + a.container = e; + return a; + } + Object.defineProperty(HashMapIterator.prototype, "pointer", { + get: function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + var t = this; + return new Proxy([], { + get: function(r, n) { + if (n === "0") return t.o.u; else if (n === "1") return t.o.p; + }, + set: function(r, n, e) { + if (n !== "1") { + throw new TypeError("props must be 1"); + } + t.o.p = e; + return true; + } + }); + }, + enumerable: false, + configurable: true + }); + HashMapIterator.prototype.copy = function() { + return new HashMapIterator(this.o, this.h, this.container, this.iteratorType); + }; + return HashMapIterator; +}(HashContainerIterator); + +var HashMap = function(t) { + __extends(HashMap, t); + function HashMap(r) { + if (r === void 0) { + r = []; + } + var n = t.call(this) || this; + var e = n; + r.forEach((function(t) { + e.setElement(t[0], t[1]); + })); + return n; + } + HashMap.prototype.begin = function() { + return new HashMapIterator(this.H, this.h, this); + }; + HashMap.prototype.end = function() { + return new HashMapIterator(this.h, this.h, this); + }; + HashMap.prototype.rBegin = function() { + return new HashMapIterator(this.l, this.h, this, 1); + }; + HashMap.prototype.rEnd = function() { + return new HashMapIterator(this.h, this.h, this, 1); + }; + HashMap.prototype.front = function() { + if (this.M === 0) return; + return [ this.H.u, this.H.p ]; + }; + HashMap.prototype.back = function() { + if (this.M === 0) return; + return [ this.l.u, this.l.p ]; + }; + HashMap.prototype.setElement = function(t, r, n) { + return this.v(t, r, n); + }; + HashMap.prototype.getElementByKey = function(t, r) { + if (r === undefined) r = checkObject(t); + if (r) { + var n = t[this.HASH_TAG]; + return n !== undefined ? this._[n].p : undefined; + } + var e = this.I[t]; + return e ? e.p : undefined; + }; + HashMap.prototype.getElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var r = this.H; + while (t--) { + r = r.m; + } + return [ r.u, r.p ]; + }; + HashMap.prototype.find = function(t, r) { + var n = this.g(t, r); + return new HashMapIterator(n, this.h, this); + }; + HashMap.prototype.forEach = function(t) { + var r = 0; + var n = this.H; + while (n !== this.h) { + t([ n.u, n.p ], r++, this); + n = n.m; + } + }; + HashMap.prototype[Symbol.iterator] = function() { + return function() { + var t; + return __generator(this, (function(r) { + switch (r.label) { + case 0: + t = this.H; + r.label = 1; + + case 1: + if (!(t !== this.h)) return [ 3, 3 ]; + return [ 4, [ t.u, t.p ] ]; + + case 2: + r.sent(); + t = t.m; + return [ 3, 1 ]; + + case 3: + return [ 2 ]; + } + })); + }.bind(this)(); + }; + return HashMap; +}(HashContainer); + +export default HashMap; +//# sourceMappingURL=HashMap.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js.map b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js.map new file mode 100644 index 000000000..a05850014 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/HashContainer/HashMap.js","../../src/container/HashContainer/HashMap.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","HashContainer","HashContainerIterator","checkObject","throwIteratorAccessError","HashMapIterator","_super","node","header","container","iteratorType","_this","defineProperty","get","_node","_header","self","Proxy","props","_key","_value","set","newValue","enumerable","configurable","copy","HashMap","forEach","el","setElement","begin","_head","end","rBegin","_tail","rEnd","front","_length","back","key","isObject","_set","getElementByKey","undefined","index","HASH_TAG","_objMap","_originMap","getElementByPos","pos","RangeError","_next","find","_findElementNode","callback","_a","bind"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;AAe7C,IAAIG,cAAejB,QAAQA,KAAKiB,KAAgB,SAAUC,GAASC;IAC/D,IAAIC,IAAI;QAAEC,OAAO;QAAGC,MAAM;YAAa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YAAR;QACE,OAAO;YD+CC,IAAIiB;YACJ,OAAOlC,YAAYjB,OAAM,SAAUmG;gBAC/B,QAAQA,EAAG9E;kBACP,KAAK;oBCjDf8B,IAAOnD,KAAK2E;oBDmDEwB,EAAG9E,QAAQ;;kBACf,KAAK;oBACD,MCpDX8B,MAASnD,KAAK2D,IAAO,OAAA,EAAA,GAAA;oBAC1B,OAAA,EAAA,GAAc,EAACR,EAAKY,GAAMZ,EAAKa;;kBDqDnB,KAAK;oBCrDjBmC,EAAA7E;oBACA6B,IAAOA,EAAK4C;oBDuDI,OAAO,EAAC,GAAa;;kBACzB,KAAK;oBAAG,OAAO,EAAC;;AAExB;AACJ,UCzDFK,KAAKpG,KANA;ADgEP;ICxDJ,OAAAsE;AAAA,CA5FA,CAA4BzB;;eA8FbyB","file":"HashMap.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { HashContainer, HashContainerIterator } from \"./Base\";\nimport checkObject from \"../../utils/checkObject\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nvar HashMapIterator = /** @class */ (function (_super) {\n __extends(HashMapIterator, _super);\n function HashMapIterator(node, header, container, iteratorType) {\n var _this = _super.call(this, node, header, iteratorType) || this;\n _this.container = container;\n return _this;\n }\n Object.defineProperty(HashMapIterator.prototype, \"pointer\", {\n get: function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n var self = this;\n return new Proxy([], {\n get: function (_, props) {\n if (props === '0')\n return self._node._key;\n else if (props === '1')\n return self._node._value;\n },\n set: function (_, props, newValue) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n },\n enumerable: false,\n configurable: true\n });\n HashMapIterator.prototype.copy = function () {\n return new HashMapIterator(this._node, this._header, this.container, this.iteratorType);\n };\n return HashMapIterator;\n}(HashContainerIterator));\nvar HashMap = /** @class */ (function (_super) {\n __extends(HashMap, _super);\n function HashMap(container) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this) || this;\n var self = _this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n return _this;\n }\n HashMap.prototype.begin = function () {\n return new HashMapIterator(this._head, this._header, this);\n };\n HashMap.prototype.end = function () {\n return new HashMapIterator(this._header, this._header, this);\n };\n HashMap.prototype.rBegin = function () {\n return new HashMapIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n HashMap.prototype.rEnd = function () {\n return new HashMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n HashMap.prototype.front = function () {\n if (this._length === 0)\n return;\n return [this._head._key, this._head._value];\n };\n HashMap.prototype.back = function () {\n if (this._length === 0)\n return;\n return [this._tail._key, this._tail._value];\n };\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after setting.\n */\n HashMap.prototype.setElement = function (key, value, isObject) {\n return this._set(key, value, isObject);\n };\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The key want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @example\n * const val = container.getElementByKey(1);\n */\n HashMap.prototype.getElementByKey = function (key, isObject) {\n if (isObject === undefined)\n isObject = checkObject(key);\n if (isObject) {\n var index = key[this.HASH_TAG];\n return index !== undefined ? this._objMap[index]._value : undefined;\n }\n var node = this._originMap[key];\n return node ? node._value : undefined;\n };\n HashMap.prototype.getElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var node = this._head;\n while (pos--) {\n node = node._next;\n }\n return [node._key, node._value];\n };\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n HashMap.prototype.find = function (key, isObject) {\n var node = this._findElementNode(key, isObject);\n return new HashMapIterator(node, this._header, this);\n };\n HashMap.prototype.forEach = function (callback) {\n var index = 0;\n var node = this._head;\n while (node !== this._header) {\n callback([node._key, node._value], index++, this);\n node = node._next;\n }\n };\n HashMap.prototype[Symbol.iterator] = function () {\n return function () {\n var node;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n node = this._head;\n _a.label = 1;\n case 1:\n if (!(node !== this._header)) return [3 /*break*/, 3];\n return [4 /*yield*/, [node._key, node._value]];\n case 2:\n _a.sent();\n node = node._next;\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n }.bind(this)();\n };\n return HashMap;\n}(HashContainer));\nexport default HashMap;\n","import { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { HashContainer, HashContainerIterator, HashLinkNode } from '@/container/HashContainer/Base';\nimport checkObject from '@/utils/checkObject';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass HashMapIterator extends HashContainerIterator {\n readonly container: HashMap;\n constructor(\n node: HashLinkNode,\n header: HashLinkNode,\n container: HashMap,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n const self = this;\n return new Proxy(<[K, V]>[], {\n get(_, props: '0' | '1') {\n if (props === '0') return self._node._key;\n else if (props === '1') return self._node._value;\n },\n set(_, props: '1', newValue: V) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n }\n copy() {\n return new HashMapIterator(this._node, this._header, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: HashMapIterator): boolean;\n}\n\nexport type { HashMapIterator };\n\nclass HashMap extends HashContainer {\n constructor(container: initContainer<[K, V]> = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n }\n begin() {\n return new HashMapIterator(this._head, this._header, this);\n }\n end() {\n return new HashMapIterator(this._header, this._header, this);\n }\n rBegin() {\n return new HashMapIterator(this._tail, this._header, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new HashMapIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front() {\n if (this._length === 0) return;\n return <[K, V]>[this._head._key, this._head._value];\n }\n back() {\n if (this._length === 0) return;\n return <[K, V]>[this._tail._key, this._tail._value];\n }\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after setting.\n */\n setElement(key: K, value: V, isObject?: boolean) {\n return this._set(key, value, isObject);\n }\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The key want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @example\n * const val = container.getElementByKey(1);\n */\n getElementByKey(key: K, isObject?: boolean) {\n if (isObject === undefined) isObject = checkObject(key);\n if (isObject) {\n const index = (>key)[this.HASH_TAG];\n return index !== undefined ? this._objMap[index]._value : undefined;\n }\n const node = this._originMap[key];\n return node ? node._value : undefined;\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n return <[K, V]>[node._key, node._value];\n }\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n find(key: K, isObject?: boolean) {\n const node = this._findElementNode(key, isObject);\n return new HashMapIterator(node, this._header, this);\n }\n forEach(callback: (element: [K, V], index: number, hashMap: HashMap) => void) {\n let index = 0;\n let node = this._head;\n while (node !== this._header) {\n callback(<[K, V]>[node._key, node._value], index++, this);\n node = node._next;\n }\n }\n [Symbol.iterator]() {\n return function * (this: HashMap) {\n let node = this._head;\n while (node !== this._header) {\n yield <[K, V]>[node._key, node._value];\n node = node._next;\n }\n }.bind(this)();\n }\n}\n\nexport default HashMap;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts new file mode 100644 index 000000000..345fe5ab5 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts @@ -0,0 +1,39 @@ +import { initContainer, IteratorType } from "../ContainerBase"; +import { HashContainer, HashContainerIterator, HashLinkNode } from "./Base"; +declare class HashSetIterator extends HashContainerIterator { + readonly container: HashSet; + constructor(node: HashLinkNode, header: HashLinkNode, container: HashSet, iteratorType?: IteratorType); + get pointer(): K; + copy(): HashSetIterator; + equals(iter: HashSetIterator): boolean; +} +export type { HashSetIterator }; +declare class HashSet extends HashContainer { + constructor(container?: initContainer); + begin(): HashSetIterator; + end(): HashSetIterator; + rBegin(): HashSetIterator; + rEnd(): HashSetIterator; + front(): K | undefined; + back(): K | undefined; + /** + * @description Insert element to set. + * @param key - The key want to insert. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns The size of container after inserting. + */ + insert(key: K, isObject?: boolean): number; + getElementByPos(pos: number): K; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ + find(key: K, isObject?: boolean): HashSetIterator; + forEach(callback: (element: K, index: number, container: HashSet) => void): void; + [Symbol.iterator](): Generator; +} +export default HashSet; diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js new file mode 100644 index 000000000..df0565855 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js @@ -0,0 +1,223 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, r) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, r) { + t.__proto__ = r; + } || function(t, r) { + for (var e in r) if (Object.prototype.hasOwnProperty.call(r, e)) t[e] = r[e]; + }; + return extendStatics(t, r); + }; + return function(t, r) { + if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); + extendStatics(t, r); + function __() { + this.constructor = t; + } + t.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(t, r) { + var e = { + label: 0, + sent: function() { + if (s[0] & 1) throw s[1]; + return s[1]; + }, + trys: [], + ops: [] + }, n, i, s, a; + return a = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (a[Symbol.iterator] = function() { + return this; + }), a; + function verb(t) { + return function(r) { + return step([ t, r ]); + }; + } + function step(a) { + if (n) throw new TypeError("Generator is already executing."); + while (e) try { + if (n = 1, i && (s = a[0] & 2 ? i["return"] : a[0] ? i["throw"] || ((s = i["return"]) && s.call(i), + 0) : i.next) && !(s = s.call(i, a[1])).done) return s; + if (i = 0, s) a = [ a[0] & 2, s.value ]; + switch (a[0]) { + case 0: + case 1: + s = a; + break; + + case 4: + e.label++; + return { + value: a[1], + done: false + }; + + case 5: + e.label++; + i = a[1]; + a = [ 0 ]; + continue; + + case 7: + a = e.ops.pop(); + e.trys.pop(); + continue; + + default: + if (!(s = e.trys, s = s.length > 0 && s[s.length - 1]) && (a[0] === 6 || a[0] === 2)) { + e = 0; + continue; + } + if (a[0] === 3 && (!s || a[1] > s[0] && a[1] < s[3])) { + e.label = a[1]; + break; + } + if (a[0] === 6 && e.label < s[1]) { + e.label = s[1]; + s = a; + break; + } + if (s && e.label < s[2]) { + e.label = s[2]; + e.ops.push(a); + break; + } + if (s[2]) e.ops.pop(); + e.trys.pop(); + continue; + } + a = r.call(t, e); + } catch (t) { + a = [ 6, t ]; + i = 0; + } finally { + n = s = 0; + } + if (a[0] & 5) throw a[1]; + return { + value: a[0] ? a[1] : void 0, + done: true + }; + } +}; + +import { HashContainer, HashContainerIterator } from "./Base"; + +import { throwIteratorAccessError } from "../../utils/throwError"; + +var HashSetIterator = function(t) { + __extends(HashSetIterator, t); + function HashSetIterator(r, e, n, i) { + var s = t.call(this, r, e, i) || this; + s.container = n; + return s; + } + Object.defineProperty(HashSetIterator.prototype, "pointer", { + get: function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + return this.o.u; + }, + enumerable: false, + configurable: true + }); + HashSetIterator.prototype.copy = function() { + return new HashSetIterator(this.o, this.h, this.container, this.iteratorType); + }; + return HashSetIterator; +}(HashContainerIterator); + +var HashSet = function(t) { + __extends(HashSet, t); + function HashSet(r) { + if (r === void 0) { + r = []; + } + var e = t.call(this) || this; + var n = e; + r.forEach((function(t) { + n.insert(t); + })); + return e; + } + HashSet.prototype.begin = function() { + return new HashSetIterator(this.H, this.h, this); + }; + HashSet.prototype.end = function() { + return new HashSetIterator(this.h, this.h, this); + }; + HashSet.prototype.rBegin = function() { + return new HashSetIterator(this.l, this.h, this, 1); + }; + HashSet.prototype.rEnd = function() { + return new HashSetIterator(this.h, this.h, this, 1); + }; + HashSet.prototype.front = function() { + return this.H.u; + }; + HashSet.prototype.back = function() { + return this.l.u; + }; + HashSet.prototype.insert = function(t, r) { + return this.v(t, undefined, r); + }; + HashSet.prototype.getElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var r = this.H; + while (t--) { + r = r.m; + } + return r.u; + }; + HashSet.prototype.find = function(t, r) { + var e = this.g(t, r); + return new HashSetIterator(e, this.h, this); + }; + HashSet.prototype.forEach = function(t) { + var r = 0; + var e = this.H; + while (e !== this.h) { + t(e.u, r++, this); + e = e.m; + } + }; + HashSet.prototype[Symbol.iterator] = function() { + return function() { + var t; + return __generator(this, (function(r) { + switch (r.label) { + case 0: + t = this.H; + r.label = 1; + + case 1: + if (!(t !== this.h)) return [ 3, 3 ]; + return [ 4, t.u ]; + + case 2: + r.sent(); + t = t.m; + return [ 3, 1 ]; + + case 3: + return [ 2 ]; + } + })); + }.bind(this)(); + }; + return HashSet; +}(HashContainer); + +export default HashSet; +//# sourceMappingURL=HashSet.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js.map b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js.map new file mode 100644 index 000000000..5f26e17c4 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/HashContainer/HashSet.js","../../src/container/HashContainer/HashSet.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","HashContainer","HashContainerIterator","throwIteratorAccessError","HashSetIterator","_super","node","header","container","iteratorType","_this","defineProperty","get","_node","_header","_key","enumerable","configurable","copy","HashSet","self","forEach","el","insert","begin","_head","end","rBegin","_tail","rEnd","front","back","key","isObject","_set","undefined","getElementByPos","pos","_length","RangeError","_next","find","_findElementNode","callback","index","_a","bind"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,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C;;AAExB;AACJ,UCpDFM,KAAK1F,KANA;AD2DP;ICnDJ,OAAA+D;AAAA,CAxEA,CAAyBlB;;eA0EVkB","file":"HashSet.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { HashContainer, HashContainerIterator } from \"./Base\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nvar HashSetIterator = /** @class */ (function (_super) {\n __extends(HashSetIterator, _super);\n function HashSetIterator(node, header, container, iteratorType) {\n var _this = _super.call(this, node, header, iteratorType) || this;\n _this.container = container;\n return _this;\n }\n Object.defineProperty(HashSetIterator.prototype, \"pointer\", {\n get: function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key;\n },\n enumerable: false,\n configurable: true\n });\n HashSetIterator.prototype.copy = function () {\n return new HashSetIterator(this._node, this._header, this.container, this.iteratorType);\n };\n return HashSetIterator;\n}(HashContainerIterator));\nvar HashSet = /** @class */ (function (_super) {\n __extends(HashSet, _super);\n function HashSet(container) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this) || this;\n var self = _this;\n container.forEach(function (el) {\n self.insert(el);\n });\n return _this;\n }\n HashSet.prototype.begin = function () {\n return new HashSetIterator(this._head, this._header, this);\n };\n HashSet.prototype.end = function () {\n return new HashSetIterator(this._header, this._header, this);\n };\n HashSet.prototype.rBegin = function () {\n return new HashSetIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n HashSet.prototype.rEnd = function () {\n return new HashSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n HashSet.prototype.front = function () {\n return this._head._key;\n };\n HashSet.prototype.back = function () {\n return this._tail._key;\n };\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after inserting.\n */\n HashSet.prototype.insert = function (key, isObject) {\n return this._set(key, undefined, isObject);\n };\n HashSet.prototype.getElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var node = this._head;\n while (pos--) {\n node = node._next;\n }\n return node._key;\n };\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n HashSet.prototype.find = function (key, isObject) {\n var node = this._findElementNode(key, isObject);\n return new HashSetIterator(node, this._header, this);\n };\n HashSet.prototype.forEach = function (callback) {\n var index = 0;\n var node = this._head;\n while (node !== this._header) {\n callback(node._key, index++, this);\n node = node._next;\n }\n };\n HashSet.prototype[Symbol.iterator] = function () {\n return function () {\n var node;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n node = this._head;\n _a.label = 1;\n case 1:\n if (!(node !== this._header)) return [3 /*break*/, 3];\n return [4 /*yield*/, node._key];\n case 2:\n _a.sent();\n node = node._next;\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n }.bind(this)();\n };\n return HashSet;\n}(HashContainer));\nexport default HashSet;\n","import { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { HashContainer, HashContainerIterator, HashLinkNode } from '@/container/HashContainer/Base';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass HashSetIterator extends HashContainerIterator {\n readonly container: HashSet;\n constructor(\n node: HashLinkNode,\n header: HashLinkNode,\n container: HashSet,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key;\n }\n copy() {\n return new HashSetIterator(this._node, this._header, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: HashSetIterator): boolean;\n}\n\nexport type { HashSetIterator };\n\nclass HashSet extends HashContainer {\n constructor(container: initContainer = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.insert(el);\n });\n }\n begin() {\n return new HashSetIterator(this._head, this._header, this);\n }\n end() {\n return new HashSetIterator(this._header, this._header, this);\n }\n rBegin() {\n return new HashSetIterator(this._tail, this._header, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new HashSetIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front(): K | undefined {\n return this._head._key;\n }\n back(): K | undefined {\n return this._tail._key;\n }\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns The size of container after inserting.\n */\n insert(key: K, isObject?: boolean) {\n return this._set(key, undefined, isObject);\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let node = this._head;\n while (pos--) {\n node = node._next;\n }\n return node._key;\n }\n /**\n * @description Check key if exist in container.\n * @param key - The element you want to search.\n * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
\n * If a `undefined` value is passed in, the type will be automatically judged.\n * @returns An iterator pointing to the element if found, or super end if not found.\n */\n find(key: K, isObject?: boolean) {\n const node = this._findElementNode(key, isObject);\n return new HashSetIterator(node, this._header, this);\n }\n forEach(callback: (element: K, index: number, container: HashSet) => void) {\n let index = 0;\n let node = this._head;\n while (node !== this._header) {\n callback(node._key, index++, this);\n node = node._next;\n }\n }\n [Symbol.iterator]() {\n return function * (this: HashSet) {\n let node = this._head;\n while (node !== this._header) {\n yield node._key;\n node = node._next;\n }\n }.bind(this)();\n }\n}\n\nexport default HashSet;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts b/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts new file mode 100644 index 000000000..8937bef03 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts @@ -0,0 +1,79 @@ +import { Base, initContainer } from "../ContainerBase"; +declare class PriorityQueue extends Base { + /** + * @description PriorityQueue's constructor. + * @param container - Initialize container, must have a forEach function. + * @param cmp - Compare function. + * @param copy - When the container is an array, you can choose to directly operate on the original object of + * the array or perform a shallow copy. The default is shallow copy. + * @example + * new PriorityQueue(); + * new PriorityQueue([1, 2, 3]); + * new PriorityQueue([1, 2, 3], (x, y) => x - y); + * new PriorityQueue([1, 2, 3], (x, y) => x - y, false); + */ + constructor(container?: initContainer, cmp?: (x: T, y: T) => number, copy?: boolean); + clear(): void; + /** + * @description Push element into a container in order. + * @param item - The element you want to push. + * @returns The size of heap after pushing. + * @example + * queue.push(1); + */ + push(item: T): void; + /** + * @description Removes the top element. + * @returns The element you popped. + * @example + * queue.pop(); + */ + pop(): T | undefined; + /** + * @description Accesses the top element. + * @example + * const top = queue.top(); + */ + top(): T | undefined; + /** + * @description Check if element is in heap. + * @param item - The item want to find. + * @returns Whether element is in heap. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * console.log(que.find(obj)); // true + */ + find(item: T): boolean; + /** + * @description Remove specified item from heap. + * @param item - The item want to remove. + * @returns Whether remove success. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * que.remove(obj); + */ + remove(item: T): boolean; + /** + * @description Update item and it's pos in the heap. + * @param item - The item want to update. + * @returns Whether update success. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * obj.id = 2; + * que.updateItem(obj); + */ + updateItem(item: T): boolean; + /** + * @returns Return a copy array of heap. + * @example + * const arr = queue.toArray(); + */ + toArray(): T[]; +} +export default PriorityQueue; diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js b/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js new file mode 100644 index 000000000..54e5f492d --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js @@ -0,0 +1,171 @@ +var __extends = this && this.t || function() { + var extendStatics = function(i, r) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(i, r) { + i.__proto__ = r; + } || function(i, r) { + for (var t in r) if (Object.prototype.hasOwnProperty.call(r, t)) i[t] = r[t]; + }; + return extendStatics(i, r); + }; + return function(i, r) { + if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); + extendStatics(i, r); + function __() { + this.constructor = i; + } + i.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + }; +}(); + +var __read = this && this.q || function(i, r) { + var t = typeof Symbol === "function" && i[Symbol.iterator]; + if (!t) return i; + var e = t.call(i), n, u = [], s; + try { + while ((r === void 0 || r-- > 0) && !(n = e.next()).done) u.push(n.value); + } catch (i) { + s = { + error: i + }; + } finally { + try { + if (n && !n.done && (t = e["return"])) t.call(e); + } finally { + if (s) throw s.error; + } + } + return u; +}; + +var __spreadArray = this && this.D || function(i, r, t) { + if (t || arguments.length === 2) for (var e = 0, n = r.length, u; e < n; e++) { + if (u || !(e in r)) { + if (!u) u = Array.prototype.slice.call(r, 0, e); + u[e] = r[e]; + } + } + return i.concat(u || Array.prototype.slice.call(r)); +}; + +import { Base } from "../ContainerBase"; + +var PriorityQueue = function(i) { + __extends(PriorityQueue, i); + function PriorityQueue(r, t, e) { + if (r === void 0) { + r = []; + } + if (t === void 0) { + t = function(i, r) { + if (i > r) return -1; + if (i < r) return 1; + return 0; + }; + } + if (e === void 0) { + e = true; + } + var n = i.call(this) || this; + n.$ = t; + if (Array.isArray(r)) { + n.ii = e ? __spreadArray([], __read(r), false) : r; + } else { + n.ii = []; + var u = n; + r.forEach((function(i) { + u.ii.push(i); + })); + } + n.M = n.ii.length; + var s = n.M >> 1; + for (var o = n.M - 1 >> 1; o >= 0; --o) { + n.ri(o, s); + } + return n; + } + PriorityQueue.prototype.ti = function(i) { + var r = this.ii[i]; + while (i > 0) { + var t = i - 1 >> 1; + var e = this.ii[t]; + if (this.$(e, r) <= 0) break; + this.ii[i] = e; + i = t; + } + this.ii[i] = r; + }; + PriorityQueue.prototype.ri = function(i, r) { + var t = this.ii[i]; + while (i < r) { + var e = i << 1 | 1; + var n = e + 1; + var u = this.ii[e]; + if (n < this.M && this.$(u, this.ii[n]) > 0) { + e = n; + u = this.ii[n]; + } + if (this.$(u, t) >= 0) break; + this.ii[i] = u; + i = e; + } + this.ii[i] = t; + }; + PriorityQueue.prototype.clear = function() { + this.M = 0; + this.ii.length = 0; + }; + PriorityQueue.prototype.push = function(i) { + this.ii.push(i); + this.ti(this.M); + this.M += 1; + }; + PriorityQueue.prototype.pop = function() { + if (this.M === 0) return; + var i = this.ii[0]; + var r = this.ii.pop(); + this.M -= 1; + if (this.M) { + this.ii[0] = r; + this.ri(0, this.M >> 1); + } + return i; + }; + PriorityQueue.prototype.top = function() { + return this.ii[0]; + }; + PriorityQueue.prototype.find = function(i) { + return this.ii.indexOf(i) >= 0; + }; + PriorityQueue.prototype.remove = function(i) { + var r = this.ii.indexOf(i); + if (r < 0) return false; + if (r === 0) { + this.pop(); + } else if (r === this.M - 1) { + this.ii.pop(); + this.M -= 1; + } else { + this.ii.splice(r, 1, this.ii.pop()); + this.M -= 1; + this.ti(r); + this.ri(r, this.M >> 1); + } + return true; + }; + PriorityQueue.prototype.updateItem = function(i) { + var r = this.ii.indexOf(i); + if (r < 0) return false; + this.ti(r); + this.ri(r, this.M >> 1); + return true; + }; + PriorityQueue.prototype.toArray = function() { + return __spreadArray([], __read(this.ii), false); + }; + return PriorityQueue; +}(Base); + +export default PriorityQueue; +//# sourceMappingURL=PriorityQueue.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js.map b/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js.map new file mode 100644 index 000000000..a1589b8da --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/OtherContainer/PriorityQueue.js","../../src/container/OtherContainer/PriorityQueue.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__read","o","n","m","Symbol","iterator","i","r","ar","e","next","done","push","value","error","__spreadArray","to","from","pack","arguments","length","l","slice","concat","Base","PriorityQueue","_super","container","cmp","copy","x","y","_this","_cmp","isArray","_priorityQueue","self_1","forEach","el","_length","halfLength","parent_1","_pushDown","_pushUp","pos","item","parent_2","parentItem","left","right","minItem","clear","pop","last","top","find","indexOf","remove","index","splice","updateItem","toArray"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;AAe7C,IAAIG,SAAUjB,QAAQA,KAAKiB,KAAW,SAAUC,GAAGC;IAC/C,IAAIC,WAAWC,WAAW,cAAcH,EAAEG,OAAOC;IACjD,KAAKF,GA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K4D,GAAQe;QACb3E,KAAK2D,GAAUgB,GAAO3E,KAAKwD,KAAW;QACtC,OAAO;ADwCP;ICjCFd,cAAAjC,UAAAqE,UAAA;QACE,OAAA9C,cAAA,IAAAf,OAAWjB,KAAKoD,KAAc;ADwC9B;ICtCJ,OAAAV;AAAA,CA9LA,CAA+BD;;eAgMhBC","file":"PriorityQueue.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { Base } from \"../ContainerBase\";\nvar PriorityQueue = /** @class */ (function (_super) {\n __extends(PriorityQueue, _super);\n /**\n * @description PriorityQueue's constructor.\n * @param container - Initialize container, must have a forEach function.\n * @param cmp - Compare function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n * @example\n * new PriorityQueue();\n * new PriorityQueue([1, 2, 3]);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y, false);\n */\n function PriorityQueue(container, cmp, copy) {\n if (container === void 0) { container = []; }\n if (cmp === void 0) { cmp = function (x, y) {\n if (x > y)\n return -1;\n if (x < y)\n return 1;\n return 0;\n }; }\n if (copy === void 0) { copy = true; }\n var _this = _super.call(this) || this;\n _this._cmp = cmp;\n if (Array.isArray(container)) {\n _this._priorityQueue = copy ? __spreadArray([], __read(container), false) : container;\n }\n else {\n _this._priorityQueue = [];\n var self_1 = _this;\n container.forEach(function (el) {\n self_1._priorityQueue.push(el);\n });\n }\n _this._length = _this._priorityQueue.length;\n var halfLength = _this._length >> 1;\n for (var parent_1 = (_this._length - 1) >> 1; parent_1 >= 0; --parent_1) {\n _this._pushDown(parent_1, halfLength);\n }\n return _this;\n }\n /**\n * @internal\n */\n PriorityQueue.prototype._pushUp = function (pos) {\n var item = this._priorityQueue[pos];\n while (pos > 0) {\n var parent_2 = (pos - 1) >> 1;\n var parentItem = this._priorityQueue[parent_2];\n if (this._cmp(parentItem, item) <= 0)\n break;\n this._priorityQueue[pos] = parentItem;\n pos = parent_2;\n }\n this._priorityQueue[pos] = item;\n };\n /**\n * @internal\n */\n PriorityQueue.prototype._pushDown = function (pos, halfLength) {\n var item = this._priorityQueue[pos];\n while (pos < halfLength) {\n var left = pos << 1 | 1;\n var right = left + 1;\n var minItem = this._priorityQueue[left];\n if (right < this._length &&\n this._cmp(minItem, this._priorityQueue[right]) > 0) {\n left = right;\n minItem = this._priorityQueue[right];\n }\n if (this._cmp(minItem, item) >= 0)\n break;\n this._priorityQueue[pos] = minItem;\n pos = left;\n }\n this._priorityQueue[pos] = item;\n };\n PriorityQueue.prototype.clear = function () {\n this._length = 0;\n this._priorityQueue.length = 0;\n };\n /**\n * @description Push element into a container in order.\n * @param item - The element you want to push.\n * @returns The size of heap after pushing.\n * @example\n * queue.push(1);\n */\n PriorityQueue.prototype.push = function (item) {\n this._priorityQueue.push(item);\n this._pushUp(this._length);\n this._length += 1;\n };\n /**\n * @description Removes the top element.\n * @returns The element you popped.\n * @example\n * queue.pop();\n */\n PriorityQueue.prototype.pop = function () {\n if (this._length === 0)\n return;\n var value = this._priorityQueue[0];\n var last = this._priorityQueue.pop();\n this._length -= 1;\n if (this._length) {\n this._priorityQueue[0] = last;\n this._pushDown(0, this._length >> 1);\n }\n return value;\n };\n /**\n * @description Accesses the top element.\n * @example\n * const top = queue.top();\n */\n PriorityQueue.prototype.top = function () {\n return this._priorityQueue[0];\n };\n /**\n * @description Check if element is in heap.\n * @param item - The item want to find.\n * @returns Whether element is in heap.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * console.log(que.find(obj)); // true\n */\n PriorityQueue.prototype.find = function (item) {\n return this._priorityQueue.indexOf(item) >= 0;\n };\n /**\n * @description Remove specified item from heap.\n * @param item - The item want to remove.\n * @returns Whether remove success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * que.remove(obj);\n */\n PriorityQueue.prototype.remove = function (item) {\n var index = this._priorityQueue.indexOf(item);\n if (index < 0)\n return false;\n if (index === 0) {\n this.pop();\n }\n else if (index === this._length - 1) {\n this._priorityQueue.pop();\n this._length -= 1;\n }\n else {\n this._priorityQueue.splice(index, 1, this._priorityQueue.pop());\n this._length -= 1;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n }\n return true;\n };\n /**\n * @description Update item and it's pos in the heap.\n * @param item - The item want to update.\n * @returns Whether update success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * obj.id = 2;\n * que.updateItem(obj);\n */\n PriorityQueue.prototype.updateItem = function (item) {\n var index = this._priorityQueue.indexOf(item);\n if (index < 0)\n return false;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n return true;\n };\n /**\n * @returns Return a copy array of heap.\n * @example\n * const arr = queue.toArray();\n */\n PriorityQueue.prototype.toArray = function () {\n return __spreadArray([], __read(this._priorityQueue), false);\n };\n return PriorityQueue;\n}(Base));\nexport default PriorityQueue;\n","import { Base, initContainer } from '@/container/ContainerBase';\n\nclass PriorityQueue extends Base {\n /**\n * @internal\n */\n private readonly _priorityQueue: T[];\n /**\n * @internal\n */\n private readonly _cmp: (x: T, y: T) => number;\n /**\n * @description PriorityQueue's constructor.\n * @param container - Initialize container, must have a forEach function.\n * @param cmp - Compare function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n * @example\n * new PriorityQueue();\n * new PriorityQueue([1, 2, 3]);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y);\n * new PriorityQueue([1, 2, 3], (x, y) => x - y, false);\n */\n constructor(\n container: initContainer = [],\n cmp: (x: T, y: T) => number =\n function (x: T, y: T) {\n if (x > y) return -1;\n if (x < y) return 1;\n return 0;\n },\n copy = true\n ) {\n super();\n this._cmp = cmp;\n if (Array.isArray(container)) {\n this._priorityQueue = copy ? [...container] : container;\n } else {\n this._priorityQueue = [];\n const self = this;\n container.forEach(function (el) {\n self._priorityQueue.push(el);\n });\n }\n this._length = this._priorityQueue.length;\n const halfLength = this._length >> 1;\n for (let parent = (this._length - 1) >> 1; parent >= 0; --parent) {\n this._pushDown(parent, halfLength);\n }\n }\n /**\n * @internal\n */\n private _pushUp(pos: number) {\n const item = this._priorityQueue[pos];\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const parentItem = this._priorityQueue[parent];\n if (this._cmp(parentItem, item) <= 0) break;\n this._priorityQueue[pos] = parentItem;\n pos = parent;\n }\n this._priorityQueue[pos] = item;\n }\n /**\n * @internal\n */\n private _pushDown(pos: number, halfLength: number) {\n const item = this._priorityQueue[pos];\n while (pos < halfLength) {\n let left = pos << 1 | 1;\n const right = left + 1;\n let minItem = this._priorityQueue[left];\n if (\n right < this._length &&\n this._cmp(minItem, this._priorityQueue[right]) > 0\n ) {\n left = right;\n minItem = this._priorityQueue[right];\n }\n if (this._cmp(minItem, item) >= 0) break;\n this._priorityQueue[pos] = minItem;\n pos = left;\n }\n this._priorityQueue[pos] = item;\n }\n clear() {\n this._length = 0;\n this._priorityQueue.length = 0;\n }\n /**\n * @description Push element into a container in order.\n * @param item - The element you want to push.\n * @returns The size of heap after pushing.\n * @example\n * queue.push(1);\n */\n push(item: T) {\n this._priorityQueue.push(item);\n this._pushUp(this._length);\n this._length += 1;\n }\n /**\n * @description Removes the top element.\n * @returns The element you popped.\n * @example\n * queue.pop();\n */\n pop() {\n if (this._length === 0) return;\n const value = this._priorityQueue[0];\n const last = this._priorityQueue.pop()!;\n this._length -= 1;\n if (this._length) {\n this._priorityQueue[0] = last;\n this._pushDown(0, this._length >> 1);\n }\n return value;\n }\n /**\n * @description Accesses the top element.\n * @example\n * const top = queue.top();\n */\n top(): T | undefined {\n return this._priorityQueue[0];\n }\n /**\n * @description Check if element is in heap.\n * @param item - The item want to find.\n * @returns Whether element is in heap.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * console.log(que.find(obj)); // true\n */\n find(item: T) {\n return this._priorityQueue.indexOf(item) >= 0;\n }\n /**\n * @description Remove specified item from heap.\n * @param item - The item want to remove.\n * @returns Whether remove success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * que.remove(obj);\n */\n remove(item: T) {\n const index = this._priorityQueue.indexOf(item);\n if (index < 0) return false;\n if (index === 0) {\n this.pop();\n } else if (index === this._length - 1) {\n this._priorityQueue.pop();\n this._length -= 1;\n } else {\n this._priorityQueue.splice(index, 1, this._priorityQueue.pop()!);\n this._length -= 1;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n }\n return true;\n }\n /**\n * @description Update item and it's pos in the heap.\n * @param item - The item want to update.\n * @returns Whether update success.\n * @example\n * const que = new PriorityQueue([], (x, y) => x.id - y.id);\n * const obj = { id: 1 };\n * que.push(obj);\n * obj.id = 2;\n * que.updateItem(obj);\n */\n updateItem(item: T) {\n const index = this._priorityQueue.indexOf(item);\n if (index < 0) return false;\n this._pushUp(index);\n this._pushDown(index, this._length >> 1);\n return true;\n }\n /**\n * @returns Return a copy array of heap.\n * @example\n * const arr = queue.toArray();\n */\n toArray() {\n return [...this._priorityQueue];\n }\n}\n\nexport default PriorityQueue;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts new file mode 100644 index 000000000..8df4e1740 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts @@ -0,0 +1,22 @@ +import { Base, initContainer } from "../ContainerBase"; +declare class Queue extends Base { + constructor(container?: initContainer); + clear(): void; + /** + * @description Inserts element to queue's end. + * @param element - The element you want to push to the front. + * @returns The container length after pushing. + */ + push(element: T): number; + /** + * @description Removes the first element. + * @returns The element you popped. + */ + pop(): T | undefined; + /** + * @description Access the first element. + * @returns The first element. + */ + front(): T | undefined; +} +export default Queue; diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js new file mode 100644 index 000000000..9d8e96587 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js @@ -0,0 +1,69 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, i) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, i) { + t.__proto__ = i; + } || function(t, i) { + for (var n in i) if (Object.prototype.hasOwnProperty.call(i, n)) t[n] = i[n]; + }; + return extendStatics(t, i); + }; + return function(t, i) { + if (typeof i !== "function" && i !== null) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); + extendStatics(t, i); + function __() { + this.constructor = t; + } + t.prototype = i === null ? Object.create(i) : (__.prototype = i.prototype, new __); + }; +}(); + +import { Base } from "../ContainerBase"; + +var Queue = function(t) { + __extends(Queue, t); + function Queue(i) { + if (i === void 0) { + i = []; + } + var n = t.call(this) || this; + n.A = 0; + n.tt = []; + var e = n; + i.forEach((function(t) { + e.push(t); + })); + return n; + } + Queue.prototype.clear = function() { + this.tt = []; + this.M = this.A = 0; + }; + Queue.prototype.push = function(t) { + var i = this.tt.length; + if (this.A / i > .5 && this.A + this.M >= i && i > 4096) { + var n = this.M; + for (var e = 0; e < n; ++e) { + this.tt[e] = this.tt[this.A + e]; + } + this.A = 0; + this.tt[this.M] = t; + } else this.tt[this.A + this.M] = t; + return ++this.M; + }; + Queue.prototype.pop = function() { + if (this.M === 0) return; + var t = this.tt[this.A++]; + this.M -= 1; + return t; + }; + Queue.prototype.front = function() { + if (this.M === 0) return; + return this.tt[this.A]; + }; + return Queue; +}(Base); + +export default Queue; +//# sourceMappingURL=Queue.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js.map b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js.map new file mode 100644 index 000000000..9a6889d0f --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/OtherContainer/Queue.js","../../src/container/OtherContainer/Queue.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","Base","Queue","_super","container","_this","_first","_queue","self","forEach","el","push","clear","_length","element","capacity","length","length_1","i","pop","front"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,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YACdtB,KAAKuB,GAAOvB,KAAK6B,KAAWC;ADW1B,eCVG9B,KAAKuB,GAAOvB,KAAKsB,IAAStB,KAAK6B,KAAWC;QACjD,SAAS9B,KAAK6B;ADad;ICPFX,MAAAT,UAAA0B,MAAA;QACE,IAAInC,KAAK6B,MAAY,GAAG;QACxB,IAAMH,IAAK1B,KAAKuB,GAAOvB,KAAKsB;QAC5BtB,KAAK6B,KAAW;QAChB,OAAOH;ADcP;ICRFR,MAAAT,UAAA2B,QAAA;QACE,IAAIpC,KAAK6B,MAAY,GAAG;QACxB,OAAO7B,KAAKuB,GAAOvB,KAAKsB;ADexB;ICbJ,OAAAJ;AAAA,CA3DA,CAAuBD;;eA6DRC","file":"Queue.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Base } from \"../ContainerBase\";\nvar Queue = /** @class */ (function (_super) {\n __extends(Queue, _super);\n function Queue(container) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n _this._first = 0;\n /**\n * @internal\n */\n _this._queue = [];\n var self = _this;\n container.forEach(function (el) {\n self.push(el);\n });\n return _this;\n }\n Queue.prototype.clear = function () {\n this._queue = [];\n this._length = this._first = 0;\n };\n /**\n * @description Inserts element to queue's end.\n * @param element - The element you want to push to the front.\n * @returns The container length after pushing.\n */\n Queue.prototype.push = function (element) {\n var capacity = this._queue.length;\n if ((this._first / capacity) > 0.5 /* QUEUE_CONSTANT.ALLOCATE_SIGMA */ &&\n (this._first + this._length) >= capacity &&\n capacity > 4096 /* QUEUE_CONSTANT.MIN_ALLOCATE_SIZE */) {\n var length_1 = this._length;\n for (var i = 0; i < length_1; ++i) {\n this._queue[i] = this._queue[this._first + i];\n }\n this._first = 0;\n this._queue[this._length] = element;\n }\n else\n this._queue[this._first + this._length] = element;\n return ++this._length;\n };\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n Queue.prototype.pop = function () {\n if (this._length === 0)\n return;\n var el = this._queue[this._first++];\n this._length -= 1;\n return el;\n };\n /**\n * @description Access the first element.\n * @returns The first element.\n */\n Queue.prototype.front = function () {\n if (this._length === 0)\n return;\n return this._queue[this._first];\n };\n return Queue;\n}(Base));\nexport default Queue;\n","import { Base, initContainer } from '@/container/ContainerBase';\n\nconst enum QUEUE_CONSTANT {\n ALLOCATE_SIGMA = 0.5,\n MIN_ALLOCATE_SIZE = (1 << 12)\n}\n\nclass Queue extends Base {\n /**\n * @internal\n */\n private _first = 0;\n /**\n * @internal\n */\n private _queue: T[] = [];\n constructor(container: initContainer = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.push(el);\n });\n }\n clear() {\n this._queue = [];\n this._length = this._first = 0;\n }\n /**\n * @description Inserts element to queue's end.\n * @param element - The element you want to push to the front.\n * @returns The container length after pushing.\n */\n push(element: T) {\n const capacity = this._queue.length;\n if (\n (this._first / capacity) > QUEUE_CONSTANT.ALLOCATE_SIGMA &&\n (this._first + this._length) >= capacity &&\n capacity > QUEUE_CONSTANT.MIN_ALLOCATE_SIZE\n ) {\n const length = this._length;\n for (let i = 0; i < length; ++i) {\n this._queue[i] = this._queue[this._first + i];\n }\n this._first = 0;\n this._queue[this._length] = element;\n } else this._queue[this._first + this._length] = element;\n return ++this._length;\n }\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n pop() {\n if (this._length === 0) return;\n const el = this._queue[this._first++];\n this._length -= 1;\n return el;\n }\n /**\n * @description Access the first element.\n * @returns The first element.\n */\n front(): T | undefined {\n if (this._length === 0) return;\n return this._queue[this._first];\n }\n}\n\nexport default Queue;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts new file mode 100644 index 000000000..3b8fac177 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts @@ -0,0 +1,22 @@ +import { Base, initContainer } from "../ContainerBase"; +declare class Stack extends Base { + constructor(container?: initContainer); + clear(): void; + /** + * @description Insert element to stack's end. + * @description The element you want to push to the back. + * @returns The container length after erasing. + */ + push(element: T): number; + /** + * @description Removes the end element. + * @returns The element you popped. + */ + pop(): T | undefined; + /** + * @description Accesses the end element. + * @returns The last element. + */ + top(): T | undefined; +} +export default Stack; diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js new file mode 100644 index 000000000..a7cd3bddc --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js @@ -0,0 +1,59 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, n) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, n) { + t.__proto__ = n; + } || function(t, n) { + for (var i in n) if (Object.prototype.hasOwnProperty.call(n, i)) t[i] = n[i]; + }; + return extendStatics(t, n); + }; + return function(t, n) { + if (typeof n !== "function" && n !== null) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); + extendStatics(t, n); + function __() { + this.constructor = t; + } + t.prototype = n === null ? Object.create(n) : (__.prototype = n.prototype, new __); + }; +}(); + +import { Base } from "../ContainerBase"; + +var Stack = function(t) { + __extends(Stack, t); + function Stack(n) { + if (n === void 0) { + n = []; + } + var i = t.call(this) || this; + i.nt = []; + var r = i; + n.forEach((function(t) { + r.push(t); + })); + return i; + } + Stack.prototype.clear = function() { + this.M = 0; + this.nt = []; + }; + Stack.prototype.push = function(t) { + this.nt.push(t); + this.M += 1; + return this.M; + }; + Stack.prototype.pop = function() { + if (this.M === 0) return; + this.M -= 1; + return this.nt.pop(); + }; + Stack.prototype.top = function() { + return this.nt[this.M - 1]; + }; + return Stack; +}(Base); + +export default Stack; +//# sourceMappingURL=Stack.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js.map b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js.map new file mode 100644 index 000000000..c15b4f13b --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/OtherContainer/Stack.js","../../src/container/OtherContainer/Stack.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","Base","Stack","_super","container","_this","_stack","self","forEach","el","push","clear","_length","element","pop","top"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;SCApCG,YAAqB;;AAE9B,IAAAC,QAAA,SAAAC;IAAuBpB,UAAAmB,OAAAC;IAKrB,SAAAD,MAAYE;QAAA,IAAAA,WAAA,GAAA;YAAAA,IAAA;AAAgC;QAA5C,IAAAC,IACEF,EAAAR,KAAAX,SAAOA;QAFDqB,EAAAC,KAAc;QAGpB,IAAMC,IAAOF;QACbD,EAAUI,SAAQ,SAAUC;YAC1BF,EAAKG,KAAKD;ADiBR;QACA,OAAOJ;AACX;IChBFH,MAAAT,UAAAkB,QAAA;QACE3B,KAAK4B,IAAU;QACf5B,KAAKsB,KAAS;ADkBd;ICXFJ,MAAAT,UAAAiB,OAAA,SAAKG;QACH7B,KAAKsB,GAAOI,KAAKG;QACjB7B,KAAK4B,KAAW;QAChB,OAAO5B,KAAK4B;ADkBZ;ICZFV,MAAAT,UAAAqB,MAAA;QACE,IAAI9B,KAAK4B,MAAY,GAAG;QACxB5B,KAAK4B,KAAW;QAChB,OAAO5B,KAAKsB,GAAOQ;ADmBnB;ICbFZ,MAAAT,UAAAsB,MAAA;QACE,OAAO/B,KAAKsB,GAAOtB,KAAK4B,IAAU;ADmBlC;ICjBJ,OAAAV;AAAA,CA1CA,CAAuBD;;eA4CRC","file":"Stack.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Base } from \"../ContainerBase\";\nvar Stack = /** @class */ (function (_super) {\n __extends(Stack, _super);\n function Stack(container) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n _this._stack = [];\n var self = _this;\n container.forEach(function (el) {\n self.push(el);\n });\n return _this;\n }\n Stack.prototype.clear = function () {\n this._length = 0;\n this._stack = [];\n };\n /**\n * @description Insert element to stack's end.\n * @description The element you want to push to the back.\n * @returns The container length after erasing.\n */\n Stack.prototype.push = function (element) {\n this._stack.push(element);\n this._length += 1;\n return this._length;\n };\n /**\n * @description Removes the end element.\n * @returns The element you popped.\n */\n Stack.prototype.pop = function () {\n if (this._length === 0)\n return;\n this._length -= 1;\n return this._stack.pop();\n };\n /**\n * @description Accesses the end element.\n * @returns The last element.\n */\n Stack.prototype.top = function () {\n return this._stack[this._length - 1];\n };\n return Stack;\n}(Base));\nexport default Stack;\n","import { Base, initContainer } from '@/container/ContainerBase';\n\nclass Stack extends Base {\n /**\n * @internal\n */\n private _stack: T[] = [];\n constructor(container: initContainer = []) {\n super();\n const self = this;\n container.forEach(function (el) {\n self.push(el);\n });\n }\n clear() {\n this._length = 0;\n this._stack = [];\n }\n /**\n * @description Insert element to stack's end.\n * @description The element you want to push to the back.\n * @returns The container length after erasing.\n */\n push(element: T) {\n this._stack.push(element);\n this._length += 1;\n return this._length;\n }\n /**\n * @description Removes the end element.\n * @returns The element you popped.\n */\n pop() {\n if (this._length === 0) return;\n this._length -= 1;\n return this._stack.pop();\n }\n /**\n * @description Accesses the end element.\n * @returns The last element.\n */\n top(): T | undefined {\n return this._stack[this._length - 1];\n }\n}\n\nexport default Stack;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts new file mode 100644 index 000000000..f9480ee9b --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts @@ -0,0 +1,9 @@ +import { ContainerIterator } from "../../ContainerBase"; +import SequentialContainer from "./index"; +export declare abstract class RandomIterator extends ContainerIterator { + abstract readonly container: SequentialContainer; + get pointer(): T; + set pointer(newValue: T); + pre(): this; + next(): this; +} diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js new file mode 100644 index 000000000..cf0b82401 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js @@ -0,0 +1,78 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, r) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, r) { + t.__proto__ = r; + } || function(t, r) { + for (var n in r) if (Object.prototype.hasOwnProperty.call(r, n)) t[n] = r[n]; + }; + return extendStatics(t, r); + }; + return function(t, r) { + if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); + extendStatics(t, r); + function __() { + this.constructor = t; + } + t.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + }; +}(); + +import { ContainerIterator } from "../../ContainerBase"; + +import { throwIteratorAccessError } from "../../../utils/throwError"; + +var RandomIterator = function(t) { + __extends(RandomIterator, t); + function RandomIterator(r, n) { + var o = t.call(this, n) || this; + o.o = r; + if (o.iteratorType === 0) { + o.pre = function() { + if (this.o === 0) { + throwIteratorAccessError(); + } + this.o -= 1; + return this; + }; + o.next = function() { + if (this.o === this.container.size()) { + throwIteratorAccessError(); + } + this.o += 1; + return this; + }; + } else { + o.pre = function() { + if (this.o === this.container.size() - 1) { + throwIteratorAccessError(); + } + this.o += 1; + return this; + }; + o.next = function() { + if (this.o === -1) { + throwIteratorAccessError(); + } + this.o -= 1; + return this; + }; + } + return o; + } + Object.defineProperty(RandomIterator.prototype, "pointer", { + get: function() { + return this.container.getElementByPos(this.o); + }, + set: function(t) { + this.container.setElementByPos(this.o, t); + }, + enumerable: false, + configurable: true + }); + return RandomIterator; +}(ContainerIterator); + +export { RandomIterator }; +//# sourceMappingURL=RandomIterator.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js.map b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js.map new file mode 100644 index 000000000..097cc9486 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Base/RandomIterator.js","../../src/container/SequentialContainer/Base/RandomIterator.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","ContainerIterator","throwIteratorAccessError","RandomIterator","_super","index","iteratorType","_this","_node","pre","next","container","size","defineProperty","get","getElementByPos","set","newValue","setElementByPos","enumerable","configurable"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;SCApCG,yBAAiC;;SAEjCC,gCAA0B;;AAEnC,IAAAC,iBAAA,SAAAC;IAAgDrB,UAAAoB,gBAAAC;IAS9C,SAAAD,eACEE,GACAC;QAFF,IAAAC,IAIEH,EAAAT,KAAAX,MAAMsB,MAAatB;QACnBuB,EAAKC,IAAQH;QACb,IAAIE,EAAKD,iBAAY,GAA0B;YAC7CC,EAAKE,MAAM;gBACT,IAAIzB,KAAKwB,MAAU,GAAG;oBACpBN;ADOM;gBCLRlB,KAAKwB,KAAS;gBACd,OAAOxB;ADOH;YCLNuB,EAAKG,OAAO;gBACV,IAAI1B,KAAKwB,MAAUxB,KAAK2B,UAAUC,QAAQ;oBACxCV;ADOM;gBCLRlB,KAAKwB,KAAS;gBACd,OAAOxB;ADOH;AACJ,eCNG;YACLuB,EAAKE,MAAM;gBACT,IAAIzB,KAAKwB,MAAUxB,KAAK2B,UAAUC,SAAS,GAAG;oBAC5CV;ADQM;gBCNRlB,KAAKwB,KAAS;gBACd,OAAOxB;ADQH;YCNNuB,EAAKG,OAAO;gBACV,IAAI1B,KAAKwB,OAAW,GAAG;oBACrBN;ADQM;gBCNRlB,KAAKwB,KAAS;gBACd,OAAOxB;ADQH;AACJ;QACA,OAAOuB;AACX;ICPFnB,OAAAyB,eAAIV,eAAAV,WAAA,WAAO;QDSLqB,KCTN;YACE,OAAO9B,KAAK2B,UAAUI,gBAAgB/B,KAAKwB;ADUvC;QACAQ,KCTN,SAAYC;YACVjC,KAAK2B,UAAUO,gBAAgBlC,KAAKwB,GAAOS;ADUvC;QACAE,YAAY;QACZC,cAAc;;ICNtB,OAAAjB;AAAA,CAzDA,CAAgDF;;SDmEvCE","file":"RandomIterator.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ContainerIterator } from \"../../ContainerBase\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nvar RandomIterator = /** @class */ (function (_super) {\n __extends(RandomIterator, _super);\n /**\n * @internal\n */\n function RandomIterator(index, iteratorType) {\n var _this = _super.call(this, iteratorType) || this;\n _this._node = index;\n if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {\n _this.pre = function () {\n if (this._node === 0) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n _this.next = function () {\n if (this._node === this.container.size()) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n }\n else {\n _this.pre = function () {\n if (this._node === this.container.size() - 1) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n _this.next = function () {\n if (this._node === -1) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n }\n return _this;\n }\n Object.defineProperty(RandomIterator.prototype, \"pointer\", {\n get: function () {\n return this.container.getElementByPos(this._node);\n },\n set: function (newValue) {\n this.container.setElementByPos(this._node, newValue);\n },\n enumerable: false,\n configurable: true\n });\n return RandomIterator;\n}(ContainerIterator));\nexport { RandomIterator };\n","import { ContainerIterator, IteratorType } from '@/container/ContainerBase';\nimport SequentialContainer from '@/container/SequentialContainer/Base/index';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nexport abstract class RandomIterator extends ContainerIterator {\n abstract readonly container: SequentialContainer;\n /**\n * @internal\n */\n _node: number;\n /**\n * @internal\n */\n protected constructor(\n index: number,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = index;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node === 0) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n this.next = function () {\n if (this._node === this.container.size()) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node === this.container.size() - 1) {\n throwIteratorAccessError();\n }\n this._node += 1;\n return this;\n };\n this.next = function () {\n if (this._node === -1) {\n throwIteratorAccessError();\n }\n this._node -= 1;\n return this;\n };\n }\n }\n get pointer() {\n return this.container.getElementByPos(this._node);\n }\n set pointer(newValue: T) {\n this.container.setElementByPos(this._node, newValue);\n }\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts new file mode 100644 index 000000000..c1b40975c --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts @@ -0,0 +1,67 @@ +import { Container } from "../../ContainerBase"; +declare abstract class SequentialContainer extends Container { + /** + * @description Push the element to the back. + * @param element - The element you want to push. + * @returns The size of container after pushing. + */ + abstract pushBack(element: T): number; + /** + * @description Removes the last element. + * @returns The element you popped. + */ + abstract popBack(): T | undefined; + /** + * @description Sets element by position. + * @param pos - The position you want to change. + * @param element - The element's value you want to update. + * @example + * container.setElementByPos(-1, 1); // throw a RangeError + */ + abstract setElementByPos(pos: number, element: T): void; + /** + * @description Removes the elements of the specified value. + * @param value - The value you want to remove. + * @returns The size of container after erasing. + * @example + * container.eraseElementByValue(-1); + */ + abstract eraseElementByValue(value: T): number; + /** + * @description Insert several elements after the specified position. + * @param pos - The position you want to insert. + * @param element - The element you want to insert. + * @param num - The number of elements you want to insert (default 1). + * @returns The size of container after inserting. + * @example + * const container = new Vector([1, 2, 3]); + * container.insert(1, 4); // [1, 4, 2, 3] + * container.insert(1, 5, 3); // [1, 5, 5, 5, 4, 2, 3] + */ + abstract insert(pos: number, element: T, num?: number): number; + /** + * @description Reverses the container. + * @example + * const container = new Vector([1, 2, 3]); + * container.reverse(); // [3, 2, 1] + */ + abstract reverse(): void; + /** + * @description Removes the duplication of elements in the container. + * @returns The size of container after inserting. + * @example + * const container = new Vector([1, 1, 3, 2, 2, 5, 5, 2]); + * container.unique(); // [1, 3, 2, 5, 2] + */ + abstract unique(): number; + /** + * @description Sort the container. + * @param cmp - Comparison function to sort. + * @example + * const container = new Vector([3, 1, 10]); + * container.sort(); // [1, 10, 3] + * container.sort((x, y) => x - y); // [1, 3, 10] + */ + abstract sort(cmp?: (x: T, y: T) => number): void; +} +export default SequentialContainer; diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js new file mode 100644 index 000000000..8ac697b28 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js @@ -0,0 +1,33 @@ +var __extends = this && this.t || function() { + var extendStatics = function(n, t) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(n, t) { + n.__proto__ = t; + } || function(n, t) { + for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) n[e] = t[e]; + }; + return extendStatics(n, t); + }; + return function(n, t) { + if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); + extendStatics(n, t); + function __() { + this.constructor = n; + } + n.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __); + }; +}(); + +import { Container } from "../../ContainerBase"; + +var SequentialContainer = function(n) { + __extends(SequentialContainer, n); + function SequentialContainer() { + return n !== null && n.apply(this, arguments) || this; + } + return SequentialContainer; +}(Container); + +export default SequentialContainer; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js.map b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js.map new file mode 100644 index 000000000..36e2c5aff --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Base/index.js","../../src/container/SequentialContainer/Base/index.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","Container","SequentialContainer","_super","apply","arguments"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;SCApCG,iBAAW;;AAEpB,IAAAC,sBAAA,SAAAC;IAA8CpB,UAAAmB,qBAAAC;IAA9C,SAAAD;QDiBQ,OAAOC,MAAW,QAAQA,EAAOC,MAAMpB,MAAMqB,cAAcrB;AC+CnE;IAAA,OAAAkB;AAAA,CAhEA,CAA8CD;;eAkE/BC","file":"index.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Container } from \"../../ContainerBase\";\nvar SequentialContainer = /** @class */ (function (_super) {\n __extends(SequentialContainer, _super);\n function SequentialContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return SequentialContainer;\n}(Container));\nexport default SequentialContainer;\n","import { Container } from '@/container/ContainerBase';\n\nabstract class SequentialContainer extends Container {\n /**\n * @description Push the element to the back.\n * @param element - The element you want to push.\n * @returns The size of container after pushing.\n */\n abstract pushBack(element: T): number;\n /**\n * @description Removes the last element.\n * @returns The element you popped.\n */\n abstract popBack(): T | undefined;\n /**\n * @description Sets element by position.\n * @param pos - The position you want to change.\n * @param element - The element's value you want to update.\n * @example\n * container.setElementByPos(-1, 1); // throw a RangeError\n */\n abstract setElementByPos(pos: number, element: T): void;\n /**\n * @description Removes the elements of the specified value.\n * @param value - The value you want to remove.\n * @returns The size of container after erasing.\n * @example\n * container.eraseElementByValue(-1);\n */\n abstract eraseElementByValue(value: T): number;\n /**\n * @description Insert several elements after the specified position.\n * @param pos - The position you want to insert.\n * @param element - The element you want to insert.\n * @param num - The number of elements you want to insert (default 1).\n * @returns The size of container after inserting.\n * @example\n * const container = new Vector([1, 2, 3]);\n * container.insert(1, 4); // [1, 4, 2, 3]\n * container.insert(1, 5, 3); // [1, 5, 5, 5, 4, 2, 3]\n */\n abstract insert(pos: number, element: T, num?: number): number;\n /**\n * @description Reverses the container.\n * @example\n * const container = new Vector([1, 2, 3]);\n * container.reverse(); // [3, 2, 1]\n */\n abstract reverse(): void;\n /**\n * @description Removes the duplication of elements in the container.\n * @returns The size of container after inserting.\n * @example\n * const container = new Vector([1, 1, 3, 2, 2, 5, 5, 2]);\n * container.unique(); // [1, 3, 2, 5, 2]\n */\n abstract unique(): number;\n /**\n * @description Sort the container.\n * @param cmp - Comparison function to sort.\n * @example\n * const container = new Vector([3, 1, 10]);\n * container.sort(); // [1, 10, 3]\n * container.sort((x, y) => x - y); // [1, 3, 10]\n */\n abstract sort(cmp?: (x: T, y: T) => number): void;\n}\n\nexport default SequentialContainer;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts new file mode 100644 index 000000000..cf63bda47 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts @@ -0,0 +1,58 @@ +import SequentialContainer from './Base'; +import { IteratorType, initContainer } from "../ContainerBase"; +import { RandomIterator } from "./Base/RandomIterator"; +declare class DequeIterator extends RandomIterator { + readonly container: Deque; + constructor(node: number, container: Deque, iteratorType?: IteratorType); + copy(): DequeIterator; + equals(iter: DequeIterator): boolean; +} +export type { DequeIterator }; +declare class Deque extends SequentialContainer { + constructor(container?: initContainer, _bucketSize?: number); + clear(): void; + begin(): DequeIterator; + end(): DequeIterator; + rBegin(): DequeIterator; + rEnd(): DequeIterator; + front(): T | undefined; + back(): T | undefined; + pushBack(element: T): number; + popBack(): T | undefined; + /** + * @description Push the element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + pushFront(element: T): number; + /** + * @description Remove the _first element. + * @returns The element you popped. + */ + popFront(): T | undefined; + getElementByPos(pos: number): T; + setElementByPos(pos: number, element: T): void; + insert(pos: number, element: T, num?: number): number; + /** + * @description Remove all elements after the specified position (excluding the specified position). + * @param pos - The previous position of the first removed element. + * @returns The size of the container after cutting. + * @example + * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1] + */ + cut(pos: number): number; + eraseElementByPos(pos: number): number; + eraseElementByValue(value: T): number; + eraseElementByIterator(iter: DequeIterator): DequeIterator; + find(element: T): DequeIterator; + reverse(): void; + unique(): number; + sort(cmp?: (x: T, y: T) => number): void; + /** + * @description Remove as much useless space as possible. + */ + shrinkToFit(): void; + forEach(callback: (element: T, index: number, deque: Deque) => void): void; + [Symbol.iterator](): Generator; +} +export default Deque; diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js new file mode 100644 index 000000000..7020e00ef --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js @@ -0,0 +1,498 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, i) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, i) { + t.__proto__ = i; + } || function(t, i) { + for (var r in i) if (Object.prototype.hasOwnProperty.call(i, r)) t[r] = i[r]; + }; + return extendStatics(t, i); + }; + return function(t, i) { + if (typeof i !== "function" && i !== null) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); + extendStatics(t, i); + function __() { + this.constructor = t; + } + t.prototype = i === null ? Object.create(i) : (__.prototype = i.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(t, i) { + var r = { + label: 0, + sent: function() { + if (h[0] & 1) throw h[1]; + return h[1]; + }, + trys: [], + ops: [] + }, e, s, h, n; + return n = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (n[Symbol.iterator] = function() { + return this; + }), n; + function verb(t) { + return function(i) { + return step([ t, i ]); + }; + } + function step(n) { + if (e) throw new TypeError("Generator is already executing."); + while (r) try { + if (e = 1, s && (h = n[0] & 2 ? s["return"] : n[0] ? s["throw"] || ((h = s["return"]) && h.call(s), + 0) : s.next) && !(h = h.call(s, n[1])).done) return h; + if (s = 0, h) n = [ n[0] & 2, h.value ]; + switch (n[0]) { + case 0: + case 1: + h = n; + break; + + case 4: + r.label++; + return { + value: n[1], + done: false + }; + + case 5: + r.label++; + s = n[1]; + n = [ 0 ]; + continue; + + case 7: + n = r.ops.pop(); + r.trys.pop(); + continue; + + default: + if (!(h = r.trys, h = h.length > 0 && h[h.length - 1]) && (n[0] === 6 || n[0] === 2)) { + r = 0; + continue; + } + if (n[0] === 3 && (!h || n[1] > h[0] && n[1] < h[3])) { + r.label = n[1]; + break; + } + if (n[0] === 6 && r.label < h[1]) { + r.label = h[1]; + h = n; + break; + } + if (h && r.label < h[2]) { + r.label = h[2]; + r.ops.push(n); + break; + } + if (h[2]) r.ops.pop(); + r.trys.pop(); + continue; + } + n = i.call(t, r); + } catch (t) { + n = [ 6, t ]; + s = 0; + } finally { + e = h = 0; + } + if (n[0] & 5) throw n[1]; + return { + value: n[0] ? n[1] : void 0, + done: true + }; + } +}; + +var __read = this && this.q || function(t, i) { + var r = typeof Symbol === "function" && t[Symbol.iterator]; + if (!r) return t; + var e = r.call(t), s, h = [], n; + try { + while ((i === void 0 || i-- > 0) && !(s = e.next()).done) h.push(s.value); + } catch (t) { + n = { + error: t + }; + } finally { + try { + if (s && !s.done && (r = e["return"])) r.call(e); + } finally { + if (n) throw n.error; + } + } + return h; +}; + +var __spreadArray = this && this.D || function(t, i, r) { + if (r || arguments.length === 2) for (var e = 0, s = i.length, h; e < s; e++) { + if (h || !(e in i)) { + if (!h) h = Array.prototype.slice.call(i, 0, e); + h[e] = i[e]; + } + } + return t.concat(h || Array.prototype.slice.call(i)); +}; + +import SequentialContainer from "./Base"; + +import { RandomIterator } from "./Base/RandomIterator"; + +var DequeIterator = function(t) { + __extends(DequeIterator, t); + function DequeIterator(i, r, e) { + var s = t.call(this, i, e) || this; + s.container = r; + return s; + } + DequeIterator.prototype.copy = function() { + return new DequeIterator(this.o, this.container, this.iteratorType); + }; + return DequeIterator; +}(RandomIterator); + +var Deque = function(t) { + __extends(Deque, t); + function Deque(i, r) { + if (i === void 0) { + i = []; + } + if (r === void 0) { + r = 1 << 12; + } + var e = t.call(this) || this; + e.A = 0; + e.S = 0; + e.R = 0; + e.k = 0; + e.C = 0; + e.j = []; + var s = function() { + if (typeof i.length === "number") return i.length; + if (typeof i.size === "number") return i.size; + if (typeof i.size === "function") return i.size(); + throw new TypeError("Cannot get the length or size of the container"); + }(); + e.B = r; + e.C = Math.max(Math.ceil(s / e.B), 1); + for (var h = 0; h < e.C; ++h) { + e.j.push(new Array(e.B)); + } + var n = Math.ceil(s / e.B); + e.A = e.R = (e.C >> 1) - (n >> 1); + e.S = e.k = e.B - s % e.B >> 1; + var u = e; + i.forEach((function(t) { + u.pushBack(t); + })); + return e; + } + Deque.prototype.O = function() { + var t = []; + var i = Math.max(this.C >> 1, 1); + for (var r = 0; r < i; ++r) { + t[r] = new Array(this.B); + } + for (var r = this.A; r < this.C; ++r) { + t[t.length] = this.j[r]; + } + for (var r = 0; r < this.R; ++r) { + t[t.length] = this.j[r]; + } + t[t.length] = __spreadArray([], __read(this.j[this.R]), false); + this.A = i; + this.R = t.length - 1; + for (var r = 0; r < i; ++r) { + t[t.length] = new Array(this.B); + } + this.j = t; + this.C = t.length; + }; + Deque.prototype.T = function(t) { + var i = this.S + t + 1; + var r = i % this.B; + var e = r - 1; + var s = this.A + (i - r) / this.B; + if (r === 0) s -= 1; + s %= this.C; + if (e < 0) e += this.B; + return { + curNodeBucketIndex: s, + curNodePointerIndex: e + }; + }; + Deque.prototype.clear = function() { + this.j = [ new Array(this.B) ]; + this.C = 1; + this.A = this.R = this.M = 0; + this.S = this.k = this.B >> 1; + }; + Deque.prototype.begin = function() { + return new DequeIterator(0, this); + }; + Deque.prototype.end = function() { + return new DequeIterator(this.M, this); + }; + Deque.prototype.rBegin = function() { + return new DequeIterator(this.M - 1, this, 1); + }; + Deque.prototype.rEnd = function() { + return new DequeIterator(-1, this, 1); + }; + Deque.prototype.front = function() { + if (this.M === 0) return; + return this.j[this.A][this.S]; + }; + Deque.prototype.back = function() { + if (this.M === 0) return; + return this.j[this.R][this.k]; + }; + Deque.prototype.pushBack = function(t) { + if (this.M) { + if (this.k < this.B - 1) { + this.k += 1; + } else if (this.R < this.C - 1) { + this.R += 1; + this.k = 0; + } else { + this.R = 0; + this.k = 0; + } + if (this.R === this.A && this.k === this.S) this.O(); + } + this.M += 1; + this.j[this.R][this.k] = t; + return this.M; + }; + Deque.prototype.popBack = function() { + if (this.M === 0) return; + var t = this.j[this.R][this.k]; + if (this.M !== 1) { + if (this.k > 0) { + this.k -= 1; + } else if (this.R > 0) { + this.R -= 1; + this.k = this.B - 1; + } else { + this.R = this.C - 1; + this.k = this.B - 1; + } + } + this.M -= 1; + return t; + }; + Deque.prototype.pushFront = function(t) { + if (this.M) { + if (this.S > 0) { + this.S -= 1; + } else if (this.A > 0) { + this.A -= 1; + this.S = this.B - 1; + } else { + this.A = this.C - 1; + this.S = this.B - 1; + } + if (this.A === this.R && this.S === this.k) this.O(); + } + this.M += 1; + this.j[this.A][this.S] = t; + return this.M; + }; + Deque.prototype.popFront = function() { + if (this.M === 0) return; + var t = this.j[this.A][this.S]; + if (this.M !== 1) { + if (this.S < this.B - 1) { + this.S += 1; + } else if (this.A < this.C - 1) { + this.A += 1; + this.S = 0; + } else { + this.A = 0; + this.S = 0; + } + } + this.M -= 1; + return t; + }; + Deque.prototype.getElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var i = this.T(t), r = i.curNodeBucketIndex, e = i.curNodePointerIndex; + return this.j[r][e]; + }; + Deque.prototype.setElementByPos = function(t, i) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var r = this.T(t), e = r.curNodeBucketIndex, s = r.curNodePointerIndex; + this.j[e][s] = i; + }; + Deque.prototype.insert = function(t, i, r) { + if (r === void 0) { + r = 1; + } + if (t < 0 || t > this.M) { + throw new RangeError; + } + if (t === 0) { + while (r--) this.pushFront(i); + } else if (t === this.M) { + while (r--) this.pushBack(i); + } else { + var e = []; + for (var s = t; s < this.M; ++s) { + e.push(this.getElementByPos(s)); + } + this.cut(t - 1); + for (var s = 0; s < r; ++s) this.pushBack(i); + for (var s = 0; s < e.length; ++s) this.pushBack(e[s]); + } + return this.M; + }; + Deque.prototype.cut = function(t) { + if (t < 0) { + this.clear(); + return 0; + } + var i = this.T(t), r = i.curNodeBucketIndex, e = i.curNodePointerIndex; + this.R = r; + this.k = e; + this.M = t + 1; + return this.M; + }; + Deque.prototype.eraseElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + if (t === 0) this.popFront(); else if (t === this.M - 1) this.popBack(); else { + var i = []; + for (var r = t + 1; r < this.M; ++r) { + i.push(this.getElementByPos(r)); + } + this.cut(t); + this.popBack(); + var e = this; + i.forEach((function(t) { + e.pushBack(t); + })); + } + return this.M; + }; + Deque.prototype.eraseElementByValue = function(t) { + if (this.M === 0) return 0; + var i = []; + for (var r = 0; r < this.M; ++r) { + var e = this.getElementByPos(r); + if (e !== t) i.push(e); + } + var s = i.length; + for (var r = 0; r < s; ++r) this.setElementByPos(r, i[r]); + return this.cut(s - 1); + }; + Deque.prototype.eraseElementByIterator = function(t) { + var i = t.o; + this.eraseElementByPos(i); + t = t.next(); + return t; + }; + Deque.prototype.find = function(t) { + for (var i = 0; i < this.M; ++i) { + if (this.getElementByPos(i) === t) { + return new DequeIterator(i, this); + } + } + return this.end(); + }; + Deque.prototype.reverse = function() { + var t = 0; + var i = this.M - 1; + while (t < i) { + var r = this.getElementByPos(t); + this.setElementByPos(t, this.getElementByPos(i)); + this.setElementByPos(i, r); + t += 1; + i -= 1; + } + }; + Deque.prototype.unique = function() { + if (this.M <= 1) { + return this.M; + } + var t = 1; + var i = this.getElementByPos(0); + for (var r = 1; r < this.M; ++r) { + var e = this.getElementByPos(r); + if (e !== i) { + i = e; + this.setElementByPos(t++, e); + } + } + while (this.M > t) this.popBack(); + return this.M; + }; + Deque.prototype.sort = function(t) { + var i = []; + for (var r = 0; r < this.M; ++r) { + i.push(this.getElementByPos(r)); + } + i.sort(t); + for (var r = 0; r < this.M; ++r) this.setElementByPos(r, i[r]); + }; + Deque.prototype.shrinkToFit = function() { + if (this.M === 0) return; + var t = []; + this.forEach((function(i) { + t.push(i); + })); + this.C = Math.max(Math.ceil(this.M / this.B), 1); + this.M = this.A = this.R = this.S = this.k = 0; + this.j = []; + for (var i = 0; i < this.C; ++i) { + this.j.push(new Array(this.B)); + } + for (var i = 0; i < t.length; ++i) this.pushBack(t[i]); + }; + Deque.prototype.forEach = function(t) { + for (var i = 0; i < this.M; ++i) { + t(this.getElementByPos(i), i, this); + } + }; + Deque.prototype[Symbol.iterator] = function() { + return function() { + var t; + return __generator(this, (function(i) { + switch (i.label) { + case 0: + t = 0; + i.label = 1; + + case 1: + if (!(t < this.M)) return [ 3, 4 ]; + return [ 4, this.getElementByPos(t) ]; + + case 2: + i.sent(); + i.label = 3; + + case 3: + ++t; + return [ 3, 1 ]; + + case 4: + return [ 2 ]; + } + })); + }.bind(this)(); + }; + return Deque; +}(SequentialContainer); + +export default Deque; +//# sourceMappingURL=Deque.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js.map b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js.map new file mode 100644 index 000000000..7ab3c11b4 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Deque.js","../../src/container/SequentialContainer/Deque.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","__read","o","m","i","r","ar","error","__spreadArray","to","from","pack","arguments","l","slice","concat","SequentialContainer","RandomIterator","DequeIterator","_super","node","container","iteratorType","_this","copy","_node","Deque","_bucketSize","_first","_curFirst","_last","_curLast","_bucketNum","_map","_length","size","Math","max","ceil","needBucketNum","self","forEach","element","pushBack","_reAllocate","newMap","addBucketNum","_getElementIndex","pos","offset","offsetRemainder","curNodePointerIndex","curNodeBucketIndex","clear","begin","end","rBegin","rEnd","front","back","popBack","pushFront","popFront","getElementByPos","RangeError","_a","setElementByPos","insert","num","arr","cut","eraseElementByPos","self_1","el","eraseElementByValue","eraseElementByIterator","iter","find","reverse","tmp","unique","index","pre","cur","sort","cmp","shrinkToFit","callback","b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KuE;ADkG5B;QChGJ,KAAK,IAAIvB,IAAI,GAAGA,IAAIiE,EAAIvE,UAAUM,GAAGhD,KAAKuF,SAAS0B,EAAIjE;ADmGvD;ICjGFsB,MAAA7D,UAAA4E,UAAA,SAAQ8C;QACN,KAAK,IAAInF,IAAI,GAAGA,IAAIhD,KAAK8E,KAAW9B,GAAG;YACrCmF,EAASnI,KAAK2G,gBAAgB3D,IAAIA,GAAGhD;ADmGnC;AACJ;ICjGFsE,MAAA7D,UAACwB,OAAOC,YAAR;QACE,OAAO;YDmGC,IAAIc;YACJ,OAAO/B,YAAYjB,OAAM,SAAU6G;gBAC/B,QAAQA,EAAGxF;kBACP,KAAK;oBCrGV2B,IAAI;oBDuGK6D,EAAGxF,QAAQ;;kBACf,KAAK;oBACD,MCzGF2B,IAAIhD,KAAK8E,IAAO,OAAA,EAAA,GAAA;oBAC9B,OAAA,EAAA,GAAM9E,KAAK2G,gBAAgB3D;;kBD0Gf,KAAK;oBC1GjB6D,EAAAvF;oBD4GgBuF,EAAGxF,QAAQ;;kBACf,KAAK;sBC9GiB2B;oBDgHlB,OAAO,EAAC,GAAa;;kBACzB,KAAK;oBAAG,OAAO,EAAC;;AAExB;AACJ,UCjHFoF,KAAKpI,KAJA;ADsHP;IChHJ,OAAAsE;AAAA,CAlWA,CAAuBV;;eAoWRU","file":"Deque.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport SequentialContainer from './Base';\nimport { RandomIterator } from \"./Base/RandomIterator\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport $getContainerSize from \"../../utils/getContainerSize.macro\";\nvar DequeIterator = /** @class */ (function (_super) {\n __extends(DequeIterator, _super);\n function DequeIterator(node, container, iteratorType) {\n var _this = _super.call(this, node, iteratorType) || this;\n _this.container = container;\n return _this;\n }\n DequeIterator.prototype.copy = function () {\n return new DequeIterator(this._node, this.container, this.iteratorType);\n };\n return DequeIterator;\n}(RandomIterator));\nvar Deque = /** @class */ (function (_super) {\n __extends(Deque, _super);\n function Deque(container, _bucketSize) {\n if (container === void 0) { container = []; }\n if (_bucketSize === void 0) { _bucketSize = (1 << 12); }\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n _this._first = 0;\n /**\n * @internal\n */\n _this._curFirst = 0;\n /**\n * @internal\n */\n _this._last = 0;\n /**\n * @internal\n */\n _this._curLast = 0;\n /**\n * @internal\n */\n _this._bucketNum = 0;\n /**\n * @internal\n */\n _this._map = [];\n var _length = (function () {\n if (typeof container.length === \"number\")\n return container.length;\n if (typeof container.size === \"number\")\n return container.size;\n if (typeof container.size === \"function\")\n return container.size();\n throw new TypeError(\"Cannot get the length or size of the container\");\n })();\n _this._bucketSize = _bucketSize;\n _this._bucketNum = Math.max(Math.ceil(_length / _this._bucketSize), 1);\n for (var i = 0; i < _this._bucketNum; ++i) {\n _this._map.push(new Array(_this._bucketSize));\n }\n var needBucketNum = Math.ceil(_length / _this._bucketSize);\n _this._first = _this._last = (_this._bucketNum >> 1) - (needBucketNum >> 1);\n _this._curFirst = _this._curLast = (_this._bucketSize - _length % _this._bucketSize) >> 1;\n var self = _this;\n container.forEach(function (element) {\n self.pushBack(element);\n });\n return _this;\n }\n /**\n * @description Growth the Deque.\n * @internal\n */\n Deque.prototype._reAllocate = function () {\n var newMap = [];\n var addBucketNum = Math.max(this._bucketNum >> 1, 1);\n for (var i = 0; i < addBucketNum; ++i) {\n newMap[i] = new Array(this._bucketSize);\n }\n for (var i = this._first; i < this._bucketNum; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n for (var i = 0; i < this._last; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n newMap[newMap.length] = __spreadArray([], __read(this._map[this._last]), false);\n this._first = addBucketNum;\n this._last = newMap.length - 1;\n for (var i = 0; i < addBucketNum; ++i) {\n newMap[newMap.length] = new Array(this._bucketSize);\n }\n this._map = newMap;\n this._bucketNum = newMap.length;\n };\n /**\n * @description Get the bucket position of the element and the pointer position by index.\n * @param pos - The element's index.\n * @internal\n */\n Deque.prototype._getElementIndex = function (pos) {\n var offset = this._curFirst + pos + 1;\n var offsetRemainder = offset % this._bucketSize;\n var curNodePointerIndex = offsetRemainder - 1;\n var curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize;\n if (offsetRemainder === 0)\n curNodeBucketIndex -= 1;\n curNodeBucketIndex %= this._bucketNum;\n if (curNodePointerIndex < 0)\n curNodePointerIndex += this._bucketSize;\n return { curNodeBucketIndex: curNodeBucketIndex, curNodePointerIndex: curNodePointerIndex };\n };\n Deque.prototype.clear = function () {\n this._map = [new Array(this._bucketSize)];\n this._bucketNum = 1;\n this._first = this._last = this._length = 0;\n this._curFirst = this._curLast = this._bucketSize >> 1;\n };\n Deque.prototype.begin = function () {\n return new DequeIterator(0, this);\n };\n Deque.prototype.end = function () {\n return new DequeIterator(this._length, this);\n };\n Deque.prototype.rBegin = function () {\n return new DequeIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */);\n };\n Deque.prototype.rEnd = function () {\n return new DequeIterator(-1, this, 1 /* IteratorType.REVERSE */);\n };\n Deque.prototype.front = function () {\n if (this._length === 0)\n return;\n return this._map[this._first][this._curFirst];\n };\n Deque.prototype.back = function () {\n if (this._length === 0)\n return;\n return this._map[this._last][this._curLast];\n };\n Deque.prototype.pushBack = function (element) {\n if (this._length) {\n if (this._curLast < this._bucketSize - 1) {\n this._curLast += 1;\n }\n else if (this._last < this._bucketNum - 1) {\n this._last += 1;\n this._curLast = 0;\n }\n else {\n this._last = 0;\n this._curLast = 0;\n }\n if (this._last === this._first &&\n this._curLast === this._curFirst)\n this._reAllocate();\n }\n this._length += 1;\n this._map[this._last][this._curLast] = element;\n return this._length;\n };\n Deque.prototype.popBack = function () {\n if (this._length === 0)\n return;\n var value = this._map[this._last][this._curLast];\n if (this._length !== 1) {\n if (this._curLast > 0) {\n this._curLast -= 1;\n }\n else if (this._last > 0) {\n this._last -= 1;\n this._curLast = this._bucketSize - 1;\n }\n else {\n this._last = this._bucketNum - 1;\n this._curLast = this._bucketSize - 1;\n }\n }\n this._length -= 1;\n return value;\n };\n /**\n * @description Push the element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n Deque.prototype.pushFront = function (element) {\n if (this._length) {\n if (this._curFirst > 0) {\n this._curFirst -= 1;\n }\n else if (this._first > 0) {\n this._first -= 1;\n this._curFirst = this._bucketSize - 1;\n }\n else {\n this._first = this._bucketNum - 1;\n this._curFirst = this._bucketSize - 1;\n }\n if (this._first === this._last &&\n this._curFirst === this._curLast)\n this._reAllocate();\n }\n this._length += 1;\n this._map[this._first][this._curFirst] = element;\n return this._length;\n };\n /**\n * @description Remove the _first element.\n * @returns The element you popped.\n */\n Deque.prototype.popFront = function () {\n if (this._length === 0)\n return;\n var value = this._map[this._first][this._curFirst];\n if (this._length !== 1) {\n if (this._curFirst < this._bucketSize - 1) {\n this._curFirst += 1;\n }\n else if (this._first < this._bucketNum - 1) {\n this._first += 1;\n this._curFirst = 0;\n }\n else {\n this._first = 0;\n this._curFirst = 0;\n }\n }\n this._length -= 1;\n return value;\n };\n Deque.prototype.getElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var _a = this._getElementIndex(pos), curNodeBucketIndex = _a.curNodeBucketIndex, curNodePointerIndex = _a.curNodePointerIndex;\n return this._map[curNodeBucketIndex][curNodePointerIndex];\n };\n Deque.prototype.setElementByPos = function (pos, element) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var _a = this._getElementIndex(pos), curNodeBucketIndex = _a.curNodeBucketIndex, curNodePointerIndex = _a.curNodePointerIndex;\n this._map[curNodeBucketIndex][curNodePointerIndex] = element;\n };\n Deque.prototype.insert = function (pos, element, num) {\n if (num === void 0) { num = 1; }\n if (pos < 0 || pos > this._length) {\n throw new RangeError();\n }\n if (pos === 0) {\n while (num--)\n this.pushFront(element);\n }\n else if (pos === this._length) {\n while (num--)\n this.pushBack(element);\n }\n else {\n var arr = [];\n for (var i = pos; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos - 1);\n for (var i = 0; i < num; ++i)\n this.pushBack(element);\n for (var i = 0; i < arr.length; ++i)\n this.pushBack(arr[i]);\n }\n return this._length;\n };\n /**\n * @description Remove all elements after the specified position (excluding the specified position).\n * @param pos - The previous position of the first removed element.\n * @returns The size of the container after cutting.\n * @example\n * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1]\n */\n Deque.prototype.cut = function (pos) {\n if (pos < 0) {\n this.clear();\n return 0;\n }\n var _a = this._getElementIndex(pos), curNodeBucketIndex = _a.curNodeBucketIndex, curNodePointerIndex = _a.curNodePointerIndex;\n this._last = curNodeBucketIndex;\n this._curLast = curNodePointerIndex;\n this._length = pos + 1;\n return this._length;\n };\n Deque.prototype.eraseElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n if (pos === 0)\n this.popFront();\n else if (pos === this._length - 1)\n this.popBack();\n else {\n var arr = [];\n for (var i = pos + 1; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos);\n this.popBack();\n var self_1 = this;\n arr.forEach(function (el) {\n self_1.pushBack(el);\n });\n }\n return this._length;\n };\n Deque.prototype.eraseElementByValue = function (value) {\n if (this._length === 0)\n return 0;\n var arr = [];\n for (var i = 0; i < this._length; ++i) {\n var element = this.getElementByPos(i);\n if (element !== value)\n arr.push(element);\n }\n var _length = arr.length;\n for (var i = 0; i < _length; ++i)\n this.setElementByPos(i, arr[i]);\n return this.cut(_length - 1);\n };\n Deque.prototype.eraseElementByIterator = function (iter) {\n var _node = iter._node;\n this.eraseElementByPos(_node);\n iter = iter.next();\n return iter;\n };\n Deque.prototype.find = function (element) {\n for (var i = 0; i < this._length; ++i) {\n if (this.getElementByPos(i) === element) {\n return new DequeIterator(i, this);\n }\n }\n return this.end();\n };\n Deque.prototype.reverse = function () {\n var l = 0;\n var r = this._length - 1;\n while (l < r) {\n var tmp = this.getElementByPos(l);\n this.setElementByPos(l, this.getElementByPos(r));\n this.setElementByPos(r, tmp);\n l += 1;\n r -= 1;\n }\n };\n Deque.prototype.unique = function () {\n if (this._length <= 1) {\n return this._length;\n }\n var index = 1;\n var pre = this.getElementByPos(0);\n for (var i = 1; i < this._length; ++i) {\n var cur = this.getElementByPos(i);\n if (cur !== pre) {\n pre = cur;\n this.setElementByPos(index++, cur);\n }\n }\n while (this._length > index)\n this.popBack();\n return this._length;\n };\n Deque.prototype.sort = function (cmp) {\n var arr = [];\n for (var i = 0; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n arr.sort(cmp);\n for (var i = 0; i < this._length; ++i)\n this.setElementByPos(i, arr[i]);\n };\n /**\n * @description Remove as much useless space as possible.\n */\n Deque.prototype.shrinkToFit = function () {\n if (this._length === 0)\n return;\n var arr = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1);\n this._length = this._first = this._last = this._curFirst = this._curLast = 0;\n this._map = [];\n for (var i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n for (var i = 0; i < arr.length; ++i)\n this.pushBack(arr[i]);\n };\n Deque.prototype.forEach = function (callback) {\n for (var i = 0; i < this._length; ++i) {\n callback(this.getElementByPos(i), i, this);\n }\n };\n Deque.prototype[Symbol.iterator] = function () {\n return function () {\n var i;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < this._length)) return [3 /*break*/, 4];\n return [4 /*yield*/, this.getElementByPos(i)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n ++i;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n }.bind(this)();\n };\n return Deque;\n}(SequentialContainer));\nexport default Deque;\n","import SequentialContainer from './Base';\nimport { IteratorType, initContainer } from '@/container/ContainerBase';\nimport { RandomIterator } from '@/container/SequentialContainer/Base/RandomIterator';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport $getContainerSize from '@/utils/getContainerSize.macro';\n\nclass DequeIterator extends RandomIterator {\n readonly container: Deque;\n constructor(node: number, container: Deque, iteratorType?: IteratorType) {\n super(node, iteratorType);\n this.container = container;\n }\n copy() {\n return new DequeIterator(this._node, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: DequeIterator): boolean;\n}\n\nexport type { DequeIterator };\n\nclass Deque extends SequentialContainer {\n /**\n * @internal\n */\n private _first = 0;\n /**\n * @internal\n */\n private _curFirst = 0;\n /**\n * @internal\n */\n private _last = 0;\n /**\n * @internal\n */\n private _curLast = 0;\n /**\n * @internal\n */\n private _bucketNum = 0;\n /**\n * @internal\n */\n private readonly _bucketSize: number;\n /**\n * @internal\n */\n private _map: T[][] = [];\n constructor(container: initContainer = [], _bucketSize = (1 << 12)) {\n super();\n const _length = $getContainerSize!(container);\n this._bucketSize = _bucketSize;\n this._bucketNum = Math.max(Math.ceil(_length / this._bucketSize), 1);\n for (let i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n const needBucketNum = Math.ceil(_length / this._bucketSize);\n this._first = this._last = (this._bucketNum >> 1) - (needBucketNum >> 1);\n this._curFirst = this._curLast = (this._bucketSize - _length % this._bucketSize) >> 1;\n const self = this;\n container.forEach(function (element) {\n self.pushBack(element);\n });\n }\n /**\n * @description Growth the Deque.\n * @internal\n */\n private _reAllocate() {\n const newMap = [];\n const addBucketNum = Math.max(this._bucketNum >> 1, 1);\n for (let i = 0; i < addBucketNum; ++i) {\n newMap[i] = new Array(this._bucketSize);\n }\n for (let i = this._first; i < this._bucketNum; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n for (let i = 0; i < this._last; ++i) {\n newMap[newMap.length] = this._map[i];\n }\n newMap[newMap.length] = [...this._map[this._last]];\n this._first = addBucketNum;\n this._last = newMap.length - 1;\n for (let i = 0; i < addBucketNum; ++i) {\n newMap[newMap.length] = new Array(this._bucketSize);\n }\n this._map = newMap;\n this._bucketNum = newMap.length;\n }\n /**\n * @description Get the bucket position of the element and the pointer position by index.\n * @param pos - The element's index.\n * @internal\n */\n private _getElementIndex(pos: number) {\n const offset = this._curFirst + pos + 1;\n const offsetRemainder = offset % this._bucketSize;\n let curNodePointerIndex = offsetRemainder - 1;\n let curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize;\n if (offsetRemainder === 0) curNodeBucketIndex -= 1;\n curNodeBucketIndex %= this._bucketNum;\n if (curNodePointerIndex < 0) curNodePointerIndex += this._bucketSize;\n return { curNodeBucketIndex, curNodePointerIndex };\n }\n clear() {\n this._map = [new Array(this._bucketSize)];\n this._bucketNum = 1;\n this._first = this._last = this._length = 0;\n this._curFirst = this._curLast = this._bucketSize >> 1;\n }\n begin() {\n return new DequeIterator(0, this);\n }\n end() {\n return new DequeIterator(this._length, this);\n }\n rBegin() {\n return new DequeIterator(this._length - 1, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new DequeIterator(-1, this, IteratorType.REVERSE);\n }\n front(): T | undefined {\n if (this._length === 0) return;\n return this._map[this._first][this._curFirst];\n }\n back(): T | undefined {\n if (this._length === 0) return;\n return this._map[this._last][this._curLast];\n }\n pushBack(element: T) {\n if (this._length) {\n if (this._curLast < this._bucketSize - 1) {\n this._curLast += 1;\n } else if (this._last < this._bucketNum - 1) {\n this._last += 1;\n this._curLast = 0;\n } else {\n this._last = 0;\n this._curLast = 0;\n }\n if (\n this._last === this._first &&\n this._curLast === this._curFirst\n ) this._reAllocate();\n }\n this._length += 1;\n this._map[this._last][this._curLast] = element;\n return this._length;\n }\n popBack() {\n if (this._length === 0) return;\n const value = this._map[this._last][this._curLast];\n if (this._length !== 1) {\n if (this._curLast > 0) {\n this._curLast -= 1;\n } else if (this._last > 0) {\n this._last -= 1;\n this._curLast = this._bucketSize - 1;\n } else {\n this._last = this._bucketNum - 1;\n this._curLast = this._bucketSize - 1;\n }\n }\n this._length -= 1;\n return value;\n }\n /**\n * @description Push the element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n pushFront(element: T) {\n if (this._length) {\n if (this._curFirst > 0) {\n this._curFirst -= 1;\n } else if (this._first > 0) {\n this._first -= 1;\n this._curFirst = this._bucketSize - 1;\n } else {\n this._first = this._bucketNum - 1;\n this._curFirst = this._bucketSize - 1;\n }\n if (\n this._first === this._last &&\n this._curFirst === this._curLast\n ) this._reAllocate();\n }\n this._length += 1;\n this._map[this._first][this._curFirst] = element;\n return this._length;\n }\n /**\n * @description Remove the _first element.\n * @returns The element you popped.\n */\n popFront() {\n if (this._length === 0) return;\n const value = this._map[this._first][this._curFirst];\n if (this._length !== 1) {\n if (this._curFirst < this._bucketSize - 1) {\n this._curFirst += 1;\n } else if (this._first < this._bucketNum - 1) {\n this._first += 1;\n this._curFirst = 0;\n } else {\n this._first = 0;\n this._curFirst = 0;\n }\n }\n this._length -= 1;\n return value;\n }\n getElementByPos(pos: number): T {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n const {\n curNodeBucketIndex,\n curNodePointerIndex\n } = this._getElementIndex(pos);\n return this._map[curNodeBucketIndex][curNodePointerIndex]!;\n }\n setElementByPos(pos: number, element: T) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n const {\n curNodeBucketIndex,\n curNodePointerIndex\n } = this._getElementIndex(pos);\n this._map[curNodeBucketIndex][curNodePointerIndex] = element;\n }\n insert(pos: number, element: T, num = 1) {\n $checkWithinAccessParams!(pos, 0, this._length);\n if (pos === 0) {\n while (num--) this.pushFront(element);\n } else if (pos === this._length) {\n while (num--) this.pushBack(element);\n } else {\n const arr: T[] = [];\n for (let i = pos; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos - 1);\n for (let i = 0; i < num; ++i) this.pushBack(element);\n for (let i = 0; i < arr.length; ++i) this.pushBack(arr[i]);\n }\n return this._length;\n }\n /**\n * @description Remove all elements after the specified position (excluding the specified position).\n * @param pos - The previous position of the first removed element.\n * @returns The size of the container after cutting.\n * @example\n * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1]\n */\n cut(pos: number) {\n if (pos < 0) {\n this.clear();\n return 0;\n }\n const {\n curNodeBucketIndex,\n curNodePointerIndex\n } = this._getElementIndex(pos);\n this._last = curNodeBucketIndex;\n this._curLast = curNodePointerIndex;\n this._length = pos + 1;\n return this._length;\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n if (pos === 0) this.popFront();\n else if (pos === this._length - 1) this.popBack();\n else {\n const arr = [];\n for (let i = pos + 1; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n this.cut(pos);\n this.popBack();\n const self = this;\n arr.forEach(function (el) {\n self.pushBack(el);\n });\n }\n return this._length;\n }\n eraseElementByValue(value: T) {\n if (this._length === 0) return 0;\n const arr: T[] = [];\n for (let i = 0; i < this._length; ++i) {\n const element = this.getElementByPos(i);\n if (element !== value) arr.push(element);\n }\n const _length = arr.length;\n for (let i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]);\n return this.cut(_length - 1);\n }\n eraseElementByIterator(iter: DequeIterator) {\n const _node = iter._node;\n this.eraseElementByPos(_node);\n iter = iter.next();\n return iter;\n }\n find(element: T) {\n for (let i = 0; i < this._length; ++i) {\n if (this.getElementByPos(i) === element) {\n return new DequeIterator(i, this);\n }\n }\n return this.end();\n }\n reverse() {\n let l = 0; let r = this._length - 1;\n while (l < r) {\n const tmp = this.getElementByPos(l);\n this.setElementByPos(l, this.getElementByPos(r));\n this.setElementByPos(r, tmp);\n l += 1;\n r -= 1;\n }\n }\n unique() {\n if (this._length <= 1) {\n return this._length;\n }\n let index = 1;\n let pre = this.getElementByPos(0);\n for (let i = 1; i < this._length; ++i) {\n const cur = this.getElementByPos(i);\n if (cur !== pre) {\n pre = cur;\n this.setElementByPos(index++, cur);\n }\n }\n while (this._length > index) this.popBack();\n return this._length;\n }\n sort(cmp?: (x: T, y: T) => number) {\n const arr: T[] = [];\n for (let i = 0; i < this._length; ++i) {\n arr.push(this.getElementByPos(i));\n }\n arr.sort(cmp);\n for (let i = 0; i < this._length; ++i) this.setElementByPos(i, arr[i]);\n }\n /**\n * @description Remove as much useless space as possible.\n */\n shrinkToFit() {\n if (this._length === 0) return;\n const arr: T[] = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1);\n this._length = this._first = this._last = this._curFirst = this._curLast = 0;\n this._map = [];\n for (let i = 0; i < this._bucketNum; ++i) {\n this._map.push(new Array(this._bucketSize));\n }\n for (let i = 0; i < arr.length; ++i) this.pushBack(arr[i]);\n }\n forEach(callback: (element: T, index: number, deque: Deque) => void) {\n for (let i = 0; i < this._length; ++i) {\n callback(this.getElementByPos(i), i, this);\n }\n }\n [Symbol.iterator]() {\n return function * (this: Deque) {\n for (let i = 0; i < this._length; ++i) {\n yield this.getElementByPos(i);\n }\n }.bind(this)();\n }\n}\n\nexport default Deque;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts new file mode 100644 index 000000000..1aca8646b --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts @@ -0,0 +1,58 @@ +import SequentialContainer from './Base'; +import { ContainerIterator, initContainer } from "../ContainerBase"; +declare class LinkListIterator extends ContainerIterator { + readonly container: LinkList; + get pointer(): T; + set pointer(newValue: T); + copy(): LinkListIterator; + equals(iter: LinkListIterator): boolean; + pre(): this; + next(): this; +} +export type { LinkListIterator }; +declare class LinkList extends SequentialContainer { + constructor(container?: initContainer); + clear(): void; + begin(): LinkListIterator; + end(): LinkListIterator; + rBegin(): LinkListIterator; + rEnd(): LinkListIterator; + front(): T | undefined; + back(): T | undefined; + getElementByPos(pos: number): T; + eraseElementByPos(pos: number): number; + eraseElementByValue(_value: T): number; + eraseElementByIterator(iter: LinkListIterator): LinkListIterator; + pushBack(element: T): number; + popBack(): T | undefined; + /** + * @description Push an element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + pushFront(element: T): number; + /** + * @description Removes the first element. + * @returns The element you popped. + */ + popFront(): T | undefined; + setElementByPos(pos: number, element: T): void; + insert(pos: number, element: T, num?: number): number; + find(element: T): LinkListIterator; + reverse(): void; + unique(): number; + sort(cmp?: (x: T, y: T) => number): void; + /** + * @description Merges two sorted lists. + * @param list - The other list you want to merge (must be sorted). + * @returns The size of list after merging. + * @example + * const linkA = new LinkList([1, 3, 5]); + * const linkB = new LinkList([2, 4, 6]); + * linkA.merge(linkB); // [1, 2, 3, 4, 5]; + */ + merge(list: LinkList): number; + forEach(callback: (element: T, index: number, list: LinkList) => void): void; + [Symbol.iterator](): Generator; +} +export default LinkList; diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js new file mode 100644 index 000000000..17ce3e8a5 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js @@ -0,0 +1,456 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, i) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, i) { + t.__proto__ = i; + } || function(t, i) { + for (var r in i) if (Object.prototype.hasOwnProperty.call(i, r)) t[r] = i[r]; + }; + return extendStatics(t, i); + }; + return function(t, i) { + if (typeof i !== "function" && i !== null) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); + extendStatics(t, i); + function __() { + this.constructor = t; + } + t.prototype = i === null ? Object.create(i) : (__.prototype = i.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(t, i) { + var r = { + label: 0, + sent: function() { + if (e[0] & 1) throw e[1]; + return e[1]; + }, + trys: [], + ops: [] + }, n, s, e, h; + return h = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (h[Symbol.iterator] = function() { + return this; + }), h; + function verb(t) { + return function(i) { + return step([ t, i ]); + }; + } + function step(h) { + if (n) throw new TypeError("Generator is already executing."); + while (r) try { + if (n = 1, s && (e = h[0] & 2 ? s["return"] : h[0] ? s["throw"] || ((e = s["return"]) && e.call(s), + 0) : s.next) && !(e = e.call(s, h[1])).done) return e; + if (s = 0, e) h = [ h[0] & 2, e.value ]; + switch (h[0]) { + case 0: + case 1: + e = h; + break; + + case 4: + r.label++; + return { + value: h[1], + done: false + }; + + case 5: + r.label++; + s = h[1]; + h = [ 0 ]; + continue; + + case 7: + h = r.ops.pop(); + r.trys.pop(); + continue; + + default: + if (!(e = r.trys, e = e.length > 0 && e[e.length - 1]) && (h[0] === 6 || h[0] === 2)) { + r = 0; + continue; + } + if (h[0] === 3 && (!e || h[1] > e[0] && h[1] < e[3])) { + r.label = h[1]; + break; + } + if (h[0] === 6 && r.label < e[1]) { + r.label = e[1]; + e = h; + break; + } + if (e && r.label < e[2]) { + r.label = e[2]; + r.ops.push(h); + break; + } + if (e[2]) r.ops.pop(); + r.trys.pop(); + continue; + } + h = i.call(t, r); + } catch (t) { + h = [ 6, t ]; + s = 0; + } finally { + n = e = 0; + } + if (h[0] & 5) throw h[1]; + return { + value: h[0] ? h[1] : void 0, + done: true + }; + } +}; + +import SequentialContainer from "./Base"; + +import { ContainerIterator } from "../ContainerBase"; + +import { throwIteratorAccessError } from "../../utils/throwError"; + +var LinkListIterator = function(t) { + __extends(LinkListIterator, t); + function LinkListIterator(i, r, n, s) { + var e = t.call(this, s) || this; + e.o = i; + e.h = r; + e.container = n; + if (e.iteratorType === 0) { + e.pre = function() { + if (this.o.L === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.L; + return this; + }; + e.next = function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.m; + return this; + }; + } else { + e.pre = function() { + if (this.o.m === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.m; + return this; + }; + e.next = function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.L; + return this; + }; + } + return e; + } + Object.defineProperty(LinkListIterator.prototype, "pointer", { + get: function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + return this.o.p; + }, + set: function(t) { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o.p = t; + }, + enumerable: false, + configurable: true + }); + LinkListIterator.prototype.copy = function() { + return new LinkListIterator(this.o, this.h, this.container, this.iteratorType); + }; + return LinkListIterator; +}(ContainerIterator); + +var LinkList = function(t) { + __extends(LinkList, t); + function LinkList(i) { + if (i === void 0) { + i = []; + } + var r = t.call(this) || this; + r.h = {}; + r.H = r.l = r.h.L = r.h.m = r.h; + var n = r; + i.forEach((function(t) { + n.pushBack(t); + })); + return r; + } + LinkList.prototype.G = function(t) { + var i = t.L, r = t.m; + i.m = r; + r.L = i; + if (t === this.H) { + this.H = r; + } + if (t === this.l) { + this.l = i; + } + this.M -= 1; + }; + LinkList.prototype.F = function(t, i) { + var r = i.m; + var n = { + p: t, + L: i, + m: r + }; + i.m = n; + r.L = n; + if (i === this.h) { + this.H = n; + } + if (r === this.h) { + this.l = n; + } + this.M += 1; + }; + LinkList.prototype.clear = function() { + this.M = 0; + this.H = this.l = this.h.L = this.h.m = this.h; + }; + LinkList.prototype.begin = function() { + return new LinkListIterator(this.H, this.h, this); + }; + LinkList.prototype.end = function() { + return new LinkListIterator(this.h, this.h, this); + }; + LinkList.prototype.rBegin = function() { + return new LinkListIterator(this.l, this.h, this, 1); + }; + LinkList.prototype.rEnd = function() { + return new LinkListIterator(this.h, this.h, this, 1); + }; + LinkList.prototype.front = function() { + return this.H.p; + }; + LinkList.prototype.back = function() { + return this.l.p; + }; + LinkList.prototype.getElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var i = this.H; + while (t--) { + i = i.m; + } + return i.p; + }; + LinkList.prototype.eraseElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var i = this.H; + while (t--) { + i = i.m; + } + this.G(i); + return this.M; + }; + LinkList.prototype.eraseElementByValue = function(t) { + var i = this.H; + while (i !== this.h) { + if (i.p === t) { + this.G(i); + } + i = i.m; + } + return this.M; + }; + LinkList.prototype.eraseElementByIterator = function(t) { + var i = t.o; + if (i === this.h) { + throwIteratorAccessError(); + } + t = t.next(); + this.G(i); + return t; + }; + LinkList.prototype.pushBack = function(t) { + this.F(t, this.l); + return this.M; + }; + LinkList.prototype.popBack = function() { + if (this.M === 0) return; + var t = this.l.p; + this.G(this.l); + return t; + }; + LinkList.prototype.pushFront = function(t) { + this.F(t, this.h); + return this.M; + }; + LinkList.prototype.popFront = function() { + if (this.M === 0) return; + var t = this.H.p; + this.G(this.H); + return t; + }; + LinkList.prototype.setElementByPos = function(t, i) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + var r = this.H; + while (t--) { + r = r.m; + } + r.p = i; + }; + LinkList.prototype.insert = function(t, i, r) { + if (r === void 0) { + r = 1; + } + if (t < 0 || t > this.M) { + throw new RangeError; + } + if (r <= 0) return this.M; + if (t === 0) { + while (r--) this.pushFront(i); + } else if (t === this.M) { + while (r--) this.pushBack(i); + } else { + var n = this.H; + for (var s = 1; s < t; ++s) { + n = n.m; + } + var e = n.m; + this.M += r; + while (r--) { + n.m = { + p: i, + L: n + }; + n.m.L = n; + n = n.m; + } + n.m = e; + e.L = n; + } + return this.M; + }; + LinkList.prototype.find = function(t) { + var i = this.H; + while (i !== this.h) { + if (i.p === t) { + return new LinkListIterator(i, this.h, this); + } + i = i.m; + } + return this.end(); + }; + LinkList.prototype.reverse = function() { + if (this.M <= 1) return; + var t = this.H; + var i = this.l; + var r = 0; + while (r << 1 < this.M) { + var n = t.p; + t.p = i.p; + i.p = n; + t = t.m; + i = i.L; + r += 1; + } + }; + LinkList.prototype.unique = function() { + if (this.M <= 1) { + return this.M; + } + var t = this.H; + while (t !== this.h) { + var i = t; + while (i.m !== this.h && i.p === i.m.p) { + i = i.m; + this.M -= 1; + } + t.m = i.m; + t.m.L = t; + t = t.m; + } + return this.M; + }; + LinkList.prototype.sort = function(t) { + if (this.M <= 1) return; + var i = []; + this.forEach((function(t) { + i.push(t); + })); + i.sort(t); + var r = this.H; + i.forEach((function(t) { + r.p = t; + r = r.m; + })); + }; + LinkList.prototype.merge = function(t) { + var i = this; + if (this.M === 0) { + t.forEach((function(t) { + i.pushBack(t); + })); + } else { + var r = this.H; + t.forEach((function(t) { + while (r !== i.h && r.p <= t) { + r = r.m; + } + i.F(t, r.L); + })); + } + return this.M; + }; + LinkList.prototype.forEach = function(t) { + var i = this.H; + var r = 0; + while (i !== this.h) { + t(i.p, r++, this); + i = i.m; + } + }; + LinkList.prototype[Symbol.iterator] = function() { + return function() { + var t; + return __generator(this, (function(i) { + switch (i.label) { + case 0: + if (this.M === 0) return [ 2 ]; + t = this.H; + i.label = 1; + + case 1: + if (!(t !== this.h)) return [ 3, 3 ]; + return [ 4, t.p ]; + + case 2: + i.sent(); + t = t.m; + return [ 3, 1 ]; + + case 3: + return [ 2 ]; + } + })); + }.bind(this)(); + }; + return LinkList; +}(SequentialContainer); + +export default LinkList; +//# sourceMappingURL=LinkList.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js.map b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js.map new file mode 100644 index 000000000..a5edf4160 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/LinkList.js","../../src/container/SequentialContainer/LinkList.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","SequentialContainer","ContainerIterator","throwIteratorAccessError","LinkListIterator","_super","_node","_header","container","iteratorType","_this","pre","_pre","_next","defineProperty","get","_value","set","newValue","enumerable","configurable","copy","LinkList","_head","_tail","self","forEach","el","pushBack","_eraseNode","node","_length","_insertNode","clear","begin","end","rBegin","rEnd","front","back","getElementByPos","pos","RangeError","curNode","eraseElementByPos","eraseElementByValue","eraseElementByIterator","iter","element","popBack","pushFront","popFront","setElementByPos","insert","num","i","find","reverse","pHead","pTail","cnt","tmp","unique","tmpNode","sort","cmp","arr","merge","list","curNode_1","callback","index","_a","bind"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF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mD,GAAS;YAC/B+D,EAAS3B,EAAQ3B,GAAQuD,KAASnH;YAClCuF,IAAUA,EAAQ9B;AD2BhB;AACJ;ICzBFS,SAAAzD,UAACwB,OAAOC,YAAR;QACE,OAAO;YD2BC,IAAIqD;YACJ,OAAOtE,YAAYjB,OAAM,SAAUoH;gBAC/B,QAAQA,EAAG/F;kBACP,KAAK;oBC7BnB,IAAIrB,KAAK2E,MAAY,GAAG,OAAA,EAAA;oBACpBY,IAAUvF,KAAKmE;oBDgCDiD,EAAG/F,QAAQ;;kBACf,KAAK;oBACD,MCjCXkE,MAAYvF,KAAKmD,IAAO,OAAA,EAAA,GAAA;oBAC7B,OAAA,EAAA,GAAMoC,EAAQ3B;;kBDkCF,KAAK;oBClCjBwD,EAAA9F;oBACAiE,IAAUA,EAAQ9B;oBDoCF,OAAO,EAAC,GAAa;;kBACzB,KAAK;oBAAG,OAAO,EAAC;;AAExB;AACJ,UCtCF4D,KAAKrH,KAPA;AD8CP;ICrCJ,OAAAkE;AAAA,CA3RA,CAA0BrB;;eA6RXqB","file":"LinkList.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport SequentialContainer from './Base';\nimport { ContainerIterator } from \"../ContainerBase\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nvar LinkListIterator = /** @class */ (function (_super) {\n __extends(LinkListIterator, _super);\n /**\n * @internal\n */\n function LinkListIterator(_node, _header, container, iteratorType) {\n var _this = _super.call(this, iteratorType) || this;\n _this._node = _node;\n _this._header = _header;\n _this.container = container;\n if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {\n _this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n _this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n }\n else {\n _this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n _this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n return _this;\n }\n Object.defineProperty(LinkListIterator.prototype, \"pointer\", {\n get: function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._value;\n },\n set: function (newValue) {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node._value = newValue;\n },\n enumerable: false,\n configurable: true\n });\n LinkListIterator.prototype.copy = function () {\n return new LinkListIterator(this._node, this._header, this.container, this.iteratorType);\n };\n return LinkListIterator;\n}(ContainerIterator));\nvar LinkList = /** @class */ (function (_super) {\n __extends(LinkList, _super);\n function LinkList(container) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this) || this;\n _this._header = {};\n _this._head = _this._tail = _this._header._pre = _this._header._next = _this._header;\n var self = _this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n return _this;\n }\n /**\n * @internal\n */\n LinkList.prototype._eraseNode = function (node) {\n var _pre = node._pre, _next = node._next;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n };\n /**\n * @internal\n */\n LinkList.prototype._insertNode = function (value, pre) {\n var next = pre._next;\n var node = {\n _value: value,\n _pre: pre,\n _next: next\n };\n pre._next = node;\n next._pre = node;\n if (pre === this._header) {\n this._head = node;\n }\n if (next === this._header) {\n this._tail = node;\n }\n this._length += 1;\n };\n LinkList.prototype.clear = function () {\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n };\n LinkList.prototype.begin = function () {\n return new LinkListIterator(this._head, this._header, this);\n };\n LinkList.prototype.end = function () {\n return new LinkListIterator(this._header, this._header, this);\n };\n LinkList.prototype.rBegin = function () {\n return new LinkListIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n LinkList.prototype.rEnd = function () {\n return new LinkListIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n LinkList.prototype.front = function () {\n return this._head._value;\n };\n LinkList.prototype.back = function () {\n return this._tail._value;\n };\n LinkList.prototype.getElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n return curNode._value;\n };\n LinkList.prototype.eraseElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n this._eraseNode(curNode);\n return this._length;\n };\n LinkList.prototype.eraseElementByValue = function (_value) {\n var curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === _value) {\n this._eraseNode(curNode);\n }\n curNode = curNode._next;\n }\n return this._length;\n };\n LinkList.prototype.eraseElementByIterator = function (iter) {\n var node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n iter = iter.next();\n this._eraseNode(node);\n return iter;\n };\n LinkList.prototype.pushBack = function (element) {\n this._insertNode(element, this._tail);\n return this._length;\n };\n LinkList.prototype.popBack = function () {\n if (this._length === 0)\n return;\n var value = this._tail._value;\n this._eraseNode(this._tail);\n return value;\n };\n /**\n * @description Push an element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n LinkList.prototype.pushFront = function (element) {\n this._insertNode(element, this._header);\n return this._length;\n };\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n LinkList.prototype.popFront = function () {\n if (this._length === 0)\n return;\n var value = this._head._value;\n this._eraseNode(this._head);\n return value;\n };\n LinkList.prototype.setElementByPos = function (pos, element) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n curNode._value = element;\n };\n LinkList.prototype.insert = function (pos, element, num) {\n if (num === void 0) { num = 1; }\n if (pos < 0 || pos > this._length) {\n throw new RangeError();\n }\n if (num <= 0)\n return this._length;\n if (pos === 0) {\n while (num--)\n this.pushFront(element);\n }\n else if (pos === this._length) {\n while (num--)\n this.pushBack(element);\n }\n else {\n var curNode = this._head;\n for (var i = 1; i < pos; ++i) {\n curNode = curNode._next;\n }\n var next = curNode._next;\n this._length += num;\n while (num--) {\n curNode._next = {\n _value: element,\n _pre: curNode\n };\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n curNode._next = next;\n next._pre = curNode;\n }\n return this._length;\n };\n LinkList.prototype.find = function (element) {\n var curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === element) {\n return new LinkListIterator(curNode, this._header, this);\n }\n curNode = curNode._next;\n }\n return this.end();\n };\n LinkList.prototype.reverse = function () {\n if (this._length <= 1)\n return;\n var pHead = this._head;\n var pTail = this._tail;\n var cnt = 0;\n while ((cnt << 1) < this._length) {\n var tmp = pHead._value;\n pHead._value = pTail._value;\n pTail._value = tmp;\n pHead = pHead._next;\n pTail = pTail._pre;\n cnt += 1;\n }\n };\n LinkList.prototype.unique = function () {\n if (this._length <= 1) {\n return this._length;\n }\n var curNode = this._head;\n while (curNode !== this._header) {\n var tmpNode = curNode;\n while (tmpNode._next !== this._header &&\n tmpNode._value === tmpNode._next._value) {\n tmpNode = tmpNode._next;\n this._length -= 1;\n }\n curNode._next = tmpNode._next;\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n return this._length;\n };\n LinkList.prototype.sort = function (cmp) {\n if (this._length <= 1)\n return;\n var arr = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n arr.sort(cmp);\n var curNode = this._head;\n arr.forEach(function (element) {\n curNode._value = element;\n curNode = curNode._next;\n });\n };\n /**\n * @description Merges two sorted lists.\n * @param list - The other list you want to merge (must be sorted).\n * @returns The size of list after merging.\n * @example\n * const linkA = new LinkList([1, 3, 5]);\n * const linkB = new LinkList([2, 4, 6]);\n * linkA.merge(linkB); // [1, 2, 3, 4, 5];\n */\n LinkList.prototype.merge = function (list) {\n var self = this;\n if (this._length === 0) {\n list.forEach(function (el) {\n self.pushBack(el);\n });\n }\n else {\n var curNode_1 = this._head;\n list.forEach(function (el) {\n while (curNode_1 !== self._header &&\n curNode_1._value <= el) {\n curNode_1 = curNode_1._next;\n }\n self._insertNode(el, curNode_1._pre);\n });\n }\n return this._length;\n };\n LinkList.prototype.forEach = function (callback) {\n var curNode = this._head;\n var index = 0;\n while (curNode !== this._header) {\n callback(curNode._value, index++, this);\n curNode = curNode._next;\n }\n };\n LinkList.prototype[Symbol.iterator] = function () {\n return function () {\n var curNode;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this._length === 0)\n return [2 /*return*/];\n curNode = this._head;\n _a.label = 1;\n case 1:\n if (!(curNode !== this._header)) return [3 /*break*/, 3];\n return [4 /*yield*/, curNode._value];\n case 2:\n _a.sent();\n curNode = curNode._next;\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n }.bind(this)();\n };\n return LinkList;\n}(SequentialContainer));\nexport default LinkList;\n","import SequentialContainer from './Base';\nimport { ContainerIterator, initContainer, IteratorType } from '@/container/ContainerBase';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\ntype LinkNode = {\n _value: T;\n _pre: LinkNode;\n _next: LinkNode;\n}\n\nclass LinkListIterator extends ContainerIterator {\n readonly container: LinkList;\n /**\n * @internal\n */\n _node: LinkNode;\n /**\n * @internal\n */\n private readonly _header: LinkNode;\n /**\n * @internal\n */\n constructor(\n _node: LinkNode,\n _header: LinkNode,\n container: LinkList,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = _node;\n this._header = _header;\n this.container = container;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node._pre === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node._next === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next;\n return this;\n };\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre;\n return this;\n };\n }\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._value;\n }\n set pointer(newValue: T) {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node._value = newValue;\n }\n copy() {\n return new LinkListIterator(this._node, this._header, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: LinkListIterator): boolean;\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n\nexport type { LinkListIterator };\n\nclass LinkList extends SequentialContainer {\n /**\n * @internal\n */\n private _head: LinkNode;\n /**\n * @internal\n */\n private _tail: LinkNode;\n /**\n * @internal\n */\n private readonly _header: LinkNode;\n constructor(container: initContainer = []) {\n super();\n this._header = >{};\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n const self = this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n }\n /**\n * @internal\n */\n private _eraseNode(node: LinkNode) {\n const { _pre, _next } = node;\n _pre._next = _next;\n _next._pre = _pre;\n if (node === this._head) {\n this._head = _next;\n }\n if (node === this._tail) {\n this._tail = _pre;\n }\n this._length -= 1;\n }\n /**\n * @internal\n */\n private _insertNode(value: T, pre: LinkNode) {\n const next = pre._next;\n const node = {\n _value: value,\n _pre: pre,\n _next: next\n };\n pre._next = node;\n next._pre = node;\n if (pre === this._header) {\n this._head = node;\n }\n if (next === this._header) {\n this._tail = node;\n }\n this._length += 1;\n }\n clear() {\n this._length = 0;\n this._head = this._tail = this._header._pre = this._header._next = this._header;\n }\n begin() {\n return new LinkListIterator(this._head, this._header, this);\n }\n end() {\n return new LinkListIterator(this._header, this._header, this);\n }\n rBegin() {\n return new LinkListIterator(this._tail, this._header, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new LinkListIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front(): T | undefined {\n return this._head._value;\n }\n back(): T | undefined {\n return this._tail._value;\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n return curNode._value;\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n this._eraseNode(curNode);\n return this._length;\n }\n eraseElementByValue(_value: T) {\n let curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === _value) {\n this._eraseNode(curNode);\n }\n curNode = curNode._next;\n }\n return this._length;\n }\n eraseElementByIterator(iter: LinkListIterator) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n iter = iter.next();\n this._eraseNode(node);\n return iter;\n }\n pushBack(element: T) {\n this._insertNode(element, this._tail);\n return this._length;\n }\n popBack() {\n if (this._length === 0) return;\n const value = this._tail._value;\n this._eraseNode(this._tail);\n return value;\n }\n /**\n * @description Push an element to the front.\n * @param element - The element you want to push.\n * @returns The size of queue after pushing.\n */\n pushFront(element: T) {\n this._insertNode(element, this._header);\n return this._length;\n }\n /**\n * @description Removes the first element.\n * @returns The element you popped.\n */\n popFront() {\n if (this._length === 0) return;\n const value = this._head._value;\n this._eraseNode(this._head);\n return value;\n }\n setElementByPos(pos: number, element: T) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let curNode = this._head;\n while (pos--) {\n curNode = curNode._next;\n }\n curNode._value = element;\n }\n insert(pos: number, element: T, num = 1) {\n $checkWithinAccessParams!(pos, 0, this._length);\n if (num <= 0) return this._length;\n if (pos === 0) {\n while (num--) this.pushFront(element);\n } else if (pos === this._length) {\n while (num--) this.pushBack(element);\n } else {\n let curNode = this._head;\n for (let i = 1; i < pos; ++i) {\n curNode = curNode._next;\n }\n const next = curNode._next;\n this._length += num;\n while (num--) {\n curNode._next = >{\n _value: element,\n _pre: curNode\n };\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n curNode._next = next;\n next._pre = curNode;\n }\n return this._length;\n }\n find(element: T) {\n let curNode = this._head;\n while (curNode !== this._header) {\n if (curNode._value === element) {\n return new LinkListIterator(curNode, this._header, this);\n }\n curNode = curNode._next;\n }\n return this.end();\n }\n reverse() {\n if (this._length <= 1) return;\n let pHead = this._head;\n let pTail = this._tail;\n let cnt = 0;\n while ((cnt << 1) < this._length) {\n const tmp = pHead._value;\n pHead._value = pTail._value;\n pTail._value = tmp;\n pHead = pHead._next;\n pTail = pTail._pre;\n cnt += 1;\n }\n }\n unique() {\n if (this._length <= 1) {\n return this._length;\n }\n let curNode = this._head;\n while (curNode !== this._header) {\n let tmpNode = curNode;\n while (\n tmpNode._next !== this._header &&\n tmpNode._value === tmpNode._next._value\n ) {\n tmpNode = tmpNode._next;\n this._length -= 1;\n }\n curNode._next = tmpNode._next;\n curNode._next._pre = curNode;\n curNode = curNode._next;\n }\n return this._length;\n }\n sort(cmp?: (x: T, y: T) => number) {\n if (this._length <= 1) return;\n const arr: T[] = [];\n this.forEach(function (el) {\n arr.push(el);\n });\n arr.sort(cmp);\n let curNode: LinkNode = this._head;\n arr.forEach(function (element) {\n curNode._value = element;\n curNode = curNode._next;\n });\n }\n /**\n * @description Merges two sorted lists.\n * @param list - The other list you want to merge (must be sorted).\n * @returns The size of list after merging.\n * @example\n * const linkA = new LinkList([1, 3, 5]);\n * const linkB = new LinkList([2, 4, 6]);\n * linkA.merge(linkB); // [1, 2, 3, 4, 5];\n */\n merge(list: LinkList) {\n const self = this;\n if (this._length === 0) {\n list.forEach(function (el) {\n self.pushBack(el);\n });\n } else {\n let curNode = this._head;\n list.forEach(function (el) {\n while (\n curNode !== self._header &&\n curNode._value <= el\n ) {\n curNode = curNode._next;\n }\n self._insertNode(el, curNode._pre);\n });\n }\n return this._length;\n }\n forEach(callback: (element: T, index: number, list: LinkList) => void) {\n let curNode = this._head;\n let index = 0;\n while (curNode !== this._header) {\n callback(curNode._value, index++, this);\n curNode = curNode._next;\n }\n }\n [Symbol.iterator]() {\n return function * (this: LinkList) {\n if (this._length === 0) return;\n let curNode = this._head;\n while (curNode !== this._header) {\n yield curNode._value;\n curNode = curNode._next;\n }\n }.bind(this)();\n }\n}\n\nexport default LinkList;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts new file mode 100644 index 000000000..d26df418f --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts @@ -0,0 +1,40 @@ +import SequentialContainer from './Base'; +import { initContainer, IteratorType } from "../ContainerBase"; +import { RandomIterator } from "./Base/RandomIterator"; +declare class VectorIterator extends RandomIterator { + container: Vector; + constructor(node: number, container: Vector, iteratorType?: IteratorType); + copy(): VectorIterator; + equals(iter: VectorIterator): boolean; +} +export type { VectorIterator }; +declare class Vector extends SequentialContainer { + /** + * @param container - Initialize container, must have a forEach function. + * @param copy - When the container is an array, you can choose to directly operate on the original object of + * the array or perform a shallow copy. The default is shallow copy. + */ + constructor(container?: initContainer, copy?: boolean); + clear(): void; + begin(): VectorIterator; + end(): VectorIterator; + rBegin(): VectorIterator; + rEnd(): VectorIterator; + front(): T | undefined; + back(): T | undefined; + getElementByPos(pos: number): T; + eraseElementByPos(pos: number): number; + eraseElementByValue(value: T): number; + eraseElementByIterator(iter: VectorIterator): VectorIterator; + pushBack(element: T): number; + popBack(): T | undefined; + setElementByPos(pos: number, element: T): void; + insert(pos: number, element: T, num?: number): number; + find(element: T): VectorIterator; + reverse(): void; + unique(): number; + sort(cmp?: (x: T, y: T) => number): void; + forEach(callback: (element: T, index: number, vector: Vector) => void): void; + [Symbol.iterator](): Generator; +} +export default Vector; diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js new file mode 100644 index 000000000..deaa34270 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js @@ -0,0 +1,323 @@ +var __extends = this && this.t || function() { + var extendStatics = function(t, r) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(t, r) { + t.__proto__ = r; + } || function(t, r) { + for (var e in r) if (Object.prototype.hasOwnProperty.call(r, e)) t[e] = r[e]; + }; + return extendStatics(t, r); + }; + return function(t, r) { + if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); + extendStatics(t, r); + function __() { + this.constructor = t; + } + t.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(t, r) { + var e = { + label: 0, + sent: function() { + if (o[0] & 1) throw o[1]; + return o[1]; + }, + trys: [], + ops: [] + }, n, i, o, u; + return u = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (u[Symbol.iterator] = function() { + return this; + }), u; + function verb(t) { + return function(r) { + return step([ t, r ]); + }; + } + function step(u) { + if (n) throw new TypeError("Generator is already executing."); + while (e) try { + if (n = 1, i && (o = u[0] & 2 ? i["return"] : u[0] ? i["throw"] || ((o = i["return"]) && o.call(i), + 0) : i.next) && !(o = o.call(i, u[1])).done) return o; + if (i = 0, o) u = [ u[0] & 2, o.value ]; + switch (u[0]) { + case 0: + case 1: + o = u; + break; + + case 4: + e.label++; + return { + value: u[1], + done: false + }; + + case 5: + e.label++; + i = u[1]; + u = [ 0 ]; + continue; + + case 7: + u = e.ops.pop(); + e.trys.pop(); + continue; + + default: + if (!(o = e.trys, o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) { + e = 0; + continue; + } + if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) { + e.label = u[1]; + break; + } + if (u[0] === 6 && e.label < o[1]) { + e.label = o[1]; + o = u; + break; + } + if (o && e.label < o[2]) { + e.label = o[2]; + e.ops.push(u); + break; + } + if (o[2]) e.ops.pop(); + e.trys.pop(); + continue; + } + u = r.call(t, e); + } catch (t) { + u = [ 6, t ]; + i = 0; + } finally { + n = o = 0; + } + if (u[0] & 5) throw u[1]; + return { + value: u[0] ? u[1] : void 0, + done: true + }; + } +}; + +var __read = this && this.q || function(t, r) { + var e = typeof Symbol === "function" && t[Symbol.iterator]; + if (!e) return t; + var n = e.call(t), i, o = [], u; + try { + while ((r === void 0 || r-- > 0) && !(i = n.next()).done) o.push(i.value); + } catch (t) { + u = { + error: t + }; + } finally { + try { + if (i && !i.done && (e = n["return"])) e.call(n); + } finally { + if (u) throw u.error; + } + } + return o; +}; + +var __spreadArray = this && this.D || function(t, r, e) { + if (e || arguments.length === 2) for (var n = 0, i = r.length, o; n < i; n++) { + if (o || !(n in r)) { + if (!o) o = Array.prototype.slice.call(r, 0, n); + o[n] = r[n]; + } + } + return t.concat(o || Array.prototype.slice.call(r)); +}; + +var __values = this && this.V || function(t) { + var r = typeof Symbol === "function" && Symbol.iterator, e = r && t[r], n = 0; + if (e) return e.call(t); + if (t && typeof t.length === "number") return { + next: function() { + if (t && n >= t.length) t = void 0; + return { + value: t && t[n++], + done: !t + }; + } + }; + throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; + +import SequentialContainer from "./Base"; + +import { RandomIterator } from "./Base/RandomIterator"; + +var VectorIterator = function(t) { + __extends(VectorIterator, t); + function VectorIterator(r, e, n) { + var i = t.call(this, r, n) || this; + i.container = e; + return i; + } + VectorIterator.prototype.copy = function() { + return new VectorIterator(this.o, this.container, this.iteratorType); + }; + return VectorIterator; +}(RandomIterator); + +var Vector = function(t) { + __extends(Vector, t); + function Vector(r, e) { + if (r === void 0) { + r = []; + } + if (e === void 0) { + e = true; + } + var n = t.call(this) || this; + if (Array.isArray(r)) { + n.J = e ? __spreadArray([], __read(r), false) : r; + n.M = r.length; + } else { + n.J = []; + var i = n; + r.forEach((function(t) { + i.pushBack(t); + })); + } + return n; + } + Vector.prototype.clear = function() { + this.M = 0; + this.J.length = 0; + }; + Vector.prototype.begin = function() { + return new VectorIterator(0, this); + }; + Vector.prototype.end = function() { + return new VectorIterator(this.M, this); + }; + Vector.prototype.rBegin = function() { + return new VectorIterator(this.M - 1, this, 1); + }; + Vector.prototype.rEnd = function() { + return new VectorIterator(-1, this, 1); + }; + Vector.prototype.front = function() { + return this.J[0]; + }; + Vector.prototype.back = function() { + return this.J[this.M - 1]; + }; + Vector.prototype.getElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + return this.J[t]; + }; + Vector.prototype.eraseElementByPos = function(t) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + this.J.splice(t, 1); + this.M -= 1; + return this.M; + }; + Vector.prototype.eraseElementByValue = function(t) { + var r = 0; + for (var e = 0; e < this.M; ++e) { + if (this.J[e] !== t) { + this.J[r++] = this.J[e]; + } + } + this.M = this.J.length = r; + return this.M; + }; + Vector.prototype.eraseElementByIterator = function(t) { + var r = t.o; + t = t.next(); + this.eraseElementByPos(r); + return t; + }; + Vector.prototype.pushBack = function(t) { + this.J.push(t); + this.M += 1; + return this.M; + }; + Vector.prototype.popBack = function() { + if (this.M === 0) return; + this.M -= 1; + return this.J.pop(); + }; + Vector.prototype.setElementByPos = function(t, r) { + if (t < 0 || t > this.M - 1) { + throw new RangeError; + } + this.J[t] = r; + }; + Vector.prototype.insert = function(t, r, e) { + var n; + if (e === void 0) { + e = 1; + } + if (t < 0 || t > this.M) { + throw new RangeError; + } + (n = this.J).splice.apply(n, __spreadArray([ t, 0 ], __read(new Array(e).fill(r)), false)); + this.M += e; + return this.M; + }; + Vector.prototype.find = function(t) { + for (var r = 0; r < this.M; ++r) { + if (this.J[r] === t) { + return new VectorIterator(r, this); + } + } + return this.end(); + }; + Vector.prototype.reverse = function() { + this.J.reverse(); + }; + Vector.prototype.unique = function() { + var t = 1; + for (var r = 1; r < this.M; ++r) { + if (this.J[r] !== this.J[r - 1]) { + this.J[t++] = this.J[r]; + } + } + this.M = this.J.length = t; + return this.M; + }; + Vector.prototype.sort = function(t) { + this.J.sort(t); + }; + Vector.prototype.forEach = function(t) { + for (var r = 0; r < this.M; ++r) { + t(this.J[r], r, this); + } + }; + Vector.prototype[Symbol.iterator] = function() { + return function() { + return __generator(this, (function(t) { + switch (t.label) { + case 0: + return [ 5, __values(this.J) ]; + + case 1: + t.sent(); + return [ 2 ]; + } + })); + }.bind(this)(); + }; + return Vector; +}(SequentialContainer); + +export default Vector; +//# sourceMappingURL=Vector.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js.map b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js.map new file mode 100644 index 000000000..225a82d7e --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/SequentialContainer/Vector.js","../../src/container/SequentialContainer/Vector.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","__read","o","m","i","r","ar","error","__spreadArray","to","from","pack","arguments","l","slice","concat","__values","s","SequentialContainer","RandomIterator","VectorIterator","_super","node","container","iteratorType","_this","copy","_node","Vector","isArray","_vector","_length","self_1","forEach","el","pushBack","clear","begin","end","rBegin","rEnd","front","back","getElementByPos","pos","RangeError","eraseElementByPos","splice","eraseElementByValue","index","eraseElementByIterator","iter","element","popBack","setElementByPos","insert","num","_a","apply","fill","find","reverse","unique","sort","cmp","callback","bind"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aA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AAQ1B,IAAI,IAAI;gBAC3ChD,KAAK0E,EAAQmB,OAAW7F,KAAK0E,EAAQ1B;ADsFjC;AACJ;QCpFJhD,KAAK2E,IAAU3E,KAAK0E,EAAQhC,SAASmD;QACrC,OAAO7F,KAAK2E;ADsFZ;ICpFFH,OAAA/D,UAAAkG,OAAA,SAAKC;QACH5G,KAAK0E,EAAQiC,KAAKC;ADsFlB;ICpFFpC,OAAA/D,UAAAoE,UAAA,SAAQgC;QACN,KAAK,IAAI7D,IAAI,GAAGA,IAAIhD,KAAK2E,KAAW3B,GAAG;YACrC6D,EAAS7G,KAAK0E,EAAQ1B,IAAIA,GAAGhD;ADsF3B;AACJ;ICpFFwE,OAAA/D,UAACwB,OAAOC,YAAR;QACE,OAAO;YDsFC,OAAOjB,YAAYjB,OAAM,SAAUqG;gBAC/B,QAAQA,EAAGhF;kBACP,KAAK;oBCvFnB,OAAA,EAAA,GAAAuC,SAAQ5D,KAAK0E;;kBDwFC,KAAK;oBCxFnB2B,EAAA/E;oBD0FkB,OAAO,EAAC;;AAEpB;AACJ,UC5FFwF,KAAK9G,KAFA;AD+FP;IC3FJ,OAAAwE;AAAA,CA7HA,CAAwBV;;eA+HTU","file":"Vector.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nimport SequentialContainer from './Base';\nimport { RandomIterator } from \"./Base/RandomIterator\";\nimport $checkWithinAccessParams from \"../../utils/checkParams.macro\";\nvar VectorIterator = /** @class */ (function (_super) {\n __extends(VectorIterator, _super);\n function VectorIterator(node, container, iteratorType) {\n var _this = _super.call(this, node, iteratorType) || this;\n _this.container = container;\n return _this;\n }\n VectorIterator.prototype.copy = function () {\n return new VectorIterator(this._node, this.container, this.iteratorType);\n };\n return VectorIterator;\n}(RandomIterator));\nvar Vector = /** @class */ (function (_super) {\n __extends(Vector, _super);\n /**\n * @param container - Initialize container, must have a forEach function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n */\n function Vector(container, copy) {\n if (container === void 0) { container = []; }\n if (copy === void 0) { copy = true; }\n var _this = _super.call(this) || this;\n if (Array.isArray(container)) {\n _this._vector = copy ? __spreadArray([], __read(container), false) : container;\n _this._length = container.length;\n }\n else {\n _this._vector = [];\n var self_1 = _this;\n container.forEach(function (el) {\n self_1.pushBack(el);\n });\n }\n return _this;\n }\n Vector.prototype.clear = function () {\n this._length = 0;\n this._vector.length = 0;\n };\n Vector.prototype.begin = function () {\n return new VectorIterator(0, this);\n };\n Vector.prototype.end = function () {\n return new VectorIterator(this._length, this);\n };\n Vector.prototype.rBegin = function () {\n return new VectorIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */);\n };\n Vector.prototype.rEnd = function () {\n return new VectorIterator(-1, this, 1 /* IteratorType.REVERSE */);\n };\n Vector.prototype.front = function () {\n return this._vector[0];\n };\n Vector.prototype.back = function () {\n return this._vector[this._length - 1];\n };\n Vector.prototype.getElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n return this._vector[pos];\n };\n Vector.prototype.eraseElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n this._vector.splice(pos, 1);\n this._length -= 1;\n return this._length;\n };\n Vector.prototype.eraseElementByValue = function (value) {\n var index = 0;\n for (var i = 0; i < this._length; ++i) {\n if (this._vector[i] !== value) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n };\n Vector.prototype.eraseElementByIterator = function (iter) {\n var _node = iter._node;\n iter = iter.next();\n this.eraseElementByPos(_node);\n return iter;\n };\n Vector.prototype.pushBack = function (element) {\n this._vector.push(element);\n this._length += 1;\n return this._length;\n };\n Vector.prototype.popBack = function () {\n if (this._length === 0)\n return;\n this._length -= 1;\n return this._vector.pop();\n };\n Vector.prototype.setElementByPos = function (pos, element) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n this._vector[pos] = element;\n };\n Vector.prototype.insert = function (pos, element, num) {\n var _a;\n if (num === void 0) { num = 1; }\n if (pos < 0 || pos > this._length) {\n throw new RangeError();\n }\n (_a = this._vector).splice.apply(_a, __spreadArray([pos, 0], __read(new Array(num).fill(element)), false));\n this._length += num;\n return this._length;\n };\n Vector.prototype.find = function (element) {\n for (var i = 0; i < this._length; ++i) {\n if (this._vector[i] === element) {\n return new VectorIterator(i, this);\n }\n }\n return this.end();\n };\n Vector.prototype.reverse = function () {\n this._vector.reverse();\n };\n Vector.prototype.unique = function () {\n var index = 1;\n for (var i = 1; i < this._length; ++i) {\n if (this._vector[i] !== this._vector[i - 1]) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n };\n Vector.prototype.sort = function (cmp) {\n this._vector.sort(cmp);\n };\n Vector.prototype.forEach = function (callback) {\n for (var i = 0; i < this._length; ++i) {\n callback(this._vector[i], i, this);\n }\n };\n Vector.prototype[Symbol.iterator] = function () {\n return function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [5 /*yield**/, __values(this._vector)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n }.bind(this)();\n };\n return Vector;\n}(SequentialContainer));\nexport default Vector;\n","import SequentialContainer from './Base';\nimport { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { RandomIterator } from '@/container/SequentialContainer/Base/RandomIterator';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\n\nclass VectorIterator extends RandomIterator {\n container: Vector;\n constructor(node: number, container: Vector, iteratorType?: IteratorType) {\n super(node, iteratorType);\n this.container = container;\n }\n copy() {\n return new VectorIterator(this._node, this.container, this.iteratorType);\n }\n // @ts-ignore\n equals(iter: VectorIterator): boolean;\n}\n\nexport type { VectorIterator };\n\nclass Vector extends SequentialContainer {\n /**\n * @internal\n */\n private readonly _vector: T[];\n /**\n * @param container - Initialize container, must have a forEach function.\n * @param copy - When the container is an array, you can choose to directly operate on the original object of\n * the array or perform a shallow copy. The default is shallow copy.\n */\n constructor(container: initContainer = [], copy = true) {\n super();\n if (Array.isArray(container)) {\n this._vector = copy ? [...container] : container;\n this._length = container.length;\n } else {\n this._vector = [];\n const self = this;\n container.forEach(function (el) {\n self.pushBack(el);\n });\n }\n }\n clear() {\n this._length = 0;\n this._vector.length = 0;\n }\n begin() {\n return new VectorIterator(0, this);\n }\n end() {\n return new VectorIterator(this._length, this);\n }\n rBegin() {\n return new VectorIterator(this._length - 1, this, IteratorType.REVERSE);\n }\n rEnd() {\n return new VectorIterator(-1, this, IteratorType.REVERSE);\n }\n front(): T | undefined {\n return this._vector[0];\n }\n back(): T | undefined {\n return this._vector[this._length - 1];\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n return this._vector[pos];\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n this._vector.splice(pos, 1);\n this._length -= 1;\n return this._length;\n }\n eraseElementByValue(value: T) {\n let index = 0;\n for (let i = 0; i < this._length; ++i) {\n if (this._vector[i] !== value) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n }\n eraseElementByIterator(iter: VectorIterator) {\n const _node = iter._node;\n iter = iter.next();\n this.eraseElementByPos(_node);\n return iter;\n }\n pushBack(element: T) {\n this._vector.push(element);\n this._length += 1;\n return this._length;\n }\n popBack() {\n if (this._length === 0) return;\n this._length -= 1;\n return this._vector.pop();\n }\n setElementByPos(pos: number, element: T) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n this._vector[pos] = element;\n }\n insert(pos: number, element: T, num = 1) {\n $checkWithinAccessParams!(pos, 0, this._length);\n this._vector.splice(pos, 0, ...new Array(num).fill(element));\n this._length += num;\n return this._length;\n }\n find(element: T) {\n for (let i = 0; i < this._length; ++i) {\n if (this._vector[i] === element) {\n return new VectorIterator(i, this);\n }\n }\n return this.end();\n }\n reverse() {\n this._vector.reverse();\n }\n unique() {\n let index = 1;\n for (let i = 1; i < this._length; ++i) {\n if (this._vector[i] !== this._vector[i - 1]) {\n this._vector[index++] = this._vector[i];\n }\n }\n this._length = this._vector.length = index;\n return this._length;\n }\n sort(cmp?: (x: T, y: T) => number) {\n this._vector.sort(cmp);\n }\n forEach(callback: (element: T, index: number, vector: Vector) => void) {\n for (let i = 0; i < this._length; ++i) {\n callback(this._vector[i], i, this);\n }\n }\n [Symbol.iterator]() {\n return function * (this: Vector) {\n yield * this._vector;\n }.bind(this)();\n }\n}\n\nexport default Vector;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts new file mode 100644 index 000000000..e6288572a --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts @@ -0,0 +1,18 @@ +import { ContainerIterator } from "../../ContainerBase"; +import TreeContainer from "./index"; +declare abstract class TreeIterator extends ContainerIterator { + abstract readonly container: TreeContainer; + /** + * @description Get the sequential index of the iterator in the tree container.
+ * Note: + * This function only takes effect when the specified tree container `enableIndex = true`. + * @returns The index subscript of the node in the tree. + * @example + * const st = new OrderedSet([1, 2, 3], true); + * console.log(st.begin().next().index); // 1 + */ + get index(): number; + pre(): this; + next(): this; +} +export default TreeIterator; diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js new file mode 100644 index 000000000..3e4f5c7e1 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js @@ -0,0 +1,98 @@ +var __extends = this && this.t || function() { + var extendStatics = function(r, t) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(r, t) { + r.__proto__ = t; + } || function(r, t) { + for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) r[e] = t[e]; + }; + return extendStatics(r, t); + }; + return function(r, t) { + if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); + extendStatics(r, t); + function __() { + this.constructor = r; + } + r.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __); + }; +}(); + +import { ContainerIterator } from "../../ContainerBase"; + +import { throwIteratorAccessError } from "../../../utils/throwError"; + +var TreeIterator = function(r) { + __extends(TreeIterator, r); + function TreeIterator(t, e, i) { + var n = r.call(this, i) || this; + n.o = t; + n.h = e; + if (n.iteratorType === 0) { + n.pre = function() { + if (this.o === this.h.K) { + throwIteratorAccessError(); + } + this.o = this.o.L(); + return this; + }; + n.next = function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.m(); + return this; + }; + } else { + n.pre = function() { + if (this.o === this.h.N) { + throwIteratorAccessError(); + } + this.o = this.o.m(); + return this; + }; + n.next = function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + this.o = this.o.L(); + return this; + }; + } + return n; + } + Object.defineProperty(TreeIterator.prototype, "index", { + get: function() { + var r = this.o; + var t = this.h.rr; + if (r === this.h) { + if (t) { + return t.tr - 1; + } + return 0; + } + var e = 0; + if (r.K) { + e += r.K.tr; + } + while (r !== t) { + var i = r.rr; + if (r === i.N) { + e += 1; + if (i.K) { + e += i.K.tr; + } + } + r = i; + } + return e; + }, + enumerable: false, + configurable: true + }); + return TreeIterator; +}(ContainerIterator); + +export default TreeIterator; +//# sourceMappingURL=TreeIterator.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js.map b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js.map new file mode 100644 index 000000000..85dad7de7 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/Base/TreeIterator.js","../../src/container/TreeContainer/Base/TreeIterator.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","ContainerIterator","throwIteratorAccessError","TreeIterator","_super","node","header","iteratorType","_this","_node","_header","pre","_left","_pre","next","_next","_right","defineProperty","get","root","_parent","_subTreeSize","index","enumerable","configurable"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC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ACE,IAAIT,IAAQzB,KAAKyB;YACjB,IAAMU,IAAOnC,KAAK0B,EAAQU;YAC1B,IAAIX,MAAUzB,KAAK0B,GAAS;gBAC1B,IAAIS,GAAM;oBACR,OAAOA,EAAKE,KAAe;ADCnB;gBCCV,OAAO;ADCD;YCCR,IAAIC,IAAQ;YACZ,IAAIb,EAAMG,GAAO;gBACfU,KAAUb,EAAMG,EAAoCS;ADC9C;YCCR,OAAOZ,MAAUU,GAAM;gBACrB,IAAMC,IAAUX,EAAMW;gBACtB,IAAIX,MAAUW,EAAQJ,GAAQ;oBAC5BM,KAAS;oBACT,IAAIF,EAAQR,GAAO;wBACjBU,KAAUF,EAAQR,EAAoCS;ADC5C;AACJ;gBCCVZ,IAAQW;ADCF;YCCR,OAAOE;ADCH;QACAC,YAAY;QACZC,cAAc;;ICGtB,OAAArB;AAAA,CA7FA,CAA0CF;;eA+F3BE","file":"TreeIterator.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ContainerIterator } from \"../../ContainerBase\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nvar TreeIterator = /** @class */ (function (_super) {\n __extends(TreeIterator, _super);\n /**\n * @internal\n */\n function TreeIterator(node, header, iteratorType) {\n var _this = _super.call(this, iteratorType) || this;\n _this._node = node;\n _this._header = header;\n if (_this.iteratorType === 0 /* IteratorType.NORMAL */) {\n _this.pre = function () {\n if (this._node === this._header._left) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n _this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n }\n else {\n _this.pre = function () {\n if (this._node === this._header._right) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n _this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n }\n return _this;\n }\n Object.defineProperty(TreeIterator.prototype, \"index\", {\n /**\n * @description Get the sequential index of the iterator in the tree container.
\n * Note:\n * This function only takes effect when the specified tree container `enableIndex = true`.\n * @returns The index subscript of the node in the tree.\n * @example\n * const st = new OrderedSet([1, 2, 3], true);\n * console.log(st.begin().next().index); // 1\n */\n get: function () {\n var _node = this._node;\n var root = this._header._parent;\n if (_node === this._header) {\n if (root) {\n return root._subTreeSize - 1;\n }\n return 0;\n }\n var index = 0;\n if (_node._left) {\n index += _node._left._subTreeSize;\n }\n while (_node !== root) {\n var _parent = _node._parent;\n if (_node === _parent._right) {\n index += 1;\n if (_parent._left) {\n index += _parent._left._subTreeSize;\n }\n }\n _node = _parent;\n }\n return index;\n },\n enumerable: false,\n configurable: true\n });\n return TreeIterator;\n}(ContainerIterator));\nexport default TreeIterator;\n","import { TreeNode } from './TreeNode';\nimport type { TreeNodeEnableIndex } from './TreeNode';\nimport { ContainerIterator, IteratorType } from '@/container/ContainerBase';\nimport TreeContainer from '@/container/TreeContainer/Base/index';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nabstract class TreeIterator extends ContainerIterator {\n abstract readonly container: TreeContainer;\n /**\n * @internal\n */\n _node: TreeNode;\n /**\n * @internal\n */\n protected _header: TreeNode;\n /**\n * @internal\n */\n protected constructor(\n node: TreeNode,\n header: TreeNode,\n iteratorType?: IteratorType\n ) {\n super(iteratorType);\n this._node = node;\n this._header = header;\n if (this.iteratorType === IteratorType.NORMAL) {\n this.pre = function () {\n if (this._node === this._header._left) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n } else {\n this.pre = function () {\n if (this._node === this._header._right) {\n throwIteratorAccessError();\n }\n this._node = this._node._next();\n return this;\n };\n\n this.next = function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n this._node = this._node._pre();\n return this;\n };\n }\n }\n /**\n * @description Get the sequential index of the iterator in the tree container.
\n * Note:\n * This function only takes effect when the specified tree container `enableIndex = true`.\n * @returns The index subscript of the node in the tree.\n * @example\n * const st = new OrderedSet([1, 2, 3], true);\n * console.log(st.begin().next().index); // 1\n */\n get index() {\n let _node = this._node as TreeNodeEnableIndex;\n const root = this._header._parent as TreeNodeEnableIndex;\n if (_node === this._header) {\n if (root) {\n return root._subTreeSize - 1;\n }\n return 0;\n }\n let index = 0;\n if (_node._left) {\n index += (_node._left as TreeNodeEnableIndex)._subTreeSize;\n }\n while (_node !== root) {\n const _parent = _node._parent as TreeNodeEnableIndex;\n if (_node === _parent._right) {\n index += 1;\n if (_parent._left) {\n index += (_parent._left as TreeNodeEnableIndex)._subTreeSize;\n }\n }\n _node = _parent;\n }\n return index;\n }\n // @ts-ignore\n pre(): this;\n // @ts-ignore\n next(): this;\n}\n\nexport default TreeIterator;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts new file mode 100644 index 000000000..d0aec5050 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts @@ -0,0 +1,47 @@ +export declare const enum TreeNodeColor { + RED = 1, + BLACK = 0 +} +export declare class TreeNode { + _color: TreeNodeColor; + _key: K | undefined; + _value: V | undefined; + _left: TreeNode | undefined; + _right: TreeNode | undefined; + _parent: TreeNode | undefined; + constructor(key?: K, value?: V); + /** + * @description Get the pre node. + * @returns TreeNode about the pre node. + */ + _pre(): TreeNode; + /** + * @description Get the next node. + * @returns TreeNode about the next node. + */ + _next(): TreeNode; + /** + * @description Rotate left. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateLeft(): TreeNode; + /** + * @description Rotate right. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateRight(): TreeNode; +} +export declare class TreeNodeEnableIndex extends TreeNode { + _subTreeSize: number; + /** + * @description Rotate left and do recount. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateLeft(): TreeNodeEnableIndex; + /** + * @description Rotate right and do recount. + * @returns TreeNode about moved to original position after rotation. + */ + _rotateRight(): TreeNodeEnableIndex; + _recount(): void; +} diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js new file mode 100644 index 000000000..0b58346d1 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js @@ -0,0 +1,132 @@ +var __extends = this && this.t || function() { + var extendStatics = function(e, n) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(e, n) { + e.__proto__ = n; + } || function(e, n) { + for (var t in n) if (Object.prototype.hasOwnProperty.call(n, t)) e[t] = n[t]; + }; + return extendStatics(e, n); + }; + return function(e, n) { + if (typeof n !== "function" && n !== null) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); + extendStatics(e, n); + function __() { + this.constructor = e; + } + e.prototype = n === null ? Object.create(n) : (__.prototype = n.prototype, new __); + }; +}(); + +var TreeNode = function() { + function TreeNode(e, n) { + this.ee = 1; + this.u = undefined; + this.p = undefined; + this.K = undefined; + this.N = undefined; + this.rr = undefined; + this.u = e; + this.p = n; + } + TreeNode.prototype.L = function() { + var e = this; + if (e.ee === 1 && e.rr.rr === e) { + e = e.N; + } else if (e.K) { + e = e.K; + while (e.N) { + e = e.N; + } + } else { + var n = e.rr; + while (n.K === e) { + e = n; + n = e.rr; + } + e = n; + } + return e; + }; + TreeNode.prototype.m = function() { + var e = this; + if (e.N) { + e = e.N; + while (e.K) { + e = e.K; + } + return e; + } else { + var n = e.rr; + while (n.N === e) { + e = n; + n = e.rr; + } + if (e.N !== n) { + return n; + } else return e; + } + }; + TreeNode.prototype.ne = function() { + var e = this.rr; + var n = this.N; + var t = n.K; + if (e.rr === this) e.rr = n; else if (e.K === this) e.K = n; else e.N = n; + n.rr = e; + n.K = this; + this.rr = n; + this.N = t; + if (t) t.rr = this; + return n; + }; + TreeNode.prototype.te = function() { + var e = this.rr; + var n = this.K; + var t = n.N; + if (e.rr === this) e.rr = n; else if (e.K === this) e.K = n; else e.N = n; + n.rr = e; + n.N = this; + this.rr = n; + this.K = t; + if (t) t.rr = this; + return n; + }; + return TreeNode; +}(); + +export { TreeNode }; + +var TreeNodeEnableIndex = function(e) { + __extends(TreeNodeEnableIndex, e); + function TreeNodeEnableIndex() { + var n = e !== null && e.apply(this, arguments) || this; + n.tr = 1; + return n; + } + TreeNodeEnableIndex.prototype.ne = function() { + var n = e.prototype.ne.call(this); + this.ie(); + n.ie(); + return n; + }; + TreeNodeEnableIndex.prototype.te = function() { + var n = e.prototype.te.call(this); + this.ie(); + n.ie(); + return n; + }; + TreeNodeEnableIndex.prototype.ie = function() { + this.tr = 1; + if (this.K) { + this.tr += this.K.tr; + } + if (this.N) { + this.tr += this.N.tr; + } + }; + return TreeNodeEnableIndex; +}(TreeNode); + +export { TreeNodeEnableIndex }; +//# sourceMappingURL=TreeNode.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js.map b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js.map new file mode 100644 index 000000000..c186e1e83 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/Base/TreeNode.js","../../src/container/TreeContainer/Base/TreeNode.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","TreeNode","key","value","_color","_key","undefined","_value","_left","_right","_parent","_pre","preNode","pre","_next","nextNode","_rotateLeft","PP","V","R","_rotateRight","F","K","TreeNodeEnableIndex","_super","_this","apply","arguments","_subTreeSize","parent","_recount"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;ACK7C,IAAAG,WAAA;IAOE,SAAAA,SAAYC,GAASC;QANrBnB,KAAAoB,KAAM;QACNpB,KAAAqB,IAAsBC;QACtBtB,KAAAuB,IAAwBD;QACxBtB,KAAAwB,IAAoCF;QACpCtB,KAAAyB,IAAqCH;QACrCtB,KAAA0B,KAAsCJ;QAEpCtB,KAAKqB,IAAOH;QACZlB,KAAKuB,IAASJ;ADWd;ICLFF,SAAAR,UAAAkB,IAAA;QACE,IAAIC,IAA0B5B;QAC9B,IACE4B,EAAQR,OAAM,KACdQ,EAAQF,GAASA,OAAYE,GAC7B;YACAA,IAAUA,EAAQH;ADSh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a,QAClCJ,EAAGR,IAASY;QAEjBA,EAAEX,KAAUO;QACZI,EAAEZ,IAASzB;QAEXA,KAAK0B,KAAUW;QACfrC,KAAKwB,IAAQc;QAEb,IAAIA,GAAGA,EAAEZ,KAAU1B;QAEnB,OAAOqC;ADYP;ICVJ,OAAApB;AAAA,CA1GA;;SDuHSA;;ACXT,IAAAsB,sBAAA,SAAAC;IAA+CzC,UAAAwC,qBAAAC;IAA/C,SAAAD;QAAA,IAAAE,IAAAD,MAAA,QAAAA,EAAAE,MAAA1C,MAAA2C,cAAA3C;QACEyC,EAAAG,KAAe;QDgBT,OAAOH;ACcf;IAzBEF,oBAAA9B,UAAAuB,KAAA;QACE,IAAMa,IAASL,EAAA/B,UAAMuB,GAAWrB,KAAAX;QAChCA,KAAK8C;QACLD,EAAOC;QACP,OAAOD;ADkBP;ICZFN,oBAAA9B,UAAA2B,KAAA;QACE,IAAMS,IAASL,EAAA/B,UAAM2B,GAAYzB,KAAAX;QACjCA,KAAK8C;QACLD,EAAOC;QACP,OAAOD;ADkBP;IChBFN,oBAAA9B,UAAAqC,KAAA;QACE9C,KAAK4C,KAAe;QACpB,IAAI5C,KAAKwB,GAAO;YACdxB,KAAK4C,MAAiB5C,KAAKwB,EAAoCoB;ADkB7D;QChBJ,IAAI5C,KAAKyB,GAAQ;YACfzB,KAAK4C,MAAiB5C,KAAKyB,EAAqCmB;ADkB9D;AACJ;IChBJ,OAAAL;AAAA,CA/BA,CAA+CtB;;SDkDtCsB","file":"TreeNode.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar TreeNode = /** @class */ (function () {\n function TreeNode(key, value) {\n this._color = 1 /* TreeNodeColor.RED */;\n this._key = undefined;\n this._value = undefined;\n this._left = undefined;\n this._right = undefined;\n this._parent = undefined;\n this._key = key;\n this._value = value;\n }\n /**\n * @description Get the pre node.\n * @returns TreeNode about the pre node.\n */\n TreeNode.prototype._pre = function () {\n var preNode = this;\n if (preNode._color === 1 /* TreeNodeColor.RED */ &&\n preNode._parent._parent === preNode) {\n preNode = preNode._right;\n }\n else if (preNode._left) {\n preNode = preNode._left;\n while (preNode._right) {\n preNode = preNode._right;\n }\n }\n else {\n var pre = preNode._parent;\n while (pre._left === preNode) {\n preNode = pre;\n pre = preNode._parent;\n }\n preNode = pre;\n }\n return preNode;\n };\n /**\n * @description Get the next node.\n * @returns TreeNode about the next node.\n */\n TreeNode.prototype._next = function () {\n var nextNode = this;\n if (nextNode._right) {\n nextNode = nextNode._right;\n while (nextNode._left) {\n nextNode = nextNode._left;\n }\n return nextNode;\n }\n else {\n var pre = nextNode._parent;\n while (pre._right === nextNode) {\n nextNode = pre;\n pre = nextNode._parent;\n }\n if (nextNode._right !== pre) {\n return pre;\n }\n else\n return nextNode;\n }\n };\n /**\n * @description Rotate left.\n * @returns TreeNode about moved to original position after rotation.\n */\n TreeNode.prototype._rotateLeft = function () {\n var PP = this._parent;\n var V = this._right;\n var R = V._left;\n if (PP._parent === this)\n PP._parent = V;\n else if (PP._left === this)\n PP._left = V;\n else\n PP._right = V;\n V._parent = PP;\n V._left = this;\n this._parent = V;\n this._right = R;\n if (R)\n R._parent = this;\n return V;\n };\n /**\n * @description Rotate right.\n * @returns TreeNode about moved to original position after rotation.\n */\n TreeNode.prototype._rotateRight = function () {\n var PP = this._parent;\n var F = this._left;\n var K = F._right;\n if (PP._parent === this)\n PP._parent = F;\n else if (PP._left === this)\n PP._left = F;\n else\n PP._right = F;\n F._parent = PP;\n F._right = this;\n this._parent = F;\n this._left = K;\n if (K)\n K._parent = this;\n return F;\n };\n return TreeNode;\n}());\nexport { TreeNode };\nvar TreeNodeEnableIndex = /** @class */ (function (_super) {\n __extends(TreeNodeEnableIndex, _super);\n function TreeNodeEnableIndex() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._subTreeSize = 1;\n return _this;\n }\n /**\n * @description Rotate left and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n TreeNodeEnableIndex.prototype._rotateLeft = function () {\n var parent = _super.prototype._rotateLeft.call(this);\n this._recount();\n parent._recount();\n return parent;\n };\n /**\n * @description Rotate right and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n TreeNodeEnableIndex.prototype._rotateRight = function () {\n var parent = _super.prototype._rotateRight.call(this);\n this._recount();\n parent._recount();\n return parent;\n };\n TreeNodeEnableIndex.prototype._recount = function () {\n this._subTreeSize = 1;\n if (this._left) {\n this._subTreeSize += this._left._subTreeSize;\n }\n if (this._right) {\n this._subTreeSize += this._right._subTreeSize;\n }\n };\n return TreeNodeEnableIndex;\n}(TreeNode));\nexport { TreeNodeEnableIndex };\n","export const enum TreeNodeColor {\n RED = 1,\n BLACK = 0\n}\n\nexport class TreeNode {\n _color = TreeNodeColor.RED;\n _key: K | undefined = undefined;\n _value: V | undefined = undefined;\n _left: TreeNode | undefined = undefined;\n _right: TreeNode | undefined = undefined;\n _parent: TreeNode | undefined = undefined;\n constructor(key?: K, value?: V) {\n this._key = key;\n this._value = value;\n }\n /**\n * @description Get the pre node.\n * @returns TreeNode about the pre node.\n */\n _pre() {\n let preNode: TreeNode = this;\n if (\n preNode._color === TreeNodeColor.RED &&\n preNode._parent!._parent === preNode\n ) {\n preNode = preNode._right!;\n } else if (preNode._left) {\n preNode = preNode._left;\n while (preNode._right) {\n preNode = preNode._right;\n }\n } else {\n let pre = preNode._parent!;\n while (pre._left === preNode) {\n preNode = pre;\n pre = preNode._parent!;\n }\n preNode = pre;\n }\n return preNode;\n }\n /**\n * @description Get the next node.\n * @returns TreeNode about the next node.\n */\n _next() {\n let nextNode: TreeNode = this;\n if (nextNode._right) {\n nextNode = nextNode._right;\n while (nextNode._left) {\n nextNode = nextNode._left;\n }\n return nextNode;\n } else {\n let pre = nextNode._parent!;\n while (pre._right === nextNode) {\n nextNode = pre;\n pre = nextNode._parent!;\n }\n if (nextNode._right !== pre) {\n return pre;\n } else return nextNode;\n }\n }\n /**\n * @description Rotate left.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateLeft() {\n const PP = this._parent!;\n const V = this._right!;\n const R = V._left;\n\n if (PP._parent === this) PP._parent = V;\n else if (PP._left === this) PP._left = V;\n else PP._right = V;\n\n V._parent = PP;\n V._left = this;\n\n this._parent = V;\n this._right = R;\n\n if (R) R._parent = this;\n\n return V;\n }\n /**\n * @description Rotate right.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateRight() {\n const PP = this._parent!;\n const F = this._left!;\n const K = F._right;\n\n if (PP._parent === this) PP._parent = F;\n else if (PP._left === this) PP._left = F;\n else PP._right = F;\n\n F._parent = PP;\n F._right = this;\n\n this._parent = F;\n this._left = K;\n\n if (K) K._parent = this;\n\n return F;\n }\n}\n\nexport class TreeNodeEnableIndex extends TreeNode {\n _subTreeSize = 1;\n /**\n * @description Rotate left and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateLeft() {\n const parent = super._rotateLeft() as TreeNodeEnableIndex;\n this._recount();\n parent._recount();\n return parent;\n }\n /**\n * @description Rotate right and do recount.\n * @returns TreeNode about moved to original position after rotation.\n */\n _rotateRight() {\n const parent = super._rotateRight() as TreeNodeEnableIndex;\n this._recount();\n parent._recount();\n return parent;\n }\n _recount() {\n this._subTreeSize = 1;\n if (this._left) {\n this._subTreeSize += (this._left as TreeNodeEnableIndex)._subTreeSize;\n }\n if (this._right) {\n this._subTreeSize += (this._right as TreeNodeEnableIndex)._subTreeSize;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts new file mode 100644 index 000000000..96e4792d2 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts @@ -0,0 +1,58 @@ +import type TreeIterator from './TreeIterator'; +import { Container } from "../../ContainerBase"; +declare abstract class TreeContainer extends Container { + clear(): void; + /** + * @description Update node's key by iterator. + * @param iter - The iterator you want to change. + * @param key - The key you want to update. + * @returns Whether the modification is successful. + * @example + * const st = new orderedSet([1, 2, 5]); + * const iter = st.find(2); + * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5] + */ + updateKeyByIterator(iter: TreeIterator, key: K): boolean; + eraseElementByPos(pos: number): number; + /** + * @description Remove the element of the specified key. + * @param key - The key you want to remove. + * @returns Whether erase successfully. + */ + eraseElementByKey(key: K): boolean; + eraseElementByIterator(iter: TreeIterator): TreeIterator; + forEach(callback: (element: K | [K, V], index: number, tree: TreeContainer) => void): void; + getElementByPos(pos: number): K | [K, V]; + /** + * @description Get the height of the tree. + * @returns Number about the height of the RB-tree. + */ + getHeight(): number; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element less than the given key. + */ + abstract reverseUpperBound(key: K): TreeIterator; + /** + * @description Union the other tree to self. + * @param other - The other tree container you want to merge. + * @returns The size of the tree after union. + */ + abstract union(other: TreeContainer): number; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element not greater than the given key. + */ + abstract reverseLowerBound(key: K): TreeIterator; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element not less than the given key. + */ + abstract lowerBound(key: K): TreeIterator; + /** + * @param key - The given key you want to compare. + * @returns An iterator to the first element greater than the given key. + */ + abstract upperBound(key: K): TreeIterator; +} +export default TreeContainer; diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js new file mode 100644 index 000000000..5056baf84 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js @@ -0,0 +1,600 @@ +var __extends = this && this.t || function() { + var extendStatics = function(e, r) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(e, r) { + e.__proto__ = r; + } || function(e, r) { + for (var i in r) if (Object.prototype.hasOwnProperty.call(r, i)) e[i] = r[i]; + }; + return extendStatics(e, r); + }; + return function(e, r) { + if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); + extendStatics(e, r); + function __() { + this.constructor = e; + } + e.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + }; +}(); + +var __read = this && this.q || function(e, r) { + var i = typeof Symbol === "function" && e[Symbol.iterator]; + if (!i) return e; + var t = i.call(e), n, s = [], f; + try { + while ((r === void 0 || r-- > 0) && !(n = t.next()).done) s.push(n.value); + } catch (e) { + f = { + error: e + }; + } finally { + try { + if (n && !n.done && (i = t["return"])) i.call(t); + } finally { + if (f) throw f.error; + } + } + return s; +}; + +var __values = this && this.V || function(e) { + var r = typeof Symbol === "function" && Symbol.iterator, i = r && e[r], t = 0; + if (i) return i.call(e); + if (e && typeof e.length === "number") return { + next: function() { + if (e && t >= e.length) e = void 0; + return { + value: e && e[t++], + done: !e + }; + } + }; + throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; + +import { TreeNode, TreeNodeEnableIndex } from "./TreeNode"; + +import { Container } from "../../ContainerBase"; + +import { throwIteratorAccessError } from "../../../utils/throwError"; + +var TreeContainer = function(e) { + __extends(TreeContainer, e); + function TreeContainer(r, i) { + if (r === void 0) { + r = function(e, r) { + if (e < r) return -1; + if (e > r) return 1; + return 0; + }; + } + if (i === void 0) { + i = false; + } + var t = e.call(this) || this; + t.W = undefined; + t.$ = r; + if (i) { + t.re = TreeNodeEnableIndex; + t.v = function(e, r, i) { + var t = this.se(e, r, i); + if (t) { + var n = t.rr; + while (n !== this.h) { + n.tr += 1; + n = n.rr; + } + var s = this.fe(t); + if (s) { + var f = s, h = f.parentNode, u = f.grandParent, a = f.curNode; + h.ie(); + u.ie(); + a.ie(); + } + } + return this.M; + }; + t.G = function(e) { + var r = this.he(e); + while (r !== this.h) { + r.tr -= 1; + r = r.rr; + } + }; + } else { + t.re = TreeNode; + t.v = function(e, r, i) { + var t = this.se(e, r, i); + if (t) this.fe(t); + return this.M; + }; + t.G = t.he; + } + t.h = new t.re; + return t; + } + TreeContainer.prototype.U = function(e, r) { + var i = this.h; + while (e) { + var t = this.$(e.u, r); + if (t < 0) { + e = e.N; + } else if (t > 0) { + i = e; + e = e.K; + } else return e; + } + return i; + }; + TreeContainer.prototype.X = function(e, r) { + var i = this.h; + while (e) { + var t = this.$(e.u, r); + if (t <= 0) { + e = e.N; + } else { + i = e; + e = e.K; + } + } + return i; + }; + TreeContainer.prototype.Y = function(e, r) { + var i = this.h; + while (e) { + var t = this.$(e.u, r); + if (t < 0) { + i = e; + e = e.N; + } else if (t > 0) { + e = e.K; + } else return e; + } + return i; + }; + TreeContainer.prototype.Z = function(e, r) { + var i = this.h; + while (e) { + var t = this.$(e.u, r); + if (t < 0) { + i = e; + e = e.N; + } else { + e = e.K; + } + } + return i; + }; + TreeContainer.prototype.ue = function(e) { + while (true) { + var r = e.rr; + if (r === this.h) return; + if (e.ee === 1) { + e.ee = 0; + return; + } + if (e === r.K) { + var i = r.N; + if (i.ee === 1) { + i.ee = 0; + r.ee = 1; + if (r === this.W) { + this.W = r.ne(); + } else r.ne(); + } else { + if (i.N && i.N.ee === 1) { + i.ee = r.ee; + r.ee = 0; + i.N.ee = 0; + if (r === this.W) { + this.W = r.ne(); + } else r.ne(); + return; + } else if (i.K && i.K.ee === 1) { + i.ee = 1; + i.K.ee = 0; + i.te(); + } else { + i.ee = 1; + e = r; + } + } + } else { + var i = r.K; + if (i.ee === 1) { + i.ee = 0; + r.ee = 1; + if (r === this.W) { + this.W = r.te(); + } else r.te(); + } else { + if (i.K && i.K.ee === 1) { + i.ee = r.ee; + r.ee = 0; + i.K.ee = 0; + if (r === this.W) { + this.W = r.te(); + } else r.te(); + return; + } else if (i.N && i.N.ee === 1) { + i.ee = 1; + i.N.ee = 0; + i.ne(); + } else { + i.ee = 1; + e = r; + } + } + } + } + }; + TreeContainer.prototype.he = function(e) { + var r, i; + if (this.M === 1) { + this.clear(); + return this.h; + } + var t = e; + while (t.K || t.N) { + if (t.N) { + t = t.N; + while (t.K) t = t.K; + } else { + t = t.K; + } + r = __read([ t.u, e.u ], 2), e.u = r[0], t.u = r[1]; + i = __read([ t.p, e.p ], 2), e.p = i[0], t.p = i[1]; + e = t; + } + if (this.h.K === t) { + this.h.K = t.rr; + } else if (this.h.N === t) { + this.h.N = t.rr; + } + this.ue(t); + var n = t.rr; + if (t === n.K) { + n.K = undefined; + } else n.N = undefined; + this.M -= 1; + this.W.ee = 0; + return n; + }; + TreeContainer.prototype.ae = function(e, r) { + if (e === undefined) return false; + var i = this.ae(e.K, r); + if (i) return true; + if (r(e)) return true; + return this.ae(e.N, r); + }; + TreeContainer.prototype.fe = function(e) { + while (true) { + var r = e.rr; + if (r.ee === 0) return; + var i = r.rr; + if (r === i.K) { + var t = i.N; + if (t && t.ee === 1) { + t.ee = r.ee = 0; + if (i === this.W) return; + i.ee = 1; + e = i; + continue; + } else if (e === r.N) { + e.ee = 0; + if (e.K) e.K.rr = r; + if (e.N) e.N.rr = i; + r.N = e.K; + i.K = e.N; + e.K = r; + e.N = i; + if (i === this.W) { + this.W = e; + this.h.rr = e; + } else { + var n = i.rr; + if (n.K === i) { + n.K = e; + } else n.N = e; + } + e.rr = i.rr; + r.rr = e; + i.rr = e; + i.ee = 1; + return { + parentNode: r, + grandParent: i, + curNode: e + }; + } else { + r.ee = 0; + if (i === this.W) { + this.W = i.te(); + } else i.te(); + i.ee = 1; + } + } else { + var t = i.K; + if (t && t.ee === 1) { + t.ee = r.ee = 0; + if (i === this.W) return; + i.ee = 1; + e = i; + continue; + } else if (e === r.K) { + e.ee = 0; + if (e.K) e.K.rr = i; + if (e.N) e.N.rr = r; + i.N = e.K; + r.K = e.N; + e.K = i; + e.N = r; + if (i === this.W) { + this.W = e; + this.h.rr = e; + } else { + var n = i.rr; + if (n.K === i) { + n.K = e; + } else n.N = e; + } + e.rr = i.rr; + r.rr = e; + i.rr = e; + i.ee = 1; + return { + parentNode: r, + grandParent: i, + curNode: e + }; + } else { + r.ee = 0; + if (i === this.W) { + this.W = i.ne(); + } else i.ne(); + i.ee = 1; + } + } + return; + } + }; + TreeContainer.prototype.se = function(e, r, i) { + if (this.W === undefined) { + this.M += 1; + this.W = new this.re(e, r); + this.W.ee = 0; + this.W.rr = this.h; + this.h.rr = this.W; + this.h.K = this.W; + this.h.N = this.W; + return; + } + var t; + var n = this.h.K; + var s = this.$(n.u, e); + if (s === 0) { + n.p = r; + return; + } else if (s > 0) { + n.K = new this.re(e, r); + n.K.rr = n; + t = n.K; + this.h.K = t; + } else { + var f = this.h.N; + var h = this.$(f.u, e); + if (h === 0) { + f.p = r; + return; + } else if (h < 0) { + f.N = new this.re(e, r); + f.N.rr = f; + t = f.N; + this.h.N = t; + } else { + if (i !== undefined) { + var u = i.o; + if (u !== this.h) { + var a = this.$(u.u, e); + if (a === 0) { + u.p = r; + return; + } else if (a > 0) { + var o = u.L(); + var l = this.$(o.u, e); + if (l === 0) { + o.p = r; + return; + } else if (l < 0) { + t = new this.re(e, r); + if (o.N === undefined) { + o.N = t; + t.rr = o; + } else { + u.K = t; + t.rr = u; + } + } + } + } + } + if (t === undefined) { + t = this.W; + while (true) { + var v = this.$(t.u, e); + if (v > 0) { + if (t.K === undefined) { + t.K = new this.re(e, r); + t.K.rr = t; + t = t.K; + break; + } + t = t.K; + } else if (v < 0) { + if (t.N === undefined) { + t.N = new this.re(e, r); + t.N.rr = t; + t = t.N; + break; + } + t = t.N; + } else { + t.p = r; + return; + } + } + } + } + } + this.M += 1; + return t; + }; + TreeContainer.prototype.g = function(e, r) { + while (e) { + var i = this.$(e.u, r); + if (i < 0) { + e = e.N; + } else if (i > 0) { + e = e.K; + } else return e; + } + return e || this.h; + }; + TreeContainer.prototype.clear = function() { + this.M = 0; + this.W = undefined; + this.h.rr = undefined; + this.h.K = this.h.N = undefined; + }; + TreeContainer.prototype.updateKeyByIterator = function(e, r) { + var i = e.o; + if (i === this.h) { + throwIteratorAccessError(); + } + if (this.M === 1) { + i.u = r; + return true; + } + if (i === this.h.K) { + if (this.$(i.m().u, r) > 0) { + i.u = r; + return true; + } + return false; + } + if (i === this.h.N) { + if (this.$(i.L().u, r) < 0) { + i.u = r; + return true; + } + return false; + } + var t = i.L().u; + if (this.$(t, r) >= 0) return false; + var n = i.m().u; + if (this.$(n, r) <= 0) return false; + i.u = r; + return true; + }; + TreeContainer.prototype.eraseElementByPos = function(e) { + if (e < 0 || e > this.M - 1) { + throw new RangeError; + } + var r = 0; + var i = this; + this.ae(this.W, (function(t) { + if (e === r) { + i.G(t); + return true; + } + r += 1; + return false; + })); + return this.M; + }; + TreeContainer.prototype.eraseElementByKey = function(e) { + if (this.M === 0) return false; + var r = this.g(this.W, e); + if (r === this.h) return false; + this.G(r); + return true; + }; + TreeContainer.prototype.eraseElementByIterator = function(e) { + var r = e.o; + if (r === this.h) { + throwIteratorAccessError(); + } + var i = r.N === undefined; + var t = e.iteratorType === 0; + if (t) { + if (i) e.next(); + } else { + if (!i || r.K === undefined) e.next(); + } + this.G(r); + return e; + }; + TreeContainer.prototype.forEach = function(e) { + var r, i; + var t = 0; + try { + for (var n = __values(this), s = n.next(); !s.done; s = n.next()) { + var f = s.value; + e(f, t++, this); + } + } catch (e) { + r = { + error: e + }; + } finally { + try { + if (s && !s.done && (i = n.return)) i.call(n); + } finally { + if (r) throw r.error; + } + } + }; + TreeContainer.prototype.getElementByPos = function(e) { + var r, i; + if (e < 0 || e > this.M - 1) { + throw new RangeError; + } + var t; + var n = 0; + try { + for (var s = __values(this), f = s.next(); !f.done; f = s.next()) { + var h = f.value; + if (n === e) { + t = h; + break; + } + n += 1; + } + } catch (e) { + r = { + error: e + }; + } finally { + try { + if (f && !f.done && (i = s.return)) i.call(s); + } finally { + if (r) throw r.error; + } + } + return t; + }; + TreeContainer.prototype.getHeight = function() { + if (this.M === 0) return 0; + var traversal = function(e) { + if (!e) return 0; + return Math.max(traversal(e.K), traversal(e.N)) + 1; + }; + return traversal(this.W); + }; + return TreeContainer; +}(Container); + +export default TreeContainer; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js.map b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js.map new file mode 100644 index 000000000..bbfc2ffae --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/Base/index.js","../../src/container/TreeContainer/Base/index.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__read","o","n","m","Symbol","iterator","i","r","ar","e","next","done","push","value","error","__values","s","length","TreeNode","TreeNodeEnableIndex","Container","throwIteratorAccessError","TreeContainer","_super","cmp","enableIndex","x","y","_this","_root","undefined","_cmp","_TreeNodeClass","_set","key","hint","curNode","_preSet","_parent","_header","_subTreeSize","nodeList","_insertNodeSelfBalance","_a","parentNode","grandParent","curNode_1","_recount","_length","_eraseNode","_preEraseNode","_lowerBound","resNode","cmpResult","_key","_right","_left","_upperBound","_reverseLowerBound","_reverseUpperBound","_eraseNodeSelfBalance","_color","brother","_rotateLeft","_rotateRight","_b","clear","swapNode","_value","_inOrderTraversal","callback","ifReturn","uncle","GP","minNode","compareToMin","maxNode","compareToMax","iterNode","_node","iterCmpRes","preNode","_pre","preCmpRes","_findElementNode","updateKeyByIterator","iter","node","_next","preKey","nextKey","eraseElementByPos","pos","RangeError","index","self","eraseElementByKey","eraseElementByIterator","hasNoRight","isNormal","iteratorType","forEach","e_1","_c","element","e_1_1","return","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ACxC;AACJ;ICvGFQ,cAAA9B,UAAAmH,kBAAA,SAAgBf;QDyGV,IAAIgB,GAAKjE;QACT,ICzGsBiD,IAAG,KAAHA,IAAQ7G,KAAKiE,IAAO,GAtiBd;YAAE,MAAU,IAAI6C;ADipB5C;QC1GJ,IAAIgB;QACJ,IAAIf,IAAQ;QD4GR;YC3GJ,KAAsB,IAAA7B,IAAAlD,SAAAhC,OAAIwH,IAAAtC,EAAAvD,SAAA6F,EAAA5F,MAAA4F,IAAAtC,EAAAvD,QAAE;gBAAvB,IAAM8F,IAAOD,EAAA1F;gBAChB,IAAIiF,MAAUF,GAAK;oBACjBiB,IAAML;oBACN;AD8GQ;gBC5GVV,KAAS;AD8GH;AAQJ,UANA,OAAOgB;YAASF,IAAM;gBAAE9F,OAAOgG;;AAAS,UAAC;YAErC;gBACI,IAAIP,MAAOA,EAAG5F,SAASgC,IAAKsB,EAAGyC,SAAS/D,EAAGjD,KAAKuE;AAEhB,cADnC;gBACS,IAAI2C,GAAK,MAAMA,EAAI9F;AAAO;AACxC;QCpHJ,OAAmB+F;ADsHnB;IChHFvF,cAAA9B,UAAAuH,YAAA;QACE,IAAIhI,KAAKiE,MAAY,GAAG,OAAO;QAC/B,IAAMgE,YACJ,SAAU5E;YACR,KAAKA,GAAS,OAAO;YACrB,OAAO6E,KAAKC,IAAIF,UAAU5E,EAAQoB,IAAQwD,UAAU5E,EAAQmB,MAAW;ADuHvE;QCrHJ,OAAOyD,UAAUjI,KAAK8C;ADuHtB;IC3FJ,OAAAP;AAAA,CAzlBA,CAA2CF;;eA2lB5BE","file":"index.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nimport { TreeNode, TreeNodeEnableIndex } from './TreeNode';\nimport { Container } from \"../../ContainerBase\";\nimport $checkWithinAccessParams from \"../../../utils/checkParams.macro\";\nimport { throwIteratorAccessError } from \"../../../utils/throwError\";\nvar TreeContainer = /** @class */ (function (_super) {\n __extends(TreeContainer, _super);\n /**\n * @internal\n */\n function TreeContainer(cmp, enableIndex) {\n if (cmp === void 0) { cmp = function (x, y) {\n if (x < y)\n return -1;\n if (x > y)\n return 1;\n return 0;\n }; }\n if (enableIndex === void 0) { enableIndex = false; }\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n _this._root = undefined;\n _this._cmp = cmp;\n if (enableIndex) {\n _this._TreeNodeClass = TreeNodeEnableIndex;\n _this._set = function (key, value, hint) {\n var curNode = this._preSet(key, value, hint);\n if (curNode) {\n var p = curNode._parent;\n while (p !== this._header) {\n p._subTreeSize += 1;\n p = p._parent;\n }\n var nodeList = this._insertNodeSelfBalance(curNode);\n if (nodeList) {\n var _a = nodeList, parentNode = _a.parentNode, grandParent = _a.grandParent, curNode_1 = _a.curNode;\n parentNode._recount();\n grandParent._recount();\n curNode_1._recount();\n }\n }\n return this._length;\n };\n _this._eraseNode = function (curNode) {\n var p = this._preEraseNode(curNode);\n while (p !== this._header) {\n p._subTreeSize -= 1;\n p = p._parent;\n }\n };\n }\n else {\n _this._TreeNodeClass = TreeNode;\n _this._set = function (key, value, hint) {\n var curNode = this._preSet(key, value, hint);\n if (curNode)\n this._insertNodeSelfBalance(curNode);\n return this._length;\n };\n _this._eraseNode = _this._preEraseNode;\n }\n _this._header = new _this._TreeNodeClass();\n return _this;\n }\n /**\n * @internal\n */\n TreeContainer.prototype._lowerBound = function (curNode, key) {\n var resNode = this._header;\n while (curNode) {\n var cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n }\n else if (cmpResult > 0) {\n resNode = curNode;\n curNode = curNode._left;\n }\n else\n return curNode;\n }\n return resNode;\n };\n /**\n * @internal\n */\n TreeContainer.prototype._upperBound = function (curNode, key) {\n var resNode = this._header;\n while (curNode) {\n var cmpResult = this._cmp(curNode._key, key);\n if (cmpResult <= 0) {\n curNode = curNode._right;\n }\n else {\n resNode = curNode;\n curNode = curNode._left;\n }\n }\n return resNode;\n };\n /**\n * @internal\n */\n TreeContainer.prototype._reverseLowerBound = function (curNode, key) {\n var resNode = this._header;\n while (curNode) {\n var cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n }\n else if (cmpResult > 0) {\n curNode = curNode._left;\n }\n else\n return curNode;\n }\n return resNode;\n };\n /**\n * @internal\n */\n TreeContainer.prototype._reverseUpperBound = function (curNode, key) {\n var resNode = this._header;\n while (curNode) {\n var cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n }\n else {\n curNode = curNode._left;\n }\n }\n return resNode;\n };\n /**\n * @internal\n */\n TreeContainer.prototype._eraseNodeSelfBalance = function (curNode) {\n while (true) {\n var parentNode = curNode._parent;\n if (parentNode === this._header)\n return;\n if (curNode._color === 1 /* TreeNodeColor.RED */) {\n curNode._color = 0 /* TreeNodeColor.BLACK */;\n return;\n }\n if (curNode === parentNode._left) {\n var brother = parentNode._right;\n if (brother._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 0 /* TreeNodeColor.BLACK */;\n parentNode._color = 1 /* TreeNodeColor.RED */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n }\n else\n parentNode._rotateLeft();\n }\n else {\n if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) {\n brother._color = parentNode._color;\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n brother._right._color = 0 /* TreeNodeColor.BLACK */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n }\n else\n parentNode._rotateLeft();\n return;\n }\n else if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 1 /* TreeNodeColor.RED */;\n brother._left._color = 0 /* TreeNodeColor.BLACK */;\n brother._rotateRight();\n }\n else {\n brother._color = 1 /* TreeNodeColor.RED */;\n curNode = parentNode;\n }\n }\n }\n else {\n var brother = parentNode._left;\n if (brother._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 0 /* TreeNodeColor.BLACK */;\n parentNode._color = 1 /* TreeNodeColor.RED */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n }\n else\n parentNode._rotateRight();\n }\n else {\n if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) {\n brother._color = parentNode._color;\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n brother._left._color = 0 /* TreeNodeColor.BLACK */;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n }\n else\n parentNode._rotateRight();\n return;\n }\n else if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) {\n brother._color = 1 /* TreeNodeColor.RED */;\n brother._right._color = 0 /* TreeNodeColor.BLACK */;\n brother._rotateLeft();\n }\n else {\n brother._color = 1 /* TreeNodeColor.RED */;\n curNode = parentNode;\n }\n }\n }\n }\n };\n /**\n * @internal\n */\n TreeContainer.prototype._preEraseNode = function (curNode) {\n var _a, _b;\n if (this._length === 1) {\n this.clear();\n return this._header;\n }\n var swapNode = curNode;\n while (swapNode._left || swapNode._right) {\n if (swapNode._right) {\n swapNode = swapNode._right;\n while (swapNode._left)\n swapNode = swapNode._left;\n }\n else {\n swapNode = swapNode._left;\n }\n _a = __read([swapNode._key, curNode._key], 2), curNode._key = _a[0], swapNode._key = _a[1];\n _b = __read([swapNode._value, curNode._value], 2), curNode._value = _b[0], swapNode._value = _b[1];\n curNode = swapNode;\n }\n if (this._header._left === swapNode) {\n this._header._left = swapNode._parent;\n }\n else if (this._header._right === swapNode) {\n this._header._right = swapNode._parent;\n }\n this._eraseNodeSelfBalance(swapNode);\n var _parent = swapNode._parent;\n if (swapNode === _parent._left) {\n _parent._left = undefined;\n }\n else\n _parent._right = undefined;\n this._length -= 1;\n this._root._color = 0 /* TreeNodeColor.BLACK */;\n return _parent;\n };\n /**\n * @internal\n */\n TreeContainer.prototype._inOrderTraversal = function (curNode, callback) {\n if (curNode === undefined)\n return false;\n var ifReturn = this._inOrderTraversal(curNode._left, callback);\n if (ifReturn)\n return true;\n if (callback(curNode))\n return true;\n return this._inOrderTraversal(curNode._right, callback);\n };\n /**\n * @internal\n */\n TreeContainer.prototype._insertNodeSelfBalance = function (curNode) {\n while (true) {\n var parentNode = curNode._parent;\n if (parentNode._color === 0 /* TreeNodeColor.BLACK */)\n return;\n var grandParent = parentNode._parent;\n if (parentNode === grandParent._left) {\n var uncle = grandParent._right;\n if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) {\n uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root)\n return;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n curNode = grandParent;\n continue;\n }\n else if (curNode === parentNode._right) {\n curNode._color = 0 /* TreeNodeColor.BLACK */;\n if (curNode._left)\n curNode._left._parent = parentNode;\n if (curNode._right)\n curNode._right._parent = grandParent;\n parentNode._right = curNode._left;\n grandParent._left = curNode._right;\n curNode._left = parentNode;\n curNode._right = grandParent;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n }\n else {\n var GP = grandParent._parent;\n if (GP._left === grandParent) {\n GP._left = curNode;\n }\n else\n GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n return { parentNode: parentNode, grandParent: grandParent, curNode: curNode };\n }\n else {\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root) {\n this._root = grandParent._rotateRight();\n }\n else\n grandParent._rotateRight();\n grandParent._color = 1 /* TreeNodeColor.RED */;\n }\n }\n else {\n var uncle = grandParent._left;\n if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) {\n uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root)\n return;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n curNode = grandParent;\n continue;\n }\n else if (curNode === parentNode._left) {\n curNode._color = 0 /* TreeNodeColor.BLACK */;\n if (curNode._left)\n curNode._left._parent = grandParent;\n if (curNode._right)\n curNode._right._parent = parentNode;\n grandParent._right = curNode._left;\n parentNode._left = curNode._right;\n curNode._left = grandParent;\n curNode._right = parentNode;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n }\n else {\n var GP = grandParent._parent;\n if (GP._left === grandParent) {\n GP._left = curNode;\n }\n else\n GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = 1 /* TreeNodeColor.RED */;\n return { parentNode: parentNode, grandParent: grandParent, curNode: curNode };\n }\n else {\n parentNode._color = 0 /* TreeNodeColor.BLACK */;\n if (grandParent === this._root) {\n this._root = grandParent._rotateLeft();\n }\n else\n grandParent._rotateLeft();\n grandParent._color = 1 /* TreeNodeColor.RED */;\n }\n }\n return;\n }\n };\n /**\n * @internal\n */\n TreeContainer.prototype._preSet = function (key, value, hint) {\n if (this._root === undefined) {\n this._length += 1;\n this._root = new this._TreeNodeClass(key, value);\n this._root._color = 0 /* TreeNodeColor.BLACK */;\n this._root._parent = this._header;\n this._header._parent = this._root;\n this._header._left = this._root;\n this._header._right = this._root;\n return;\n }\n var curNode;\n var minNode = this._header._left;\n var compareToMin = this._cmp(minNode._key, key);\n if (compareToMin === 0) {\n minNode._value = value;\n return;\n }\n else if (compareToMin > 0) {\n minNode._left = new this._TreeNodeClass(key, value);\n minNode._left._parent = minNode;\n curNode = minNode._left;\n this._header._left = curNode;\n }\n else {\n var maxNode = this._header._right;\n var compareToMax = this._cmp(maxNode._key, key);\n if (compareToMax === 0) {\n maxNode._value = value;\n return;\n }\n else if (compareToMax < 0) {\n maxNode._right = new this._TreeNodeClass(key, value);\n maxNode._right._parent = maxNode;\n curNode = maxNode._right;\n this._header._right = curNode;\n }\n else {\n if (hint !== undefined) {\n var iterNode = hint._node;\n if (iterNode !== this._header) {\n var iterCmpRes = this._cmp(iterNode._key, key);\n if (iterCmpRes === 0) {\n iterNode._value = value;\n return;\n }\n else /* istanbul ignore else */ if (iterCmpRes > 0) {\n var preNode = iterNode._pre();\n var preCmpRes = this._cmp(preNode._key, key);\n if (preCmpRes === 0) {\n preNode._value = value;\n return;\n }\n else if (preCmpRes < 0) {\n curNode = new this._TreeNodeClass(key, value);\n if (preNode._right === undefined) {\n preNode._right = curNode;\n curNode._parent = preNode;\n }\n else {\n iterNode._left = curNode;\n curNode._parent = iterNode;\n }\n }\n }\n }\n }\n if (curNode === undefined) {\n curNode = this._root;\n while (true) {\n var cmpResult = this._cmp(curNode._key, key);\n if (cmpResult > 0) {\n if (curNode._left === undefined) {\n curNode._left = new this._TreeNodeClass(key, value);\n curNode._left._parent = curNode;\n curNode = curNode._left;\n break;\n }\n curNode = curNode._left;\n }\n else if (cmpResult < 0) {\n if (curNode._right === undefined) {\n curNode._right = new this._TreeNodeClass(key, value);\n curNode._right._parent = curNode;\n curNode = curNode._right;\n break;\n }\n curNode = curNode._right;\n }\n else {\n curNode._value = value;\n return;\n }\n }\n }\n }\n }\n this._length += 1;\n return curNode;\n };\n /**\n * @internal\n */\n TreeContainer.prototype._findElementNode = function (curNode, key) {\n while (curNode) {\n var cmpResult = this._cmp(curNode._key, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n }\n else if (cmpResult > 0) {\n curNode = curNode._left;\n }\n else\n return curNode;\n }\n return curNode || this._header;\n };\n TreeContainer.prototype.clear = function () {\n this._length = 0;\n this._root = undefined;\n this._header._parent = undefined;\n this._header._left = this._header._right = undefined;\n };\n /**\n * @description Update node's key by iterator.\n * @param iter - The iterator you want to change.\n * @param key - The key you want to update.\n * @returns Whether the modification is successful.\n * @example\n * const st = new orderedSet([1, 2, 5]);\n * const iter = st.find(2);\n * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5]\n */\n TreeContainer.prototype.updateKeyByIterator = function (iter, key) {\n var node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n if (this._length === 1) {\n node._key = key;\n return true;\n }\n if (node === this._header._left) {\n if (this._cmp(node._next()._key, key) > 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n if (node === this._header._right) {\n if (this._cmp(node._pre()._key, key) < 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n var preKey = node._pre()._key;\n if (this._cmp(preKey, key) >= 0)\n return false;\n var nextKey = node._next()._key;\n if (this._cmp(nextKey, key) <= 0)\n return false;\n node._key = key;\n return true;\n };\n TreeContainer.prototype.eraseElementByPos = function (pos) {\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var index = 0;\n var self = this;\n this._inOrderTraversal(this._root, function (curNode) {\n if (pos === index) {\n self._eraseNode(curNode);\n return true;\n }\n index += 1;\n return false;\n });\n return this._length;\n };\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @returns Whether erase successfully.\n */\n TreeContainer.prototype.eraseElementByKey = function (key) {\n if (this._length === 0)\n return false;\n var curNode = this._findElementNode(this._root, key);\n if (curNode === this._header)\n return false;\n this._eraseNode(curNode);\n return true;\n };\n TreeContainer.prototype.eraseElementByIterator = function (iter) {\n var node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n var hasNoRight = node._right === undefined;\n var isNormal = iter.iteratorType === 0 /* IteratorType.NORMAL */;\n // For the normal iterator, the `next` node will be swapped to `this` node when has right.\n if (isNormal) {\n // So we should move it to next when it's right is null.\n if (hasNoRight)\n iter.next();\n }\n else {\n // For the reverse iterator, only when it doesn't have right and has left the `next` node will be swapped.\n // So when it has right, or it is a leaf node we should move it to `next`.\n if (!hasNoRight || node._left === undefined)\n iter.next();\n }\n this._eraseNode(node);\n return iter;\n };\n TreeContainer.prototype.forEach = function (callback) {\n var e_1, _a;\n var index = 0;\n try {\n for (var _b = __values(this), _c = _b.next(); !_c.done; _c = _b.next()) {\n var element = _c.value;\n callback(element, index++, this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n TreeContainer.prototype.getElementByPos = function (pos) {\n var e_2, _a;\n if (pos < 0 || pos > this._length - 1) {\n throw new RangeError();\n }\n var res;\n var index = 0;\n try {\n for (var _b = __values(this), _c = _b.next(); !_c.done; _c = _b.next()) {\n var element = _c.value;\n if (index === pos) {\n res = element;\n break;\n }\n index += 1;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return res;\n };\n /**\n * @description Get the height of the tree.\n * @returns Number about the height of the RB-tree.\n */\n TreeContainer.prototype.getHeight = function () {\n if (this._length === 0)\n return 0;\n var traversal = function (curNode) {\n if (!curNode)\n return 0;\n return Math.max(traversal(curNode._left), traversal(curNode._right)) + 1;\n };\n return traversal(this._root);\n };\n return TreeContainer;\n}(Container));\nexport default TreeContainer;\n","import type TreeIterator from './TreeIterator';\nimport { TreeNode, TreeNodeColor, TreeNodeEnableIndex } from './TreeNode';\nimport { Container, IteratorType } from '@/container/ContainerBase';\nimport $checkWithinAccessParams from '@/utils/checkParams.macro';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nabstract class TreeContainer extends Container {\n /**\n * @internal\n */\n protected _root: TreeNode | undefined = undefined;\n /**\n * @internal\n */\n protected _header: TreeNode;\n /**\n * @internal\n */\n protected readonly _cmp: (x: K, y: K) => number;\n /**\n * @internal\n */\n protected readonly _TreeNodeClass: typeof TreeNode | typeof TreeNodeEnableIndex;\n /**\n * @internal\n */\n protected readonly _eraseNode: (curNode: TreeNode) => void;\n /**\n * @internal\n */\n protected _set: (key: K, value: V, hint?: TreeIterator) => number;\n /**\n * @internal\n */\n protected constructor(\n cmp: (x: K, y: K) => number =\n function (x: K, y: K) {\n if (x < y) return -1;\n if (x > y) return 1;\n return 0;\n },\n enableIndex = false\n ) {\n super();\n this._cmp = cmp;\n if (enableIndex) {\n this._TreeNodeClass = TreeNodeEnableIndex;\n this._set = function (key, value, hint) {\n const curNode = this._preSet(key, value, hint);\n if (curNode) {\n let p = curNode._parent as TreeNodeEnableIndex;\n while (p !== this._header) {\n p._subTreeSize += 1;\n p = p._parent as TreeNodeEnableIndex;\n }\n const nodeList = this._insertNodeSelfBalance(curNode);\n if (nodeList) {\n const {\n parentNode,\n grandParent,\n curNode\n } = nodeList as unknown as Record>;\n parentNode._recount();\n grandParent._recount();\n curNode._recount();\n }\n }\n return this._length;\n };\n this._eraseNode = function (curNode) {\n let p = this._preEraseNode(curNode) as TreeNodeEnableIndex;\n while (p !== this._header) {\n p._subTreeSize -= 1;\n p = p._parent as TreeNodeEnableIndex;\n }\n };\n } else {\n this._TreeNodeClass = TreeNode;\n this._set = function (key, value, hint) {\n const curNode = this._preSet(key, value, hint);\n if (curNode) this._insertNodeSelfBalance(curNode);\n return this._length;\n };\n this._eraseNode = this._preEraseNode;\n }\n this._header = new this._TreeNodeClass();\n }\n /**\n * @internal\n */\n protected _lowerBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n } else if (cmpResult > 0) {\n resNode = curNode;\n curNode = curNode._left;\n } else return curNode;\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _upperBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult <= 0) {\n curNode = curNode._right;\n } else {\n resNode = curNode;\n curNode = curNode._left;\n }\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _reverseLowerBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n } else if (cmpResult > 0) {\n curNode = curNode._left;\n } else return curNode;\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _reverseUpperBound(curNode: TreeNode | undefined, key: K) {\n let resNode = this._header;\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n resNode = curNode;\n curNode = curNode._right;\n } else {\n curNode = curNode._left;\n }\n }\n return resNode;\n }\n /**\n * @internal\n */\n protected _eraseNodeSelfBalance(curNode: TreeNode) {\n while (true) {\n const parentNode = curNode._parent!;\n if (parentNode === this._header) return;\n if (curNode._color === TreeNodeColor.RED) {\n curNode._color = TreeNodeColor.BLACK;\n return;\n }\n if (curNode === parentNode._left) {\n const brother = parentNode._right!;\n if (brother._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.BLACK;\n parentNode._color = TreeNodeColor.RED;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n } else parentNode._rotateLeft();\n } else {\n if (brother._right && brother._right._color === TreeNodeColor.RED) {\n brother._color = parentNode._color;\n parentNode._color = TreeNodeColor.BLACK;\n brother._right._color = TreeNodeColor.BLACK;\n if (parentNode === this._root) {\n this._root = parentNode._rotateLeft();\n } else parentNode._rotateLeft();\n return;\n } else if (brother._left && brother._left._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.RED;\n brother._left._color = TreeNodeColor.BLACK;\n brother._rotateRight();\n } else {\n brother._color = TreeNodeColor.RED;\n curNode = parentNode;\n }\n }\n } else {\n const brother = parentNode._left!;\n if (brother._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.BLACK;\n parentNode._color = TreeNodeColor.RED;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n } else parentNode._rotateRight();\n } else {\n if (brother._left && brother._left._color === TreeNodeColor.RED) {\n brother._color = parentNode._color;\n parentNode._color = TreeNodeColor.BLACK;\n brother._left._color = TreeNodeColor.BLACK;\n if (parentNode === this._root) {\n this._root = parentNode._rotateRight();\n } else parentNode._rotateRight();\n return;\n } else if (brother._right && brother._right._color === TreeNodeColor.RED) {\n brother._color = TreeNodeColor.RED;\n brother._right._color = TreeNodeColor.BLACK;\n brother._rotateLeft();\n } else {\n brother._color = TreeNodeColor.RED;\n curNode = parentNode;\n }\n }\n }\n }\n }\n /**\n * @internal\n */\n protected _preEraseNode(curNode: TreeNode) {\n if (this._length === 1) {\n this.clear();\n return this._header;\n }\n let swapNode = curNode;\n while (swapNode._left || swapNode._right) {\n if (swapNode._right) {\n swapNode = swapNode._right;\n while (swapNode._left) swapNode = swapNode._left;\n } else {\n swapNode = swapNode._left!;\n }\n [curNode._key, swapNode._key] = [swapNode._key, curNode._key];\n [curNode._value, swapNode._value] = [swapNode._value, curNode._value];\n curNode = swapNode;\n }\n if (this._header._left === swapNode) {\n this._header._left = swapNode._parent;\n } else if (this._header._right === swapNode) {\n this._header._right = swapNode._parent;\n }\n this._eraseNodeSelfBalance(swapNode);\n const _parent = swapNode._parent!;\n if (swapNode === _parent._left) {\n _parent._left = undefined;\n } else _parent._right = undefined;\n this._length -= 1;\n this._root!._color = TreeNodeColor.BLACK;\n return _parent;\n }\n /**\n * @internal\n */\n protected _inOrderTraversal(\n curNode: TreeNode | undefined,\n callback: (curNode: TreeNode) => boolean\n ): boolean {\n if (curNode === undefined) return false;\n const ifReturn = this._inOrderTraversal(curNode._left, callback);\n if (ifReturn) return true;\n if (callback(curNode)) return true;\n return this._inOrderTraversal(curNode._right, callback);\n }\n /**\n * @internal\n */\n protected _insertNodeSelfBalance(curNode: TreeNode) {\n while (true) {\n const parentNode = curNode._parent!;\n if (parentNode._color === TreeNodeColor.BLACK) return;\n const grandParent = parentNode._parent!;\n if (parentNode === grandParent._left) {\n const uncle = grandParent._right;\n if (uncle && uncle._color === TreeNodeColor.RED) {\n uncle._color = parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) return;\n grandParent._color = TreeNodeColor.RED;\n curNode = grandParent;\n continue;\n } else if (curNode === parentNode._right) {\n curNode._color = TreeNodeColor.BLACK;\n if (curNode._left) curNode._left._parent = parentNode;\n if (curNode._right) curNode._right._parent = grandParent;\n parentNode._right = curNode._left;\n grandParent._left = curNode._right;\n curNode._left = parentNode;\n curNode._right = grandParent;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n } else {\n const GP = grandParent._parent!;\n if (GP._left === grandParent) {\n GP._left = curNode;\n } else GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = TreeNodeColor.RED;\n return { parentNode, grandParent, curNode };\n } else {\n parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) {\n this._root = grandParent._rotateRight();\n } else grandParent._rotateRight();\n grandParent._color = TreeNodeColor.RED;\n }\n } else {\n const uncle = grandParent._left;\n if (uncle && uncle._color === TreeNodeColor.RED) {\n uncle._color = parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) return;\n grandParent._color = TreeNodeColor.RED;\n curNode = grandParent;\n continue;\n } else if (curNode === parentNode._left) {\n curNode._color = TreeNodeColor.BLACK;\n if (curNode._left) curNode._left._parent = grandParent;\n if (curNode._right) curNode._right._parent = parentNode;\n grandParent._right = curNode._left;\n parentNode._left = curNode._right;\n curNode._left = grandParent;\n curNode._right = parentNode;\n if (grandParent === this._root) {\n this._root = curNode;\n this._header._parent = curNode;\n } else {\n const GP = grandParent._parent!;\n if (GP._left === grandParent) {\n GP._left = curNode;\n } else GP._right = curNode;\n }\n curNode._parent = grandParent._parent;\n parentNode._parent = curNode;\n grandParent._parent = curNode;\n grandParent._color = TreeNodeColor.RED;\n return { parentNode, grandParent, curNode };\n } else {\n parentNode._color = TreeNodeColor.BLACK;\n if (grandParent === this._root) {\n this._root = grandParent._rotateLeft();\n } else grandParent._rotateLeft();\n grandParent._color = TreeNodeColor.RED;\n }\n }\n return;\n }\n }\n /**\n * @internal\n */\n protected _preSet(key: K, value?: V, hint?: TreeIterator) {\n if (this._root === undefined) {\n this._length += 1;\n this._root = new this._TreeNodeClass(key, value);\n this._root._color = TreeNodeColor.BLACK;\n this._root._parent = this._header;\n this._header._parent = this._root;\n this._header._left = this._root;\n this._header._right = this._root;\n return;\n }\n let curNode;\n const minNode = this._header._left!;\n const compareToMin = this._cmp(minNode._key!, key);\n if (compareToMin === 0) {\n minNode._value = value;\n return;\n } else if (compareToMin > 0) {\n minNode._left = new this._TreeNodeClass(key, value);\n minNode._left._parent = minNode;\n curNode = minNode._left;\n this._header._left = curNode;\n } else {\n const maxNode = this._header._right!;\n const compareToMax = this._cmp(maxNode._key!, key);\n if (compareToMax === 0) {\n maxNode._value = value;\n return;\n } else if (compareToMax < 0) {\n maxNode._right = new this._TreeNodeClass(key, value);\n maxNode._right._parent = maxNode;\n curNode = maxNode._right;\n this._header._right = curNode;\n } else {\n if (hint !== undefined) {\n const iterNode = hint._node;\n if (iterNode !== this._header) {\n const iterCmpRes = this._cmp(iterNode._key!, key);\n if (iterCmpRes === 0) {\n iterNode._value = value;\n return;\n } else /* istanbul ignore else */ if (iterCmpRes > 0) {\n const preNode = iterNode._pre();\n const preCmpRes = this._cmp(preNode._key!, key);\n if (preCmpRes === 0) {\n preNode._value = value;\n return;\n } else if (preCmpRes < 0) {\n curNode = new this._TreeNodeClass(key, value);\n if (preNode._right === undefined) {\n preNode._right = curNode;\n curNode._parent = preNode;\n } else {\n iterNode._left = curNode;\n curNode._parent = iterNode;\n }\n }\n }\n }\n }\n if (curNode === undefined) {\n curNode = this._root;\n while (true) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult > 0) {\n if (curNode._left === undefined) {\n curNode._left = new this._TreeNodeClass(key, value);\n curNode._left._parent = curNode;\n curNode = curNode._left;\n break;\n }\n curNode = curNode._left;\n } else if (cmpResult < 0) {\n if (curNode._right === undefined) {\n curNode._right = new this._TreeNodeClass(key, value);\n curNode._right._parent = curNode;\n curNode = curNode._right;\n break;\n }\n curNode = curNode._right;\n } else {\n curNode._value = value;\n return;\n }\n }\n }\n }\n }\n this._length += 1;\n return curNode;\n }\n /**\n * @internal\n */\n protected _findElementNode(curNode: TreeNode | undefined, key: K) {\n while (curNode) {\n const cmpResult = this._cmp(curNode._key!, key);\n if (cmpResult < 0) {\n curNode = curNode._right;\n } else if (cmpResult > 0) {\n curNode = curNode._left;\n } else return curNode;\n }\n return curNode || this._header;\n }\n clear() {\n this._length = 0;\n this._root = undefined;\n this._header._parent = undefined;\n this._header._left = this._header._right = undefined;\n }\n /**\n * @description Update node's key by iterator.\n * @param iter - The iterator you want to change.\n * @param key - The key you want to update.\n * @returns Whether the modification is successful.\n * @example\n * const st = new orderedSet([1, 2, 5]);\n * const iter = st.find(2);\n * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5]\n */\n updateKeyByIterator(iter: TreeIterator, key: K): boolean {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n if (this._length === 1) {\n node._key = key;\n return true;\n }\n if (node === this._header._left) {\n if (this._cmp(node._next()._key!, key) > 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n if (node === this._header._right) {\n if (this._cmp(node._pre()._key!, key) < 0) {\n node._key = key;\n return true;\n }\n return false;\n }\n const preKey = node._pre()._key!;\n if (this._cmp(preKey, key) >= 0) return false;\n const nextKey = node._next()._key!;\n if (this._cmp(nextKey, key) <= 0) return false;\n node._key = key;\n return true;\n }\n eraseElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let index = 0;\n const self = this;\n this._inOrderTraversal(\n this._root,\n function (curNode) {\n if (pos === index) {\n self._eraseNode(curNode);\n return true;\n }\n index += 1;\n return false;\n });\n return this._length;\n }\n /**\n * @description Remove the element of the specified key.\n * @param key - The key you want to remove.\n * @returns Whether erase successfully.\n */\n eraseElementByKey(key: K) {\n if (this._length === 0) return false;\n const curNode = this._findElementNode(this._root, key);\n if (curNode === this._header) return false;\n this._eraseNode(curNode);\n return true;\n }\n eraseElementByIterator(iter: TreeIterator) {\n const node = iter._node;\n if (node === this._header) {\n throwIteratorAccessError();\n }\n const hasNoRight = node._right === undefined;\n const isNormal = iter.iteratorType === IteratorType.NORMAL;\n // For the normal iterator, the `next` node will be swapped to `this` node when has right.\n if (isNormal) {\n // So we should move it to next when it's right is null.\n if (hasNoRight) iter.next();\n } else {\n // For the reverse iterator, only when it doesn't have right and has left the `next` node will be swapped.\n // So when it has right, or it is a leaf node we should move it to `next`.\n if (!hasNoRight || node._left === undefined) iter.next();\n }\n this._eraseNode(node);\n return iter;\n }\n forEach(callback: (element: K | [K, V], index: number, tree: TreeContainer) => void) {\n let index = 0;\n for (const element of this) callback(element, index++, this);\n }\n getElementByPos(pos: number) {\n $checkWithinAccessParams!(pos, 0, this._length - 1);\n let res;\n let index = 0;\n for (const element of this) {\n if (index === pos) {\n res = element;\n break;\n }\n index += 1;\n }\n return res;\n }\n /**\n * @description Get the height of the tree.\n * @returns Number about the height of the RB-tree.\n */\n getHeight() {\n if (this._length === 0) return 0;\n const traversal =\n function (curNode: TreeNode | undefined): number {\n if (!curNode) return 0;\n return Math.max(traversal(curNode._left), traversal(curNode._right)) + 1;\n };\n return traversal(this._root);\n }\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element less than the given key.\n */\n abstract reverseUpperBound(key: K): TreeIterator;\n /**\n * @description Union the other tree to self.\n * @param other - The other tree container you want to merge.\n * @returns The size of the tree after union.\n */\n abstract union(other: TreeContainer): number;\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element not greater than the given key.\n */\n abstract reverseLowerBound(key: K): TreeIterator;\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element not less than the given key.\n */\n abstract lowerBound(key: K): TreeIterator;\n /**\n * @param key - The given key you want to compare.\n * @returns An iterator to the first element greater than the given key.\n */\n abstract upperBound(key: K): TreeIterator;\n}\n\nexport default TreeContainer;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts new file mode 100644 index 000000000..18c921fab --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts @@ -0,0 +1,62 @@ +import TreeContainer from './Base'; +import TreeIterator from './Base/TreeIterator'; +import { TreeNode } from './Base/TreeNode'; +import { initContainer, IteratorType } from "../ContainerBase"; +declare class OrderedMapIterator extends TreeIterator { + container: OrderedMap; + constructor(node: TreeNode, header: TreeNode, container: OrderedMap, iteratorType?: IteratorType); + get pointer(): [K, V]; + copy(): OrderedMapIterator; + equals(iter: OrderedMapIterator): boolean; +} +export type { OrderedMapIterator }; +declare class OrderedMap extends TreeContainer { + /** + * @param container - The initialization container. + * @param cmp - The compare function. + * @param enableIndex - Whether to enable iterator indexing function. + * @example + * new OrderedMap(); + * new OrderedMap([[0, 1], [2, 1]]); + * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y); + * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true); + */ + constructor(container?: initContainer<[K, V]>, cmp?: (x: K, y: K) => number, enableIndex?: boolean); + begin(): OrderedMapIterator; + end(): OrderedMapIterator; + rBegin(): OrderedMapIterator; + rEnd(): OrderedMapIterator; + front(): [K, V] | undefined; + back(): [K, V] | undefined; + lowerBound(key: K): OrderedMapIterator; + upperBound(key: K): OrderedMapIterator; + reverseLowerBound(key: K): OrderedMapIterator; + reverseUpperBound(key: K): OrderedMapIterator; + /** + * @description Insert a key-value pair or set value by the given key. + * @param key - The key want to insert. + * @param value - The value want to set. + * @param hint - You can give an iterator hint to improve insertion efficiency. + * @return The size of container after setting. + * @example + * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]); + * const iter = mp.begin(); + * mp.setElement(1, 0); + * mp.setElement(3, 0, iter); // give a hint will be faster. + */ + setElement(key: K, value: V, hint?: OrderedMapIterator): number; + find(key: K): OrderedMapIterator; + /** + * @description Get the value of the element of the specified key. + * @param key - The specified key you want to get. + * @example + * const val = container.getElementByKey(1); + */ + getElementByKey(key: K): V | undefined; + union(other: OrderedMap): number; + [Symbol.iterator](): Generator<[K, V], void, unknown>; + eraseElementByIterator(iter: OrderedMapIterator): OrderedMapIterator; + forEach(callback: (element: [K, V], index: number, map: OrderedMap) => void): void; + getElementByPos(pos: number): [K, V]; +} +export default OrderedMap; diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js new file mode 100644 index 000000000..90795d511 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js @@ -0,0 +1,265 @@ +var __extends = this && this.t || function() { + var extendStatics = function(r, e) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(r, e) { + r.__proto__ = e; + } || function(r, e) { + for (var t in e) if (Object.prototype.hasOwnProperty.call(e, t)) r[t] = e[t]; + }; + return extendStatics(r, e); + }; + return function(r, e) { + if (typeof e !== "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null"); + extendStatics(r, e); + function __() { + this.constructor = r; + } + r.prototype = e === null ? Object.create(e) : (__.prototype = e.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(r, e) { + var t = { + label: 0, + sent: function() { + if (o[0] & 1) throw o[1]; + return o[1]; + }, + trys: [], + ops: [] + }, n, i, o, a; + return a = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (a[Symbol.iterator] = function() { + return this; + }), a; + function verb(r) { + return function(e) { + return step([ r, e ]); + }; + } + function step(a) { + if (n) throw new TypeError("Generator is already executing."); + while (t) try { + if (n = 1, i && (o = a[0] & 2 ? i["return"] : a[0] ? i["throw"] || ((o = i["return"]) && o.call(i), + 0) : i.next) && !(o = o.call(i, a[1])).done) return o; + if (i = 0, o) a = [ a[0] & 2, o.value ]; + switch (a[0]) { + case 0: + case 1: + o = a; + break; + + case 4: + t.label++; + return { + value: a[1], + done: false + }; + + case 5: + t.label++; + i = a[1]; + a = [ 0 ]; + continue; + + case 7: + a = t.ops.pop(); + t.trys.pop(); + continue; + + default: + if (!(o = t.trys, o = o.length > 0 && o[o.length - 1]) && (a[0] === 6 || a[0] === 2)) { + t = 0; + continue; + } + if (a[0] === 3 && (!o || a[1] > o[0] && a[1] < o[3])) { + t.label = a[1]; + break; + } + if (a[0] === 6 && t.label < o[1]) { + t.label = o[1]; + o = a; + break; + } + if (o && t.label < o[2]) { + t.label = o[2]; + t.ops.push(a); + break; + } + if (o[2]) t.ops.pop(); + t.trys.pop(); + continue; + } + a = e.call(r, t); + } catch (r) { + a = [ 6, r ]; + i = 0; + } finally { + n = o = 0; + } + if (a[0] & 5) throw a[1]; + return { + value: a[0] ? a[1] : void 0, + done: true + }; + } +}; + +var __values = this && this.V || function(r) { + var e = typeof Symbol === "function" && Symbol.iterator, t = e && r[e], n = 0; + if (t) return t.call(r); + if (r && typeof r.length === "number") return { + next: function() { + if (r && n >= r.length) r = void 0; + return { + value: r && r[n++], + done: !r + }; + } + }; + throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; + +import TreeContainer from "./Base"; + +import TreeIterator from "./Base/TreeIterator"; + +import { throwIteratorAccessError } from "../../utils/throwError"; + +var OrderedMapIterator = function(r) { + __extends(OrderedMapIterator, r); + function OrderedMapIterator(e, t, n, i) { + var o = r.call(this, e, t, i) || this; + o.container = n; + return o; + } + Object.defineProperty(OrderedMapIterator.prototype, "pointer", { + get: function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + var r = this; + return new Proxy([], { + get: function(e, t) { + if (t === "0") return r.o.u; else if (t === "1") return r.o.p; + }, + set: function(e, t, n) { + if (t !== "1") { + throw new TypeError("props must be 1"); + } + r.o.p = n; + return true; + } + }); + }, + enumerable: false, + configurable: true + }); + OrderedMapIterator.prototype.copy = function() { + return new OrderedMapIterator(this.o, this.h, this.container, this.iteratorType); + }; + return OrderedMapIterator; +}(TreeIterator); + +var OrderedMap = function(r) { + __extends(OrderedMap, r); + function OrderedMap(e, t, n) { + if (e === void 0) { + e = []; + } + var i = r.call(this, t, n) || this; + var o = i; + e.forEach((function(r) { + o.setElement(r[0], r[1]); + })); + return i; + } + OrderedMap.prototype.P = function(r) { + return __generator(this, (function(e) { + switch (e.label) { + case 0: + if (r === undefined) return [ 2 ]; + return [ 5, __values(this.P(r.K)) ]; + + case 1: + e.sent(); + return [ 4, [ r.u, r.p ] ]; + + case 2: + e.sent(); + return [ 5, __values(this.P(r.N)) ]; + + case 3: + e.sent(); + return [ 2 ]; + } + })); + }; + OrderedMap.prototype.begin = function() { + return new OrderedMapIterator(this.h.K || this.h, this.h, this); + }; + OrderedMap.prototype.end = function() { + return new OrderedMapIterator(this.h, this.h, this); + }; + OrderedMap.prototype.rBegin = function() { + return new OrderedMapIterator(this.h.N || this.h, this.h, this, 1); + }; + OrderedMap.prototype.rEnd = function() { + return new OrderedMapIterator(this.h, this.h, this, 1); + }; + OrderedMap.prototype.front = function() { + if (this.M === 0) return; + var r = this.h.K; + return [ r.u, r.p ]; + }; + OrderedMap.prototype.back = function() { + if (this.M === 0) return; + var r = this.h.N; + return [ r.u, r.p ]; + }; + OrderedMap.prototype.lowerBound = function(r) { + var e = this.U(this.W, r); + return new OrderedMapIterator(e, this.h, this); + }; + OrderedMap.prototype.upperBound = function(r) { + var e = this.X(this.W, r); + return new OrderedMapIterator(e, this.h, this); + }; + OrderedMap.prototype.reverseLowerBound = function(r) { + var e = this.Y(this.W, r); + return new OrderedMapIterator(e, this.h, this); + }; + OrderedMap.prototype.reverseUpperBound = function(r) { + var e = this.Z(this.W, r); + return new OrderedMapIterator(e, this.h, this); + }; + OrderedMap.prototype.setElement = function(r, e, t) { + return this.v(r, e, t); + }; + OrderedMap.prototype.find = function(r) { + var e = this.g(this.W, r); + return new OrderedMapIterator(e, this.h, this); + }; + OrderedMap.prototype.getElementByKey = function(r) { + var e = this.g(this.W, r); + return e.p; + }; + OrderedMap.prototype.union = function(r) { + var e = this; + r.forEach((function(r) { + e.setElement(r[0], r[1]); + })); + return this.M; + }; + OrderedMap.prototype[Symbol.iterator] = function() { + return this.P(this.W); + }; + return OrderedMap; +}(TreeContainer); + +export default OrderedMap; +//# sourceMappingURL=OrderedMap.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js.map b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js.map new file mode 100644 index 000000000..76fbadc11 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/OrderedMap.js","../../src/container/TreeContainer/OrderedMap.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","__values","o","s","m","i","TreeContainer","TreeIterator","throwIteratorAccessError","OrderedMapIterator","_super","node","header","container","iteratorType","_this","defineProperty","get","_node","_header","self","Proxy","props","_key","_value","set","newValue","enumerable","configurable","copy","OrderedMap","cmp","enableIndex","forEach","el","setElement","_iterationFunc","curNode","_a","undefined","_left","_right","begin","end","rBegin","rEnd","front","_length","minNode","back","maxNode","lowerBound","key","resNode","_lowerBound","_root","upperBound","_upperBound","reverseLowerBound","_reverseLowerBound","reverseUpperBound","_reverseUpperBound","hint","_set","find","_findElementNode","getElementByKey","union","other"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC,IAAIE,gBAAgB,SAAUC,GAAGC;QAC7BF,gBAAgBG,OAAOC,kBAClB;YAAEC,WAAW;qBAAgBC,SAAS,SAAUL,GAAGC;YAAKD,EAAEI,YAAYH;AAAG,aAC1E,SAAUD,GAAGC;YAAK,KAAK,IAAIK,KAAKL,GAAG,IAAIC,OAAOK,UAAUC,eAAeC,KAAKR,GAAGK,IAAIN,EAAEM,KAAKL,EAAEK;AAAI;QACpG,OAAOP,cAAcC,GAAGC;AAC5B;IACA,OAAO,SAAUD,GAAGC;QAChB,WAAWA,MAAM,cAAcA,MAAM,MACjC,MAAM,IAAIS,UAAU,yBAAyBC,OAAOV,KAAK;QAC7DF,cAAcC,GAAGC;QACjB,SAASW;YAAOd,KAAKe,cAAcb;AAAG;QACtCA,EAAEO,YAAYN,MAAM,OAAOC,OAAOY,OAAOb,MAAMW,GAAGL,YAAYN,EAAEM,WAAW,IAAIK;AACnF;AACJ,CAd6C;;AAe7C,IAAIG,cAAejB,QAAQA,KAAKiB,KAAgB,SAAUC,GAASC;IAC/D,IAAIC,IAAI;QAAEC,OAAO;QAAGC,MAAM;YAAa,IAAIC,EAAE,KAAK,GAAG,MAAMA,EAAE;YAAI,OAAOA,EAAE;AAAI;QAAGC,MAAM;QAAIC,KAAK;OAAMC,GAAGC,GAAGJ,GAAGK;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mG,GAAOH;QAC7C,OAAO,IAAI3C,mBAAyB4C,GAASjG,KAAK+D,GAAS/D;ADmD3D;ICjDF0E,WAAAjE,UAAA6F,oBAAA,SAAkBN;QAChB,IAAMC,IAAUjG,KAAKuG,EAAmBvG,KAAKmG,GAAOH;QACpD,OAAO,IAAI3C,mBAAyB4C,GAASjG,KAAK+D,GAAS/D;ADmD3D;ICjDF0E,WAAAjE,UAAA+F,oBAAA,SAAkBR;QAChB,IAAMC,IAAUjG,KAAKyG,EAAmBzG,KAAKmG,GAAOH;QACpD,OAAO,IAAI3C,mBAAyB4C,GAASjG,KAAK+D,GAAS/D;ADmD3D;ICrCF0E,WAAAjE,UAAAsE,aAAA,SAAWiB,GAAQxD,GAAUkE;QAC3B,OAAO1G,KAAK2G,EAAKX,GAAKxD,GAAOkE;ADmD7B;ICjDFhC,WAAAjE,UAAAmG,OAAA,SAAKZ;QACH,IAAMf,IAAUjF,KAAK6G,EAAiB7G,KAAKmG,GAAOH;QAClD,OAAO,IAAI3C,mBAAyB4B,GAASjF,KAAK+D,GAAS/D;ADmD3D;IC3CF0E,WAAAjE,UAAAqG,kBAAA,SAAgBd;QACd,IAAMf,IAAUjF,KAAK6G,EAAiB7G,KAAKmG,GAAOH;QAClD,OAAOf,EAAQb;ADmDf;ICjDFM,WAAAjE,UAAAsG,QAAA,SAAMC;QACJ,IAAMhD,IAAOhE;QACbgH,EAAMnC,SAAQ,SAAUC;YACtBd,EAAKe,WAAWD,EAAG,IAAIA,EAAG;ADmDxB;QCjDJ,OAAO9E,KAAK2F;ADmDZ;ICjDFjB,WAAAjE,UAACwB,OAAOC,YAAR;QACE,OAAOlC,KAAKgF,EAAehF,KAAKmG;ADmDhC;IC3CJ,OAAAzB;AAAA,CAzHA,CAA+BxB;;eA2HhBwB","file":"OrderedMap.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nimport TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nvar OrderedMapIterator = /** @class */ (function (_super) {\n __extends(OrderedMapIterator, _super);\n function OrderedMapIterator(node, header, container, iteratorType) {\n var _this = _super.call(this, node, header, iteratorType) || this;\n _this.container = container;\n return _this;\n }\n Object.defineProperty(OrderedMapIterator.prototype, \"pointer\", {\n get: function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n var self = this;\n return new Proxy([], {\n get: function (_, props) {\n if (props === '0')\n return self._node._key;\n else if (props === '1')\n return self._node._value;\n },\n set: function (_, props, newValue) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n },\n enumerable: false,\n configurable: true\n });\n OrderedMapIterator.prototype.copy = function () {\n return new OrderedMapIterator(this._node, this._header, this.container, this.iteratorType);\n };\n return OrderedMapIterator;\n}(TreeIterator));\nvar OrderedMap = /** @class */ (function (_super) {\n __extends(OrderedMap, _super);\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedMap();\n * new OrderedMap([[0, 1], [2, 1]]);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true);\n */\n function OrderedMap(container, cmp, enableIndex) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this, cmp, enableIndex) || this;\n var self = _this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n return _this;\n }\n /**\n * @internal\n */\n OrderedMap.prototype._iterationFunc = function (curNode) {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (curNode === undefined)\n return [2 /*return*/];\n return [5 /*yield**/, __values(this._iterationFunc(curNode._left))];\n case 1:\n _a.sent();\n return [4 /*yield*/, [curNode._key, curNode._value]];\n case 2:\n _a.sent();\n return [5 /*yield**/, __values(this._iterationFunc(curNode._right))];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n };\n OrderedMap.prototype.begin = function () {\n return new OrderedMapIterator(this._header._left || this._header, this._header, this);\n };\n OrderedMap.prototype.end = function () {\n return new OrderedMapIterator(this._header, this._header, this);\n };\n OrderedMap.prototype.rBegin = function () {\n return new OrderedMapIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n OrderedMap.prototype.rEnd = function () {\n return new OrderedMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n OrderedMap.prototype.front = function () {\n if (this._length === 0)\n return;\n var minNode = this._header._left;\n return [minNode._key, minNode._value];\n };\n OrderedMap.prototype.back = function () {\n if (this._length === 0)\n return;\n var maxNode = this._header._right;\n return [maxNode._key, maxNode._value];\n };\n OrderedMap.prototype.lowerBound = function (key) {\n var resNode = this._lowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n };\n OrderedMap.prototype.upperBound = function (key) {\n var resNode = this._upperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n };\n OrderedMap.prototype.reverseLowerBound = function (key) {\n var resNode = this._reverseLowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n };\n OrderedMap.prototype.reverseUpperBound = function (key) {\n var resNode = this._reverseUpperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n };\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]);\n * const iter = mp.begin();\n * mp.setElement(1, 0);\n * mp.setElement(3, 0, iter); // give a hint will be faster.\n */\n OrderedMap.prototype.setElement = function (key, value, hint) {\n return this._set(key, value, hint);\n };\n OrderedMap.prototype.find = function (key) {\n var curNode = this._findElementNode(this._root, key);\n return new OrderedMapIterator(curNode, this._header, this);\n };\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The specified key you want to get.\n * @example\n * const val = container.getElementByKey(1);\n */\n OrderedMap.prototype.getElementByKey = function (key) {\n var curNode = this._findElementNode(this._root, key);\n return curNode._value;\n };\n OrderedMap.prototype.union = function (other) {\n var self = this;\n other.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n return this._length;\n };\n OrderedMap.prototype[Symbol.iterator] = function () {\n return this._iterationFunc(this._root);\n };\n return OrderedMap;\n}(TreeContainer));\nexport default OrderedMap;\n","import TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { TreeNode } from './Base/TreeNode';\nimport { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass OrderedMapIterator extends TreeIterator {\n container: OrderedMap;\n constructor(\n node: TreeNode,\n header: TreeNode,\n container: OrderedMap,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n const self = this;\n return new Proxy(<[K, V]>[], {\n get(_, props: '0' | '1') {\n if (props === '0') return self._node._key;\n else if (props === '1') return self._node._value;\n },\n set(_, props: '1', newValue: V) {\n if (props !== '1') {\n throw new TypeError('props must be 1');\n }\n self._node._value = newValue;\n return true;\n }\n });\n }\n copy() {\n return new OrderedMapIterator(\n this._node,\n this._header,\n this.container,\n this.iteratorType\n );\n }\n // @ts-ignore\n equals(iter: OrderedMapIterator): boolean;\n}\n\nexport type { OrderedMapIterator };\n\nclass OrderedMap extends TreeContainer {\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedMap();\n * new OrderedMap([[0, 1], [2, 1]]);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y);\n * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true);\n */\n constructor(\n container: initContainer<[K, V]> = [],\n cmp?: (x: K, y: K) => number,\n enableIndex?: boolean\n ) {\n super(cmp, enableIndex);\n const self = this;\n container.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n }\n /**\n * @internal\n */\n private * _iterationFunc(\n curNode: TreeNode | undefined\n ): Generator<[K, V], void> {\n if (curNode === undefined) return;\n yield * this._iterationFunc(curNode._left);\n yield <[K, V]>[curNode._key, curNode._value];\n yield * this._iterationFunc(curNode._right);\n }\n begin() {\n return new OrderedMapIterator(this._header._left || this._header, this._header, this);\n }\n end() {\n return new OrderedMapIterator(this._header, this._header, this);\n }\n rBegin() {\n return new OrderedMapIterator(\n this._header._right || this._header,\n this._header,\n this,\n IteratorType.REVERSE\n );\n }\n rEnd() {\n return new OrderedMapIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front() {\n if (this._length === 0) return;\n const minNode = this._header._left!;\n return <[K, V]>[minNode._key, minNode._value];\n }\n back() {\n if (this._length === 0) return;\n const maxNode = this._header._right!;\n return <[K, V]>[maxNode._key, maxNode._value];\n }\n lowerBound(key: K) {\n const resNode = this._lowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n upperBound(key: K) {\n const resNode = this._upperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n reverseLowerBound(key: K) {\n const resNode = this._reverseLowerBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n reverseUpperBound(key: K) {\n const resNode = this._reverseUpperBound(this._root, key);\n return new OrderedMapIterator(resNode, this._header, this);\n }\n /**\n * @description Insert a key-value pair or set value by the given key.\n * @param key - The key want to insert.\n * @param value - The value want to set.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]);\n * const iter = mp.begin();\n * mp.setElement(1, 0);\n * mp.setElement(3, 0, iter); // give a hint will be faster.\n */\n setElement(key: K, value: V, hint?: OrderedMapIterator) {\n return this._set(key, value, hint);\n }\n find(key: K) {\n const curNode = this._findElementNode(this._root, key);\n return new OrderedMapIterator(curNode, this._header, this);\n }\n /**\n * @description Get the value of the element of the specified key.\n * @param key - The specified key you want to get.\n * @example\n * const val = container.getElementByKey(1);\n */\n getElementByKey(key: K) {\n const curNode = this._findElementNode(this._root, key);\n return curNode._value;\n }\n union(other: OrderedMap) {\n const self = this;\n other.forEach(function (el) {\n self.setElement(el[0], el[1]);\n });\n return this._length;\n }\n [Symbol.iterator]() {\n return this._iterationFunc(this._root);\n }\n // @ts-ignore\n eraseElementByIterator(iter: OrderedMapIterator): OrderedMapIterator;\n // @ts-ignore\n forEach(callback: (element: [K, V], index: number, map: OrderedMap) => void): void;\n // @ts-ignore\n getElementByPos(pos: number): [K, V];\n}\n\nexport default OrderedMap;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts new file mode 100644 index 000000000..e946983a8 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts @@ -0,0 +1,54 @@ +import TreeContainer from './Base'; +import TreeIterator from './Base/TreeIterator'; +import { TreeNode } from './Base/TreeNode'; +import { initContainer, IteratorType } from "../ContainerBase"; +declare class OrderedSetIterator extends TreeIterator { + container: OrderedSet; + constructor(node: TreeNode, header: TreeNode, container: OrderedSet, iteratorType?: IteratorType); + get pointer(): NonNullable; + copy(): OrderedSetIterator; + equals(iter: OrderedSetIterator): boolean; +} +export type { OrderedSetIterator }; +declare class OrderedSet extends TreeContainer { + /** + * @param container - The initialization container. + * @param cmp - The compare function. + * @param enableIndex - Whether to enable iterator indexing function. + * @example + * new OrderedSet(); + * new OrderedSet([0, 1, 2]); + * new OrderedSet([0, 1, 2], (x, y) => x - y); + * new OrderedSet([0, 1, 2], (x, y) => x - y, true); + */ + constructor(container?: initContainer, cmp?: (x: K, y: K) => number, enableIndex?: boolean); + begin(): OrderedSetIterator; + end(): OrderedSetIterator; + rBegin(): OrderedSetIterator; + rEnd(): OrderedSetIterator; + front(): K | undefined; + back(): K | undefined; + /** + * @description Insert element to set. + * @param key - The key want to insert. + * @param hint - You can give an iterator hint to improve insertion efficiency. + * @return The size of container after setting. + * @example + * const st = new OrderedSet([2, 4, 5]); + * const iter = st.begin(); + * st.insert(1); + * st.insert(3, iter); // give a hint will be faster. + */ + insert(key: K, hint?: OrderedSetIterator): number; + find(element: K): OrderedSetIterator; + lowerBound(key: K): OrderedSetIterator; + upperBound(key: K): OrderedSetIterator; + reverseLowerBound(key: K): OrderedSetIterator; + reverseUpperBound(key: K): OrderedSetIterator; + union(other: OrderedSet): number; + [Symbol.iterator](): Generator; + eraseElementByIterator(iter: OrderedSetIterator): OrderedSetIterator; + forEach(callback: (element: K, index: number, tree: OrderedSet) => void): void; + getElementByPos(pos: number): K; +} +export default OrderedSet; diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js new file mode 100644 index 000000000..0bd127050 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js @@ -0,0 +1,245 @@ +var __extends = this && this.t || function() { + var extendStatics = function(e, t) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function(e, t) { + e.__proto__ = t; + } || function(e, t) { + for (var r in t) if (Object.prototype.hasOwnProperty.call(t, r)) e[r] = t[r]; + }; + return extendStatics(e, t); + }; + return function(e, t) { + if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); + extendStatics(e, t); + function __() { + this.constructor = e; + } + e.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __); + }; +}(); + +var __generator = this && this.i || function(e, t) { + var r = { + label: 0, + sent: function() { + if (o[0] & 1) throw o[1]; + return o[1]; + }, + trys: [], + ops: [] + }, n, i, o, u; + return u = { + next: verb(0), + throw: verb(1), + return: verb(2) + }, typeof Symbol === "function" && (u[Symbol.iterator] = function() { + return this; + }), u; + function verb(e) { + return function(t) { + return step([ e, t ]); + }; + } + function step(u) { + if (n) throw new TypeError("Generator is already executing."); + while (r) try { + if (n = 1, i && (o = u[0] & 2 ? i["return"] : u[0] ? i["throw"] || ((o = i["return"]) && o.call(i), + 0) : i.next) && !(o = o.call(i, u[1])).done) return o; + if (i = 0, o) u = [ u[0] & 2, o.value ]; + switch (u[0]) { + case 0: + case 1: + o = u; + break; + + case 4: + r.label++; + return { + value: u[1], + done: false + }; + + case 5: + r.label++; + i = u[1]; + u = [ 0 ]; + continue; + + case 7: + u = r.ops.pop(); + r.trys.pop(); + continue; + + default: + if (!(o = r.trys, o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) { + r = 0; + continue; + } + if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) { + r.label = u[1]; + break; + } + if (u[0] === 6 && r.label < o[1]) { + r.label = o[1]; + o = u; + break; + } + if (o && r.label < o[2]) { + r.label = o[2]; + r.ops.push(u); + break; + } + if (o[2]) r.ops.pop(); + r.trys.pop(); + continue; + } + u = t.call(e, r); + } catch (e) { + u = [ 6, e ]; + i = 0; + } finally { + n = o = 0; + } + if (u[0] & 5) throw u[1]; + return { + value: u[0] ? u[1] : void 0, + done: true + }; + } +}; + +var __values = this && this.V || function(e) { + var t = typeof Symbol === "function" && Symbol.iterator, r = t && e[t], n = 0; + if (r) return r.call(e); + if (e && typeof e.length === "number") return { + next: function() { + if (e && n >= e.length) e = void 0; + return { + value: e && e[n++], + done: !e + }; + } + }; + throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; + +import TreeContainer from "./Base"; + +import TreeIterator from "./Base/TreeIterator"; + +import { throwIteratorAccessError } from "../../utils/throwError"; + +var OrderedSetIterator = function(e) { + __extends(OrderedSetIterator, e); + function OrderedSetIterator(t, r, n, i) { + var o = e.call(this, t, r, i) || this; + o.container = n; + return o; + } + Object.defineProperty(OrderedSetIterator.prototype, "pointer", { + get: function() { + if (this.o === this.h) { + throwIteratorAccessError(); + } + return this.o.u; + }, + enumerable: false, + configurable: true + }); + OrderedSetIterator.prototype.copy = function() { + return new OrderedSetIterator(this.o, this.h, this.container, this.iteratorType); + }; + return OrderedSetIterator; +}(TreeIterator); + +var OrderedSet = function(e) { + __extends(OrderedSet, e); + function OrderedSet(t, r, n) { + if (t === void 0) { + t = []; + } + var i = e.call(this, r, n) || this; + var o = i; + t.forEach((function(e) { + o.insert(e); + })); + return i; + } + OrderedSet.prototype.P = function(e) { + return __generator(this, (function(t) { + switch (t.label) { + case 0: + if (e === undefined) return [ 2 ]; + return [ 5, __values(this.P(e.K)) ]; + + case 1: + t.sent(); + return [ 4, e.u ]; + + case 2: + t.sent(); + return [ 5, __values(this.P(e.N)) ]; + + case 3: + t.sent(); + return [ 2 ]; + } + })); + }; + OrderedSet.prototype.begin = function() { + return new OrderedSetIterator(this.h.K || this.h, this.h, this); + }; + OrderedSet.prototype.end = function() { + return new OrderedSetIterator(this.h, this.h, this); + }; + OrderedSet.prototype.rBegin = function() { + return new OrderedSetIterator(this.h.N || this.h, this.h, this, 1); + }; + OrderedSet.prototype.rEnd = function() { + return new OrderedSetIterator(this.h, this.h, this, 1); + }; + OrderedSet.prototype.front = function() { + return this.h.K ? this.h.K.u : undefined; + }; + OrderedSet.prototype.back = function() { + return this.h.N ? this.h.N.u : undefined; + }; + OrderedSet.prototype.insert = function(e, t) { + return this.v(e, undefined, t); + }; + OrderedSet.prototype.find = function(e) { + var t = this.g(this.W, e); + return new OrderedSetIterator(t, this.h, this); + }; + OrderedSet.prototype.lowerBound = function(e) { + var t = this.U(this.W, e); + return new OrderedSetIterator(t, this.h, this); + }; + OrderedSet.prototype.upperBound = function(e) { + var t = this.X(this.W, e); + return new OrderedSetIterator(t, this.h, this); + }; + OrderedSet.prototype.reverseLowerBound = function(e) { + var t = this.Y(this.W, e); + return new OrderedSetIterator(t, this.h, this); + }; + OrderedSet.prototype.reverseUpperBound = function(e) { + var t = this.Z(this.W, e); + return new OrderedSetIterator(t, this.h, this); + }; + OrderedSet.prototype.union = function(e) { + var t = this; + e.forEach((function(e) { + t.insert(e); + })); + return this.M; + }; + OrderedSet.prototype[Symbol.iterator] = function() { + return this.P(this.W); + }; + return OrderedSet; +}(TreeContainer); + +export default OrderedSet; +//# sourceMappingURL=OrderedSet.js.map diff --git a/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js.map b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js.map new file mode 100644 index 000000000..c716c510c --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["container/TreeContainer/OrderedSet.js","../../src/container/TreeContainer/OrderedSet.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__generator","thisArg","body","_","label","sent","t","trys","ops","f","y","g","next","verb","throw","return","Symbol","iterator","n","v","step","op","done","value","pop","length","push","e","__values","o","s","m","i","TreeContainer","TreeIterator","throwIteratorAccessError","OrderedSetIterator","_super","node","header","container","iteratorType","_this","defineProperty","get","_node","_header","_key","enumerable","configurable","copy","OrderedSet","cmp","enableIndex","self","forEach","el","insert","_iterationFunc","curNode","_a","undefined","_left","_right","begin","end","rBegin","rEnd","front","back","key","hint","_set","find","element","resNode","_findElementNode","_root","lowerBound","_lowerBound","upperBound","_upperBound","reverseLowerBound","_reverseLowerBound","reverseUpperBound","_reverseUpperBound","union","other","_length"],"mappings":"AAAA,IAAIA,YAAaC,QAAQA,KAAKD,KAAe;IACzC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AAe3E,KAAK8F;AD2ChC;ICnCJ,OAAA1B;AAAA,CA9GA,CAA4BlB;;eAgHbkB","file":"OrderedSet.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nimport TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { throwIteratorAccessError } from \"../../utils/throwError\";\nvar OrderedSetIterator = /** @class */ (function (_super) {\n __extends(OrderedSetIterator, _super);\n function OrderedSetIterator(node, header, container, iteratorType) {\n var _this = _super.call(this, node, header, iteratorType) || this;\n _this.container = container;\n return _this;\n }\n Object.defineProperty(OrderedSetIterator.prototype, \"pointer\", {\n get: function () {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key;\n },\n enumerable: false,\n configurable: true\n });\n OrderedSetIterator.prototype.copy = function () {\n return new OrderedSetIterator(this._node, this._header, this.container, this.iteratorType);\n };\n return OrderedSetIterator;\n}(TreeIterator));\nvar OrderedSet = /** @class */ (function (_super) {\n __extends(OrderedSet, _super);\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedSet();\n * new OrderedSet([0, 1, 2]);\n * new OrderedSet([0, 1, 2], (x, y) => x - y);\n * new OrderedSet([0, 1, 2], (x, y) => x - y, true);\n */\n function OrderedSet(container, cmp, enableIndex) {\n if (container === void 0) { container = []; }\n var _this = _super.call(this, cmp, enableIndex) || this;\n var self = _this;\n container.forEach(function (el) {\n self.insert(el);\n });\n return _this;\n }\n /**\n * @internal\n */\n OrderedSet.prototype._iterationFunc = function (curNode) {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (curNode === undefined)\n return [2 /*return*/];\n return [5 /*yield**/, __values(this._iterationFunc(curNode._left))];\n case 1:\n _a.sent();\n return [4 /*yield*/, curNode._key];\n case 2:\n _a.sent();\n return [5 /*yield**/, __values(this._iterationFunc(curNode._right))];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n };\n OrderedSet.prototype.begin = function () {\n return new OrderedSetIterator(this._header._left || this._header, this._header, this);\n };\n OrderedSet.prototype.end = function () {\n return new OrderedSetIterator(this._header, this._header, this);\n };\n OrderedSet.prototype.rBegin = function () {\n return new OrderedSetIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n OrderedSet.prototype.rEnd = function () {\n return new OrderedSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */);\n };\n OrderedSet.prototype.front = function () {\n return this._header._left ? this._header._left._key : undefined;\n };\n OrderedSet.prototype.back = function () {\n return this._header._right ? this._header._right._key : undefined;\n };\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const st = new OrderedSet([2, 4, 5]);\n * const iter = st.begin();\n * st.insert(1);\n * st.insert(3, iter); // give a hint will be faster.\n */\n OrderedSet.prototype.insert = function (key, hint) {\n return this._set(key, undefined, hint);\n };\n OrderedSet.prototype.find = function (element) {\n var resNode = this._findElementNode(this._root, element);\n return new OrderedSetIterator(resNode, this._header, this);\n };\n OrderedSet.prototype.lowerBound = function (key) {\n var resNode = this._lowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n };\n OrderedSet.prototype.upperBound = function (key) {\n var resNode = this._upperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n };\n OrderedSet.prototype.reverseLowerBound = function (key) {\n var resNode = this._reverseLowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n };\n OrderedSet.prototype.reverseUpperBound = function (key) {\n var resNode = this._reverseUpperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n };\n OrderedSet.prototype.union = function (other) {\n var self = this;\n other.forEach(function (el) {\n self.insert(el);\n });\n return this._length;\n };\n OrderedSet.prototype[Symbol.iterator] = function () {\n return this._iterationFunc(this._root);\n };\n return OrderedSet;\n}(TreeContainer));\nexport default OrderedSet;\n","import TreeContainer from './Base';\nimport TreeIterator from './Base/TreeIterator';\nimport { TreeNode } from './Base/TreeNode';\nimport { initContainer, IteratorType } from '@/container/ContainerBase';\nimport { throwIteratorAccessError } from '@/utils/throwError';\n\nclass OrderedSetIterator extends TreeIterator {\n container: OrderedSet;\n constructor(\n node: TreeNode,\n header: TreeNode,\n container: OrderedSet,\n iteratorType?: IteratorType\n ) {\n super(node, header, iteratorType);\n this.container = container;\n }\n get pointer() {\n if (this._node === this._header) {\n throwIteratorAccessError();\n }\n return this._node._key!;\n }\n copy() {\n return new OrderedSetIterator(\n this._node,\n this._header,\n this.container,\n this.iteratorType\n );\n }\n // @ts-ignore\n equals(iter: OrderedSetIterator): boolean;\n}\n\nexport type { OrderedSetIterator };\n\nclass OrderedSet extends TreeContainer {\n /**\n * @param container - The initialization container.\n * @param cmp - The compare function.\n * @param enableIndex - Whether to enable iterator indexing function.\n * @example\n * new OrderedSet();\n * new OrderedSet([0, 1, 2]);\n * new OrderedSet([0, 1, 2], (x, y) => x - y);\n * new OrderedSet([0, 1, 2], (x, y) => x - y, true);\n */\n constructor(\n container: initContainer = [],\n cmp?: (x: K, y: K) => number,\n enableIndex?: boolean\n ) {\n super(cmp, enableIndex);\n const self = this;\n container.forEach(function (el) {\n self.insert(el);\n });\n }\n /**\n * @internal\n */\n private * _iterationFunc(\n curNode: TreeNode | undefined\n ): Generator {\n if (curNode === undefined) return;\n yield * this._iterationFunc(curNode._left);\n yield curNode._key!;\n yield * this._iterationFunc(curNode._right);\n }\n begin() {\n return new OrderedSetIterator(\n this._header._left || this._header,\n this._header,\n this\n );\n }\n end() {\n return new OrderedSetIterator(this._header, this._header, this);\n }\n rBegin() {\n return new OrderedSetIterator(\n this._header._right || this._header,\n this._header,\n this,\n IteratorType.REVERSE\n );\n }\n rEnd() {\n return new OrderedSetIterator(this._header, this._header, this, IteratorType.REVERSE);\n }\n front() {\n return this._header._left ? this._header._left._key : undefined;\n }\n back() {\n return this._header._right ? this._header._right._key : undefined;\n }\n /**\n * @description Insert element to set.\n * @param key - The key want to insert.\n * @param hint - You can give an iterator hint to improve insertion efficiency.\n * @return The size of container after setting.\n * @example\n * const st = new OrderedSet([2, 4, 5]);\n * const iter = st.begin();\n * st.insert(1);\n * st.insert(3, iter); // give a hint will be faster.\n */\n insert(key: K, hint?: OrderedSetIterator) {\n return this._set(key, undefined, hint);\n }\n find(element: K) {\n const resNode = this._findElementNode(this._root, element);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n lowerBound(key: K) {\n const resNode = this._lowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n upperBound(key: K) {\n const resNode = this._upperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n reverseLowerBound(key: K) {\n const resNode = this._reverseLowerBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n reverseUpperBound(key: K) {\n const resNode = this._reverseUpperBound(this._root, key);\n return new OrderedSetIterator(resNode, this._header, this);\n }\n union(other: OrderedSet) {\n const self = this;\n other.forEach(function (el) {\n self.insert(el);\n });\n return this._length;\n }\n [Symbol.iterator]() {\n return this._iterationFunc(this._root);\n }\n // @ts-ignore\n eraseElementByIterator(iter: OrderedSetIterator): OrderedSetIterator;\n // @ts-ignore\n forEach(callback: (element: K, index: number, tree: OrderedSet) => void): void;\n // @ts-ignore\n getElementByPos(pos: number): K;\n}\n\nexport default OrderedSet;\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/index.d.ts b/node_modules/js-sdsl/dist/esm/index.d.ts new file mode 100644 index 000000000..a379bce8f --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/index.d.ts @@ -0,0 +1,21 @@ +export { default as Stack } from "./container/OtherContainer/Stack"; +export { default as Queue } from "./container/OtherContainer/Queue"; +export { default as PriorityQueue } from "./container/OtherContainer/PriorityQueue"; +export { default as Vector } from "./container/SequentialContainer/Vector"; +export { default as LinkList } from "./container/SequentialContainer/LinkList"; +export { default as Deque } from "./container/SequentialContainer/Deque"; +export { default as OrderedSet } from "./container/TreeContainer/OrderedSet"; +export { default as OrderedMap } from "./container/TreeContainer/OrderedMap"; +export { default as HashSet } from "./container/HashContainer/HashSet"; +export { default as HashMap } from "./container/HashContainer/HashMap"; +export type { VectorIterator } from "./container/SequentialContainer/Vector"; +export type { LinkListIterator } from "./container/SequentialContainer/LinkList"; +export type { DequeIterator } from "./container/SequentialContainer/Deque"; +export type { OrderedSetIterator } from "./container/TreeContainer/OrderedSet"; +export type { OrderedMapIterator } from "./container/TreeContainer/OrderedMap"; +export type { HashSetIterator } from "./container/HashContainer/HashSet"; +export type { HashMapIterator } from "./container/HashContainer/HashMap"; +export type { IteratorType, Container, ContainerIterator } from "./container/ContainerBase"; +export type { default as SequentialContainer } from "./container/SequentialContainer/Base"; +export type { default as TreeContainer } from "./container/TreeContainer/Base"; +export type { HashContainer } from "./container/HashContainer/Base"; diff --git a/node_modules/js-sdsl/dist/esm/index.js b/node_modules/js-sdsl/dist/esm/index.js new file mode 100644 index 000000000..5ee919b02 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/index.js @@ -0,0 +1,20 @@ +export { default as Stack } from "./container/OtherContainer/Stack"; + +export { default as Queue } from "./container/OtherContainer/Queue"; + +export { default as PriorityQueue } from "./container/OtherContainer/PriorityQueue"; + +export { default as Vector } from "./container/SequentialContainer/Vector"; + +export { default as LinkList } from "./container/SequentialContainer/LinkList"; + +export { default as Deque } from "./container/SequentialContainer/Deque"; + +export { default as OrderedSet } from "./container/TreeContainer/OrderedSet"; + +export { default as OrderedMap } from "./container/TreeContainer/OrderedMap"; + +export { default as HashSet } from "./container/HashContainer/HashSet"; + +export { default as HashMap } from "./container/HashContainer/HashMap"; +//# sourceMappingURL=index.js.map diff --git a/node_modules/js-sdsl/dist/esm/index.js.map b/node_modules/js-sdsl/dist/esm/index.js.map new file mode 100644 index 000000000..ab59f83f1 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"names":["default"],"mappings":"SAASA,wBAAkB;;SAClBA,wBAAkB;;SAClBA,gCAA0B;;SAC1BA,yBAAmB;;SACnBA,2BAAqB;;SACrBA,wBAAkB;;SAClBA,6BAAuB;;SACvBA,6BAAuB;;SACvBA,0BAAoB;;SACpBA,0BAAoB","file":"index.js","sourcesContent":["export { default as Stack } from '@/container/OtherContainer/Stack';\nexport { default as Queue } from '@/container/OtherContainer/Queue';\nexport { default as PriorityQueue } from '@/container/OtherContainer/PriorityQueue';\nexport { default as Vector } from '@/container/SequentialContainer/Vector';\nexport { default as LinkList } from '@/container/SequentialContainer/LinkList';\nexport { default as Deque } from '@/container/SequentialContainer/Deque';\nexport { default as OrderedSet } from '@/container/TreeContainer/OrderedSet';\nexport { default as OrderedMap } from '@/container/TreeContainer/OrderedMap';\nexport { default as HashSet } from '@/container/HashContainer/HashSet';\nexport { default as HashMap } from '@/container/HashContainer/HashMap';\nexport type { VectorIterator } from '@/container/SequentialContainer/Vector';\nexport type { LinkListIterator } from '@/container/SequentialContainer/LinkList';\nexport type { DequeIterator } from '@/container/SequentialContainer/Deque';\nexport type { OrderedSetIterator } from '@/container/TreeContainer/OrderedSet';\nexport type { OrderedMapIterator } from '@/container/TreeContainer/OrderedMap';\nexport type { HashSetIterator } from '@/container/HashContainer/HashSet';\nexport type { HashMapIterator } from '@/container/HashContainer/HashMap';\nexport type { IteratorType, Container, ContainerIterator } from '@/container/ContainerBase';\nexport type { default as SequentialContainer } from '@/container/SequentialContainer/Base';\nexport type { default as TreeContainer } from '@/container/TreeContainer/Base';\nexport type { HashContainer } from '@/container/HashContainer/Base';\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/utils/checkObject.d.ts b/node_modules/js-sdsl/dist/esm/utils/checkObject.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/utils/checkObject.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/js-sdsl/dist/esm/utils/checkObject.js b/node_modules/js-sdsl/dist/esm/utils/checkObject.js new file mode 100644 index 000000000..5bc53d460 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/utils/checkObject.js @@ -0,0 +1,5 @@ +export default function checkObject(t) { + var e = typeof t; + return e === "object" && t !== null || e === "function"; +} +//# sourceMappingURL=checkObject.js.map diff --git a/node_modules/js-sdsl/dist/esm/utils/checkObject.js.map b/node_modules/js-sdsl/dist/esm/utils/checkObject.js.map new file mode 100644 index 000000000..5cdc58981 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/utils/checkObject.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/utils/checkObject.ts","utils/checkObject.js"],"names":["checkObject","key","t"],"mappings":"eAMc,SAAUA,YAAeC;IACrC,IAAMC,WAAWD;IACjB,OAAQC,MAAM,YAAYD,MAAQ,QAASC,MAAM;ACCnD","file":"checkObject.js","sourcesContent":["/**\n * @description Determine whether the type of key is `object`.\n * @param key - The key want to check.\n * @returns Whether the type of key is `object`.\n * @internal\n */\nexport default function checkObject(key: T) {\n const t = typeof key;\n return (t === 'object' && key !== null) || t === 'function';\n}\n","/**\n * @description Determine whether the type of key is `object`.\n * @param key - The key want to check.\n * @returns Whether the type of key is `object`.\n * @internal\n */\nexport default function checkObject(key) {\n var t = typeof key;\n return (t === 'object' && key !== null) || t === 'function';\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/esm/utils/throwError.d.ts b/node_modules/js-sdsl/dist/esm/utils/throwError.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/utils/throwError.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/js-sdsl/dist/esm/utils/throwError.js b/node_modules/js-sdsl/dist/esm/utils/throwError.js new file mode 100644 index 000000000..260259079 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/utils/throwError.js @@ -0,0 +1,4 @@ +export function throwIteratorAccessError() { + throw new RangeError("Iterator access denied!"); +} +//# sourceMappingURL=throwError.js.map diff --git a/node_modules/js-sdsl/dist/esm/utils/throwError.js.map b/node_modules/js-sdsl/dist/esm/utils/throwError.js.map new file mode 100644 index 000000000..239f7cd16 --- /dev/null +++ b/node_modules/js-sdsl/dist/esm/utils/throwError.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/utils/throwError.ts","utils/throwError.js"],"names":["throwIteratorAccessError","RangeError"],"mappings":"OAIM,SAAUA;IACd,MAAM,IAAIC,WAAW;ACCvB","file":"throwError.js","sourcesContent":["/**\n * @description Throw an iterator access error.\n * @internal\n */\nexport function throwIteratorAccessError() {\n throw new RangeError('Iterator access denied!');\n}\n","/**\n * @description Throw an iterator access error.\n * @internal\n */\nexport function throwIteratorAccessError() {\n throw new RangeError('Iterator access denied!');\n}\n"]} \ No newline at end of file diff --git a/node_modules/js-sdsl/dist/umd/js-sdsl.js b/node_modules/js-sdsl/dist/umd/js-sdsl.js new file mode 100644 index 000000000..bdeca2417 --- /dev/null +++ b/node_modules/js-sdsl/dist/umd/js-sdsl.js @@ -0,0 +1,3154 @@ +/*! + * js-sdsl v4.3.0 + * https://github.com/js-sdsl/js-sdsl + * (c) 2021-present ZLY201 + * MIT license + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sdsl = {})); +})(this, (function (exports) { 'use strict'; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; + }; + return extendStatics(d, b); + }; + function __extends(d, b) { + if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + function __generator(thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }, + f, + y, + t, + g; + return g = { + next: verb(0), + "throw": verb(1), + "return": verb(2) + }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { + return this; + }), g; + function verb(n) { + return function (v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], + done: false + }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } + } + function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, + m = s && o[s], + i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { + value: o && o[i++], + done: !o + }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), + r, + ar = [], + e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } catch (error) { + e = { + error: error + }; + } finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; + } + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + var ContainerIterator = /** @class */function () { + /** + * @internal + */ + function ContainerIterator(iteratorType) { + if (iteratorType === void 0) { + iteratorType = 0 /* IteratorType.NORMAL */; + } + this.iteratorType = iteratorType; + } + /** + * @param iter - The other iterator you want to compare. + * @returns Whether this equals to obj. + * @example + * container.find(1).equals(container.end()); + */ + ContainerIterator.prototype.equals = function (iter) { + return this._node === iter._node; + }; + return ContainerIterator; + }(); + var Base = /** @class */function () { + function Base() { + /** + * @description Container's size. + * @internal + */ + this._length = 0; + } + Object.defineProperty(Base.prototype, "length", { + /** + * @returns The size of the container. + * @example + * const container = new Vector([1, 2]); + * console.log(container.length); // 2 + */ + get: function () { + return this._length; + }, + enumerable: false, + configurable: true + }); + /** + * @returns The size of the container. + * @example + * const container = new Vector([1, 2]); + * console.log(container.size()); // 2 + */ + Base.prototype.size = function () { + return this._length; + }; + /** + * @returns Whether the container is empty. + * @example + * container.clear(); + * console.log(container.empty()); // true + */ + Base.prototype.empty = function () { + return this._length === 0; + }; + return Base; + }(); + var Container = /** @class */function (_super) { + __extends(Container, _super); + function Container() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Container; + }(Base); + + var Stack = /** @class */function (_super) { + __extends(Stack, _super); + function Stack(container) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this) || this; + /** + * @internal + */ + _this._stack = []; + var self = _this; + container.forEach(function (el) { + self.push(el); + }); + return _this; + } + Stack.prototype.clear = function () { + this._length = 0; + this._stack = []; + }; + /** + * @description Insert element to stack's end. + * @description The element you want to push to the back. + * @returns The container length after erasing. + */ + Stack.prototype.push = function (element) { + this._stack.push(element); + this._length += 1; + return this._length; + }; + /** + * @description Removes the end element. + * @returns The element you popped. + */ + Stack.prototype.pop = function () { + if (this._length === 0) return; + this._length -= 1; + return this._stack.pop(); + }; + /** + * @description Accesses the end element. + * @returns The last element. + */ + Stack.prototype.top = function () { + return this._stack[this._length - 1]; + }; + return Stack; + }(Base); + + var Queue = /** @class */function (_super) { + __extends(Queue, _super); + function Queue(container) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this) || this; + /** + * @internal + */ + _this._first = 0; + /** + * @internal + */ + _this._queue = []; + var self = _this; + container.forEach(function (el) { + self.push(el); + }); + return _this; + } + Queue.prototype.clear = function () { + this._queue = []; + this._length = this._first = 0; + }; + /** + * @description Inserts element to queue's end. + * @param element - The element you want to push to the front. + * @returns The container length after pushing. + */ + Queue.prototype.push = function (element) { + var capacity = this._queue.length; + if (this._first / capacity > 0.5 /* QUEUE_CONSTANT.ALLOCATE_SIGMA */ && this._first + this._length >= capacity && capacity > 4096 /* QUEUE_CONSTANT.MIN_ALLOCATE_SIZE */) { + var length_1 = this._length; + for (var i = 0; i < length_1; ++i) { + this._queue[i] = this._queue[this._first + i]; + } + this._first = 0; + this._queue[this._length] = element; + } else this._queue[this._first + this._length] = element; + return ++this._length; + }; + /** + * @description Removes the first element. + * @returns The element you popped. + */ + Queue.prototype.pop = function () { + if (this._length === 0) return; + var el = this._queue[this._first++]; + this._length -= 1; + return el; + }; + /** + * @description Access the first element. + * @returns The first element. + */ + Queue.prototype.front = function () { + if (this._length === 0) return; + return this._queue[this._first]; + }; + return Queue; + }(Base); + + var PriorityQueue = /** @class */function (_super) { + __extends(PriorityQueue, _super); + /** + * @description PriorityQueue's constructor. + * @param container - Initialize container, must have a forEach function. + * @param cmp - Compare function. + * @param copy - When the container is an array, you can choose to directly operate on the original object of + * the array or perform a shallow copy. The default is shallow copy. + * @example + * new PriorityQueue(); + * new PriorityQueue([1, 2, 3]); + * new PriorityQueue([1, 2, 3], (x, y) => x - y); + * new PriorityQueue([1, 2, 3], (x, y) => x - y, false); + */ + function PriorityQueue(container, cmp, copy) { + if (container === void 0) { + container = []; + } + if (cmp === void 0) { + cmp = function (x, y) { + if (x > y) return -1; + if (x < y) return 1; + return 0; + }; + } + if (copy === void 0) { + copy = true; + } + var _this = _super.call(this) || this; + _this._cmp = cmp; + if (Array.isArray(container)) { + _this._priorityQueue = copy ? __spreadArray([], __read(container), false) : container; + } else { + _this._priorityQueue = []; + var self_1 = _this; + container.forEach(function (el) { + self_1._priorityQueue.push(el); + }); + } + _this._length = _this._priorityQueue.length; + var halfLength = _this._length >> 1; + for (var parent_1 = _this._length - 1 >> 1; parent_1 >= 0; --parent_1) { + _this._pushDown(parent_1, halfLength); + } + return _this; + } + /** + * @internal + */ + PriorityQueue.prototype._pushUp = function (pos) { + var item = this._priorityQueue[pos]; + while (pos > 0) { + var parent_2 = pos - 1 >> 1; + var parentItem = this._priorityQueue[parent_2]; + if (this._cmp(parentItem, item) <= 0) break; + this._priorityQueue[pos] = parentItem; + pos = parent_2; + } + this._priorityQueue[pos] = item; + }; + /** + * @internal + */ + PriorityQueue.prototype._pushDown = function (pos, halfLength) { + var item = this._priorityQueue[pos]; + while (pos < halfLength) { + var left = pos << 1 | 1; + var right = left + 1; + var minItem = this._priorityQueue[left]; + if (right < this._length && this._cmp(minItem, this._priorityQueue[right]) > 0) { + left = right; + minItem = this._priorityQueue[right]; + } + if (this._cmp(minItem, item) >= 0) break; + this._priorityQueue[pos] = minItem; + pos = left; + } + this._priorityQueue[pos] = item; + }; + PriorityQueue.prototype.clear = function () { + this._length = 0; + this._priorityQueue.length = 0; + }; + /** + * @description Push element into a container in order. + * @param item - The element you want to push. + * @returns The size of heap after pushing. + * @example + * queue.push(1); + */ + PriorityQueue.prototype.push = function (item) { + this._priorityQueue.push(item); + this._pushUp(this._length); + this._length += 1; + }; + /** + * @description Removes the top element. + * @returns The element you popped. + * @example + * queue.pop(); + */ + PriorityQueue.prototype.pop = function () { + if (this._length === 0) return; + var value = this._priorityQueue[0]; + var last = this._priorityQueue.pop(); + this._length -= 1; + if (this._length) { + this._priorityQueue[0] = last; + this._pushDown(0, this._length >> 1); + } + return value; + }; + /** + * @description Accesses the top element. + * @example + * const top = queue.top(); + */ + PriorityQueue.prototype.top = function () { + return this._priorityQueue[0]; + }; + /** + * @description Check if element is in heap. + * @param item - The item want to find. + * @returns Whether element is in heap. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * console.log(que.find(obj)); // true + */ + PriorityQueue.prototype.find = function (item) { + return this._priorityQueue.indexOf(item) >= 0; + }; + /** + * @description Remove specified item from heap. + * @param item - The item want to remove. + * @returns Whether remove success. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * que.remove(obj); + */ + PriorityQueue.prototype.remove = function (item) { + var index = this._priorityQueue.indexOf(item); + if (index < 0) return false; + if (index === 0) { + this.pop(); + } else if (index === this._length - 1) { + this._priorityQueue.pop(); + this._length -= 1; + } else { + this._priorityQueue.splice(index, 1, this._priorityQueue.pop()); + this._length -= 1; + this._pushUp(index); + this._pushDown(index, this._length >> 1); + } + return true; + }; + /** + * @description Update item and it's pos in the heap. + * @param item - The item want to update. + * @returns Whether update success. + * @example + * const que = new PriorityQueue([], (x, y) => x.id - y.id); + * const obj = { id: 1 }; + * que.push(obj); + * obj.id = 2; + * que.updateItem(obj); + */ + PriorityQueue.prototype.updateItem = function (item) { + var index = this._priorityQueue.indexOf(item); + if (index < 0) return false; + this._pushUp(index); + this._pushDown(index, this._length >> 1); + return true; + }; + /** + * @returns Return a copy array of heap. + * @example + * const arr = queue.toArray(); + */ + PriorityQueue.prototype.toArray = function () { + return __spreadArray([], __read(this._priorityQueue), false); + }; + return PriorityQueue; + }(Base); + + var SequentialContainer = /** @class */function (_super) { + __extends(SequentialContainer, _super); + function SequentialContainer() { + return _super !== null && _super.apply(this, arguments) || this; + } + return SequentialContainer; + }(Container); + + /** + * @description Throw an iterator access error. + * @internal + */ + function throwIteratorAccessError() { + throw new RangeError('Iterator access denied!'); + } + + var RandomIterator = /** @class */function (_super) { + __extends(RandomIterator, _super); + /** + * @internal + */ + function RandomIterator(index, iteratorType) { + var _this = _super.call(this, iteratorType) || this; + _this._node = index; + if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { + _this.pre = function () { + if (this._node === 0) { + throwIteratorAccessError(); + } + this._node -= 1; + return this; + }; + _this.next = function () { + if (this._node === this.container.size()) { + throwIteratorAccessError(); + } + this._node += 1; + return this; + }; + } else { + _this.pre = function () { + if (this._node === this.container.size() - 1) { + throwIteratorAccessError(); + } + this._node += 1; + return this; + }; + _this.next = function () { + if (this._node === -1) { + throwIteratorAccessError(); + } + this._node -= 1; + return this; + }; + } + return _this; + } + Object.defineProperty(RandomIterator.prototype, "pointer", { + get: function () { + return this.container.getElementByPos(this._node); + }, + set: function (newValue) { + this.container.setElementByPos(this._node, newValue); + }, + enumerable: false, + configurable: true + }); + return RandomIterator; + }(ContainerIterator); + + var VectorIterator = /** @class */function (_super) { + __extends(VectorIterator, _super); + function VectorIterator(node, container, iteratorType) { + var _this = _super.call(this, node, iteratorType) || this; + _this.container = container; + return _this; + } + VectorIterator.prototype.copy = function () { + return new VectorIterator(this._node, this.container, this.iteratorType); + }; + return VectorIterator; + }(RandomIterator); + var Vector = /** @class */function (_super) { + __extends(Vector, _super); + /** + * @param container - Initialize container, must have a forEach function. + * @param copy - When the container is an array, you can choose to directly operate on the original object of + * the array or perform a shallow copy. The default is shallow copy. + */ + function Vector(container, copy) { + if (container === void 0) { + container = []; + } + if (copy === void 0) { + copy = true; + } + var _this = _super.call(this) || this; + if (Array.isArray(container)) { + _this._vector = copy ? __spreadArray([], __read(container), false) : container; + _this._length = container.length; + } else { + _this._vector = []; + var self_1 = _this; + container.forEach(function (el) { + self_1.pushBack(el); + }); + } + return _this; + } + Vector.prototype.clear = function () { + this._length = 0; + this._vector.length = 0; + }; + Vector.prototype.begin = function () { + return new VectorIterator(0, this); + }; + Vector.prototype.end = function () { + return new VectorIterator(this._length, this); + }; + Vector.prototype.rBegin = function () { + return new VectorIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */); + }; + + Vector.prototype.rEnd = function () { + return new VectorIterator(-1, this, 1 /* IteratorType.REVERSE */); + }; + + Vector.prototype.front = function () { + return this._vector[0]; + }; + Vector.prototype.back = function () { + return this._vector[this._length - 1]; + }; + Vector.prototype.getElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + return this._vector[pos]; + }; + Vector.prototype.eraseElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + this._vector.splice(pos, 1); + this._length -= 1; + return this._length; + }; + Vector.prototype.eraseElementByValue = function (value) { + var index = 0; + for (var i = 0; i < this._length; ++i) { + if (this._vector[i] !== value) { + this._vector[index++] = this._vector[i]; + } + } + this._length = this._vector.length = index; + return this._length; + }; + Vector.prototype.eraseElementByIterator = function (iter) { + var _node = iter._node; + iter = iter.next(); + this.eraseElementByPos(_node); + return iter; + }; + Vector.prototype.pushBack = function (element) { + this._vector.push(element); + this._length += 1; + return this._length; + }; + Vector.prototype.popBack = function () { + if (this._length === 0) return; + this._length -= 1; + return this._vector.pop(); + }; + Vector.prototype.setElementByPos = function (pos, element) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + this._vector[pos] = element; + }; + Vector.prototype.insert = function (pos, element, num) { + var _a; + if (num === void 0) { + num = 1; + } + if (pos < 0 || pos > this._length) { + throw new RangeError(); + } + (_a = this._vector).splice.apply(_a, __spreadArray([pos, 0], __read(new Array(num).fill(element)), false)); + this._length += num; + return this._length; + }; + Vector.prototype.find = function (element) { + for (var i = 0; i < this._length; ++i) { + if (this._vector[i] === element) { + return new VectorIterator(i, this); + } + } + return this.end(); + }; + Vector.prototype.reverse = function () { + this._vector.reverse(); + }; + Vector.prototype.unique = function () { + var index = 1; + for (var i = 1; i < this._length; ++i) { + if (this._vector[i] !== this._vector[i - 1]) { + this._vector[index++] = this._vector[i]; + } + } + this._length = this._vector.length = index; + return this._length; + }; + Vector.prototype.sort = function (cmp) { + this._vector.sort(cmp); + }; + Vector.prototype.forEach = function (callback) { + for (var i = 0; i < this._length; ++i) { + callback(this._vector[i], i, this); + } + }; + Vector.prototype[Symbol.iterator] = function () { + return function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + return [5 /*yield**/, __values(this._vector)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }.bind(this)(); + }; + return Vector; + }(SequentialContainer); + + var LinkListIterator = /** @class */function (_super) { + __extends(LinkListIterator, _super); + /** + * @internal + */ + function LinkListIterator(_node, _header, container, iteratorType) { + var _this = _super.call(this, iteratorType) || this; + _this._node = _node; + _this._header = _header; + _this.container = container; + if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { + _this.pre = function () { + if (this._node._pre === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._pre; + return this; + }; + _this.next = function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._next; + return this; + }; + } else { + _this.pre = function () { + if (this._node._next === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._next; + return this; + }; + _this.next = function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._pre; + return this; + }; + } + return _this; + } + Object.defineProperty(LinkListIterator.prototype, "pointer", { + get: function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + return this._node._value; + }, + set: function (newValue) { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node._value = newValue; + }, + enumerable: false, + configurable: true + }); + LinkListIterator.prototype.copy = function () { + return new LinkListIterator(this._node, this._header, this.container, this.iteratorType); + }; + return LinkListIterator; + }(ContainerIterator); + var LinkList = /** @class */function (_super) { + __extends(LinkList, _super); + function LinkList(container) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this) || this; + _this._header = {}; + _this._head = _this._tail = _this._header._pre = _this._header._next = _this._header; + var self = _this; + container.forEach(function (el) { + self.pushBack(el); + }); + return _this; + } + /** + * @internal + */ + LinkList.prototype._eraseNode = function (node) { + var _pre = node._pre, + _next = node._next; + _pre._next = _next; + _next._pre = _pre; + if (node === this._head) { + this._head = _next; + } + if (node === this._tail) { + this._tail = _pre; + } + this._length -= 1; + }; + /** + * @internal + */ + LinkList.prototype._insertNode = function (value, pre) { + var next = pre._next; + var node = { + _value: value, + _pre: pre, + _next: next + }; + pre._next = node; + next._pre = node; + if (pre === this._header) { + this._head = node; + } + if (next === this._header) { + this._tail = node; + } + this._length += 1; + }; + LinkList.prototype.clear = function () { + this._length = 0; + this._head = this._tail = this._header._pre = this._header._next = this._header; + }; + LinkList.prototype.begin = function () { + return new LinkListIterator(this._head, this._header, this); + }; + LinkList.prototype.end = function () { + return new LinkListIterator(this._header, this._header, this); + }; + LinkList.prototype.rBegin = function () { + return new LinkListIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + LinkList.prototype.rEnd = function () { + return new LinkListIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + LinkList.prototype.front = function () { + return this._head._value; + }; + LinkList.prototype.back = function () { + return this._tail._value; + }; + LinkList.prototype.getElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var curNode = this._head; + while (pos--) { + curNode = curNode._next; + } + return curNode._value; + }; + LinkList.prototype.eraseElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var curNode = this._head; + while (pos--) { + curNode = curNode._next; + } + this._eraseNode(curNode); + return this._length; + }; + LinkList.prototype.eraseElementByValue = function (_value) { + var curNode = this._head; + while (curNode !== this._header) { + if (curNode._value === _value) { + this._eraseNode(curNode); + } + curNode = curNode._next; + } + return this._length; + }; + LinkList.prototype.eraseElementByIterator = function (iter) { + var node = iter._node; + if (node === this._header) { + throwIteratorAccessError(); + } + iter = iter.next(); + this._eraseNode(node); + return iter; + }; + LinkList.prototype.pushBack = function (element) { + this._insertNode(element, this._tail); + return this._length; + }; + LinkList.prototype.popBack = function () { + if (this._length === 0) return; + var value = this._tail._value; + this._eraseNode(this._tail); + return value; + }; + /** + * @description Push an element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + LinkList.prototype.pushFront = function (element) { + this._insertNode(element, this._header); + return this._length; + }; + /** + * @description Removes the first element. + * @returns The element you popped. + */ + LinkList.prototype.popFront = function () { + if (this._length === 0) return; + var value = this._head._value; + this._eraseNode(this._head); + return value; + }; + LinkList.prototype.setElementByPos = function (pos, element) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var curNode = this._head; + while (pos--) { + curNode = curNode._next; + } + curNode._value = element; + }; + LinkList.prototype.insert = function (pos, element, num) { + if (num === void 0) { + num = 1; + } + if (pos < 0 || pos > this._length) { + throw new RangeError(); + } + if (num <= 0) return this._length; + if (pos === 0) { + while (num--) this.pushFront(element); + } else if (pos === this._length) { + while (num--) this.pushBack(element); + } else { + var curNode = this._head; + for (var i = 1; i < pos; ++i) { + curNode = curNode._next; + } + var next = curNode._next; + this._length += num; + while (num--) { + curNode._next = { + _value: element, + _pre: curNode + }; + curNode._next._pre = curNode; + curNode = curNode._next; + } + curNode._next = next; + next._pre = curNode; + } + return this._length; + }; + LinkList.prototype.find = function (element) { + var curNode = this._head; + while (curNode !== this._header) { + if (curNode._value === element) { + return new LinkListIterator(curNode, this._header, this); + } + curNode = curNode._next; + } + return this.end(); + }; + LinkList.prototype.reverse = function () { + if (this._length <= 1) return; + var pHead = this._head; + var pTail = this._tail; + var cnt = 0; + while (cnt << 1 < this._length) { + var tmp = pHead._value; + pHead._value = pTail._value; + pTail._value = tmp; + pHead = pHead._next; + pTail = pTail._pre; + cnt += 1; + } + }; + LinkList.prototype.unique = function () { + if (this._length <= 1) { + return this._length; + } + var curNode = this._head; + while (curNode !== this._header) { + var tmpNode = curNode; + while (tmpNode._next !== this._header && tmpNode._value === tmpNode._next._value) { + tmpNode = tmpNode._next; + this._length -= 1; + } + curNode._next = tmpNode._next; + curNode._next._pre = curNode; + curNode = curNode._next; + } + return this._length; + }; + LinkList.prototype.sort = function (cmp) { + if (this._length <= 1) return; + var arr = []; + this.forEach(function (el) { + arr.push(el); + }); + arr.sort(cmp); + var curNode = this._head; + arr.forEach(function (element) { + curNode._value = element; + curNode = curNode._next; + }); + }; + /** + * @description Merges two sorted lists. + * @param list - The other list you want to merge (must be sorted). + * @returns The size of list after merging. + * @example + * const linkA = new LinkList([1, 3, 5]); + * const linkB = new LinkList([2, 4, 6]); + * linkA.merge(linkB); // [1, 2, 3, 4, 5]; + */ + LinkList.prototype.merge = function (list) { + var self = this; + if (this._length === 0) { + list.forEach(function (el) { + self.pushBack(el); + }); + } else { + var curNode_1 = this._head; + list.forEach(function (el) { + while (curNode_1 !== self._header && curNode_1._value <= el) { + curNode_1 = curNode_1._next; + } + self._insertNode(el, curNode_1._pre); + }); + } + return this._length; + }; + LinkList.prototype.forEach = function (callback) { + var curNode = this._head; + var index = 0; + while (curNode !== this._header) { + callback(curNode._value, index++, this); + curNode = curNode._next; + } + }; + LinkList.prototype[Symbol.iterator] = function () { + return function () { + var curNode; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this._length === 0) return [2 /*return*/]; + curNode = this._head; + _a.label = 1; + case 1: + if (!(curNode !== this._header)) return [3 /*break*/, 3]; + return [4 /*yield*/, curNode._value]; + case 2: + _a.sent(); + curNode = curNode._next; + return [3 /*break*/, 1]; + case 3: + return [2 /*return*/]; + } + }); + }.bind(this)(); + }; + return LinkList; + }(SequentialContainer); + + var DequeIterator = /** @class */function (_super) { + __extends(DequeIterator, _super); + function DequeIterator(node, container, iteratorType) { + var _this = _super.call(this, node, iteratorType) || this; + _this.container = container; + return _this; + } + DequeIterator.prototype.copy = function () { + return new DequeIterator(this._node, this.container, this.iteratorType); + }; + return DequeIterator; + }(RandomIterator); + var Deque = /** @class */function (_super) { + __extends(Deque, _super); + function Deque(container, _bucketSize) { + if (container === void 0) { + container = []; + } + if (_bucketSize === void 0) { + _bucketSize = 1 << 12; + } + var _this = _super.call(this) || this; + /** + * @internal + */ + _this._first = 0; + /** + * @internal + */ + _this._curFirst = 0; + /** + * @internal + */ + _this._last = 0; + /** + * @internal + */ + _this._curLast = 0; + /** + * @internal + */ + _this._bucketNum = 0; + /** + * @internal + */ + _this._map = []; + var _length = function () { + if (typeof container.length === "number") return container.length; + if (typeof container.size === "number") return container.size; + if (typeof container.size === "function") return container.size(); + throw new TypeError("Cannot get the length or size of the container"); + }(); + _this._bucketSize = _bucketSize; + _this._bucketNum = Math.max(Math.ceil(_length / _this._bucketSize), 1); + for (var i = 0; i < _this._bucketNum; ++i) { + _this._map.push(new Array(_this._bucketSize)); + } + var needBucketNum = Math.ceil(_length / _this._bucketSize); + _this._first = _this._last = (_this._bucketNum >> 1) - (needBucketNum >> 1); + _this._curFirst = _this._curLast = _this._bucketSize - _length % _this._bucketSize >> 1; + var self = _this; + container.forEach(function (element) { + self.pushBack(element); + }); + return _this; + } + /** + * @description Growth the Deque. + * @internal + */ + Deque.prototype._reAllocate = function () { + var newMap = []; + var addBucketNum = Math.max(this._bucketNum >> 1, 1); + for (var i = 0; i < addBucketNum; ++i) { + newMap[i] = new Array(this._bucketSize); + } + for (var i = this._first; i < this._bucketNum; ++i) { + newMap[newMap.length] = this._map[i]; + } + for (var i = 0; i < this._last; ++i) { + newMap[newMap.length] = this._map[i]; + } + newMap[newMap.length] = __spreadArray([], __read(this._map[this._last]), false); + this._first = addBucketNum; + this._last = newMap.length - 1; + for (var i = 0; i < addBucketNum; ++i) { + newMap[newMap.length] = new Array(this._bucketSize); + } + this._map = newMap; + this._bucketNum = newMap.length; + }; + /** + * @description Get the bucket position of the element and the pointer position by index. + * @param pos - The element's index. + * @internal + */ + Deque.prototype._getElementIndex = function (pos) { + var offset = this._curFirst + pos + 1; + var offsetRemainder = offset % this._bucketSize; + var curNodePointerIndex = offsetRemainder - 1; + var curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize; + if (offsetRemainder === 0) curNodeBucketIndex -= 1; + curNodeBucketIndex %= this._bucketNum; + if (curNodePointerIndex < 0) curNodePointerIndex += this._bucketSize; + return { + curNodeBucketIndex: curNodeBucketIndex, + curNodePointerIndex: curNodePointerIndex + }; + }; + Deque.prototype.clear = function () { + this._map = [new Array(this._bucketSize)]; + this._bucketNum = 1; + this._first = this._last = this._length = 0; + this._curFirst = this._curLast = this._bucketSize >> 1; + }; + Deque.prototype.begin = function () { + return new DequeIterator(0, this); + }; + Deque.prototype.end = function () { + return new DequeIterator(this._length, this); + }; + Deque.prototype.rBegin = function () { + return new DequeIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */); + }; + + Deque.prototype.rEnd = function () { + return new DequeIterator(-1, this, 1 /* IteratorType.REVERSE */); + }; + + Deque.prototype.front = function () { + if (this._length === 0) return; + return this._map[this._first][this._curFirst]; + }; + Deque.prototype.back = function () { + if (this._length === 0) return; + return this._map[this._last][this._curLast]; + }; + Deque.prototype.pushBack = function (element) { + if (this._length) { + if (this._curLast < this._bucketSize - 1) { + this._curLast += 1; + } else if (this._last < this._bucketNum - 1) { + this._last += 1; + this._curLast = 0; + } else { + this._last = 0; + this._curLast = 0; + } + if (this._last === this._first && this._curLast === this._curFirst) this._reAllocate(); + } + this._length += 1; + this._map[this._last][this._curLast] = element; + return this._length; + }; + Deque.prototype.popBack = function () { + if (this._length === 0) return; + var value = this._map[this._last][this._curLast]; + if (this._length !== 1) { + if (this._curLast > 0) { + this._curLast -= 1; + } else if (this._last > 0) { + this._last -= 1; + this._curLast = this._bucketSize - 1; + } else { + this._last = this._bucketNum - 1; + this._curLast = this._bucketSize - 1; + } + } + this._length -= 1; + return value; + }; + /** + * @description Push the element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + Deque.prototype.pushFront = function (element) { + if (this._length) { + if (this._curFirst > 0) { + this._curFirst -= 1; + } else if (this._first > 0) { + this._first -= 1; + this._curFirst = this._bucketSize - 1; + } else { + this._first = this._bucketNum - 1; + this._curFirst = this._bucketSize - 1; + } + if (this._first === this._last && this._curFirst === this._curLast) this._reAllocate(); + } + this._length += 1; + this._map[this._first][this._curFirst] = element; + return this._length; + }; + /** + * @description Remove the _first element. + * @returns The element you popped. + */ + Deque.prototype.popFront = function () { + if (this._length === 0) return; + var value = this._map[this._first][this._curFirst]; + if (this._length !== 1) { + if (this._curFirst < this._bucketSize - 1) { + this._curFirst += 1; + } else if (this._first < this._bucketNum - 1) { + this._first += 1; + this._curFirst = 0; + } else { + this._first = 0; + this._curFirst = 0; + } + } + this._length -= 1; + return value; + }; + Deque.prototype.getElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var _a = this._getElementIndex(pos), + curNodeBucketIndex = _a.curNodeBucketIndex, + curNodePointerIndex = _a.curNodePointerIndex; + return this._map[curNodeBucketIndex][curNodePointerIndex]; + }; + Deque.prototype.setElementByPos = function (pos, element) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var _a = this._getElementIndex(pos), + curNodeBucketIndex = _a.curNodeBucketIndex, + curNodePointerIndex = _a.curNodePointerIndex; + this._map[curNodeBucketIndex][curNodePointerIndex] = element; + }; + Deque.prototype.insert = function (pos, element, num) { + if (num === void 0) { + num = 1; + } + if (pos < 0 || pos > this._length) { + throw new RangeError(); + } + if (pos === 0) { + while (num--) this.pushFront(element); + } else if (pos === this._length) { + while (num--) this.pushBack(element); + } else { + var arr = []; + for (var i = pos; i < this._length; ++i) { + arr.push(this.getElementByPos(i)); + } + this.cut(pos - 1); + for (var i = 0; i < num; ++i) this.pushBack(element); + for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]); + } + return this._length; + }; + /** + * @description Remove all elements after the specified position (excluding the specified position). + * @param pos - The previous position of the first removed element. + * @returns The size of the container after cutting. + * @example + * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1] + */ + Deque.prototype.cut = function (pos) { + if (pos < 0) { + this.clear(); + return 0; + } + var _a = this._getElementIndex(pos), + curNodeBucketIndex = _a.curNodeBucketIndex, + curNodePointerIndex = _a.curNodePointerIndex; + this._last = curNodeBucketIndex; + this._curLast = curNodePointerIndex; + this._length = pos + 1; + return this._length; + }; + Deque.prototype.eraseElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + if (pos === 0) this.popFront();else if (pos === this._length - 1) this.popBack();else { + var arr = []; + for (var i = pos + 1; i < this._length; ++i) { + arr.push(this.getElementByPos(i)); + } + this.cut(pos); + this.popBack(); + var self_1 = this; + arr.forEach(function (el) { + self_1.pushBack(el); + }); + } + return this._length; + }; + Deque.prototype.eraseElementByValue = function (value) { + if (this._length === 0) return 0; + var arr = []; + for (var i = 0; i < this._length; ++i) { + var element = this.getElementByPos(i); + if (element !== value) arr.push(element); + } + var _length = arr.length; + for (var i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]); + return this.cut(_length - 1); + }; + Deque.prototype.eraseElementByIterator = function (iter) { + var _node = iter._node; + this.eraseElementByPos(_node); + iter = iter.next(); + return iter; + }; + Deque.prototype.find = function (element) { + for (var i = 0; i < this._length; ++i) { + if (this.getElementByPos(i) === element) { + return new DequeIterator(i, this); + } + } + return this.end(); + }; + Deque.prototype.reverse = function () { + var l = 0; + var r = this._length - 1; + while (l < r) { + var tmp = this.getElementByPos(l); + this.setElementByPos(l, this.getElementByPos(r)); + this.setElementByPos(r, tmp); + l += 1; + r -= 1; + } + }; + Deque.prototype.unique = function () { + if (this._length <= 1) { + return this._length; + } + var index = 1; + var pre = this.getElementByPos(0); + for (var i = 1; i < this._length; ++i) { + var cur = this.getElementByPos(i); + if (cur !== pre) { + pre = cur; + this.setElementByPos(index++, cur); + } + } + while (this._length > index) this.popBack(); + return this._length; + }; + Deque.prototype.sort = function (cmp) { + var arr = []; + for (var i = 0; i < this._length; ++i) { + arr.push(this.getElementByPos(i)); + } + arr.sort(cmp); + for (var i = 0; i < this._length; ++i) this.setElementByPos(i, arr[i]); + }; + /** + * @description Remove as much useless space as possible. + */ + Deque.prototype.shrinkToFit = function () { + if (this._length === 0) return; + var arr = []; + this.forEach(function (el) { + arr.push(el); + }); + this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1); + this._length = this._first = this._last = this._curFirst = this._curLast = 0; + this._map = []; + for (var i = 0; i < this._bucketNum; ++i) { + this._map.push(new Array(this._bucketSize)); + } + for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]); + }; + Deque.prototype.forEach = function (callback) { + for (var i = 0; i < this._length; ++i) { + callback(this.getElementByPos(i), i, this); + } + }; + Deque.prototype[Symbol.iterator] = function () { + return function () { + var i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + i = 0; + _a.label = 1; + case 1: + if (!(i < this._length)) return [3 /*break*/, 4]; + return [4 /*yield*/, this.getElementByPos(i)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + ++i; + return [3 /*break*/, 1]; + case 4: + return [2 /*return*/]; + } + }); + }.bind(this)(); + }; + return Deque; + }(SequentialContainer); + + var TreeNode = /** @class */function () { + function TreeNode(key, value) { + this._color = 1 /* TreeNodeColor.RED */; + this._key = undefined; + this._value = undefined; + this._left = undefined; + this._right = undefined; + this._parent = undefined; + this._key = key; + this._value = value; + } + /** + * @description Get the pre node. + * @returns TreeNode about the pre node. + */ + TreeNode.prototype._pre = function () { + var preNode = this; + if (preNode._color === 1 /* TreeNodeColor.RED */ && preNode._parent._parent === preNode) { + preNode = preNode._right; + } else if (preNode._left) { + preNode = preNode._left; + while (preNode._right) { + preNode = preNode._right; + } + } else { + var pre = preNode._parent; + while (pre._left === preNode) { + preNode = pre; + pre = preNode._parent; + } + preNode = pre; + } + return preNode; + }; + /** + * @description Get the next node. + * @returns TreeNode about the next node. + */ + TreeNode.prototype._next = function () { + var nextNode = this; + if (nextNode._right) { + nextNode = nextNode._right; + while (nextNode._left) { + nextNode = nextNode._left; + } + return nextNode; + } else { + var pre = nextNode._parent; + while (pre._right === nextNode) { + nextNode = pre; + pre = nextNode._parent; + } + if (nextNode._right !== pre) { + return pre; + } else return nextNode; + } + }; + /** + * @description Rotate left. + * @returns TreeNode about moved to original position after rotation. + */ + TreeNode.prototype._rotateLeft = function () { + var PP = this._parent; + var V = this._right; + var R = V._left; + if (PP._parent === this) PP._parent = V;else if (PP._left === this) PP._left = V;else PP._right = V; + V._parent = PP; + V._left = this; + this._parent = V; + this._right = R; + if (R) R._parent = this; + return V; + }; + /** + * @description Rotate right. + * @returns TreeNode about moved to original position after rotation. + */ + TreeNode.prototype._rotateRight = function () { + var PP = this._parent; + var F = this._left; + var K = F._right; + if (PP._parent === this) PP._parent = F;else if (PP._left === this) PP._left = F;else PP._right = F; + F._parent = PP; + F._right = this; + this._parent = F; + this._left = K; + if (K) K._parent = this; + return F; + }; + return TreeNode; + }(); + var TreeNodeEnableIndex = /** @class */function (_super) { + __extends(TreeNodeEnableIndex, _super); + function TreeNodeEnableIndex() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._subTreeSize = 1; + return _this; + } + /** + * @description Rotate left and do recount. + * @returns TreeNode about moved to original position after rotation. + */ + TreeNodeEnableIndex.prototype._rotateLeft = function () { + var parent = _super.prototype._rotateLeft.call(this); + this._recount(); + parent._recount(); + return parent; + }; + /** + * @description Rotate right and do recount. + * @returns TreeNode about moved to original position after rotation. + */ + TreeNodeEnableIndex.prototype._rotateRight = function () { + var parent = _super.prototype._rotateRight.call(this); + this._recount(); + parent._recount(); + return parent; + }; + TreeNodeEnableIndex.prototype._recount = function () { + this._subTreeSize = 1; + if (this._left) { + this._subTreeSize += this._left._subTreeSize; + } + if (this._right) { + this._subTreeSize += this._right._subTreeSize; + } + }; + return TreeNodeEnableIndex; + }(TreeNode); + + var TreeContainer = /** @class */function (_super) { + __extends(TreeContainer, _super); + /** + * @internal + */ + function TreeContainer(cmp, enableIndex) { + if (cmp === void 0) { + cmp = function (x, y) { + if (x < y) return -1; + if (x > y) return 1; + return 0; + }; + } + if (enableIndex === void 0) { + enableIndex = false; + } + var _this = _super.call(this) || this; + /** + * @internal + */ + _this._root = undefined; + _this._cmp = cmp; + if (enableIndex) { + _this._TreeNodeClass = TreeNodeEnableIndex; + _this._set = function (key, value, hint) { + var curNode = this._preSet(key, value, hint); + if (curNode) { + var p = curNode._parent; + while (p !== this._header) { + p._subTreeSize += 1; + p = p._parent; + } + var nodeList = this._insertNodeSelfBalance(curNode); + if (nodeList) { + var _a = nodeList, + parentNode = _a.parentNode, + grandParent = _a.grandParent, + curNode_1 = _a.curNode; + parentNode._recount(); + grandParent._recount(); + curNode_1._recount(); + } + } + return this._length; + }; + _this._eraseNode = function (curNode) { + var p = this._preEraseNode(curNode); + while (p !== this._header) { + p._subTreeSize -= 1; + p = p._parent; + } + }; + } else { + _this._TreeNodeClass = TreeNode; + _this._set = function (key, value, hint) { + var curNode = this._preSet(key, value, hint); + if (curNode) this._insertNodeSelfBalance(curNode); + return this._length; + }; + _this._eraseNode = _this._preEraseNode; + } + _this._header = new _this._TreeNodeClass(); + return _this; + } + /** + * @internal + */ + TreeContainer.prototype._lowerBound = function (curNode, key) { + var resNode = this._header; + while (curNode) { + var cmpResult = this._cmp(curNode._key, key); + if (cmpResult < 0) { + curNode = curNode._right; + } else if (cmpResult > 0) { + resNode = curNode; + curNode = curNode._left; + } else return curNode; + } + return resNode; + }; + /** + * @internal + */ + TreeContainer.prototype._upperBound = function (curNode, key) { + var resNode = this._header; + while (curNode) { + var cmpResult = this._cmp(curNode._key, key); + if (cmpResult <= 0) { + curNode = curNode._right; + } else { + resNode = curNode; + curNode = curNode._left; + } + } + return resNode; + }; + /** + * @internal + */ + TreeContainer.prototype._reverseLowerBound = function (curNode, key) { + var resNode = this._header; + while (curNode) { + var cmpResult = this._cmp(curNode._key, key); + if (cmpResult < 0) { + resNode = curNode; + curNode = curNode._right; + } else if (cmpResult > 0) { + curNode = curNode._left; + } else return curNode; + } + return resNode; + }; + /** + * @internal + */ + TreeContainer.prototype._reverseUpperBound = function (curNode, key) { + var resNode = this._header; + while (curNode) { + var cmpResult = this._cmp(curNode._key, key); + if (cmpResult < 0) { + resNode = curNode; + curNode = curNode._right; + } else { + curNode = curNode._left; + } + } + return resNode; + }; + /** + * @internal + */ + TreeContainer.prototype._eraseNodeSelfBalance = function (curNode) { + while (true) { + var parentNode = curNode._parent; + if (parentNode === this._header) return; + if (curNode._color === 1 /* TreeNodeColor.RED */) { + curNode._color = 0 /* TreeNodeColor.BLACK */; + return; + } + if (curNode === parentNode._left) { + var brother = parentNode._right; + if (brother._color === 1 /* TreeNodeColor.RED */) { + brother._color = 0 /* TreeNodeColor.BLACK */; + parentNode._color = 1 /* TreeNodeColor.RED */; + if (parentNode === this._root) { + this._root = parentNode._rotateLeft(); + } else parentNode._rotateLeft(); + } else { + if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) { + brother._color = parentNode._color; + parentNode._color = 0 /* TreeNodeColor.BLACK */; + brother._right._color = 0 /* TreeNodeColor.BLACK */; + if (parentNode === this._root) { + this._root = parentNode._rotateLeft(); + } else parentNode._rotateLeft(); + return; + } else if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) { + brother._color = 1 /* TreeNodeColor.RED */; + brother._left._color = 0 /* TreeNodeColor.BLACK */; + brother._rotateRight(); + } else { + brother._color = 1 /* TreeNodeColor.RED */; + curNode = parentNode; + } + } + } else { + var brother = parentNode._left; + if (brother._color === 1 /* TreeNodeColor.RED */) { + brother._color = 0 /* TreeNodeColor.BLACK */; + parentNode._color = 1 /* TreeNodeColor.RED */; + if (parentNode === this._root) { + this._root = parentNode._rotateRight(); + } else parentNode._rotateRight(); + } else { + if (brother._left && brother._left._color === 1 /* TreeNodeColor.RED */) { + brother._color = parentNode._color; + parentNode._color = 0 /* TreeNodeColor.BLACK */; + brother._left._color = 0 /* TreeNodeColor.BLACK */; + if (parentNode === this._root) { + this._root = parentNode._rotateRight(); + } else parentNode._rotateRight(); + return; + } else if (brother._right && brother._right._color === 1 /* TreeNodeColor.RED */) { + brother._color = 1 /* TreeNodeColor.RED */; + brother._right._color = 0 /* TreeNodeColor.BLACK */; + brother._rotateLeft(); + } else { + brother._color = 1 /* TreeNodeColor.RED */; + curNode = parentNode; + } + } + } + } + }; + /** + * @internal + */ + TreeContainer.prototype._preEraseNode = function (curNode) { + var _a, _b; + if (this._length === 1) { + this.clear(); + return this._header; + } + var swapNode = curNode; + while (swapNode._left || swapNode._right) { + if (swapNode._right) { + swapNode = swapNode._right; + while (swapNode._left) swapNode = swapNode._left; + } else { + swapNode = swapNode._left; + } + _a = __read([swapNode._key, curNode._key], 2), curNode._key = _a[0], swapNode._key = _a[1]; + _b = __read([swapNode._value, curNode._value], 2), curNode._value = _b[0], swapNode._value = _b[1]; + curNode = swapNode; + } + if (this._header._left === swapNode) { + this._header._left = swapNode._parent; + } else if (this._header._right === swapNode) { + this._header._right = swapNode._parent; + } + this._eraseNodeSelfBalance(swapNode); + var _parent = swapNode._parent; + if (swapNode === _parent._left) { + _parent._left = undefined; + } else _parent._right = undefined; + this._length -= 1; + this._root._color = 0 /* TreeNodeColor.BLACK */; + return _parent; + }; + /** + * @internal + */ + TreeContainer.prototype._inOrderTraversal = function (curNode, callback) { + if (curNode === undefined) return false; + var ifReturn = this._inOrderTraversal(curNode._left, callback); + if (ifReturn) return true; + if (callback(curNode)) return true; + return this._inOrderTraversal(curNode._right, callback); + }; + /** + * @internal + */ + TreeContainer.prototype._insertNodeSelfBalance = function (curNode) { + while (true) { + var parentNode = curNode._parent; + if (parentNode._color === 0 /* TreeNodeColor.BLACK */) return; + var grandParent = parentNode._parent; + if (parentNode === grandParent._left) { + var uncle = grandParent._right; + if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) { + uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */; + if (grandParent === this._root) return; + grandParent._color = 1 /* TreeNodeColor.RED */; + curNode = grandParent; + continue; + } else if (curNode === parentNode._right) { + curNode._color = 0 /* TreeNodeColor.BLACK */; + if (curNode._left) curNode._left._parent = parentNode; + if (curNode._right) curNode._right._parent = grandParent; + parentNode._right = curNode._left; + grandParent._left = curNode._right; + curNode._left = parentNode; + curNode._right = grandParent; + if (grandParent === this._root) { + this._root = curNode; + this._header._parent = curNode; + } else { + var GP = grandParent._parent; + if (GP._left === grandParent) { + GP._left = curNode; + } else GP._right = curNode; + } + curNode._parent = grandParent._parent; + parentNode._parent = curNode; + grandParent._parent = curNode; + grandParent._color = 1 /* TreeNodeColor.RED */; + return { + parentNode: parentNode, + grandParent: grandParent, + curNode: curNode + }; + } else { + parentNode._color = 0 /* TreeNodeColor.BLACK */; + if (grandParent === this._root) { + this._root = grandParent._rotateRight(); + } else grandParent._rotateRight(); + grandParent._color = 1 /* TreeNodeColor.RED */; + } + } else { + var uncle = grandParent._left; + if (uncle && uncle._color === 1 /* TreeNodeColor.RED */) { + uncle._color = parentNode._color = 0 /* TreeNodeColor.BLACK */; + if (grandParent === this._root) return; + grandParent._color = 1 /* TreeNodeColor.RED */; + curNode = grandParent; + continue; + } else if (curNode === parentNode._left) { + curNode._color = 0 /* TreeNodeColor.BLACK */; + if (curNode._left) curNode._left._parent = grandParent; + if (curNode._right) curNode._right._parent = parentNode; + grandParent._right = curNode._left; + parentNode._left = curNode._right; + curNode._left = grandParent; + curNode._right = parentNode; + if (grandParent === this._root) { + this._root = curNode; + this._header._parent = curNode; + } else { + var GP = grandParent._parent; + if (GP._left === grandParent) { + GP._left = curNode; + } else GP._right = curNode; + } + curNode._parent = grandParent._parent; + parentNode._parent = curNode; + grandParent._parent = curNode; + grandParent._color = 1 /* TreeNodeColor.RED */; + return { + parentNode: parentNode, + grandParent: grandParent, + curNode: curNode + }; + } else { + parentNode._color = 0 /* TreeNodeColor.BLACK */; + if (grandParent === this._root) { + this._root = grandParent._rotateLeft(); + } else grandParent._rotateLeft(); + grandParent._color = 1 /* TreeNodeColor.RED */; + } + } + + return; + } + }; + /** + * @internal + */ + TreeContainer.prototype._preSet = function (key, value, hint) { + if (this._root === undefined) { + this._length += 1; + this._root = new this._TreeNodeClass(key, value); + this._root._color = 0 /* TreeNodeColor.BLACK */; + this._root._parent = this._header; + this._header._parent = this._root; + this._header._left = this._root; + this._header._right = this._root; + return; + } + var curNode; + var minNode = this._header._left; + var compareToMin = this._cmp(minNode._key, key); + if (compareToMin === 0) { + minNode._value = value; + return; + } else if (compareToMin > 0) { + minNode._left = new this._TreeNodeClass(key, value); + minNode._left._parent = minNode; + curNode = minNode._left; + this._header._left = curNode; + } else { + var maxNode = this._header._right; + var compareToMax = this._cmp(maxNode._key, key); + if (compareToMax === 0) { + maxNode._value = value; + return; + } else if (compareToMax < 0) { + maxNode._right = new this._TreeNodeClass(key, value); + maxNode._right._parent = maxNode; + curNode = maxNode._right; + this._header._right = curNode; + } else { + if (hint !== undefined) { + var iterNode = hint._node; + if (iterNode !== this._header) { + var iterCmpRes = this._cmp(iterNode._key, key); + if (iterCmpRes === 0) { + iterNode._value = value; + return; + } else /* istanbul ignore else */if (iterCmpRes > 0) { + var preNode = iterNode._pre(); + var preCmpRes = this._cmp(preNode._key, key); + if (preCmpRes === 0) { + preNode._value = value; + return; + } else if (preCmpRes < 0) { + curNode = new this._TreeNodeClass(key, value); + if (preNode._right === undefined) { + preNode._right = curNode; + curNode._parent = preNode; + } else { + iterNode._left = curNode; + curNode._parent = iterNode; + } + } + } + } + } + if (curNode === undefined) { + curNode = this._root; + while (true) { + var cmpResult = this._cmp(curNode._key, key); + if (cmpResult > 0) { + if (curNode._left === undefined) { + curNode._left = new this._TreeNodeClass(key, value); + curNode._left._parent = curNode; + curNode = curNode._left; + break; + } + curNode = curNode._left; + } else if (cmpResult < 0) { + if (curNode._right === undefined) { + curNode._right = new this._TreeNodeClass(key, value); + curNode._right._parent = curNode; + curNode = curNode._right; + break; + } + curNode = curNode._right; + } else { + curNode._value = value; + return; + } + } + } + } + } + this._length += 1; + return curNode; + }; + /** + * @internal + */ + TreeContainer.prototype._findElementNode = function (curNode, key) { + while (curNode) { + var cmpResult = this._cmp(curNode._key, key); + if (cmpResult < 0) { + curNode = curNode._right; + } else if (cmpResult > 0) { + curNode = curNode._left; + } else return curNode; + } + return curNode || this._header; + }; + TreeContainer.prototype.clear = function () { + this._length = 0; + this._root = undefined; + this._header._parent = undefined; + this._header._left = this._header._right = undefined; + }; + /** + * @description Update node's key by iterator. + * @param iter - The iterator you want to change. + * @param key - The key you want to update. + * @returns Whether the modification is successful. + * @example + * const st = new orderedSet([1, 2, 5]); + * const iter = st.find(2); + * st.updateKeyByIterator(iter, 3); // then st will become [1, 3, 5] + */ + TreeContainer.prototype.updateKeyByIterator = function (iter, key) { + var node = iter._node; + if (node === this._header) { + throwIteratorAccessError(); + } + if (this._length === 1) { + node._key = key; + return true; + } + if (node === this._header._left) { + if (this._cmp(node._next()._key, key) > 0) { + node._key = key; + return true; + } + return false; + } + if (node === this._header._right) { + if (this._cmp(node._pre()._key, key) < 0) { + node._key = key; + return true; + } + return false; + } + var preKey = node._pre()._key; + if (this._cmp(preKey, key) >= 0) return false; + var nextKey = node._next()._key; + if (this._cmp(nextKey, key) <= 0) return false; + node._key = key; + return true; + }; + TreeContainer.prototype.eraseElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var index = 0; + var self = this; + this._inOrderTraversal(this._root, function (curNode) { + if (pos === index) { + self._eraseNode(curNode); + return true; + } + index += 1; + return false; + }); + return this._length; + }; + /** + * @description Remove the element of the specified key. + * @param key - The key you want to remove. + * @returns Whether erase successfully. + */ + TreeContainer.prototype.eraseElementByKey = function (key) { + if (this._length === 0) return false; + var curNode = this._findElementNode(this._root, key); + if (curNode === this._header) return false; + this._eraseNode(curNode); + return true; + }; + TreeContainer.prototype.eraseElementByIterator = function (iter) { + var node = iter._node; + if (node === this._header) { + throwIteratorAccessError(); + } + var hasNoRight = node._right === undefined; + var isNormal = iter.iteratorType === 0 /* IteratorType.NORMAL */; + // For the normal iterator, the `next` node will be swapped to `this` node when has right. + if (isNormal) { + // So we should move it to next when it's right is null. + if (hasNoRight) iter.next(); + } else { + // For the reverse iterator, only when it doesn't have right and has left the `next` node will be swapped. + // So when it has right, or it is a leaf node we should move it to `next`. + if (!hasNoRight || node._left === undefined) iter.next(); + } + this._eraseNode(node); + return iter; + }; + TreeContainer.prototype.forEach = function (callback) { + var e_1, _a; + var index = 0; + try { + for (var _b = __values(this), _c = _b.next(); !_c.done; _c = _b.next()) { + var element = _c.value; + callback(element, index++, this); + } + } catch (e_1_1) { + e_1 = { + error: e_1_1 + }; + } finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } finally { + if (e_1) throw e_1.error; + } + } + }; + TreeContainer.prototype.getElementByPos = function (pos) { + var e_2, _a; + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var res; + var index = 0; + try { + for (var _b = __values(this), _c = _b.next(); !_c.done; _c = _b.next()) { + var element = _c.value; + if (index === pos) { + res = element; + break; + } + index += 1; + } + } catch (e_2_1) { + e_2 = { + error: e_2_1 + }; + } finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } finally { + if (e_2) throw e_2.error; + } + } + return res; + }; + /** + * @description Get the height of the tree. + * @returns Number about the height of the RB-tree. + */ + TreeContainer.prototype.getHeight = function () { + if (this._length === 0) return 0; + var traversal = function (curNode) { + if (!curNode) return 0; + return Math.max(traversal(curNode._left), traversal(curNode._right)) + 1; + }; + return traversal(this._root); + }; + return TreeContainer; + }(Container); + + var TreeIterator = /** @class */function (_super) { + __extends(TreeIterator, _super); + /** + * @internal + */ + function TreeIterator(node, header, iteratorType) { + var _this = _super.call(this, iteratorType) || this; + _this._node = node; + _this._header = header; + if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { + _this.pre = function () { + if (this._node === this._header._left) { + throwIteratorAccessError(); + } + this._node = this._node._pre(); + return this; + }; + _this.next = function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._next(); + return this; + }; + } else { + _this.pre = function () { + if (this._node === this._header._right) { + throwIteratorAccessError(); + } + this._node = this._node._next(); + return this; + }; + _this.next = function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._pre(); + return this; + }; + } + return _this; + } + Object.defineProperty(TreeIterator.prototype, "index", { + /** + * @description Get the sequential index of the iterator in the tree container.
+ * Note: + * This function only takes effect when the specified tree container `enableIndex = true`. + * @returns The index subscript of the node in the tree. + * @example + * const st = new OrderedSet([1, 2, 3], true); + * console.log(st.begin().next().index); // 1 + */ + get: function () { + var _node = this._node; + var root = this._header._parent; + if (_node === this._header) { + if (root) { + return root._subTreeSize - 1; + } + return 0; + } + var index = 0; + if (_node._left) { + index += _node._left._subTreeSize; + } + while (_node !== root) { + var _parent = _node._parent; + if (_node === _parent._right) { + index += 1; + if (_parent._left) { + index += _parent._left._subTreeSize; + } + } + _node = _parent; + } + return index; + }, + enumerable: false, + configurable: true + }); + return TreeIterator; + }(ContainerIterator); + + var OrderedSetIterator = /** @class */function (_super) { + __extends(OrderedSetIterator, _super); + function OrderedSetIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; + } + Object.defineProperty(OrderedSetIterator.prototype, "pointer", { + get: function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + return this._node._key; + }, + enumerable: false, + configurable: true + }); + OrderedSetIterator.prototype.copy = function () { + return new OrderedSetIterator(this._node, this._header, this.container, this.iteratorType); + }; + return OrderedSetIterator; + }(TreeIterator); + var OrderedSet = /** @class */function (_super) { + __extends(OrderedSet, _super); + /** + * @param container - The initialization container. + * @param cmp - The compare function. + * @param enableIndex - Whether to enable iterator indexing function. + * @example + * new OrderedSet(); + * new OrderedSet([0, 1, 2]); + * new OrderedSet([0, 1, 2], (x, y) => x - y); + * new OrderedSet([0, 1, 2], (x, y) => x - y, true); + */ + function OrderedSet(container, cmp, enableIndex) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this, cmp, enableIndex) || this; + var self = _this; + container.forEach(function (el) { + self.insert(el); + }); + return _this; + } + /** + * @internal + */ + OrderedSet.prototype._iterationFunc = function (curNode) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (curNode === undefined) return [2 /*return*/]; + return [5 /*yield**/, __values(this._iterationFunc(curNode._left))]; + case 1: + _a.sent(); + return [4 /*yield*/, curNode._key]; + case 2: + _a.sent(); + return [5 /*yield**/, __values(this._iterationFunc(curNode._right))]; + case 3: + _a.sent(); + return [2 /*return*/]; + } + }); + }; + + OrderedSet.prototype.begin = function () { + return new OrderedSetIterator(this._header._left || this._header, this._header, this); + }; + OrderedSet.prototype.end = function () { + return new OrderedSetIterator(this._header, this._header, this); + }; + OrderedSet.prototype.rBegin = function () { + return new OrderedSetIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + OrderedSet.prototype.rEnd = function () { + return new OrderedSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + OrderedSet.prototype.front = function () { + return this._header._left ? this._header._left._key : undefined; + }; + OrderedSet.prototype.back = function () { + return this._header._right ? this._header._right._key : undefined; + }; + /** + * @description Insert element to set. + * @param key - The key want to insert. + * @param hint - You can give an iterator hint to improve insertion efficiency. + * @return The size of container after setting. + * @example + * const st = new OrderedSet([2, 4, 5]); + * const iter = st.begin(); + * st.insert(1); + * st.insert(3, iter); // give a hint will be faster. + */ + OrderedSet.prototype.insert = function (key, hint) { + return this._set(key, undefined, hint); + }; + OrderedSet.prototype.find = function (element) { + var resNode = this._findElementNode(this._root, element); + return new OrderedSetIterator(resNode, this._header, this); + }; + OrderedSet.prototype.lowerBound = function (key) { + var resNode = this._lowerBound(this._root, key); + return new OrderedSetIterator(resNode, this._header, this); + }; + OrderedSet.prototype.upperBound = function (key) { + var resNode = this._upperBound(this._root, key); + return new OrderedSetIterator(resNode, this._header, this); + }; + OrderedSet.prototype.reverseLowerBound = function (key) { + var resNode = this._reverseLowerBound(this._root, key); + return new OrderedSetIterator(resNode, this._header, this); + }; + OrderedSet.prototype.reverseUpperBound = function (key) { + var resNode = this._reverseUpperBound(this._root, key); + return new OrderedSetIterator(resNode, this._header, this); + }; + OrderedSet.prototype.union = function (other) { + var self = this; + other.forEach(function (el) { + self.insert(el); + }); + return this._length; + }; + OrderedSet.prototype[Symbol.iterator] = function () { + return this._iterationFunc(this._root); + }; + return OrderedSet; + }(TreeContainer); + + var OrderedMapIterator = /** @class */function (_super) { + __extends(OrderedMapIterator, _super); + function OrderedMapIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; + } + Object.defineProperty(OrderedMapIterator.prototype, "pointer", { + get: function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + var self = this; + return new Proxy([], { + get: function (_, props) { + if (props === '0') return self._node._key;else if (props === '1') return self._node._value; + }, + set: function (_, props, newValue) { + if (props !== '1') { + throw new TypeError('props must be 1'); + } + self._node._value = newValue; + return true; + } + }); + }, + enumerable: false, + configurable: true + }); + OrderedMapIterator.prototype.copy = function () { + return new OrderedMapIterator(this._node, this._header, this.container, this.iteratorType); + }; + return OrderedMapIterator; + }(TreeIterator); + var OrderedMap = /** @class */function (_super) { + __extends(OrderedMap, _super); + /** + * @param container - The initialization container. + * @param cmp - The compare function. + * @param enableIndex - Whether to enable iterator indexing function. + * @example + * new OrderedMap(); + * new OrderedMap([[0, 1], [2, 1]]); + * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y); + * new OrderedMap([[0, 1], [2, 1]], (x, y) => x - y, true); + */ + function OrderedMap(container, cmp, enableIndex) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this, cmp, enableIndex) || this; + var self = _this; + container.forEach(function (el) { + self.setElement(el[0], el[1]); + }); + return _this; + } + /** + * @internal + */ + OrderedMap.prototype._iterationFunc = function (curNode) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (curNode === undefined) return [2 /*return*/]; + return [5 /*yield**/, __values(this._iterationFunc(curNode._left))]; + case 1: + _a.sent(); + return [4 /*yield*/, [curNode._key, curNode._value]]; + case 2: + _a.sent(); + return [5 /*yield**/, __values(this._iterationFunc(curNode._right))]; + case 3: + _a.sent(); + return [2 /*return*/]; + } + }); + }; + + OrderedMap.prototype.begin = function () { + return new OrderedMapIterator(this._header._left || this._header, this._header, this); + }; + OrderedMap.prototype.end = function () { + return new OrderedMapIterator(this._header, this._header, this); + }; + OrderedMap.prototype.rBegin = function () { + return new OrderedMapIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + OrderedMap.prototype.rEnd = function () { + return new OrderedMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + OrderedMap.prototype.front = function () { + if (this._length === 0) return; + var minNode = this._header._left; + return [minNode._key, minNode._value]; + }; + OrderedMap.prototype.back = function () { + if (this._length === 0) return; + var maxNode = this._header._right; + return [maxNode._key, maxNode._value]; + }; + OrderedMap.prototype.lowerBound = function (key) { + var resNode = this._lowerBound(this._root, key); + return new OrderedMapIterator(resNode, this._header, this); + }; + OrderedMap.prototype.upperBound = function (key) { + var resNode = this._upperBound(this._root, key); + return new OrderedMapIterator(resNode, this._header, this); + }; + OrderedMap.prototype.reverseLowerBound = function (key) { + var resNode = this._reverseLowerBound(this._root, key); + return new OrderedMapIterator(resNode, this._header, this); + }; + OrderedMap.prototype.reverseUpperBound = function (key) { + var resNode = this._reverseUpperBound(this._root, key); + return new OrderedMapIterator(resNode, this._header, this); + }; + /** + * @description Insert a key-value pair or set value by the given key. + * @param key - The key want to insert. + * @param value - The value want to set. + * @param hint - You can give an iterator hint to improve insertion efficiency. + * @return The size of container after setting. + * @example + * const mp = new OrderedMap([[2, 0], [4, 0], [5, 0]]); + * const iter = mp.begin(); + * mp.setElement(1, 0); + * mp.setElement(3, 0, iter); // give a hint will be faster. + */ + OrderedMap.prototype.setElement = function (key, value, hint) { + return this._set(key, value, hint); + }; + OrderedMap.prototype.find = function (key) { + var curNode = this._findElementNode(this._root, key); + return new OrderedMapIterator(curNode, this._header, this); + }; + /** + * @description Get the value of the element of the specified key. + * @param key - The specified key you want to get. + * @example + * const val = container.getElementByKey(1); + */ + OrderedMap.prototype.getElementByKey = function (key) { + var curNode = this._findElementNode(this._root, key); + return curNode._value; + }; + OrderedMap.prototype.union = function (other) { + var self = this; + other.forEach(function (el) { + self.setElement(el[0], el[1]); + }); + return this._length; + }; + OrderedMap.prototype[Symbol.iterator] = function () { + return this._iterationFunc(this._root); + }; + return OrderedMap; + }(TreeContainer); + + /** + * @description Determine whether the type of key is `object`. + * @param key - The key want to check. + * @returns Whether the type of key is `object`. + * @internal + */ + function checkObject(key) { + var t = typeof key; + return t === 'object' && key !== null || t === 'function'; + } + + var HashContainerIterator = /** @class */function (_super) { + __extends(HashContainerIterator, _super); + /** + * @internal + */ + function HashContainerIterator(node, header, iteratorType) { + var _this = _super.call(this, iteratorType) || this; + _this._node = node; + _this._header = header; + if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { + _this.pre = function () { + if (this._node._pre === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._pre; + return this; + }; + _this.next = function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._next; + return this; + }; + } else { + _this.pre = function () { + if (this._node._next === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._next; + return this; + }; + _this.next = function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + this._node = this._node._pre; + return this; + }; + } + return _this; + } + return HashContainerIterator; + }(ContainerIterator); + var HashContainer = /** @class */function (_super) { + __extends(HashContainer, _super); + /** + * @internal + */ + function HashContainer() { + var _this = _super.call(this) || this; + /** + * @internal + */ + _this._objMap = []; + /** + * @internal + */ + _this._originMap = {}; + /** + * @description Unique symbol used to tag object. + */ + _this.HASH_TAG = Symbol('@@HASH_TAG'); + Object.setPrototypeOf(_this._originMap, null); + _this._header = {}; + _this._header._pre = _this._header._next = _this._head = _this._tail = _this._header; + return _this; + } + /** + * @internal + */ + HashContainer.prototype._eraseNode = function (node) { + var _pre = node._pre, + _next = node._next; + _pre._next = _next; + _next._pre = _pre; + if (node === this._head) { + this._head = _next; + } + if (node === this._tail) { + this._tail = _pre; + } + this._length -= 1; + }; + /** + * @internal + */ + HashContainer.prototype._set = function (key, value, isObject) { + if (isObject === undefined) isObject = checkObject(key); + var newTail; + if (isObject) { + var index = key[this.HASH_TAG]; + if (index !== undefined) { + this._objMap[index]._value = value; + return this._length; + } + Object.defineProperty(key, this.HASH_TAG, { + value: this._objMap.length, + configurable: true + }); + newTail = { + _key: key, + _value: value, + _pre: this._tail, + _next: this._header + }; + this._objMap.push(newTail); + } else { + var node = this._originMap[key]; + if (node) { + node._value = value; + return this._length; + } + newTail = { + _key: key, + _value: value, + _pre: this._tail, + _next: this._header + }; + this._originMap[key] = newTail; + } + if (this._length === 0) { + this._head = newTail; + this._header._next = newTail; + } else { + this._tail._next = newTail; + } + this._tail = newTail; + this._header._pre = newTail; + return ++this._length; + }; + /** + * @internal + */ + HashContainer.prototype._findElementNode = function (key, isObject) { + if (isObject === undefined) isObject = checkObject(key); + if (isObject) { + var index = key[this.HASH_TAG]; + if (index === undefined) return this._header; + return this._objMap[index]; + } else { + return this._originMap[key] || this._header; + } + }; + HashContainer.prototype.clear = function () { + var HASH_TAG = this.HASH_TAG; + this._objMap.forEach(function (el) { + delete el._key[HASH_TAG]; + }); + this._objMap = []; + this._originMap = {}; + Object.setPrototypeOf(this._originMap, null); + this._length = 0; + this._head = this._tail = this._header._pre = this._header._next = this._header; + }; + /** + * @description Remove the element of the specified key. + * @param key - The key you want to remove. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns Whether erase successfully. + */ + HashContainer.prototype.eraseElementByKey = function (key, isObject) { + var node; + if (isObject === undefined) isObject = checkObject(key); + if (isObject) { + var index = key[this.HASH_TAG]; + if (index === undefined) return false; + delete key[this.HASH_TAG]; + node = this._objMap[index]; + delete this._objMap[index]; + } else { + node = this._originMap[key]; + if (node === undefined) return false; + delete this._originMap[key]; + } + this._eraseNode(node); + return true; + }; + HashContainer.prototype.eraseElementByIterator = function (iter) { + var node = iter._node; + if (node === this._header) { + throwIteratorAccessError(); + } + this._eraseNode(node); + return iter.next(); + }; + HashContainer.prototype.eraseElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var node = this._head; + while (pos--) { + node = node._next; + } + this._eraseNode(node); + return this._length; + }; + return HashContainer; + }(Container); + + var HashSetIterator = /** @class */function (_super) { + __extends(HashSetIterator, _super); + function HashSetIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; + } + Object.defineProperty(HashSetIterator.prototype, "pointer", { + get: function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + return this._node._key; + }, + enumerable: false, + configurable: true + }); + HashSetIterator.prototype.copy = function () { + return new HashSetIterator(this._node, this._header, this.container, this.iteratorType); + }; + return HashSetIterator; + }(HashContainerIterator); + var HashSet = /** @class */function (_super) { + __extends(HashSet, _super); + function HashSet(container) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this) || this; + var self = _this; + container.forEach(function (el) { + self.insert(el); + }); + return _this; + } + HashSet.prototype.begin = function () { + return new HashSetIterator(this._head, this._header, this); + }; + HashSet.prototype.end = function () { + return new HashSetIterator(this._header, this._header, this); + }; + HashSet.prototype.rBegin = function () { + return new HashSetIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + HashSet.prototype.rEnd = function () { + return new HashSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + HashSet.prototype.front = function () { + return this._head._key; + }; + HashSet.prototype.back = function () { + return this._tail._key; + }; + /** + * @description Insert element to set. + * @param key - The key want to insert. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns The size of container after inserting. + */ + HashSet.prototype.insert = function (key, isObject) { + return this._set(key, undefined, isObject); + }; + HashSet.prototype.getElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var node = this._head; + while (pos--) { + node = node._next; + } + return node._key; + }; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ + HashSet.prototype.find = function (key, isObject) { + var node = this._findElementNode(key, isObject); + return new HashSetIterator(node, this._header, this); + }; + HashSet.prototype.forEach = function (callback) { + var index = 0; + var node = this._head; + while (node !== this._header) { + callback(node._key, index++, this); + node = node._next; + } + }; + HashSet.prototype[Symbol.iterator] = function () { + return function () { + var node; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + node = this._head; + _a.label = 1; + case 1: + if (!(node !== this._header)) return [3 /*break*/, 3]; + return [4 /*yield*/, node._key]; + case 2: + _a.sent(); + node = node._next; + return [3 /*break*/, 1]; + case 3: + return [2 /*return*/]; + } + }); + }.bind(this)(); + }; + return HashSet; + }(HashContainer); + + var HashMapIterator = /** @class */function (_super) { + __extends(HashMapIterator, _super); + function HashMapIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; + } + Object.defineProperty(HashMapIterator.prototype, "pointer", { + get: function () { + if (this._node === this._header) { + throwIteratorAccessError(); + } + var self = this; + return new Proxy([], { + get: function (_, props) { + if (props === '0') return self._node._key;else if (props === '1') return self._node._value; + }, + set: function (_, props, newValue) { + if (props !== '1') { + throw new TypeError('props must be 1'); + } + self._node._value = newValue; + return true; + } + }); + }, + enumerable: false, + configurable: true + }); + HashMapIterator.prototype.copy = function () { + return new HashMapIterator(this._node, this._header, this.container, this.iteratorType); + }; + return HashMapIterator; + }(HashContainerIterator); + var HashMap = /** @class */function (_super) { + __extends(HashMap, _super); + function HashMap(container) { + if (container === void 0) { + container = []; + } + var _this = _super.call(this) || this; + var self = _this; + container.forEach(function (el) { + self.setElement(el[0], el[1]); + }); + return _this; + } + HashMap.prototype.begin = function () { + return new HashMapIterator(this._head, this._header, this); + }; + HashMap.prototype.end = function () { + return new HashMapIterator(this._header, this._header, this); + }; + HashMap.prototype.rBegin = function () { + return new HashMapIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + HashMap.prototype.rEnd = function () { + return new HashMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); + }; + + HashMap.prototype.front = function () { + if (this._length === 0) return; + return [this._head._key, this._head._value]; + }; + HashMap.prototype.back = function () { + if (this._length === 0) return; + return [this._tail._key, this._tail._value]; + }; + /** + * @description Insert a key-value pair or set value by the given key. + * @param key - The key want to insert. + * @param value - The value want to set. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns The size of container after setting. + */ + HashMap.prototype.setElement = function (key, value, isObject) { + return this._set(key, value, isObject); + }; + /** + * @description Get the value of the element of the specified key. + * @param key - The key want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @example + * const val = container.getElementByKey(1); + */ + HashMap.prototype.getElementByKey = function (key, isObject) { + if (isObject === undefined) isObject = checkObject(key); + if (isObject) { + var index = key[this.HASH_TAG]; + return index !== undefined ? this._objMap[index]._value : undefined; + } + var node = this._originMap[key]; + return node ? node._value : undefined; + }; + HashMap.prototype.getElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var node = this._head; + while (pos--) { + node = node._next; + } + return [node._key, node._value]; + }; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.
+ * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ + HashMap.prototype.find = function (key, isObject) { + var node = this._findElementNode(key, isObject); + return new HashMapIterator(node, this._header, this); + }; + HashMap.prototype.forEach = function (callback) { + var index = 0; + var node = this._head; + while (node !== this._header) { + callback([node._key, node._value], index++, this); + node = node._next; + } + }; + HashMap.prototype[Symbol.iterator] = function () { + return function () { + var node; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + node = this._head; + _a.label = 1; + case 1: + if (!(node !== this._header)) return [3 /*break*/, 3]; + return [4 /*yield*/, [node._key, node._value]]; + case 2: + _a.sent(); + node = node._next; + return [3 /*break*/, 1]; + case 3: + return [2 /*return*/]; + } + }); + }.bind(this)(); + }; + return HashMap; + }(HashContainer); + + exports.Deque = Deque; + exports.HashMap = HashMap; + exports.HashSet = HashSet; + exports.LinkList = LinkList; + exports.OrderedMap = OrderedMap; + exports.OrderedSet = OrderedSet; + exports.PriorityQueue = PriorityQueue; + exports.Queue = Queue; + exports.Stack = Stack; + exports.Vector = Vector; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/node_modules/js-sdsl/dist/umd/js-sdsl.min.js b/node_modules/js-sdsl/dist/umd/js-sdsl.min.js new file mode 100644 index 000000000..d9e814ccf --- /dev/null +++ b/node_modules/js-sdsl/dist/umd/js-sdsl.min.js @@ -0,0 +1,8 @@ +/*! + * js-sdsl v4.3.0 + * https://github.com/js-sdsl/js-sdsl + * (c) 2021-present ZLY201 + * MIT license + */ +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).sdsl={})}(this,function(t){"use strict";var L=function(t,i){return(L=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,i){t.__proto__=i}:function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}))(t,i)};function i(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}L(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}function r(e,n){var o,s,h,u={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(r){return function(t){var i=[r,t];if(o)throw new TypeError("Generator is already executing.");for(;u=f&&i[f=0]?0:u;)try{if(o=1,s&&(h=2&i[0]?s.return:i[0]?s.throw||((h=s.return)&&h.call(s),0):s.next)&&!(h=h.call(s,i[1])).done)return h;switch(s=0,(i=h?[2&i[0],h.value]:i)[0]){case 0:case 1:h=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,s=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(h=0<(h=u.trys).length&&h[h.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!h||i[1]>h[0]&&i[1]=t.length?void 0:t)&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,i){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,n,o=r.call(t),s=[];try{for(;(void 0===i||0=i&&4096>1,e=this.l[r];if(this.v(e,i)<=0)break;this.l[t]=e,t=r}this.l[t]=i},p.prototype._=function(t,i){for(var r=this.l[t];t>1)),t},p.prototype.top=function(){return this.l[0]},p.prototype.find=function(t){return 0<=this.l.indexOf(t)},p.prototype.remove=function(t){t=this.l.indexOf(t);return!(t<0||(0===t?this.pop():t===this.i-1?(this.l.pop(),--this.i):(this.l.splice(t,1,this.l.pop()),--this.i,this.p(t),this._(t,this.i>>1)),0))},p.prototype.updateItem=function(t){t=this.l.indexOf(t);return!(t<0||(this.p(t),this._(t,this.i>>1),0))},p.prototype.toArray=function(){return f([],h(this.l),!1)};var U,n=p;function p(t,i,r){void 0===t&&(t=[]),void 0===i&&(i=function(t,i){return i>1),s=n.i-1>>1;0<=s;--s)n._(s,o);return n}i(Y,J=_);var J,c=Y;function Y(){return null!==J&&J.apply(this,arguments)||this}function a(){throw new RangeError("Iterator access denied!")}i(Z,z=e),Object.defineProperty(Z.prototype,"pointer",{get:function(){return this.container.getElementByPos(this.t)},set:function(t){this.container.setElementByPos(this.t,t)},enumerable:!1,configurable:!0});var z,W=Z;function Z(t,i){i=z.call(this,i)||this;return i.t=t,0===i.iteratorType?(i.pre=function(){return 0===this.t&&a(),--this.t,this},i.next=function(){return this.t===this.container.size()&&a(),this.t+=1,this}):(i.pre=function(){return this.t===this.container.size()-1&&a(),this.t+=1,this},i.next=function(){return-1===this.t&&a(),--this.t,this}),i}i(Q,$=W),Q.prototype.copy=function(){return new Q(this.t,this.container,this.iteratorType)};var $,y=Q;function Q(t,i,r){t=$.call(this,t,r)||this;return t.container=i,t}i(l,tt=c),l.prototype.clear=function(){this.i=0,this.I.length=0},l.prototype.begin=function(){return new y(0,this)},l.prototype.end=function(){return new y(this.i,this)},l.prototype.rBegin=function(){return new y(this.i-1,this,1)},l.prototype.rEnd=function(){return new y(-1,this,1)},l.prototype.front=function(){return this.I[0]},l.prototype.back=function(){return this.I[this.i-1]},l.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;return this.I[t]},l.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;return this.I.splice(t,1),--this.i,this.i},l.prototype.eraseElementByValue=function(t){for(var i=0,r=0;rthis.i-1)throw new RangeError;this.I[t]=i},l.prototype.insert=function(t,i,r){var e;if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;return(e=this.I).splice.apply(e,f([t,0],h(new Array(r).fill(i)),!1)),this.i+=r,this.i},l.prototype.find=function(t){for(var i=0;ithis.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return i.k},S.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return this.M(i),this.i},S.prototype.eraseElementByValue=function(t){for(var i=this.H;i!==this.S;)i.k===t&&this.M(i),i=i.O;return this.i},S.prototype.eraseElementByIterator=function(t){var i=t.t;return i===this.S&&a(),t=t.next(),this.M(i),t},S.prototype.pushBack=function(t){return this.A(t,this.g),this.i},S.prototype.popBack=function(){var t;if(0!==this.i)return t=this.g.k,this.M(this.g),t},S.prototype.pushFront=function(t){return this.A(t,this.S),this.i},S.prototype.popFront=function(){var t;if(0!==this.i)return t=this.H.k,this.M(this.H),t},S.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;for(var r=this.H;t--;)r=r.O;r.k=i},S.prototype.insert=function(t,i,r){if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;if(!(r<=0))if(0===t)for(;r--;)this.pushFront(i);else if(t===this.i)for(;r--;)this.pushBack(i);else{for(var e=this.H,n=1;n>1,1),r=0;r>1},w.prototype.begin=function(){return new B(0,this)},w.prototype.end=function(){return new B(this.i,this)},w.prototype.rBegin=function(){return new B(this.i-1,this,1)},w.prototype.rEnd=function(){return new B(-1,this,1)},w.prototype.front=function(){if(0!==this.i)return this.m[this.u][this.T]},w.prototype.back=function(){if(0!==this.i)return this.m[this.C][this.q]},w.prototype.pushBack=function(t){return this.i&&(this.qthis.i-1)throw new RangeError;var t=this.R(t),i=t.curNodeBucketIndex,t=t.curNodePointerIndex;return this.m[i][t]},w.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;var t=this.R(t),r=t.curNodeBucketIndex,t=t.curNodePointerIndex;this.m[r][t]=i},w.prototype.insert=function(t,i,r){if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;if(0===t)for(;r--;)this.pushFront(i);else if(t===this.i)for(;r--;)this.pushBack(i);else{for(var e=[],n=t;nthis.i-1)throw new RangeError;if(0===t)this.popFront();else if(t===this.i-1)this.popBack();else{for(var i=[],r=t+1;rt;)this.popBack()}return this.i},w.prototype.sort=function(t){for(var i=[],r=0;r>1)-(i>>1),r.T=r.q=r.V-e%r.V>>1,r);return t.forEach(function(t){o.pushBack(t)}),r}g.prototype.L=function(){var t=this;if(1===t.N&&t.F.F===t)t=t.G;else if(t.B)for(t=t.B;t.G;)t=t.G;else{for(var i=t.F;i.B===t;)i=(t=i).F;t=i}return t},g.prototype.O=function(){var t=this;if(t.G){for(t=t.G;t.B;)t=t.B;return t}for(var i=t.F;i.G===t;)i=(t=i).F;return t.G!==i?i:t},g.prototype.J=function(){var t=this.F,i=this.G,r=i.B;return t.F===this?t.F=i:t.B===this?t.B=i:t.G=i,i.F=t,(i.B=this).F=i,(this.G=r)&&(r.F=this),i},g.prototype.K=function(){var t=this.F,i=this.B,r=i.G;return t.F===this?t.F=i:t.B===this?t.B=i:t.G=i,i.F=t,(i.G=this).F=i,(this.B=r)&&(r.F=this),i};var ut=g;function g(t,i){this.N=1,this.P=void 0,this.k=void 0,this.B=void 0,this.G=void 0,this.F=void 0,this.P=t,this.k=i}i(m,E=ut),m.prototype.J=function(){var t=E.prototype.J.call(this);return this.W(),t.W(),t},m.prototype.K=function(){var t=E.prototype.K.call(this);return this.W(),t.W(),t},m.prototype.W=function(){this.U=1,this.B&&(this.U+=this.B.U),this.G&&(this.U+=this.G.U)};var E,ft=m;function m(){var t=null!==E&&E.apply(this,arguments)||this;return t.U=1,t}i(P,pt=_),P.prototype.rt=function(t,i){for(var r=this.S;t;){var e=this.v(t.P,i);if(e<0)t=t.G;else{if(!(0this.i-1)throw new RangeError;var r=0,e=this;return this.ut(this.X,function(t){return i===r?(e.M(t),!0):(r+=1,!1)}),this.i},P.prototype.eraseElementByKey=function(t){return 0!==this.i&&(t=this.ot(this.X,t))!==this.S&&(this.M(t),!0)},P.prototype.eraseElementByIterator=function(t){var i=t.t,r=(i===this.S&&a(),void 0===i.G);return 0===t.iteratorType?r&&t.next():r&&void 0!==i.B||t.next(),this.M(i),t},P.prototype.forEach=function(t){var i,r,e=0;try{for(var n=u(this),o=n.next();!o.done;o=n.next())t(o.value,e++,this)}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}},P.prototype.getElementByPos=function(t){var i,r,e;if(t<0||t>this.i-1)throw new RangeError;var n=0;try{for(var o=u(this),s=o.next();!s.done;s=o.next()){var h=s.value;if(n===t){e=h;break}n+=1}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return e},P.prototype.getHeight=function(){var i;return 0===this.i?0:(i=function(t){return t?Math.max(i(t.B),i(t.G))+1:0})(this.X)};var pt,c=P;function P(t,i){void 0===t&&(t=function(t,i){return tthis.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return this.M(i),this.i};var mt,e=H;function H(){var t=mt.call(this)||this;return t.ct=[],t.vt={},t.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(t.vt,null),t.S={},t.S.L=t.S.O=t.H=t.g=t.S,t}i(x,Pt=c),Object.defineProperty(x.prototype,"pointer",{get:function(){return this.t===this.S&&a(),this.t.P},enumerable:!1,configurable:!0}),x.prototype.copy=function(){return new x(this.t,this.S,this.container,this.iteratorType)};var Pt,T=x;function x(t,i,r,e){t=Pt.call(this,t,i,e)||this;return t.container=r,t}i(X,bt=e),X.prototype.begin=function(){return new T(this.H,this.S,this)},X.prototype.end=function(){return new T(this.S,this.S,this)},X.prototype.rBegin=function(){return new T(this.g,this.S,this,1)},X.prototype.rEnd=function(){return new T(this.S,this.S,this,1)},X.prototype.front=function(){return this.H.P},X.prototype.back=function(){return this.g.P},X.prototype.insert=function(t,i){return this.Z(t,void 0,i)},X.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return i.P},X.prototype.find=function(t,i){t=this.ot(t,i);return new T(t,this.S,this)},X.prototype.forEach=function(t){for(var i=0,r=this.H;r!==this.S;)t(r.P,i++,this),r=r.O},X.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=this.H,t.label=1;case 1:return i===this.S?[3,3]:[4,i.P];case 2:return t.sent(),i=i.O,[3,1];case 3:return[2]}})}.bind(this)()};var bt,_=X;function X(t){void 0===t&&(t=[]);var i=bt.call(this)||this,r=i;return t.forEach(function(t){r.insert(t)}),i}i(Gt,kt=c),Object.defineProperty(Gt.prototype,"pointer",{get:function(){this.t===this.S&&a();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.t.P:"1"===i?e.t.k:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.t.k=r,!0}})},enumerable:!1,configurable:!0}),Gt.prototype.copy=function(){return new Gt(this.t,this.S,this.container,this.iteratorType)};var kt,I=Gt;function Gt(t,i,r,e){t=kt.call(this,t,i,e)||this;return t.container=r,t}i(A,Ot=e),A.prototype.begin=function(){return new I(this.H,this.S,this)},A.prototype.end=function(){return new I(this.S,this.S,this)},A.prototype.rBegin=function(){return new I(this.g,this.S,this,1)},A.prototype.rEnd=function(){return new I(this.S,this.S,this,1)},A.prototype.front=function(){if(0!==this.i)return[this.H.P,this.H.k]},A.prototype.back=function(){if(0!==this.i)return[this.g.P,this.g.k]},A.prototype.setElement=function(t,i,r){return this.Z(t,i,r)},A.prototype.getElementByKey=function(t,i){return(i=void 0===i?wt(t):i)?void 0!==(i=t[this.HASH_TAG])?this.ct[i].k:void 0:(i=this.vt[t])?i.k:void 0},A.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return[i.P,i.k]},A.prototype.find=function(t,i){t=this.ot(t,i);return new I(t,this.S,this)},A.prototype.forEach=function(t){for(var i=0,r=this.H;r!==this.S;)t([r.P,r.k],i++,this),r=r.O},A.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=this.H,t.label=1;case 1:return i===this.S?[3,3]:[4,[i.P,i.k]];case 2:return t.sent(),i=i.O,[3,1];case 3:return[2]}})}.bind(this)()};var Ot,c=A;function A(t){void 0===t&&(t=[]);var i=Ot.call(this)||this,r=i;return t.forEach(function(t){r.setElement(t[0],t[1])}),i}t.Deque=W,t.HashMap=c,t.HashSet=_,t.LinkList=nt,t.OrderedMap=at,t.OrderedSet=dt,t.PriorityQueue=n,t.Queue=K,t.Stack=C,t.Vector=it,Object.defineProperty(t,"dt",{value:!0})}); +//# sourceMappingURL=js-sdsl.min.js.map diff --git a/node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map b/node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map new file mode 100644 index 000000000..eced60ce6 --- /dev/null +++ b/node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["js-sdsl.js"],"names":["exports","sdsl","module","factory","define","global","globalThis","self","this","extendStatics","__generator","body","Object","setPrototypeOf","__proto__","Array","d","b","t","p","prototype","hasOwnProperty","call","__extends","next","TypeError","String","return","constructor","Symbol","verb","g","thisArg","v","f","y","_","label","sent","op","step","trys","ops","throw","iterator","n","done","pop","value","length","__values","s","push","o","e","i","m","error","r","ar","__spreadArray","arguments","ContainerIterator","iteratorType","_node","Base","pack","_length","l","from","defineProperty","get","enumerable","slice","Stack","_super","container","Container","clear","configurable","Queue","_this","el","forEach","_stack","_first","apply","element","cmp","_cmp","self_1","parent_1","halfLength","minItem","_priorityQueue","_queue","right","left","pos","item","capacity","PriorityQueue","length_1","last","_pushDown","indexOf","remove","_pushUp","parent_2","parentItem","pre","throwIteratorAccessError","getElementByPos","set","RandomIterator","VectorIterator","copy","rEnd","index","Vector","splice","popBack","toArray","x","SequentialContainer","__read","_a","RangeError","reverse","_header","setElementByPos","newValue","callback","_next","node","LinkListIterator","_vector","LinkList","rBegin","_tail","_pre","front","_eraseNode","_head","eraseElementByPos","eraseElementByIterator","iter","begin","_value","num","curNode","eraseElementByValue","_insertNode","isArray","pushBack","pTail","insert","tmp","curNode_1","back","bind","DequeIterator","Deque","_bucketSize","_last","_bucketNum","size","_curFirst","popFront","addBucketNum","newMap","offset","curNodePointerIndex","offsetRemainder","curNodeBucketIndex","pHead","_curLast","cnt","unique","_map","tmpNode","sort","arr","list","cut","_reAllocate","cur","_getElementIndex","Math","max","ceil","end","TreeNode","_key","undefined","_right","_parent","preNode","_color","_left","pushFront","nextNode","V","_rotateRight","PP","F","K","TreeNodeEnableIndex","_subTreeSize","_recount","parent","TreeContainer","enableIndex","_set","nodeList","_TreeNodeClass","resNode","cmpResult","find","_reverseUpperBound","key","parentNode","_root","_rotateLeft","brother","needBucketNum","_b","swapNode","ifReturn","uncle","R","GP","grandParent","_lowerBound","_upperBound","_reverseLowerBound","preKey","nextKey","isNormal","hasNoRight","_preEraseNode","e_1","_c","res","_eraseNodeSelfBalance","e_2_1","_inOrderTraversal","_insertNodeSelfBalance","traversal","TreeIterator","header","root","OrderedSetIterator","OrderedSet","compareToMin","minNode","maxNode","compareToMax","hint","iterNode","iterCmpRes","preCmpRes","lowerBound","upperBound","reverseLowerBound","reverseUpperBound","union","OrderedMapIterator","props","OrderedMap","_iterationFunc","eraseElementByKey","getElementByKey","e_1_1","checkObject","HashContainerIterator","e_2","_preSet","newTail","HashContainer","_objMap","_originMap","HASH_TAG","isObject","HashSetIterator","HashSet","_findElementNode","other","HashMapIterator","setElement","HashMap","Proxy"],"mappings":";;;;;;UAQWA,EAAAA,GAE2F,U,OAARC,SAAQ,aAAA,OAAAC,OAAAC,EAAAH,OAAAA,EAClFA,YADkFA,OAC7FI,QAAWJ,OAAAA,IAAAA,OAAAA,CAAAA,WAAAA,CAAAA,EAAWG,GAAAE,EAAA,aAAAA,OAAAC,WAAAA,WAAAD,GAAAE,MAAAN,KAAA,EAAA,CAA9B,EAAEO,KAAAA,SAkBKC,GAAgB,aAkBpB,IAAAA,EAASC,SAAqBC,EAAAA,GAV5B,OAPAF,EAkBQG,OAAAC,iBAAA,CAjBNC,UAkBS,E,YACDC,MAAA,SAAAC,EAAAC,GAjBRD,EAAEF,UAkBQG,CAjBZ,EAAK,SAkBCD,EAAOE,GACT,IAAA,IAAAC,KAAAF,EAAAL,OAAAQ,UAAAC,eAAAC,KAAAL,EAAAE,CAAAA,IAAAH,EAAAG,GAAAF,EAAAE,GAjBJ,IAmBSH,EAAAC,CAAAA,CAjBX,EACA,SAsBEM,EAAWP,EAAAC,GArBX,GAsBa,YAtBb,OAsBEO,GAAW,OAAAP,EAAA,MAAA,IAAAQ,UAAA,uBAAAC,OAAAT,CAAAA,EAAA,+BAAA,EApBb,SAsBEU,IArBAnB,KAAKoB,YAsBGC,CArBV,CAHApB,EAsBWqB,EAAAA,CAAAA,EAIXd,EAAAI,UAAIW,OAAAA,EAAAA,OAAAA,OAAAA,CAAAA,GAAAA,EAAAA,UAAAA,EAAAA,UAAAA,IAAAA,EArBN,CACA,SAsBIrB,EAAOsB,EAAUC,GArBnB,IASEC,EACAC,EACAjB,EAXEkB,EAAI,CAuBNC,MAAA,EACFC,KAA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AS9B,CAAAA,GAAS9G,IAAAA,EAC5C8H,EAAOA,EAAKD,CAEhB,EACA6J,EAAQ9Q,UAAUS,OAAOe,UAAY,WACnC,OAAO,WACL,IAAI0F,EACJ,OAAO5H,EAAYF,KAAAA,SAAgBsH,GACjC,OAAQA,EAAGzF,OACT,KAAK,EACHiG,EAAO9H,KAAKuI,EACZjB,EAAGzF,MAAQ,EACb,KAAK,EACH,OAAMiG,IAAS9H,KAAKyH,EAAiB,CAAC,EAAa,GAC5C,CAAC,EAAa,CAACK,EAAK2D,EAAM3D,EAAKc,IACxC,KAAK,EAGH,OAFAtB,EAAGxF,KAAAA,EACHgG,EAAOA,EAAKD,EACL,CAAC,EAAa,GACvB,KAAK,EACH,MAAO,CAAC,E,CAEd,CAAA,CACF,EAAE2B,KAAKxJ,IAAAA,EAlBA,CAmBT,EAhHF,IAAqCmE,GAAjCuN,EAiHKA,EA/GP,SAASA,EAAQtN,GACXA,KAAAA,IAAAA,IACFA,EAAY,IAEd,IAAIK,EAAQN,GAAOrD,KAAKd,IAAAA,GAASA,KAC7BD,EAAO0E,EAIX,OAHAL,EAAUO,QAAAA,SAAkBD,GAC1B3E,EAAK0R,WAAW/M,EAAG,GAAIA,EAAG,EAAA,CAC5B,CAAA,EACOD,CACT,CAwGFjF,EAAQkK,MAAQA,EAChBlK,EAAQkS,QAAUA,EAClBlS,EAAQ6R,QAAUA,EAClB7R,EAAQyI,SAAWA,GACnBzI,EAAQ6Q,WAAaA,GACrB7Q,EAAQ6P,WAAaA,GACrB7P,EAAQqG,cAAgBA,EACxBrG,EAAQgF,MAAQA,EAChBhF,EAAQ0E,MAAQA,EAChB1E,EAAQuH,OAASA,GAEjB3G,OAAO0D,eAAetE,EAAS,KAAc,CAAEgD,MAAO,CAAA,C,EAEzD,CAAA","file":"js-sdsl.min.js"} \ No newline at end of file diff --git a/node_modules/js-sdsl/package.json b/node_modules/js-sdsl/package.json new file mode 100644 index 000000000..1c35cd215 --- /dev/null +++ b/node_modules/js-sdsl/package.json @@ -0,0 +1,166 @@ +{ + "name": "js-sdsl", + "version": "4.3.0", + "description": "javascript standard data structure library which benchmark against C++ STL", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/esm/index.d.ts", + "author": { + "name": "ZLY201", + "email": "951711127@qq.com", + "url": "https://github.com/js-sdsl/js-sdsl" + }, + "sideEffects": false, + "homepage": "https://js-sdsl.org", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + }, + "scripts": { + "setup": "rm -rf node_modules && yarn install", + "dev": "ttsc --project tsconfig.dev.json --watch", + "build": "gulp", + "build:cjs": "gulp cjs", + "build:esm": "gulp esm", + "build:umd": "gulp umd", + "build:umd:min": "yarn build:umd && gulp umd:min", + "build:isolate": "gulp isolate", + "build:all": "yarn build && yarn build:isolate", + "test": "yarn test:unit && yarn test:chrome && yarn test:performance", + "test:unit": "nyc ts-mocha --paths 'test/**/*.test.ts' --timeout 10000", + "test:edge": "karma start --browsers Edge", + "test:safari": "karma start --browsers SafariNative", + "test:chrome": "karma start --browsers ChromeHeadless", + "test:firefox": "karma start --browsers Firefox", + "test:isolate": "yarn build:isolate && ts-mocha --paths 'test/IsolationTest/*.ts'", + "test:performance": "gulp performance && node dist/performance/performance/index.js", + "lint": "eslint --fix --color --cache --max-warnings=0 .", + "generate": "typedoc src/index.ts --includeVersion --sort required-first --sort instance-first --sort source-order", + "generate:dev": "yarn generate --watch", + "prepare": "husky install" + }, + "lint-staged": { + "*.{js,ts}": [ + "yarn lint" + ] + }, + "devDependencies": { + "@babel/core": "^7.19.3", + "@babel/plugin-transform-modules-commonjs": "^7.18.6", + "@rollup/plugin-babel": "^5.3.1", + "@rollup/plugin-typescript": "^9.0.2", + "@types/babel__core": "^7.1.19", + "@types/chai": "^3.5.2", + "@types/delete-empty": "^3.0.2", + "@types/gulp": "^4.0.9", + "@types/gulp-babel": "^6.1.30", + "@types/gulp-filter": "^3.0.34", + "@types/gulp-rename": "^2.0.1", + "@types/gulp-sourcemaps": "^0.0.35", + "@types/gulp-tap": "^1.0.1", + "@types/gulp-terser": "^1.2.1", + "@types/gulp-uglify": "^3.0.7", + "@types/karma": "^6.3.3", + "@types/merge-stream": "^1.1.2", + "@types/mocha": "^9.1.1", + "@types/node": "^17.0.0", + "@typescript-eslint/eslint-plugin": "^5.33.1", + "@typescript-eslint/parser": "^5.33.1", + "all-contributors-cli": "^6.20.0", + "babel-plugin-remove-unused-import": "^2.1.1", + "browserslist": "^4.21.3", + "chai": "^3.5.0", + "commitlint": "^17.0.3", + "compare-versions": "^5.0.1", + "conventional-changelog-conventionalcommits": "^5.0.0", + "delete-empty": "^3.0.0", + "eslint": "^8.23.1", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-compat": "^4.0.2", + "eslint-plugin-import": "^2.26.0", + "get-npm-package-version": "^1.1.1", + "gh-pages": "^3.2.3", + "gulp": "^4.0.2", + "gulp-babel": "^8.0.0", + "gulp-clean": "^0.4.0", + "gulp-filter": "^7.0.0", + "gulp-rename": "^2.0.0", + "gulp-sourcemaps": "^3.0.0", + "gulp-tap": "^2.0.0", + "gulp-terser": "^2.1.0", + "gulp-typescript": "^5.0.0", + "gulp-uglify": "^3.0.2", + "husky": "^8.0.1", + "karma": "^6.4.1", + "karma-chrome-launcher": "^3.1.1", + "karma-edge-launcher": "^0.4.2", + "karma-firefox-launcher": "^2.1.2", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-requirejs": "^1.1.0", + "karma-safarinative-launcher": "^1.1.0", + "karma-typescript": "^5.5.3", + "lint-staged": "^13.0.3", + "merge-stream": "^2.0.0", + "mocha": "^9.2.2", + "nyc": "^15.1.0", + "requirejs": "^2.3.6", + "rollup": "^2.79.1", + "rollup-plugin-license": "^3.0.0", + "rollup-plugin-ts": "^3.0.2", + "ts-macros": "^1.3.3", + "ts-mocha": "^10.0.0", + "ts-node": "^10.9.1", + "ts-transform-paths": "^2.0.3", + "tsconfig-paths": "^4.0.0", + "tslib": "^2.4.0", + "ttypescript": "^1.5.13", + "typedoc": "^0.23.10", + "typedoc-plugin-missing-exports": "^1.0.0", + "typescript": "~4.7.4" + }, + "repository": { + "type": "github", + "url": "https://github.com/js-sdsl/js-sdsl.git" + }, + "license": "MIT", + "files": [ + "dist/cjs", + "dist/esm", + "dist/umd", + "CHANGELOG.md" + ], + "keywords": [ + "data", + "structure", + "data structure", + "rbTree", + "rbtree", + "RBTree", + "red black tree", + "ordered", + "set", + "map", + "ordered map", + "ordered set", + "deque", + "heap", + "priority queue", + "link list", + "LinkList", + "linkedList", + "vector", + "stack", + "queue", + "hash", + "hash set", + "hash map", + "c++", + "stl" + ], + "bugs": { + "email": "951711127@qq.com", + "url": "https://github.com/js-sdsl/js-sdsl/issues" + }, + "dependencies": {} +} diff --git a/node_modules/eslint/node_modules/@babel/code-frame/LICENSE b/node_modules/lodash.merge/LICENSE similarity index 52% rename from node_modules/eslint/node_modules/@babel/code-frame/LICENSE rename to node_modules/lodash.merge/LICENSE index f31575ec7..77c42f140 100644 --- a/node_modules/eslint/node_modules/@babel/code-frame/LICENSE +++ b/node_modules/lodash.merge/LICENSE @@ -1,6 +1,16 @@ -MIT License +Copyright OpenJS Foundation and other contributors -Copyright (c) 2014-present Sebastian McKenzie and other contributors +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -20,3 +30,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.merge/README.md b/node_modules/lodash.merge/README.md new file mode 100644 index 000000000..91b75386c --- /dev/null +++ b/node_modules/lodash.merge/README.md @@ -0,0 +1,18 @@ +# lodash.merge v4.6.2 + +The [Lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.merge +``` + +In Node.js: +```js +var merge = require('lodash.merge'); +``` + +See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.merge) for more details. diff --git a/node_modules/lodash.merge/index.js b/node_modules/lodash.merge/index.js new file mode 100644 index 000000000..8e75d955e --- /dev/null +++ b/node_modules/lodash.merge/index.js @@ -0,0 +1,1977 @@ +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = merge; diff --git a/node_modules/lodash.merge/package.json b/node_modules/lodash.merge/package.json new file mode 100644 index 000000000..3130fc8fb --- /dev/null +++ b/node_modules/lodash.merge/package.json @@ -0,0 +1,16 @@ +{ + "name": "lodash.merge", + "version": "4.6.2", + "description": "The Lodash method `_.merge` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, merge", + "author": "John-David Dalton ", + "contributors": [ + "John-David Dalton ", + "Mathias Bynens " + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/minimatch/README.md b/node_modules/minimatch/README.md index ad72b8133..33ede1d6e 100644 --- a/node_modules/minimatch/README.md +++ b/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -171,6 +171,27 @@ Suppress the behavior of treating a leading `!` character as negation. Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.) +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### allowWindowsEscape + +Windows path separator `\` is by default converted to `/`, which +prohibits the usage of `\` as a escape character. This flag skips that +behavior and allows using the escape character. ## Comparisons to other fnmatch/glob implementations diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js index 5b5f8cf44..fda45ade7 100644 --- a/node_modules/minimatch/minimatch.js +++ b/node_modules/minimatch/minimatch.js @@ -1,10 +1,10 @@ module.exports = minimatch minimatch.Minimatch = Minimatch -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') @@ -56,43 +56,64 @@ function filter (pattern, options) { } function ext (a, b) { - a = a || {} b = b || {} var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) Object.keys(a).forEach(function (k) { t[k] = a[k] }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) return t } minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } var orig = minimatch var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) + return orig(p, pattern, ext(def, options)) } m.Minimatch = function Minimatch (pattern, options) { return new orig.Minimatch(pattern, ext(def, options)) } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } return m } Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch return minimatch.defaults(def).Minimatch } function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } + assertValidPattern(pattern) if (!options) options = {} @@ -101,9 +122,6 @@ function minimatch (p, pattern, options) { return false } - // "" only matches "" - if (pattern.trim() === '') return p === '' - return new Minimatch(pattern, options).match(p) } @@ -112,15 +130,14 @@ function Minimatch (pattern, options) { return new Minimatch(pattern, options) } - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } + assertValidPattern(pattern) if (!options) options = {} + pattern = pattern.trim() // windows support: need to use /, not \ - if (path.sep !== '/') { + if (!options.allowWindowsEscape && path.sep !== '/') { pattern = pattern.split(path.sep).join('/') } @@ -131,6 +148,7 @@ function Minimatch (pattern, options) { this.negate = false this.comment = false this.empty = false + this.partial = !!options.partial // make the set of regexps etc. this.make() @@ -140,9 +158,6 @@ Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { - // don't do it more than once. - if (this._made) return - var pattern = this.pattern var options = this.options @@ -162,7 +177,7 @@ function make () { // step 2: expand braces var set = this.globSet = this.braceExpand() - if (options.debug) this.debug = console.error + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } this.debug(this.pattern, set) @@ -242,12 +257,11 @@ function braceExpand (pattern, options) { pattern = typeof pattern === 'undefined' ? this.pattern : pattern - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } + assertValidPattern(pattern) - if (options.nobrace || - !pattern.match(/\{.*\}/)) { + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { // shortcut. no need to expand. return [pattern] } @@ -255,6 +269,17 @@ function braceExpand (pattern, options) { return expand(pattern) } +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full @@ -269,14 +294,17 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } + assertValidPattern(pattern) var options = this.options // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } if (pattern === '') return '' var re = '' @@ -332,10 +360,12 @@ function parse (pattern, isSub) { } switch (c) { - case '/': + /* istanbul ignore next */ + case '/': { // completely not allowed, even escaped. // Should already be path-split by now. return false + } case '\\': clearStateChar() @@ -454,25 +484,23 @@ function parse (pattern, isSub) { // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue } // finish up the class. @@ -556,9 +584,7 @@ function parse (pattern, isSub) { // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true + case '[': case '.': case '(': addPatternStart = true } // Hack to work around lack of negative lookbehind in JS @@ -620,7 +646,7 @@ function parse (pattern, isSub) { var flags = options.nocase ? 'i' : '' try { var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { + } catch (er) /* istanbul ignore next - should be impossible */ { // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line @@ -678,7 +704,7 @@ function makeRe () { try { this.regexp = new RegExp(re, flags) - } catch (ex) { + } catch (ex) /* istanbul ignore next - should be impossible */ { this.regexp = false } return this.regexp @@ -696,8 +722,8 @@ minimatch.match = function (list, pattern, options) { return list } -Minimatch.prototype.match = match -function match (f, partial) { +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. @@ -779,6 +805,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // should be impossible. // some invalid regexp stuff in the set. + /* istanbul ignore if */ if (p === false) return false if (p === GLOBSTAR) { @@ -852,6 +879,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then + /* istanbul ignore if */ if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr) @@ -865,11 +893,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // patterns with magic have been turned into regexps. var hit if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } + hit = f === p this.debug('string match', p, f, hit) } else { hit = f.match(p) @@ -900,16 +924,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // this is ok if we're doing the match as part of // a glob fs traversal. return partial - } else if (pi === pl) { + } else /* istanbul ignore else */ if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd + return (fi === fl - 1) && (file[fi] === '') } // should be unreachable. + /* istanbul ignore next */ throw new Error('wtf?') } diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json index 58d58b3e2..566efdfe4 100644 --- a/node_modules/minimatch/package.json +++ b/node_modules/minimatch/package.json @@ -1,64 +1,33 @@ { - "_from": "minimatch@^3.0.4", - "_id": "minimatch@3.0.4", - "_inBundle": false, - "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "_location": "/minimatch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimatch@^3.0.4", - "name": "minimatch", - "escapedName": "minimatch", - "rawSpec": "^3.0.4", - "saveSpec": null, - "fetchSpec": "^3.0.4" + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" }, - "_requiredBy": [ - "/glob", - "/test-exclude" - ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", - "_spec": "minimatch@^3.0.4", - "_where": "/Users/hcliff/src/github-asana-action/node_modules/test-exclude", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" + "engines": { + "node": "*" }, - "bundleDependencies": false, "dependencies": { "brace-expansion": "^1.1.7" }, - "deprecated": false, - "description": "a glob matcher in javascript", "devDependencies": { - "tap": "^10.3.2" - }, - "engines": { - "node": "*" + "tap": "^15.1.6" }, + "license": "ISC", "files": [ "minimatch.js" - ], - "homepage": "https://github.com/isaacs/minimatch#readme", - "license": "ISC", - "main": "minimatch.js", - "name": "minimatch", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --cov" - }, - "version": "3.0.4" + ] } diff --git a/node_modules/progress/CHANGELOG.md b/node_modules/progress/CHANGELOG.md deleted file mode 100644 index d9be0aa18..000000000 --- a/node_modules/progress/CHANGELOG.md +++ /dev/null @@ -1,115 +0,0 @@ - -2.0.0 / 2017-04-04 -================== - - * Fix: check before using stream.clearLine to prevent crash in Docker - * Fix: fixed output multiline on windows cmd - * Fix: Bug with array length when window is too small - * Fix: Don't clear whole line every time; instead, clear everything after end of line - * Fix: Use `this.stream` instead of `console.log` when terminating a progress bar to ensure that, if a writable stream is provided, it uses that rather than process.stdout - * Fix: Bug causing potentially stale tokens on render - * Feature: configurable cursor - * Feature: feature to interrupt the bar and display a message - * Feature: Add rate reporting to progress bar - * Improvement: Add head option to specify head character - * Improvement: Rename tickTokens to tokens - * Improvement: Change default throttle time to 16ms - * Improvement: Rename renderDelay to renderThrottle - * Improvement: Add delay between render updates - * Docs: Add example and documentation for custom token usage - * Docs: Add head option to readme - * Docs: Updated README example for public use - * Docs: Add renderThrottle option to code documentation - -1.1.7 / 2014-06-30 -================== - - * fixed a bug that occurs when a progress bar attempts to draw itself - on a console with very few columns - -1.1.6 / 2014-06-16 -================== - - * now prevents progress bar from exceeding TTY width by limiting its width to - the with of the TTY - -1.1.5 / 2014-03-25 -================== - - * updated documentation and various other repo maintenance - * updated makefile to run examples with `make` - * removed dependency on readline module - -1.1.4 / 2014-03-14 -================== - - * now supports streams, for example output progress bar to stderr, while piping - stdout - * increases performance and flicker by remembering the last drawn progress bar - -1.1.3 / 2013-12-31 -================== - - * fixes a bug where bar would bug when initializing - * allows to pass updated tokens when ticking or updating the bar - * fixes a bug where the bar would throw if skipping to far - -1.1.2 / 2013-10-17 -================== - - * lets you pass an `fmt` and a `total` instead of an options object - -1.1.0 / 2013-09-18 -================== - - * eta and elapsed tokens default to 0.0 instead of ?.? - * better JSDocs - * added back and forth example - * added method to update the progress bar to a specific percentage - * added an option to hide the bar on completion - -1.0.1 / 2013-08-07 -================== - - * on os x readline now works, reverting the terminal hack - -1.0.0 / 2013-06-18 -================== - - * remove .version - * merge pull request #15 from davglass/readline-osx - * on OSX revert back to terminal hack to avoid a readline bug - -0.1.0 / 2012-09-19 -================== - - * fixed logic bug that caused bar to jump one extra space at the end [davglass] - * working with readline impl, even on Windows [davglass] - * using readline instead of the \r hack [davglass] - -0.0.5 / 2012-08-07 -================== - - * add ability to tick by zero chunks - tick(0) - * fix ETA. Closes #4 [lwille] - -0.0.4 / 2011-11-14 -================== - - * allow more recent versions of node - -0.0.3 / 2011-04-20 -================== - - * changed; erase the line when complete - -0.0.2 / 2011-04-20 -================== - - * added custom tokens support - * fixed; clear line before writing - -0.0.1 / 2010-01-03 -================== - - * initial release diff --git a/node_modules/progress/LICENSE b/node_modules/progress/LICENSE deleted file mode 100644 index 4608b3947..000000000 --- a/node_modules/progress/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2017 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/progress/Makefile b/node_modules/progress/Makefile deleted file mode 100644 index f933be10a..000000000 --- a/node_modules/progress/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -EXAMPLES = $(foreach EXAMPLE, $(wildcard examples/*.js), $(EXAMPLE)) - -.PHONY: test -test: $(EXAMPLES) - -.PHONY: $(EXAMPLES) -$(EXAMPLES): ; node $@ && echo diff --git a/node_modules/progress/Readme.md b/node_modules/progress/Readme.md deleted file mode 100644 index 6d4271abc..000000000 --- a/node_modules/progress/Readme.md +++ /dev/null @@ -1,146 +0,0 @@ -Flexible ascii progress bar. - -## Installation - -```bash -$ npm install progress -``` - -## Usage - -First we create a `ProgressBar`, giving it a format string -as well as the `total`, telling the progress bar when it will -be considered complete. After that all we need to do is `tick()` appropriately. - -```javascript -var ProgressBar = require('progress'); - -var bar = new ProgressBar(':bar', { total: 10 }); -var timer = setInterval(function () { - bar.tick(); - if (bar.complete) { - console.log('\ncomplete\n'); - clearInterval(timer); - } -}, 100); -``` - -### Options - -These are keys in the options object you can pass to the progress bar along with -`total` as seen in the example above. - -- `curr` current completed index -- `total` total number of ticks to complete -- `width` the displayed width of the progress bar defaulting to total -- `stream` the output stream defaulting to stderr -- `head` head character defaulting to complete character -- `complete` completion character defaulting to "=" -- `incomplete` incomplete character defaulting to "-" -- `renderThrottle` minimum time between updates in milliseconds defaulting to 16 -- `clear` option to clear the bar on completion defaulting to false -- `callback` optional function to call when the progress bar completes - -### Tokens - -These are tokens you can use in the format of your progress bar. - -- `:bar` the progress bar itself -- `:current` current tick number -- `:total` total ticks -- `:elapsed` time elapsed in seconds -- `:percent` completion percentage -- `:eta` estimated completion time in seconds -- `:rate` rate of ticks per second - -### Custom Tokens - -You can define custom tokens by adding a `{'name': value}` object parameter to your method (`tick()`, `update()`, etc.) calls. - -```javascript -var bar = new ProgressBar(':current: :token1 :token2', { total: 3 }) -bar.tick({ - 'token1': "Hello", - 'token2': "World!\n" -}) -bar.tick(2, { - 'token1': "Goodbye", - 'token2': "World!" -}) -``` -The above example would result in the output below. - -``` -1: Hello World! -3: Goodbye World! -``` - -## Examples - -### Download - -In our download example each tick has a variable influence, so we pass the chunk -length which adjusts the progress bar appropriately relative to the total -length. - -```javascript -var ProgressBar = require('progress'); -var https = require('https'); - -var req = https.request({ - host: 'download.github.com', - port: 443, - path: '/visionmedia-node-jscoverage-0d4608a.zip' -}); - -req.on('response', function(res){ - var len = parseInt(res.headers['content-length'], 10); - - console.log(); - var bar = new ProgressBar(' downloading [:bar] :rate/bps :percent :etas', { - complete: '=', - incomplete: ' ', - width: 20, - total: len - }); - - res.on('data', function (chunk) { - bar.tick(chunk.length); - }); - - res.on('end', function () { - console.log('\n'); - }); -}); - -req.end(); -``` - -The above example result in a progress bar like the one below. - -``` -downloading [===== ] 39/bps 29% 3.7s -``` - -### Interrupt - -To display a message during progress bar execution, use `interrupt()` -```javascript -var ProgressBar = require('progress'); - -var bar = new ProgressBar(':bar :current/:total', { total: 10 }); -var timer = setInterval(function () { - bar.tick(); - if (bar.complete) { - clearInterval(timer); - } else if (bar.curr === 5) { - bar.interrupt('this message appears above the progress bar\ncurrent progress is ' + bar.curr + '/' + bar.total); - } -}, 1000); -``` - -You can see more examples in the `examples` folder. - -## License - -MIT diff --git a/node_modules/progress/index.js b/node_modules/progress/index.js deleted file mode 100644 index 4449dd30d..000000000 --- a/node_modules/progress/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/node-progress'); diff --git a/node_modules/progress/lib/node-progress.js b/node_modules/progress/lib/node-progress.js deleted file mode 100644 index 8eb0740a7..000000000 --- a/node_modules/progress/lib/node-progress.js +++ /dev/null @@ -1,236 +0,0 @@ -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Expose `ProgressBar`. - */ - -exports = module.exports = ProgressBar; - -/** - * Initialize a `ProgressBar` with the given `fmt` string and `options` or - * `total`. - * - * Options: - * - * - `curr` current completed index - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stderr - * - `head` head character defaulting to complete character - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 - * - `callback` optional function to call when the progress bar completes - * - `clear` will clear the progress bar upon termination - * - * Tokens: - * - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - `:rate` rate of ticks per second - * - * @param {string} fmt - * @param {object|number} options or total - * @api public - */ - -function ProgressBar(fmt, options) { - this.stream = options.stream || process.stderr; - - if (typeof(options) == 'number') { - var total = options; - options = {}; - options.total = total; - } else { - options = options || {}; - if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); - } - - this.fmt = fmt; - this.curr = options.curr || 0; - this.total = options.total; - this.width = options.width || this.total; - this.clear = options.clear - this.chars = { - complete : options.complete || '=', - incomplete : options.incomplete || '-', - head : options.head || (options.complete || '=') - }; - this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0; - this.lastRender = -Infinity; - this.callback = options.callback || function () {}; - this.tokens = {}; - this.lastDraw = ''; -} - -/** - * "tick" the progress bar with optional `len` and optional `tokens`. - * - * @param {number|object} len or tokens - * @param {object} tokens - * @api public - */ - -ProgressBar.prototype.tick = function(len, tokens){ - if (len !== 0) - len = len || 1; - - // swap tokens - if ('object' == typeof len) tokens = len, len = 1; - if (tokens) this.tokens = tokens; - - // start time for eta - if (0 == this.curr) this.start = new Date; - - this.curr += len - - // try to render - this.render(); - - // progress complete - if (this.curr >= this.total) { - this.render(undefined, true); - this.complete = true; - this.terminate(); - this.callback(this); - return; - } -}; - -/** - * Method to render the progress bar with optional `tokens` to place in the - * progress bar's `fmt` field. - * - * @param {object} tokens - * @api public - */ - -ProgressBar.prototype.render = function (tokens, force) { - force = force !== undefined ? force : false; - if (tokens) this.tokens = tokens; - - if (!this.stream.isTTY) return; - - var now = Date.now(); - var delta = now - this.lastRender; - if (!force && (delta < this.renderThrottle)) { - return; - } else { - this.lastRender = now; - } - - var ratio = this.curr / this.total; - ratio = Math.min(Math.max(ratio, 0), 1); - - var percent = Math.floor(ratio * 100); - var incomplete, complete, completeLength; - var elapsed = new Date - this.start; - var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); - var rate = this.curr / (elapsed / 1000); - - /* populate the bar template with percentages and timestamps */ - var str = this.fmt - .replace(':current', this.curr) - .replace(':total', this.total) - .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) - .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) - .toFixed(1)) - .replace(':percent', percent.toFixed(0) + '%') - .replace(':rate', Math.round(rate)); - - /* compute the available space (non-zero) for the bar */ - var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); - if(availableSpace && process.platform === 'win32'){ - availableSpace = availableSpace - 1; - } - - var width = Math.min(this.width, availableSpace); - - /* TODO: the following assumes the user has one ':bar' token */ - completeLength = Math.round(width * ratio); - complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); - incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); - - /* add head to the complete string */ - if(completeLength > 0) - complete = complete.slice(0, -1) + this.chars.head; - - /* fill in the actual progress bar */ - str = str.replace(':bar', complete + incomplete); - - /* replace the extra tokens */ - if (this.tokens) for (var key in this.tokens) str = str.replace(':' + key, this.tokens[key]); - - if (this.lastDraw !== str) { - this.stream.cursorTo(0); - this.stream.write(str); - this.stream.clearLine(1); - this.lastDraw = str; - } -}; - -/** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - * - * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the - * overall completion to. - * @api public - */ - -ProgressBar.prototype.update = function (ratio, tokens) { - var goal = Math.floor(ratio * this.total); - var delta = goal - this.curr; - - this.tick(delta, tokens); -}; - -/** - * "interrupt" the progress bar and write a message above it. - * @param {string} message The message to write. - * @api public - */ - -ProgressBar.prototype.interrupt = function (message) { - // clear the current line - this.stream.clearLine(); - // move the cursor to the start of the line - this.stream.cursorTo(0); - // write the message text - this.stream.write(message); - // terminate the line after writing the message - this.stream.write('\n'); - // re-display the progress bar with its lastDraw - this.stream.write(this.lastDraw); -}; - -/** - * Terminates a progress bar. - * - * @api public - */ - -ProgressBar.prototype.terminate = function () { - if (this.clear) { - if (this.stream.clearLine) { - this.stream.clearLine(); - this.stream.cursorTo(0); - } - } else { - this.stream.write('\n'); - } -}; diff --git a/node_modules/progress/package.json b/node_modules/progress/package.json deleted file mode 100644 index e19d6bde9..000000000 --- a/node_modules/progress/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "progress@^2.0.0", - "_id": "progress@2.0.3", - "_inBundle": false, - "_integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "_location": "/progress", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "progress@^2.0.0", - "name": "progress", - "escapedName": "progress", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "_shasum": "7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8", - "_spec": "progress@^2.0.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "bugs": { - "url": "https://github.com/visionmedia/node-progress/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Christoffer Hallas", - "email": "christoffer.hallas@gmail.com" - }, - { - "name": "Jordan Scales", - "email": "scalesjordan@gmail.com" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - }, - { - "name": "Marco Brack", - "email": "PapstDonB@Googlemail.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Flexible ascii progress bar", - "engines": { - "node": ">=0.4.0" - }, - "homepage": "https://github.com/visionmedia/node-progress#readme", - "keywords": [ - "cli", - "progress" - ], - "license": "MIT", - "main": "./index.js", - "name": "progress", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress.git" - }, - "version": "2.0.3" -} diff --git a/node_modules/queue-microtask/LICENSE b/node_modules/queue-microtask/LICENSE new file mode 100755 index 000000000..c7e685275 --- /dev/null +++ b/node_modules/queue-microtask/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/queue-microtask/README.md b/node_modules/queue-microtask/README.md new file mode 100644 index 000000000..0be05a64f --- /dev/null +++ b/node_modules/queue-microtask/README.md @@ -0,0 +1,90 @@ +# queue-microtask [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[ci-image]: https://img.shields.io/github/workflow/status/feross/queue-microtask/ci/master +[ci-url]: https://github.com/feross/queue-microtask/actions +[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg +[npm-url]: https://npmjs.org/package/queue-microtask +[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg +[downloads-url]: https://npmjs.org/package/queue-microtask +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines + +- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all modern JS engines. +- No dependencies. Less than 10 lines. No shims or complicated fallbacks. +- Optimal performance in all modern environments + - Uses `queueMicrotask` in modern environments + - Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (same performance as `queueMicrotask`) + +## install + +``` +npm install queue-microtask +``` + +## usage + +```js +const queueMicrotask = require('queue-microtask') + +queueMicrotask(() => { /* this will run soon */ }) +``` + +## What is `queueMicrotask` and why would one use it? + +The `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop. + +A microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop. + +The code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node. + +Using microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context. + +See the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information. + +## Who is this package for? + +This package allows you to use `queueMicrotask` safely in all modern JS engines. Use it if you prioritize small JS bundle size over support for old browsers. + +If you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package. + +## Why not use `process.nextTick`? + +In Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations. + +You can think of `queueMicrotask` as a standardized version of `process.nextTick` that works in the browser. No need to rely on your browser bundler to shim `process` for the browser environment. + +## Why not use `setTimeout(fn, 0)`? + +This approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program. + +## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)? + +These packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package. + +This package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically. + +Note: This package throws an exception in JS environments which lack `Promise` support -- which are usually very old browsers and Node.js versions. + +Since the `queueMicrotask` API is supported in Node.js, Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get optimal performance**. Any JS environment with `Promise`, which is almost all of them, also get optimal performance. If you need support for JS environments which lack `Promise` support, use one of the alternative packages. + +## What is a shim? + +> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. – [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing)) + +This package could also be described as a "ponyfill". + +> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. – [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills) + +## API + +### `queueMicrotask(fn)` + +The `queueMicrotask()` method queues a microtask. + +The `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop. + +## license + +MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org). diff --git a/node_modules/queue-microtask/index.d.ts b/node_modules/queue-microtask/index.d.ts new file mode 100644 index 000000000..b6a864632 --- /dev/null +++ b/node_modules/queue-microtask/index.d.ts @@ -0,0 +1,2 @@ +declare const queueMicrotask: (cb: () => void) => void +export = queueMicrotask diff --git a/node_modules/queue-microtask/index.js b/node_modules/queue-microtask/index.js new file mode 100644 index 000000000..55605343a --- /dev/null +++ b/node_modules/queue-microtask/index.js @@ -0,0 +1,9 @@ +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ +let promise + +module.exports = typeof queueMicrotask === 'function' + ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) + // reuse resolved promise, and allocate it lazily + : cb => (promise || (promise = Promise.resolve())) + .then(cb) + .catch(err => setTimeout(() => { throw err }, 0)) diff --git a/node_modules/queue-microtask/package.json b/node_modules/queue-microtask/package.json new file mode 100644 index 000000000..d29a401f5 --- /dev/null +++ b/node_modules/queue-microtask/package.json @@ -0,0 +1,55 @@ +{ + "name": "queue-microtask", + "description": "fast, tiny `queueMicrotask` shim for modern engines", + "version": "1.2.3", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/queue-microtask/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.2.2" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "homepage": "https://github.com/feross/queue-microtask", + "keywords": [ + "asap", + "immediate", + "micro task", + "microtask", + "nextTick", + "process.nextTick", + "queue micro task", + "queue microtask", + "queue-microtask", + "queueMicrotask", + "setImmediate", + "task" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/queue-microtask.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/regexpp/index.d.ts b/node_modules/regexpp/index.d.ts deleted file mode 100644 index 7943c6395..000000000 --- a/node_modules/regexpp/index.d.ts +++ /dev/null @@ -1,247 +0,0 @@ -// Generated by dts-bundle v0.7.3 - -declare module 'regexpp' { - import * as AST from "regexpp/ast"; - import { RegExpParser } from "regexpp/parser"; - import { RegExpValidator } from "regexpp/validator"; - import { RegExpVisitor } from "regexpp/visitor"; - export { AST, RegExpParser, RegExpValidator }; - export function parseRegExpLiteral(source: string | RegExp, options?: RegExpParser.Options): AST.RegExpLiteral; - export function validateRegExpLiteral(source: string, options?: RegExpValidator.Options): void; - export function visitRegExpAST(node: AST.Node, handlers: RegExpVisitor.Handlers): void; -} - -declare module 'regexpp/ast' { - export type Node = BranchNode | LeafNode; - export type BranchNode = RegExpLiteral | Pattern | Alternative | Group | CapturingGroup | Quantifier | CharacterClass | LookaroundAssertion | CharacterClassRange; - export type LeafNode = BoundaryAssertion | CharacterSet | Character | Backreference | Flags; - export type Element = Assertion | Quantifier | QuantifiableElement; - export type QuantifiableElement = Group | CapturingGroup | CharacterClass | CharacterSet | Character | Backreference | LookaheadAssertion; - export type CharacterClassElement = EscapeCharacterSet | UnicodePropertyCharacterSet | Character | CharacterClassRange; - export interface NodeBase { - type: Node["type"]; - parent: Node["parent"]; - start: number; - end: number; - raw: string; - } - export interface RegExpLiteral extends NodeBase { - type: "RegExpLiteral"; - parent: null; - pattern: Pattern; - flags: Flags; - } - export interface Pattern extends NodeBase { - type: "Pattern"; - parent: RegExpLiteral | null; - alternatives: Alternative[]; - } - export interface Alternative extends NodeBase { - type: "Alternative"; - parent: Pattern | Group | CapturingGroup | LookaroundAssertion; - elements: Element[]; - } - export interface Group extends NodeBase { - type: "Group"; - parent: Alternative | Quantifier; - alternatives: Alternative[]; - } - export interface CapturingGroup extends NodeBase { - type: "CapturingGroup"; - parent: Alternative | Quantifier; - name: string | null; - alternatives: Alternative[]; - references: Backreference[]; - } - export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion; - export interface LookaheadAssertion extends NodeBase { - type: "Assertion"; - parent: Alternative | Quantifier; - kind: "lookahead"; - negate: boolean; - alternatives: Alternative[]; - } - export interface LookbehindAssertion extends NodeBase { - type: "Assertion"; - parent: Alternative; - kind: "lookbehind"; - negate: boolean; - alternatives: Alternative[]; - } - export interface Quantifier extends NodeBase { - type: "Quantifier"; - parent: Alternative; - min: number; - max: number; - greedy: boolean; - element: QuantifiableElement; - } - export interface CharacterClass extends NodeBase { - type: "CharacterClass"; - parent: Alternative | Quantifier; - negate: boolean; - elements: CharacterClassElement[]; - } - export interface CharacterClassRange extends NodeBase { - type: "CharacterClassRange"; - parent: CharacterClass; - min: Character; - max: Character; - } - export type Assertion = BoundaryAssertion | LookaroundAssertion; - export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion; - export interface EdgeAssertion extends NodeBase { - type: "Assertion"; - parent: Alternative | Quantifier; - kind: "start" | "end"; - } - export interface WordBoundaryAssertion extends NodeBase { - type: "Assertion"; - parent: Alternative | Quantifier; - kind: "word"; - negate: boolean; - } - export type CharacterSet = AnyCharacterSet | EscapeCharacterSet | UnicodePropertyCharacterSet; - export interface AnyCharacterSet extends NodeBase { - type: "CharacterSet"; - parent: Alternative | Quantifier; - kind: "any"; - } - export interface EscapeCharacterSet extends NodeBase { - type: "CharacterSet"; - parent: Alternative | Quantifier | CharacterClass; - kind: "digit" | "space" | "word"; - negate: boolean; - } - export interface UnicodePropertyCharacterSet extends NodeBase { - type: "CharacterSet"; - parent: Alternative | Quantifier | CharacterClass; - kind: "property"; - key: string; - value: string | null; - negate: boolean; - } - export interface Character extends NodeBase { - type: "Character"; - parent: Alternative | Quantifier | CharacterClass | CharacterClassRange; - value: number; - } - export interface Backreference extends NodeBase { - type: "Backreference"; - parent: Alternative | Quantifier; - ref: number | string; - resolved: CapturingGroup; - } - export interface Flags extends NodeBase { - type: "Flags"; - parent: RegExpLiteral | null; - dotAll: boolean; - global: boolean; - ignoreCase: boolean; - multiline: boolean; - sticky: boolean; - unicode: boolean; - } -} - -declare module 'regexpp/parser' { - import { Flags, RegExpLiteral, Pattern } from "regexpp/ast"; - import { EcmaVersion } from "regexpp/ecma-versions"; - export namespace RegExpParser { - interface Options { - strict?: boolean; - ecmaVersion?: EcmaVersion; - } - } - export class RegExpParser { - constructor(options?: RegExpParser.Options); - parseLiteral(source: string, start?: number, end?: number): RegExpLiteral; - parseFlags(source: string, start?: number, end?: number): Flags; - parsePattern(source: string, start?: number, end?: number, uFlag?: boolean): Pattern; - } -} - -declare module 'regexpp/validator' { - import { EcmaVersion } from "regexpp/ecma-versions"; - export namespace RegExpValidator { - interface Options { - strict?: boolean; - ecmaVersion?: EcmaVersion; - onLiteralEnter?(start: number): void; - onLiteralLeave?(start: number, end: number): void; - onFlags?(start: number, end: number, global: boolean, ignoreCase: boolean, multiline: boolean, unicode: boolean, sticky: boolean, dotAll: boolean): void; - onPatternEnter?(start: number): void; - onPatternLeave?(start: number, end: number): void; - onDisjunctionEnter?(start: number): void; - onDisjunctionLeave?(start: number, end: number): void; - onAlternativeEnter?(start: number, index: number): void; - onAlternativeLeave?(start: number, end: number, index: number): void; - onGroupEnter?(start: number): void; - onGroupLeave?(start: number, end: number): void; - onCapturingGroupEnter?(start: number, name: string | null): void; - onCapturingGroupLeave?(start: number, end: number, name: string | null): void; - onQuantifier?(start: number, end: number, min: number, max: number, greedy: boolean): void; - onLookaroundAssertionEnter?(start: number, kind: "lookahead" | "lookbehind", negate: boolean): void; - onLookaroundAssertionLeave?(start: number, end: number, kind: "lookahead" | "lookbehind", negate: boolean): void; - onEdgeAssertion?(start: number, end: number, kind: "start" | "end"): void; - onWordBoundaryAssertion?(start: number, end: number, kind: "word", negate: boolean): void; - onAnyCharacterSet?(start: number, end: number, kind: "any"): void; - onEscapeCharacterSet?(start: number, end: number, kind: "digit" | "space" | "word", negate: boolean): void; - onUnicodePropertyCharacterSet?(start: number, end: number, kind: "property", key: string, value: string | null, negate: boolean): void; - onCharacter?(start: number, end: number, value: number): void; - onBackreference?(start: number, end: number, ref: number | string): void; - onCharacterClassEnter?(start: number, negate: boolean): void; - onCharacterClassLeave?(start: number, end: number, negate: boolean): void; - onCharacterClassRange?(start: number, end: number, min: number, max: number): void; - } - } - export class RegExpValidator { - constructor(options?: RegExpValidator.Options); - validateLiteral(source: string, start?: number, end?: number): void; - validateFlags(source: string, start?: number, end?: number): void; - validatePattern(source: string, start?: number, end?: number, uFlag?: boolean): void; - } -} - -declare module 'regexpp/visitor' { - import { Alternative, Assertion, Backreference, CapturingGroup, Character, CharacterClass, CharacterClassRange, CharacterSet, Flags, Group, Node, Pattern, Quantifier, RegExpLiteral } from "regexpp/ast"; - export class RegExpVisitor { - constructor(handlers: RegExpVisitor.Handlers); - visit(node: Node): void; - } - export namespace RegExpVisitor { - interface Handlers { - onAlternativeEnter?(node: Alternative): void; - onAlternativeLeave?(node: Alternative): void; - onAssertionEnter?(node: Assertion): void; - onAssertionLeave?(node: Assertion): void; - onBackreferenceEnter?(node: Backreference): void; - onBackreferenceLeave?(node: Backreference): void; - onCapturingGroupEnter?(node: CapturingGroup): void; - onCapturingGroupLeave?(node: CapturingGroup): void; - onCharacterEnter?(node: Character): void; - onCharacterLeave?(node: Character): void; - onCharacterClassEnter?(node: CharacterClass): void; - onCharacterClassLeave?(node: CharacterClass): void; - onCharacterClassRangeEnter?(node: CharacterClassRange): void; - onCharacterClassRangeLeave?(node: CharacterClassRange): void; - onCharacterSetEnter?(node: CharacterSet): void; - onCharacterSetLeave?(node: CharacterSet): void; - onFlagsEnter?(node: Flags): void; - onFlagsLeave?(node: Flags): void; - onGroupEnter?(node: Group): void; - onGroupLeave?(node: Group): void; - onPatternEnter?(node: Pattern): void; - onPatternLeave?(node: Pattern): void; - onQuantifierEnter?(node: Quantifier): void; - onQuantifierLeave?(node: Quantifier): void; - onRegExpLiteralEnter?(node: RegExpLiteral): void; - onRegExpLiteralLeave?(node: RegExpLiteral): void; - } - } -} - -declare module 'regexpp/ecma-versions' { - export type EcmaVersion = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020; -} - diff --git a/node_modules/regexpp/index.js.map b/node_modules/regexpp/index.js.map deleted file mode 100644 index 68fc68e63..000000000 --- a/node_modules/regexpp/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\index.ts"}],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAE3D,SAAgB,SAAS,CAAC,EAAU;IAChC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;CAC5B;AAED,SAAgB,YAAY,CAAC,EAAU;IACnC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAA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AA;CAC1C;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/regexpp/index.mjs.map b/node_modules/regexpp/index.mjs.map deleted file mode 100644 index ee329beb5..000000000 --- a/node_modules/regexpp/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.AD\\dev\\regexpp\\.temp\\src\\index.ts"}],"names":[],"mappings":";;;;;;;AAIA,IA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I,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;SAC5C;KACJ;CACJ;;SCzLe,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B;IAE9B,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;CAChE;AAOD,SAAgB,qBAAqB,CACjC,MAAc,EACd,OAAiC;IAEjC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;CAC9D;AAED,SAAgB,cAAc,CAC1B,IAAc,EACd,QAAgC;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;CAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/regexpp/package.json b/node_modules/regexpp/package.json deleted file mode 100644 index 1412b824e..000000000 --- a/node_modules/regexpp/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "_from": "regexpp@^3.1.0", - "_id": "regexpp@3.1.0", - "_inBundle": false, - "_integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "_location": "/regexpp", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "regexpp@^3.1.0", - "name": "regexpp", - "escapedName": "regexpp", - "rawSpec": "^3.1.0", - "saveSpec": null, - "fetchSpec": "^3.1.0" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "_shasum": "206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2", - "_spec": "regexpp@^3.1.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/mysticatea/regexpp/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Regular expression parser for ECMAScript.", - "devDependencies": { - "@mysticatea/eslint-plugin": "^11.0.0", - "@types/eslint": "^4.16.2", - "@types/jsdom": "^12.2.4", - "@types/mocha": "^5.2.2", - "@types/node": "^12.6.8", - "codecov": "^3.5.0", - "dts-bundle": "^0.7.3", - "eslint": "^6.1.0", - "jsdom": "^15.1.1", - "mocha": "^6.2.0", - "npm-run-all": "^4.1.5", - "nyc": "^14.1.1", - "rimraf": "^2.6.2", - "rollup": "^1.17.0", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-sourcemaps": "^0.4.2", - "ts-node": "^8.3.0", - "typescript": "^3.5.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.*" - ], - "funding": "https://github.com/sponsors/mysticatea", - "homepage": "https://github.com/mysticatea/regexpp#readme", - "keywords": [ - "regexp", - "regular", - "expression", - "parser", - "validator", - "ast", - "abstract", - "syntax", - "tree", - "ecmascript", - "es2015", - "es2016", - "es2017", - "es2018", - "es2019", - "es2020", - "annexB" - ], - "license": "MIT", - "main": "index", - "name": "regexpp", - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/regexpp.git" - }, - "scripts": { - "build": "run-s build:*", - "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", - "build:rollup": "rollup -c", - "build:tsc": "tsc --module es2015", - "clean": "rimraf .temp index.*", - "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", - "lint": "eslint scripts src test --ext .ts", - "postversion": "git push && git push --tags", - "prebuild": "npm run -s clean", - "pretest": "run-s build lint", - "preversion": "npm test", - "prewatch": "npm run -s clean", - "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", - "update:test": "ts-node scripts/update-fixtures.ts", - "update:unicode": "run-s update:unicode:*", - "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", - "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", - "version": "npm run -s build", - "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" - }, - "version": "3.1.0" -} diff --git a/node_modules/require-from-string/index.js b/node_modules/require-from-string/index.js deleted file mode 100644 index cb5595fde..000000000 --- a/node_modules/require-from-string/index.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Module = require('module'); -var path = require('path'); - -module.exports = function requireFromString(code, filename, opts) { - if (typeof filename === 'object') { - opts = filename; - filename = undefined; - } - - opts = opts || {}; - filename = filename || ''; - - opts.appendPaths = opts.appendPaths || []; - opts.prependPaths = opts.prependPaths || []; - - if (typeof code !== 'string') { - throw new Error('code must be a string, not ' + typeof code); - } - - var paths = Module._nodeModulePaths(path.dirname(filename)); - - var parent = module.parent; - var m = new Module(filename, parent); - m.filename = filename; - m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths); - m._compile(code, filename); - - var exports = m.exports; - parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1); - - return exports; -}; diff --git a/node_modules/require-from-string/license b/node_modules/require-from-string/license deleted file mode 100644 index 1aeb74fd2..000000000 --- a/node_modules/require-from-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -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/require-from-string/package.json b/node_modules/require-from-string/package.json deleted file mode 100644 index 22cdcf452..000000000 --- a/node_modules/require-from-string/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "require-from-string@^2.0.2", - "_id": "require-from-string@2.0.2", - "_inBundle": false, - "_integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "_location": "/require-from-string", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "require-from-string@^2.0.2", - "name": "require-from-string", - "escapedName": "require-from-string", - "rawSpec": "^2.0.2", - "saveSpec": null, - "fetchSpec": "^2.0.2" - }, - "_requiredBy": [ - "/table/ajv" - ], - "_resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "_shasum": "89a7fdd938261267318eafe14f9c32e598c36909", - "_spec": "require-from-string@^2.0.2", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/table/node_modules/ajv", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/require-from-string/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Require module from string", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/require-from-string#readme", - "keywords": [], - "license": "MIT", - "name": "require-from-string", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/require-from-string.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.2" -} diff --git a/node_modules/require-from-string/readme.md b/node_modules/require-from-string/readme.md deleted file mode 100644 index 88b3236f8..000000000 --- a/node_modules/require-from-string/readme.md +++ /dev/null @@ -1,56 +0,0 @@ -# require-from-string [![Build Status](https://travis-ci.org/floatdrop/require-from-string.svg?branch=master)](https://travis-ci.org/floatdrop/require-from-string) - -Load module from string in Node. - -## Install - -``` -$ npm install --save require-from-string -``` - - -## Usage - -```js -var requireFromString = require('require-from-string'); - -requireFromString('module.exports = 1'); -//=> 1 -``` - - -## API - -### requireFromString(code, [filename], [options]) - -#### code - -*Required* -Type: `string` - -Module code. - -#### filename -Type: `string` -Default: `''` - -Optional filename. - - -#### options -Type: `object` - -##### appendPaths -Type: `Array` - -List of `paths`, that will be appended to module `paths`. Useful, when you want -to be able require modules from these paths. - -##### prependPaths -Type: `Array` - -Same as `appendPaths`, but paths will be prepended. - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/reusify/.coveralls.yml b/node_modules/reusify/.coveralls.yml new file mode 100644 index 000000000..359f68349 --- /dev/null +++ b/node_modules/reusify/.coveralls.yml @@ -0,0 +1 @@ +repo_token: yIxhFqtaaz5iGVYfie9mODehFYogm8S8L diff --git a/node_modules/reusify/.travis.yml b/node_modules/reusify/.travis.yml new file mode 100644 index 000000000..197047681 --- /dev/null +++ b/node_modules/reusify/.travis.yml @@ -0,0 +1,28 @@ +language: node_js +sudo: false + +node_js: + - 9 + - 8 + - 7 + - 6 + - 5 + - 4 + - 4.0 + - iojs-v3 + - iojs-v2 + - iojs-v1 + - 0.12 + - 0.10 + +cache: + directories: + - node_modules + +after_script: +- npm run coverage + +notifications: + email: + on_success: never + on_failure: always diff --git a/node_modules/table/node_modules/ajv/LICENSE b/node_modules/reusify/LICENSE similarity index 96% rename from node_modules/table/node_modules/ajv/LICENSE rename to node_modules/reusify/LICENSE index 139162ad2..fbf3a01d8 100644 --- a/node_modules/table/node_modules/ajv/LICENSE +++ b/node_modules/reusify/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2021 Evgeny Poberezkin +Copyright (c) 2015 Matteo Collina Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/reusify/README.md b/node_modules/reusify/README.md new file mode 100644 index 000000000..badcb7ccf --- /dev/null +++ b/node_modules/reusify/README.md @@ -0,0 +1,145 @@ +# reusify + +[![npm version][npm-badge]][npm-url] +[![Build Status][travis-badge]][travis-url] +[![Coverage Status][coveralls-badge]][coveralls-url] + +Reuse your objects and functions for maximum speed. This technique will +make any function run ~10% faster. You call your functions a +lot, and it adds up quickly in hot code paths. + +``` +$ node benchmarks/createNoCodeFunction.js +Total time 53133 +Total iterations 100000000 +Iteration/s 1882069.5236482036 + +$ node benchmarks/reuseNoCodeFunction.js +Total time 50617 +Total iterations 100000000 +Iteration/s 1975620.838848608 +``` + +The above benchmark uses fibonacci to simulate a real high-cpu load. +The actual numbers might differ for your use case, but the difference +should not. + +The benchmark was taken using Node v6.10.0. + +This library was extracted from +[fastparallel](http://npm.im/fastparallel). + +## Example + +```js +var reusify = require('reusify') +var fib = require('reusify/benchmarks/fib') +var instance = reusify(MyObject) + +// get an object from the cache, +// or creates a new one when cache is empty +var obj = instance.get() + +// set the state +obj.num = 100 +obj.func() + +// reset the state. +// if the state contains any external object +// do not use delete operator (it is slow) +// prefer set them to null +obj.num = 0 + +// store an object in the cache +instance.release(obj) + +function MyObject () { + // you need to define this property + // so V8 can compile MyObject into an + // hidden class + this.next = null + this.num = 0 + + var that = this + + // this function is never reallocated, + // so it can be optimized by V8 + this.func = function () { + if (null) { + // do nothing + } else { + // calculates fibonacci + fib(that.num) + } + } +} +``` + +The above example was intended for synchronous code, let's see async: +```js +var reusify = require('reusify') +var instance = reusify(MyObject) + +for (var i = 0; i < 100; i++) { + getData(i, console.log) +} + +function getData (value, cb) { + var obj = instance.get() + + obj.value = value + obj.cb = cb + obj.run() +} + +function MyObject () { + this.next = null + this.value = null + + var that = this + + this.run = function () { + asyncOperation(that.value, that.handle) + } + + this.handle = function (err, result) { + that.cb(err, result) + that.value = null + that.cb = null + instance.release(that) + } +} +``` + +Also note how in the above examples, the code, that consumes an istance of `MyObject`, +reset the state to initial condition, just before storing it in the cache. +That's needed so that every subsequent request for an instance from the cache, +could get a clean instance. + +## Why + +It is faster because V8 doesn't have to collect all the functions you +create. On a short-lived benchmark, it is as fast as creating the +nested function, but on a longer time frame it creates less +pressure on the garbage collector. + +## Other examples +If you want to see some complex example, checkout [middie](https://github.com/fastify/middie) and [steed](https://github.com/mcollina/steed). + +## Acknowledgements + +Thanks to [Trevor Norris](https://github.com/trevnorris) for +getting me down the rabbit hole of performance, and thanks to [Mathias +Buss](http://github.com/mafintosh) for suggesting me to share this +trick. + +## License + +MIT + +[npm-badge]: https://badge.fury.io/js/reusify.svg +[npm-url]: https://badge.fury.io/js/reusify +[travis-badge]: https://api.travis-ci.org/mcollina/reusify.svg +[travis-url]: https://travis-ci.org/mcollina/reusify +[coveralls-badge]: https://coveralls.io/repos/mcollina/reusify/badge.svg?branch=master&service=github +[coveralls-url]: https://coveralls.io/github/mcollina/reusify?branch=master diff --git a/node_modules/reusify/benchmarks/createNoCodeFunction.js b/node_modules/reusify/benchmarks/createNoCodeFunction.js new file mode 100644 index 000000000..ce1aac7b7 --- /dev/null +++ b/node_modules/reusify/benchmarks/createNoCodeFunction.js @@ -0,0 +1,30 @@ +'use strict' + +var fib = require('./fib') +var max = 100000000 +var start = Date.now() + +// create a funcion with the typical error +// pattern, that delegates the heavy load +// to something else +function createNoCodeFunction () { + /* eslint no-constant-condition: "off" */ + var num = 100 + + ;(function () { + if (null) { + // do nothing + } else { + fib(num) + } + })() +} + +for (var i = 0; i < max; i++) { + createNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/benchmarks/fib.js b/node_modules/reusify/benchmarks/fib.js new file mode 100644 index 000000000..e22cc48de --- /dev/null +++ b/node_modules/reusify/benchmarks/fib.js @@ -0,0 +1,13 @@ +'use strict' + +function fib (num) { + var fib = [] + + fib[0] = 0 + fib[1] = 1 + for (var i = 2; i <= num; i++) { + fib[i] = fib[i - 2] + fib[i - 1] + } +} + +module.exports = fib diff --git a/node_modules/reusify/benchmarks/reuseNoCodeFunction.js b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js new file mode 100644 index 000000000..3358d6e50 --- /dev/null +++ b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js @@ -0,0 +1,38 @@ +'use strict' + +var reusify = require('../') +var fib = require('./fib') +var instance = reusify(MyObject) +var max = 100000000 +var start = Date.now() + +function reuseNoCodeFunction () { + var obj = instance.get() + obj.num = 100 + obj.func() + obj.num = 0 + instance.release(obj) +} + +function MyObject () { + this.next = null + var that = this + this.num = 0 + this.func = function () { + /* eslint no-constant-condition: "off" */ + if (null) { + // do nothing + } else { + fib(that.num) + } + } +} + +for (var i = 0; i < max; i++) { + reuseNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/package.json b/node_modules/reusify/package.json new file mode 100644 index 000000000..ee66aeecb --- /dev/null +++ b/node_modules/reusify/package.json @@ -0,0 +1,45 @@ +{ + "name": "reusify", + "version": "1.0.4", + "description": "Reuse objects and functions with style", + "main": "reusify.js", + "scripts": { + "lint": "standard", + "test": "tape test.js | faucet", + "istanbul": "istanbul cover tape test.js", + "coverage": "npm run istanbul; cat coverage/lcov.info | coveralls" + }, + "pre-commit": [ + "lint", + "test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/reusify.git" + }, + "keywords": [ + "reuse", + "object", + "performance", + "function", + "fast" + ], + "author": "Matteo Collina ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mcollina/reusify/issues" + }, + "homepage": "https://github.com/mcollina/reusify#readme", + "engines": { + "node": ">=0.10.0", + "iojs": ">=1.0.0" + }, + "devDependencies": { + "coveralls": "^2.13.3", + "faucet": "0.0.1", + "istanbul": "^0.4.5", + "pre-commit": "^1.2.2", + "standard": "^10.0.3", + "tape": "^4.8.0" + } +} diff --git a/node_modules/reusify/reusify.js b/node_modules/reusify/reusify.js new file mode 100644 index 000000000..e6f36f3a8 --- /dev/null +++ b/node_modules/reusify/reusify.js @@ -0,0 +1,33 @@ +'use strict' + +function reusify (Constructor) { + var head = new Constructor() + var tail = head + + function get () { + var current = head + + if (current.next) { + head = current.next + } else { + head = new Constructor() + tail = head + } + + current.next = null + + return current + } + + function release (obj) { + tail.next = obj + tail = obj + } + + return { + get: get, + release: release + } +} + +module.exports = reusify diff --git a/node_modules/reusify/test.js b/node_modules/reusify/test.js new file mode 100644 index 000000000..929cfd719 --- /dev/null +++ b/node_modules/reusify/test.js @@ -0,0 +1,66 @@ +'use strict' + +var test = require('tape') +var reusify = require('./') + +test('reuse objects', function (t) { + t.plan(6) + + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + + t.notEqual(obj, instance.get(), 'two instance created') + t.notOk(obj.next, 'next must be null') + + instance.release(obj) + + // the internals keeps a hot copy ready for reuse + // putting this one back in the queue + instance.release(instance.get()) + + // comparing the old one with the one we got + // never do this in real code, after release you + // should never reuse that instance + t.equal(obj, instance.get(), 'instance must be reused') +}) + +test('reuse more than 2 objects', function (t) { + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + var obj2 = instance.get() + var obj3 = instance.get() + + t.notOk(obj.next, 'next must be null') + t.notOk(obj2.next, 'next must be null') + t.notOk(obj3.next, 'next must be null') + + t.notEqual(obj, obj2) + t.notEqual(obj, obj3) + t.notEqual(obj3, obj2) + + instance.release(obj) + instance.release(obj2) + instance.release(obj3) + + // skip one + instance.get() + + var obj4 = instance.get() + var obj5 = instance.get() + var obj6 = instance.get() + + t.equal(obj4, obj) + t.equal(obj5, obj2) + t.equal(obj6, obj3) + t.end() +}) diff --git a/node_modules/run-parallel/LICENSE b/node_modules/run-parallel/LICENSE new file mode 100644 index 000000000..c7e685275 --- /dev/null +++ b/node_modules/run-parallel/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/run-parallel/README.md b/node_modules/run-parallel/README.md new file mode 100644 index 000000000..edc3da452 --- /dev/null +++ b/node_modules/run-parallel/README.md @@ -0,0 +1,85 @@ +# run-parallel [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/run-parallel/master.svg +[travis-url]: https://travis-ci.org/feross/run-parallel +[npm-image]: https://img.shields.io/npm/v/run-parallel.svg +[npm-url]: https://npmjs.org/package/run-parallel +[downloads-image]: https://img.shields.io/npm/dm/run-parallel.svg +[downloads-url]: https://npmjs.org/package/run-parallel +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### Run an array of functions in parallel + +![parallel](https://raw.githubusercontent.com/feross/run-parallel/master/img.png) [![Sauce Test Status](https://saucelabs.com/browser-matrix/run-parallel.svg)](https://saucelabs.com/u/run-parallel) + +### install + +``` +npm install run-parallel +``` + +### usage + +#### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its callback, the main +`callback` is immediately called with the value of the error. Once the `tasks` have +completed, the results are passed to the final `callback` as an array. + +It is also possible to use an object instead of an array. Each property will be run as a +function and the results will be passed to the final `callback` as an object instead of +an array. This can be a more readable way of handling the results. + +##### arguments + +- `tasks` - An array or object containing functions to run. Each function is passed a +`callback(err, result)` which it must call on completion with an error `err` (which can +be `null`) and an optional `result` value. +- `callback(err, results)` - An optional callback to run once all the functions have +completed. This function gets a results array (or object) containing all the result +arguments passed to the task callbacks. + +##### example + +```js +var parallel = require('run-parallel') + +parallel([ + function (callback) { + setTimeout(function () { + callback(null, 'one') + }, 200) + }, + function (callback) { + setTimeout(function () { + callback(null, 'two') + }, 100) + } +], +// optional callback +function (err, results) { + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}) +``` + +This module is basically equavalent to +[`async.parallel`](https://github.com/caolan/async#paralleltasks-callback), but it's +handy to just have the one function you need instead of the kitchen sink. Modularity! +Especially handy if you're serving to the browser and need to reduce your javascript +bundle size. + +Works great in the browser with [browserify](http://browserify.org/)! + +### see also + +- [run-auto](https://github.com/feross/run-auto) +- [run-parallel-limit](https://github.com/feross/run-parallel-limit) +- [run-series](https://github.com/feross/run-series) +- [run-waterfall](https://github.com/feross/run-waterfall) + +### license + +MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/run-parallel/index.js b/node_modules/run-parallel/index.js new file mode 100644 index 000000000..6307141d6 --- /dev/null +++ b/node_modules/run-parallel/index.js @@ -0,0 +1,51 @@ +/*! run-parallel. MIT License. Feross Aboukhadijeh */ +module.exports = runParallel + +const queueMicrotask = require('queue-microtask') + +function runParallel (tasks, cb) { + let results, pending, keys + let isSync = true + + if (Array.isArray(tasks)) { + results = [] + pending = tasks.length + } else { + keys = Object.keys(tasks) + results = {} + pending = keys.length + } + + function done (err) { + function end () { + if (cb) cb(err, results) + cb = null + } + if (isSync) queueMicrotask(end) + else end() + } + + function each (i, err, result) { + results[i] = result + if (--pending === 0 || err) { + done(err) + } + } + + if (!pending) { + // empty + done(null) + } else if (keys) { + // object + keys.forEach(function (key) { + tasks[key](function (err, result) { each(key, err, result) }) + }) + } else { + // array + tasks.forEach(function (task, i) { + task(function (err, result) { each(i, err, result) }) + }) + } + + isSync = false +} diff --git a/node_modules/run-parallel/package.json b/node_modules/run-parallel/package.json new file mode 100644 index 000000000..1f1475788 --- /dev/null +++ b/node_modules/run-parallel/package.json @@ -0,0 +1,58 @@ +{ + "name": "run-parallel", + "description": "Run an array of functions in parallel", + "version": "1.2.0", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/run-parallel/issues" + }, + "dependencies": { + "queue-microtask": "^1.2.2" + }, + "devDependencies": { + "airtap": "^3.0.0", + "standard": "*", + "tape": "^5.0.1" + }, + "homepage": "https://github.com/feross/run-parallel", + "keywords": [ + "parallel", + "async", + "function", + "callback", + "asynchronous", + "run", + "array", + "run parallel" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/run-parallel.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/slice-ansi/index.js b/node_modules/slice-ansi/index.js deleted file mode 100755 index 72d37d9a5..000000000 --- a/node_modules/slice-ansi/index.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const astralRegex = require('astral-regex'); -const ansiStyles = require('ansi-styles'); - -const ESCAPES = [ - '\u001B', - '\u009B' -]; - -const wrapAnsi = code => `${ESCAPES[0]}[${code}m`; - -const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => { - let output = []; - ansiCodes = [...ansiCodes]; - - for (let ansiCode of ansiCodes) { - const ansiCodeOrigin = ansiCode; - if (ansiCode.includes(';')) { - ansiCode = ansiCode.split(';')[0][0] + '0'; - } - - const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10)); - if (item) { - const indexEscape = ansiCodes.indexOf(item.toString()); - if (indexEscape === -1) { - output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin)); - } else { - ansiCodes.splice(indexEscape, 1); - } - } else if (isEscapes) { - output.push(wrapAnsi(0)); - break; - } else { - output.push(wrapAnsi(ansiCodeOrigin)); - } - } - - if (isEscapes) { - output = output.filter((element, index) => output.indexOf(element) === index); - - if (endAnsiCode !== undefined) { - const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10))); - output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []); - } - } - - return output.join(''); -}; - -module.exports = (string, begin, end) => { - const characters = [...string]; - const ansiCodes = []; - - let stringEnd = typeof end === 'number' ? end : characters.length; - let isInsideEscape = false; - let ansiCode; - let visible = 0; - let output = ''; - - for (const [index, character] of characters.entries()) { - let leftEscape = false; - - if (ESCAPES.includes(character)) { - const code = /\d[^m]*/.exec(string.slice(index, index + 18)); - ansiCode = code && code.length > 0 ? code[0] : undefined; - - if (visible < stringEnd) { - isInsideEscape = true; - - if (ansiCode !== undefined) { - ansiCodes.push(ansiCode); - } - } - } else if (isInsideEscape && character === 'm') { - isInsideEscape = false; - leftEscape = true; - } - - if (!isInsideEscape && !leftEscape) { - visible++; - } - - if (!astralRegex({exact: true}).test(character) && isFullwidthCodePoint(character.codePointAt())) { - visible++; - - if (typeof end !== 'number') { - stringEnd++; - } - } - - if (visible > begin && visible <= stringEnd) { - output += character; - } else if (visible === begin && !isInsideEscape && ansiCode !== undefined) { - output = checkAnsi(ansiCodes); - } else if (visible >= stringEnd) { - output += checkAnsi(ansiCodes, true, ansiCode); - break; - } - } - - return output; -}; diff --git a/node_modules/slice-ansi/package.json b/node_modules/slice-ansi/package.json deleted file mode 100644 index b817dd41f..000000000 --- a/node_modules/slice-ansi/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "slice-ansi@^4.0.0", - "_id": "slice-ansi@4.0.0", - "_inBundle": false, - "_integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "_location": "/slice-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "slice-ansi@^4.0.0", - "name": "slice-ansi", - "escapedName": "slice-ansi", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/table" - ], - "_resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "_shasum": "500e8dd0fd55b05815086255b3195adf2a45fe6b", - "_spec": "slice-ansi@^4.0.0", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/table", - "bugs": { - "url": "https://github.com/chalk/slice-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "deprecated": false, - "description": "Slice a string with ANSI escape codes", - "devDependencies": { - "ava": "^2.1.0", - "chalk": "^3.0.0", - "random-item": "^3.0.0", - "strip-ansi": "^6.0.0", - "xo": "^0.26.1" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "index.js" - ], - "funding": "https://github.com/chalk/slice-ansi?sponsor=1", - "homepage": "https://github.com/chalk/slice-ansi#readme", - "keywords": [ - "slice", - "string", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "slice-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/slice-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} diff --git a/node_modules/slice-ansi/readme.md b/node_modules/slice-ansi/readme.md deleted file mode 100644 index 88d36772c..000000000 --- a/node_modules/slice-ansi/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/xojs/xo) - -> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) - -## Install - -``` -$ npm install slice-ansi -``` - -## Usage - -```js -const chalk = require('chalk'); -const sliceAnsi = require('slice-ansi'); - -const string = 'The quick brown ' + chalk.red('fox jumped over ') + - 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); - -console.log(sliceAnsi(string, 20, 30)); -``` - -## API - -### sliceAnsi(string, beginSlice, endSlice?) - -#### string - -Type: `string` - -String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). - -#### beginSlice - -Type: `number` - -Zero-based index at which to begin the slice. - -#### endSlice - -Type: `number` - -Zero-based index at which to end the slice. - -## Related - -- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes -- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal -- [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/strip-ansi/package.json b/node_modules/strip-ansi/package.json index 4a34d3b7c..1a41108d4 100644 --- a/node_modules/strip-ansi/package.json +++ b/node_modules/strip-ansi/package.json @@ -1,90 +1,54 @@ { - "_from": "strip-ansi@^6.0.0", - "_id": "strip-ansi@6.0.0", - "_inBundle": false, - "_integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "_location": "/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^6.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/@jest/core", - "/cliui", - "/string-length", - "/string-width", - "/wrap-ansi" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "_shasum": "0b1571dd7669ccd4f3e06e14ef1eed26225ae532", - "_spec": "strip-ansi@^6.0.0", - "_where": "/Users/hcliff/src/github-asana-action/node_modules/@jest/core", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes from a string", - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "6.0.0" + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } } diff --git a/node_modules/table/LICENSE b/node_modules/table/LICENSE deleted file mode 100644 index 6c41d45cd..000000000 --- a/node_modules/table/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/table/README.md b/node_modules/table/README.md deleted file mode 100644 index 22a79962a..000000000 --- a/node_modules/table/README.md +++ /dev/null @@ -1,734 +0,0 @@ - -# Table - -[![Travis build status](http://img.shields.io/travis/gajus/table/master.svg?style=flat-square)](https://travis-ci.org/gajus/table) -[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table) -[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table) -[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical) -[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas) - -* [Table](#table) - * [Features](#table-features) - * [Install](#table-install) - * [Usage](#table-usage) - * [Cell Content Alignment](#table-usage-cell-content-alignment) - * [Column Width](#table-usage-column-width) - * [Custom Border](#table-usage-custom-border) - * [Draw Horizontal Line](#table-usage-draw-horizontal-line) - * [Single Line Mode](#table-usage-single-line-mode) - * [Padding Cell Content](#table-usage-padding-cell-content) - * [Predefined Border Templates](#table-usage-predefined-border-templates) - * [Streaming](#table-usage-streaming) - * [Text Truncation](#table-usage-text-truncation) - * [Text Wrapping](#table-usage-text-wrapping) - - -Produces a string that represents array data in a text table. - -![Demo of table displaying a list of missions to the Moon.](./.README/demo.png) - - -## Features - -* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. -* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). -* Configurable border characters. -* Configurable content alignment per column. -* Configurable content padding per column. -* Configurable column width. -* Text wrapping. - - -## Install - -```bash -npm install table - -``` - -[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/gajus) -[![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/gajus) - - -## Usage - -Table data is described using an array (rows) of array (cells). - -```js -import { - table -} from 'table'; - -// Using commonjs? -// const {table} = require('table'); - -let data, - output; - -data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -/** - * @typedef {string} table~cell - */ - -/** - * @typedef {table~cell[]} table~row - */ - -/** - * @typedef {Object} table~columns - * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). - * @property {number} width Column width (default: auto). - * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). - * @property {number} paddingLeft Cell content padding width left (default: 1). - * @property {number} paddingRight Cell content padding width right (default: 1). - */ - -/** - * @typedef {Object} table~border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * Used to dynamically tell table whether to draw a line separating rows or not. - * The default behavior is to always return true. - * - * @typedef {function} drawHorizontalLine - * @param {number} index - * @param {number} size - * @return {boolean} - */ - -/** - * @typedef {Object} table~config - * @property {table~border} border - * @property {table~columns[]} columns Column specific configuration. - * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. - * @property {table~drawHorizontalLine} drawHorizontalLine - */ - -/** - * Generates a text table. - * - * @param {table~row[]} rows - * @param {table~config} config - * @return {String} - */ -output = table(data); - -console.log(output); -``` - -``` -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════╧════╝ - -``` - - - -### Cell Content Alignment - -`{string} config.columns[{number}].alignment` property controls content horizontal alignment within a cell. - -Valid values are: "left", "right" and "center". - -```js -let config, - data, - output; - -data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -config = { - columns: { - 0: { - alignment: 'left', - width: 10 - }, - 1: { - alignment: 'center', - width: 10 - }, - 2: { - alignment: 'right', - width: 10 - } - } -}; - -output = table(data, config); - -console.log(output); -``` - -``` -╔════════════╤════════════╤════════════╗ -║ 0A │ 0B │ 0C ║ -╟────────────┼────────────┼────────────╢ -║ 1A │ 1B │ 1C ║ -╟────────────┼────────────┼────────────╢ -║ 2A │ 2B │ 2C ║ -╚════════════╧════════════╧════════════╝ -``` - - -### Column Width - -`{number} config.columns[{number}].width` property restricts column width to a fixed width. - -```js -let data, - output, - options; - -data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -options = { - columns: { - 1: { - width: 10 - } - } -}; - -output = table(data, options); - -console.log(output); -``` - -``` -╔════╤════════════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────────────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────────────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════════════╧════╝ -``` - - -### Custom Border - -`{object} config.border` property describes characters used to draw the table border. - -```js -let config, - data, - output; - -data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -config = { - border: { - topBody: `─`, - topJoin: `┬`, - topLeft: `┌`, - topRight: `┐`, - - bottomBody: `─`, - bottomJoin: `┴`, - bottomLeft: `└`, - bottomRight: `┘`, - - bodyLeft: `│`, - bodyRight: `│`, - bodyJoin: `│`, - - joinBody: `─`, - joinLeft: `├`, - joinRight: `┤`, - joinJoin: `┼` - } -}; - -output = table(data, config); - -console.log(output); -``` - -``` -┌────┬────┬────┐ -│ 0A │ 0B │ 0C │ -├────┼────┼────┤ -│ 1A │ 1B │ 1C │ -├────┼────┼────┤ -│ 2A │ 2B │ 2C │ -└────┴────┴────┘ -``` - - -### Draw Horizontal Line - -`{function} config.drawHorizontalLine` property is a function that is called for every non-content row in the table. The result of the function `{boolean}` determines whether a row is drawn. - -```js -let data, - output, - options; - -data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ['3A', '3B', '3C'], - ['4A', '4B', '4C'] -]; - -options = { - /** - * @typedef {function} drawHorizontalLine - * @param {number} index - * @param {number} size - * @return {boolean} - */ - drawHorizontalLine: (index, size) => { - return index === 0 || index === 1 || index === size - 1 || index === size; - } -}; - -output = table(data, options); - -console.log(output); - -``` - -``` -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -║ 2A │ 2B │ 2C ║ -║ 3A │ 3B │ 3C ║ -╟────┼────┼────╢ -║ 4A │ 4B │ 4C ║ -╚════╧════╧════╝ - -``` - - -### Single Line Mode - -Horizontal lines inside the table are not drawn. - -```js -import { - table, - getBorderCharacters -} from 'table'; - -const data = [ - ['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'], - ['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'], - ['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'], - ['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'], - ['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'], - ['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'], - ['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'], - ['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'], -]; - -const config = { - singleLine: true -}; - -const output = table(data, config); -console.log(output); -``` - -``` -╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ -║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║ -║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║ -║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║ -║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║ -║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║ -║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║ -║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║ -║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║ -╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ -``` - - -### Padding Cell Content - -`{number} config.columns[{number}].paddingLeft` and `{number} config.columns[{number}].paddingRight` properties control content padding within a cell. Property value represents a number of whitespaces used to pad the content. - -```js -let config, - data, - output; - -data = [ - ['0A', 'AABBCC', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -config = { - columns: { - 0: { - paddingLeft: 3 - }, - 1: { - width: 2, - paddingRight: 3 - } - } -}; - -output = table(data, config); - -console.log(output); -``` - -``` -╔══════╤══════╤════╗ -║ 0A │ AA │ 0C ║ -║ │ BB │ ║ -║ │ CC │ ║ -╟──────┼──────┼────╢ -║ 1A │ 1B │ 1C ║ -╟──────┼──────┼────╢ -║ 2A │ 2B │ 2C ║ -╚══════╧══════╧════╝ -``` - - -### Predefined Border Templates - -You can load one of the predefined border templates using `getBorderCharacters` function. - -```js -import { - table, - getBorderCharacters -} from 'table'; - -let config, - data; - -data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -config = { - border: getBorderCharacters(`name of the template`) -}; - -table(data, config); -``` - -``` -# honeywell - -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════╧════╝ - -# norc - -┌────┬────┬────┐ -│ 0A │ 0B │ 0C │ -├────┼────┼────┤ -│ 1A │ 1B │ 1C │ -├────┼────┼────┤ -│ 2A │ 2B │ 2C │ -└────┴────┴────┘ - -# ramac (ASCII; for use in terminals that do not support Unicode characters) - -+----+----+----+ -| 0A | 0B | 0C | -|----|----|----| -| 1A | 1B | 1C | -|----|----|----| -| 2A | 2B | 2C | -+----+----+----+ - -# void (no borders; see "bordless table" section of the documentation) - - 0A 0B 0C - - 1A 1B 1C - - 2A 2B 2C - -``` - -Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template. - - -#### Borderless Table - -Simply using "void" border character template creates a table with a lot of unnecessary spacing. - -To create a more plesant to the eye table, reset the padding and remove the joining rows, e.g. - -```js -let output; - -output = table(data, { - border: getBorderCharacters(`void`), - columnDefault: { - paddingLeft: 0, - paddingRight: 1 - }, - drawHorizontalLine: () => { - return false - } -}); - -console.log(output); -``` - -``` -0A 0B 0C -1A 1B 1C -2A 2B 2C -``` - - -### Streaming - -`table` package exports `createStream` function used to draw a table and append rows. - -`createStream` requires `{number} columnDefault.width` and `{number} columnCount` configuration properties. - -```js -import { - createStream -} from 'table'; - -let config, - stream; - -config = { - columnDefault: { - width: 50 - }, - columnCount: 1 -}; - -stream = createStream(config); - -setInterval(() => { - stream.write([new Date()]); -}, 500); -``` - -![Streaming current date.](./.README/streaming.gif) - -`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. - -The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691). - -Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g. - -```js -import { - createStream -} from 'table'; - -import _ from 'lodash'; - -let config, - stream, - i; - -config = { - columnDefault: { - width: 50 - }, - columnCount: 3, - columns: { - 0: { - width: 10, - alignment: 'right' - }, - 1: { - alignment: 'center', - }, - 2: { - width: 10 - } - } -}; - -stream = createStream(config); - -i = 0; - -setInterval(() => { - let random; - - random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); - - stream.write([i++, new Date(), random]); -}, 500); -``` - -![Streaming random data.](./.README/streaming-random.gif) - - -### Text Truncation - -To handle a content that overflows the container width, `table` package implements [text wrapping](#table-usage-text-wrapping). However, sometimes you may want to truncate content that is too long to be displayed in the table. - -`{number} config.columns[{number}].truncate` property (default: `Infinity`) truncates the text at the specified length. - -```js -let config, - data, - output; - -data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -config = { - columns: { - 0: { - width: 20, - truncate: 100 - } - } -}; - -output = table(data, config); - -console.log(output); -``` - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor si ║ -║ t amet, consectetur ║ -║ adipiscing elit. Pha ║ -║ sellus pulvinar nibh ║ -║ sed mauris conva... ║ -╚══════════════════════╝ -``` - - -### Text Wrapping - -`table` package implements auto text wrapping, i.e. text that has width greater than the container width will be separated into multiple lines, e.g. - -```js -let config, - data, - output; - -data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -config = { - columns: { - 0: { - width: 20 - } - } -}; - -output = table(data, config); - -console.log(output); -``` - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor si ║ -║ t amet, consectetur ║ -║ adipiscing elit. Pha ║ -║ sellus pulvinar nibh ║ -║ sed mauris convallis ║ -║ dapibus. Nunc venena ║ -║ tis tempus nulla sit ║ -║ amet viverra. ║ -╚══════════════════════╝ -``` - -When `wrapWord` is `true` the text is broken at the nearest space or one of the special characters ("-", "_", "\", "/", ".", ",", ";"), e.g. - -```js -let config, - data, - output; - -data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -config = { - columns: { - 0: { - width: 20, - wrapWord: true - } - } -}; - -output = table(data, config); - -console.log(output); -``` - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor ║ -║ sit amet, ║ -║ consectetur ║ -║ adipiscing elit. ║ -║ Phasellus pulvinar ║ -║ nibh sed mauris ║ -║ convallis dapibus. ║ -║ Nunc venenatis ║ -║ tempus nulla sit ║ -║ amet viverra. ║ -╚══════════════════════╝ - -``` - diff --git a/node_modules/table/dist/alignString.js b/node_modules/table/dist/alignString.js deleted file mode 100644 index 2dec379bf..000000000 --- a/node_modules/table/dist/alignString.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _isNumber2 = _interopRequireDefault(require("lodash/isNumber")); - -var _isString2 = _interopRequireDefault(require("lodash/isString")); - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const alignments = ['left', 'right', 'center']; -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ - -const alignLeft = (subject, width) => { - return subject + ' '.repeat(width); -}; -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ - - -const alignRight = (subject, width) => { - return ' '.repeat(width) + subject; -}; -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ - - -const alignCenter = (subject, width) => { - let halfWidth; - halfWidth = width / 2; - - if (width % 2 === 0) { - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); - } else { - halfWidth = Math.floor(halfWidth); - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); - } -}; -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - * - * @param {string} subject - * @param {number} containerWidth - * @param {string} alignment One of the valid options (left, right, center). - * @returns {string} - */ - - -const alignString = (subject, containerWidth, alignment) => { - if (!(0, _isString2.default)(subject)) { - throw new TypeError('Subject parameter value must be a string.'); - } - - if (!(0, _isNumber2.default)(containerWidth)) { - throw new TypeError('Container width parameter value must be a number.'); - } - - const subjectWidth = (0, _stringWidth.default)(subject); - - if (subjectWidth > containerWidth) { - // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); - throw new Error('Subject parameter value width cannot be greater than the container width.'); - } - - if (!(0, _isString2.default)(alignment)) { - throw new TypeError('Alignment parameter value must be a string.'); - } - - if (!alignments.includes(alignment)) { - throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); - } - - if (subjectWidth === 0) { - return ' '.repeat(containerWidth); - } - - const availableWidth = containerWidth - subjectWidth; - - if (alignment === 'left') { - return alignLeft(subject, availableWidth); - } - - if (alignment === 'right') { - return alignRight(subject, availableWidth); - } - - return alignCenter(subject, availableWidth); -}; - -var _default = alignString; -exports.default = _default; -//# sourceMappingURL=alignString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/alignString.js.flow b/node_modules/table/dist/alignString.js.flow deleted file mode 100644 index 4bd216d44..000000000 --- a/node_modules/table/dist/alignString.js.flow +++ /dev/null @@ -1,96 +0,0 @@ -import _ from 'lodash'; -import stringWidth from 'string-width'; - -const alignments = [ - 'left', - 'right', - 'center', -]; - -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ -const alignLeft = (subject, width) => { - return subject + ' '.repeat(width); -}; - -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ -const alignRight = (subject, width) => { - return ' '.repeat(width) + subject; -}; - -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ -const alignCenter = (subject, width) => { - let halfWidth; - - halfWidth = width / 2; - - if (width % 2 === 0) { - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); - } else { - halfWidth = Math.floor(halfWidth); - - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); - } -}; - -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - * - * @param {string} subject - * @param {number} containerWidth - * @param {string} alignment One of the valid options (left, right, center). - * @returns {string} - */ -export default (subject, containerWidth, alignment) => { - if (!_.isString(subject)) { - throw new TypeError('Subject parameter value must be a string.'); - } - - if (!_.isNumber(containerWidth)) { - throw new TypeError('Container width parameter value must be a number.'); - } - - const subjectWidth = stringWidth(subject); - - if (subjectWidth > containerWidth) { - // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); - - throw new Error('Subject parameter value width cannot be greater than the container width.'); - } - - if (!_.isString(alignment)) { - throw new TypeError('Alignment parameter value must be a string.'); - } - - if (!alignments.includes(alignment)) { - throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); - } - - if (subjectWidth === 0) { - return ' '.repeat(containerWidth); - } - - const availableWidth = containerWidth - subjectWidth; - - if (alignment === 'left') { - return alignLeft(subject, availableWidth); - } - - if (alignment === 'right') { - return alignRight(subject, availableWidth); - } - - return alignCenter(subject, availableWidth); -}; diff --git a/node_modules/table/dist/alignString.js.map b/node_modules/table/dist/alignString.js.map deleted file mode 100644 index 8997445c0..000000000 --- a/node_modules/table/dist/alignString.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/alignString.js"],"names":["alignments","alignLeft","subject","width","repeat","alignRight","alignCenter","halfWidth","Math","floor","containerWidth","alignment","TypeError","subjectWidth","Error","includes","availableWidth"],"mappings":";;;;;;;;;;;AACA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,MADiB,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M,IAAII,KAAJ,CAAU,2EAAV,CAAN;AACD;;AAED,MAAI,CAAC,wBAAWH,SAAX,CAAL,EAA4B;AAC1B,UAAM,IAAIC,SAAJ,CAAc,6CAAd,CAAN;AACD;;AAED,MAAI,CAACZ,UAAU,CAACe,QAAX,CAAoBJ,SAApB,CAAL,EAAqC;AACnC,UAAM,IAAIG,KAAJ,CAAU,4FAAV,CAAN;AACD;;AAED,MAAID,YAAY,KAAK,CAArB,EAAwB;AACtB,WAAO,IAAIT,MAAJ,CAAWM,cAAX,CAAP;AACD;;AAED,QAAMM,cAAc,GAAGN,cAAc,GAAGG,YAAxC;;AAEA,MAAIF,SAAS,KAAK,MAAlB,EAA0B;AACxB,WAAOV,SAAS,CAACC,OAAD,EAAUc,cAAV,CAAhB;AACD;;AAED,MAAIL,SAAS,KAAK,OAAlB,EAA2B;AACzB,WAAON,UAAU,CAACH,OAAD,EAAUc,cAAV,CAAjB;AACD;;AAED,SAAOV,WAAW,CAACJ,OAAD,EAAUc,cAAV,CAAlB;AACD,C","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\n\nconst alignments = [\n 'left',\n 'right',\n 'center',\n];\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignLeft = (subject, width) => {\n return subject + ' '.repeat(width);\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignRight = (subject, width) => {\n return ' '.repeat(width) + subject;\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignCenter = (subject, width) => {\n let halfWidth;\n\n halfWidth = width / 2;\n\n if (width % 2 === 0) {\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth);\n } else {\n halfWidth = Math.floor(halfWidth);\n\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);\n }\n};\n\n/**\n * Pads a string to the left and/or right to position the subject\n * text in a desired alignment within a container.\n *\n * @param {string} subject\n * @param {number} containerWidth\n * @param {string} alignment One of the valid options (left, right, center).\n * @returns {string}\n */\nexport default (subject, containerWidth, alignment) => {\n if (!_.isString(subject)) {\n throw new TypeError('Subject parameter value must be a string.');\n }\n\n if (!_.isNumber(containerWidth)) {\n throw new TypeError('Container width parameter value must be a number.');\n }\n\n const subjectWidth = stringWidth(subject);\n\n if (subjectWidth > containerWidth) {\n // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject);\n\n throw new Error('Subject parameter value width cannot be greater than the container width.');\n }\n\n if (!_.isString(alignment)) {\n throw new TypeError('Alignment parameter value must be a string.');\n }\n\n if (!alignments.includes(alignment)) {\n throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');\n }\n\n if (subjectWidth === 0) {\n return ' '.repeat(containerWidth);\n }\n\n const availableWidth = containerWidth - subjectWidth;\n\n if (alignment === 'left') {\n return alignLeft(subject, availableWidth);\n }\n\n if (alignment === 'right') {\n return alignRight(subject, availableWidth);\n }\n\n return alignCenter(subject, availableWidth);\n};\n"],"file":"alignString.js"} \ No newline at end of file diff --git a/node_modules/table/dist/alignTableData.js b/node_modules/table/dist/alignTableData.js deleted file mode 100644 index 54add443b..000000000 --- a/node_modules/table/dist/alignTableData.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _stringWidth = _interopRequireDefault(require("string-width")); - -var _alignString = _interopRequireDefault(require("./alignString")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -const alignTableData = (rows, config) => { - return rows.map(cells => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - - if ((0, _stringWidth.default)(value) === column.width) { - return value; - } else { - return (0, _alignString.default)(value, column.width, column.alignment); - } - }); - }); -}; - -var _default = alignTableData; -exports.default = _default; -//# sourceMappingURL=alignTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/alignTableData.js.flow b/node_modules/table/dist/alignTableData.js.flow deleted file mode 100644 index c82c31e26..000000000 --- a/node_modules/table/dist/alignTableData.js.flow +++ /dev/null @@ -1,21 +0,0 @@ -import stringWidth from 'string-width'; -import alignString from './alignString'; - -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -export default (rows, config) => { - return rows.map((cells) => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - - if (stringWidth(value) === column.width) { - return value; - } else { - return alignString(value, column.width, column.alignment); - } - }); - }); -}; diff --git a/node_modules/table/dist/alignTableData.js.map b/node_modules/table/dist/alignTableData.js.map deleted file mode 100644 index 51c44790c..000000000 --- a/node_modules/table/dist/alignTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/alignTableData.js"],"names":["rows","config","map","cells","value","index1","column","columns","width","alignment"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;wBACgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,KAAD,EAAQC,MAAR,KAAmB;AAClC,YAAMC,MAAM,GAAGL,MAAM,CAACM,OAAP,CAAeF,MAAf,CAAf;;AAEA,UAAI,0BAAYD,KAAZ,MAAuBE,MAAM,CAACE,KAAlC,EAAyC;AACvC,eAAOJ,KAAP;AACD,OAFD,MAEO;AACL,eAAO,0BAAYA,KAAZ,EAAmBE,MAAM,CAACE,KAA1B,EAAiCF,MAAM,CAACG,SAAxC,CAAP;AACD;AACF,KARM,CAAP;AASD,GAVM,CAAP;AAWD,C","sourcesContent":["import stringWidth from 'string-width';\nimport alignString from './alignString';\n\n/**\n * @param {table~row[]} rows\n * @param {object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((value, index1) => {\n const column = config.columns[index1];\n\n if (stringWidth(value) === column.width) {\n return value;\n } else {\n return alignString(value, column.width, column.alignment);\n }\n });\n });\n};\n"],"file":"alignTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellHeight.js b/node_modules/table/dist/calculateCellHeight.js deleted file mode 100644 index 7c11c4f67..000000000 --- a/node_modules/table/dist/calculateCellHeight.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _isString2 = _interopRequireDefault(require("lodash/isString")); - -var _wrapCell = _interopRequireDefault(require("./wrapCell")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {string} value - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {number} - */ -const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { - if (!(0, _isString2.default)(value)) { - throw new TypeError('Value must be a string.'); - } - - if (!Number.isInteger(columnWidth)) { - throw new TypeError('Column width must be an integer.'); - } - - if (columnWidth < 1) { - throw new Error('Column width must be greater than 0.'); - } - - return (0, _wrapCell.default)(value, columnWidth, useWrapWord).length; -}; - -var _default = calculateCellHeight; -exports.default = _default; -//# sourceMappingURL=calculateCellHeight.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellHeight.js.flow b/node_modules/table/dist/calculateCellHeight.js.flow deleted file mode 100644 index 3eca8d7ff..000000000 --- a/node_modules/table/dist/calculateCellHeight.js.flow +++ /dev/null @@ -1,24 +0,0 @@ -import _ from 'lodash'; -import wrapCell from './wrapCell'; - -/** - * @param {string} value - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {number} - */ -export default (value, columnWidth, useWrapWord = false) => { - if (!_.isString(value)) { - throw new TypeError('Value must be a string.'); - } - - if (!Number.isInteger(columnWidth)) { - throw new TypeError('Column width must be an integer.'); - } - - if (columnWidth < 1) { - throw new Error('Column width must be greater than 0.'); - } - - return wrapCell(value, columnWidth, useWrapWord).length; -}; diff --git a/node_modules/table/dist/calculateCellHeight.js.map b/node_modules/table/dist/calculateCellHeight.js.map deleted file mode 100644 index e1000ab77..000000000 --- a/node_modules/table/dist/calculateCellHeight.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","TypeError","Number","isInteger","Error","length"],"mappings":";;;;;;;;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;6BACgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAAC,wBAAWF,KAAX,CAAL,EAAwB;AACtB,UAAM,IAAIG,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBJ,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAIE,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIF,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIK,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,SAAO,uBAASN,KAAT,EAAgBC,WAAhB,EAA6BC,WAA7B,EAA0CK,MAAjD;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!_.isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n return wrapCell(value, columnWidth, useWrapWord).length;\n};\n"],"file":"calculateCellHeight.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellWidthIndex.js b/node_modules/table/dist/calculateCellWidthIndex.js deleted file mode 100644 index a4df50167..000000000 --- a/node_modules/table/dist/calculateCellWidthIndex.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calculates width of each cell contents. - * - * @param {string[]} cells - * @returns {number[]} - */ -const calculateCellWidthIndex = cells => { - return cells.map(value => { - return Math.max(...value.split('\n').map(line => { - return (0, _stringWidth.default)(line); - })); - }); -}; - -var _default = calculateCellWidthIndex; -exports.default = _default; -//# sourceMappingURL=calculateCellWidthIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateCellWidthIndex.js.flow b/node_modules/table/dist/calculateCellWidthIndex.js.flow deleted file mode 100644 index e2539539a..000000000 --- a/node_modules/table/dist/calculateCellWidthIndex.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -import stringWidth from 'string-width'; - -/** - * Calculates width of each cell contents. - * - * @param {string[]} cells - * @returns {number[]} - */ -export default (cells) => { - return cells.map((value) => { - return Math.max( - ...value.split('\n').map((line) => { - return stringWidth(line); - }), - ); - }); -}; diff --git a/node_modules/table/dist/calculateCellWidthIndex.js.map b/node_modules/table/dist/calculateCellWidthIndex.js.map deleted file mode 100644 index f7fd4a778..000000000 --- a/node_modules/table/dist/calculateCellWidthIndex.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/calculateCellWidthIndex.js"],"names":["cells","map","value","Math","max","split","line"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;gCACgBA,K,IAAU;AACxB,SAAOA,KAAK,CAACC,GAAN,CAAWC,KAAD,IAAW;AAC1B,WAAOC,IAAI,CAACC,GAAL,CACL,GAAGF,KAAK,CAACG,KAAN,CAAY,IAAZ,EAAkBJ,GAAlB,CAAuBK,IAAD,IAAU;AACjC,aAAO,0BAAYA,IAAZ,CAAP;AACD,KAFE,CADE,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import stringWidth from 'string-width';\n\n/**\n * Calculates width of each cell contents.\n *\n * @param {string[]} cells\n * @returns {number[]}\n */\nexport default (cells) => {\n return cells.map((value) => {\n return Math.max(\n ...value.split('\\n').map((line) => {\n return stringWidth(line);\n }),\n );\n });\n};\n"],"file":"calculateCellWidthIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js deleted file mode 100644 index ea5d4b9a4..000000000 --- a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Produces an array of values that describe the largest value length (width) in every column. - * - * @param {Array[]} rows - * @returns {number[]} - */ -const calculateMaximumColumnWidthIndex = rows => { - if (!rows[0]) { - throw new Error('Dataset must have at least one row.'); - } - - const columns = new Array(rows[0].length).fill(0); - rows.forEach(row => { - const columnWidthIndex = (0, _calculateCellWidthIndex.default)(row); - columnWidthIndex.forEach((valueWidth, index0) => { - if (columns[index0] < valueWidth) { - columns[index0] = valueWidth; - } - }); - }); - return columns; -}; - -var _default = calculateMaximumColumnWidthIndex; -exports.default = _default; -//# sourceMappingURL=calculateMaximumColumnWidthIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow deleted file mode 100644 index 5c8c10981..000000000 --- a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow +++ /dev/null @@ -1,27 +0,0 @@ -import calculateCellWidthIndex from './calculateCellWidthIndex'; - -/** - * Produces an array of values that describe the largest value length (width) in every column. - * - * @param {Array[]} rows - * @returns {number[]} - */ -export default (rows) => { - if (!rows[0]) { - throw new Error('Dataset must have at least one row.'); - } - - const columns = new Array(rows[0].length).fill(0); - - rows.forEach((row) => { - const columnWidthIndex = calculateCellWidthIndex(row); - - columnWidthIndex.forEach((valueWidth, index0) => { - if (columns[index0] < valueWidth) { - columns[index0] = valueWidth; - } - }); - }); - - return columns; -}; diff --git a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map b/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map deleted file mode 100644 index 10c807417..000000000 --- a/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/calculateMaximumColumnWidthIndex.js"],"names":["rows","Error","columns","Array","length","fill","forEach","row","columnWidthIndex","valueWidth","index0"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;yCACgBA,I,IAAS;AACvB,MAAI,CAACA,IAAI,CAAC,CAAD,CAAT,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,QAAMC,OAAO,GAAG,IAAIC,KAAJ,CAAUH,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAlB,EAA0BC,IAA1B,CAA+B,CAA/B,CAAhB;AAEAL,EAAAA,IAAI,CAACM,OAAL,CAAcC,GAAD,IAAS;AACpB,UAAMC,gBAAgB,GAAG,sCAAwBD,GAAxB,CAAzB;AAEAC,IAAAA,gBAAgB,CAACF,OAAjB,CAAyB,CAACG,UAAD,EAAaC,MAAb,KAAwB;AAC/C,UAAIR,OAAO,CAACQ,MAAD,CAAP,GAAkBD,UAAtB,EAAkC;AAChCP,QAAAA,OAAO,CAACQ,MAAD,CAAP,GAAkBD,UAAlB;AACD;AACF,KAJD;AAKD,GARD;AAUA,SAAOP,OAAP;AACD,C","sourcesContent":["import calculateCellWidthIndex from './calculateCellWidthIndex';\n\n/**\n * Produces an array of values that describe the largest value length (width) in every column.\n *\n * @param {Array[]} rows\n * @returns {number[]}\n */\nexport default (rows) => {\n if (!rows[0]) {\n throw new Error('Dataset must have at least one row.');\n }\n\n const columns = new Array(rows[0].length).fill(0);\n\n rows.forEach((row) => {\n const columnWidthIndex = calculateCellWidthIndex(row);\n\n columnWidthIndex.forEach((valueWidth, index0) => {\n if (columns[index0] < valueWidth) {\n columns[index0] = valueWidth;\n }\n });\n });\n\n return columns;\n};\n"],"file":"calculateMaximumColumnWidthIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/calculateRowHeightIndex.js b/node_modules/table/dist/calculateRowHeightIndex.js deleted file mode 100644 index d2d201c21..000000000 --- a/node_modules/table/dist/calculateRowHeightIndex.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _max2 = _interopRequireDefault(require("lodash/max")); - -var _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean")); - -var _isNumber2 = _interopRequireDefault(require("lodash/isNumber")); - -var _calculateCellHeight = _interopRequireDefault(require("./calculateCellHeight")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calculates the vertical row span index. - * - * @param {Array[]} rows - * @param {object} config - * @returns {number[]} - */ -const calculateRowHeightIndex = (rows, config) => { - const tableWidth = rows[0].length; - const rowSpanIndex = []; - rows.forEach(cells => { - const cellHeightIndex = new Array(tableWidth).fill(1); - cells.forEach((value, index1) => { - if (!(0, _isNumber2.default)(config.columns[index1].width)) { - throw new TypeError('column[index].width must be a number.'); - } - - if (!(0, _isBoolean2.default)(config.columns[index1].wrapWord)) { - throw new TypeError('column[index].wrapWord must be a boolean.'); - } - - cellHeightIndex[index1] = (0, _calculateCellHeight.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); - }); - rowSpanIndex.push((0, _max2.default)(cellHeightIndex)); - }); - return rowSpanIndex; -}; - -var _default = calculateRowHeightIndex; -exports.default = _default; -//# sourceMappingURL=calculateRowHeightIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/calculateRowHeightIndex.js.flow b/node_modules/table/dist/calculateRowHeightIndex.js.flow deleted file mode 100644 index 063ae4d80..000000000 --- a/node_modules/table/dist/calculateRowHeightIndex.js.flow +++ /dev/null @@ -1,35 +0,0 @@ -import _ from 'lodash'; -import calculateCellHeight from './calculateCellHeight'; - -/** - * Calculates the vertical row span index. - * - * @param {Array[]} rows - * @param {object} config - * @returns {number[]} - */ -export default (rows, config) => { - const tableWidth = rows[0].length; - - const rowSpanIndex = []; - - rows.forEach((cells) => { - const cellHeightIndex = new Array(tableWidth).fill(1); - - cells.forEach((value, index1) => { - if (!_.isNumber(config.columns[index1].width)) { - throw new TypeError('column[index].width must be a number.'); - } - - if (!_.isBoolean(config.columns[index1].wrapWord)) { - throw new TypeError('column[index].wrapWord must be a boolean.'); - } - - cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord); - }); - - rowSpanIndex.push(_.max(cellHeightIndex)); - }); - - return rowSpanIndex; -}; diff --git a/node_modules/table/dist/calculateRowHeightIndex.js.map b/node_modules/table/dist/calculateRowHeightIndex.js.map deleted file mode 100644 index 06dd11d38..000000000 --- a/node_modules/table/dist/calculateRowHeightIndex.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/calculateRowHeightIndex.js"],"names":["rows","config","tableWidth","length","rowSpanIndex","forEach","cells","cellHeightIndex","Array","fill","value","index1","columns","width","TypeError","wrapWord","push"],"mappings":";;;;;;;;;;;;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;iCACgBA,I,EAAMC,M,KAAW;AAC/B,QAAMC,UAAU,GAAGF,IAAI,CAAC,CAAD,CAAJ,CAAQG,MAA3B;AAEA,QAAMC,YAAY,GAAG,EAArB;AAEAJ,EAAAA,IAAI,CAACK,OAAL,CAAcC,KAAD,IAAW;AACtB,UAAMC,eAAe,GAAG,IAAIC,KAAJ,CAAUN,UAAV,EAAsBO,IAAtB,CAA2B,CAA3B,CAAxB;AAEAH,IAAAA,KAAK,CAACD,OAAN,CAAc,CAACK,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAI,CAAC,wBAAWV,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlC,CAAL,EAA+C;AAC7C,cAAM,IAAIC,SAAJ,CAAc,uCAAd,CAAN;AACD;;AAED,UAAI,CAAC,yBAAYb,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAnC,CAAL,EAAmD;AACjD,cAAM,IAAID,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAEDP,MAAAA,eAAe,CAACI,MAAD,CAAf,GAA0B,kCAAoBD,KAApB,EAA2BT,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlD,EAAyDZ,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAhF,CAA1B;AACD,KAVD;AAYAX,IAAAA,YAAY,CAACY,IAAb,CAAkB,mBAAMT,eAAN,CAAlB;AACD,GAhBD;AAkBA,SAAOH,YAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport calculateCellHeight from './calculateCellHeight';\n\n/**\n * Calculates the vertical row span index.\n *\n * @param {Array[]} rows\n * @param {object} config\n * @returns {number[]}\n */\nexport default (rows, config) => {\n const tableWidth = rows[0].length;\n\n const rowSpanIndex = [];\n\n rows.forEach((cells) => {\n const cellHeightIndex = new Array(tableWidth).fill(1);\n\n cells.forEach((value, index1) => {\n if (!_.isNumber(config.columns[index1].width)) {\n throw new TypeError('column[index].width must be a number.');\n }\n\n if (!_.isBoolean(config.columns[index1].wrapWord)) {\n throw new TypeError('column[index].wrapWord must be a boolean.');\n }\n\n cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord);\n });\n\n rowSpanIndex.push(_.max(cellHeightIndex));\n });\n\n return rowSpanIndex;\n};\n"],"file":"calculateRowHeightIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/createStream.js b/node_modules/table/dist/createStream.js deleted file mode 100644 index 9847ec3ef..000000000 --- a/node_modules/table/dist/createStream.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _mapValues2 = _interopRequireDefault(require("lodash/mapValues")); - -var _alignTableData = _interopRequireDefault(require("./alignTableData")); - -var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); - -var _drawBorder = require("./drawBorder"); - -var _drawRow = _interopRequireDefault(require("./drawRow")); - -var _makeStreamConfig = _interopRequireDefault(require("./makeStreamConfig")); - -var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); - -var _padTableData = _interopRequireDefault(require("./padTableData")); - -var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); - -var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {Array} data - * @param {object} config - * @returns {Array} - */ -const prepareData = (data, config) => { - let rows; - rows = (0, _stringifyTableData.default)(data); - rows = (0, _truncateTableData.default)(data, config); - const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); - rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); - rows = (0, _alignTableData.default)(rows, config); - rows = (0, _padTableData.default)(rows, config); - return rows; -}; -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ - - -const create = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - const body = rows.map(literalRow => { - return (0, _drawRow.default)(literalRow, config.border); - }).join(''); - let output; - output = ''; - output += (0, _drawBorder.drawBorderTop)(columnWidthIndex, config.border); - output += body; - output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - output = output.trimEnd(); - process.stdout.write(output); -}; -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ - - -const append = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - const body = rows.map(literalRow => { - return (0, _drawRow.default)(literalRow, config.border); - }).join(''); - let output = ''; - const bottom = (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - - if (bottom !== '\n') { - output = '\r\u001B[K'; - } - - output += (0, _drawBorder.drawBorderJoin)(columnWidthIndex, config.border); - output += body; - output += bottom; - output = output.trimEnd(); - process.stdout.write(output); -}; -/** - * @param {object} userConfig - * @returns {object} - */ - - -const createStream = (userConfig = {}) => { - const config = (0, _makeStreamConfig.default)(userConfig); - const columnWidthIndex = Object.values((0, _mapValues2.default)(config.columns, column => { - return column.width + column.paddingLeft + column.paddingRight; - })); - let empty; - empty = true; - return { - /** - * @param {string[]} row - * @returns {undefined} - */ - write: row => { - if (row.length !== config.columnCount) { - throw new Error('Row cell count does not match the config.columnCount.'); - } - - if (empty) { - empty = false; - return create(row, columnWidthIndex, config); - } else { - return append(row, columnWidthIndex, config); - } - } - }; -}; - -var _default = createStream; -exports.default = _default; -//# sourceMappingURL=createStream.js.map \ No newline at end of file diff --git a/node_modules/table/dist/createStream.js.flow b/node_modules/table/dist/createStream.js.flow deleted file mode 100644 index fee2d5c4b..000000000 --- a/node_modules/table/dist/createStream.js.flow +++ /dev/null @@ -1,126 +0,0 @@ -import _ from 'lodash'; -import alignTableData from './alignTableData'; -import calculateRowHeightIndex from './calculateRowHeightIndex'; -import { - drawBorderBottom, - drawBorderJoin, - drawBorderTop, -} from './drawBorder'; -import drawRow from './drawRow'; -import makeStreamConfig from './makeStreamConfig'; -import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; -import padTableData from './padTableData'; -import stringifyTableData from './stringifyTableData'; -import truncateTableData from './truncateTableData'; - -/** - * @param {Array} data - * @param {object} config - * @returns {Array} - */ -const prepareData = (data, config) => { - let rows; - - rows = stringifyTableData(data); - - rows = truncateTableData(data, config); - - const rowHeightIndex = calculateRowHeightIndex(rows, config); - - rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); - rows = alignTableData(rows, config); - rows = padTableData(rows, config); - - return rows; -}; - -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ -const create = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - - const body = rows.map((literalRow) => { - return drawRow(literalRow, config.border); - }).join(''); - - let output; - - output = ''; - - output += drawBorderTop(columnWidthIndex, config.border); - output += body; - output += drawBorderBottom(columnWidthIndex, config.border); - - output = output.trimEnd(); - - process.stdout.write(output); -}; - -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ -const append = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - - const body = rows.map((literalRow) => { - return drawRow(literalRow, config.border); - }).join(''); - - let output = ''; - const bottom = drawBorderBottom(columnWidthIndex, config.border); - - if (bottom !== '\n') { - output = '\r\u001B[K'; - } - - output += drawBorderJoin(columnWidthIndex, config.border); - output += body; - output += bottom; - - output = output.trimEnd(); - - process.stdout.write(output); -}; - -/** - * @param {object} userConfig - * @returns {object} - */ -export default (userConfig = {}) => { - const config = makeStreamConfig(userConfig); - - const columnWidthIndex = Object.values(_.mapValues(config.columns, (column) => { - return column.width + column.paddingLeft + column.paddingRight; - })); - - let empty; - - empty = true; - - return { - /** - * @param {string[]} row - * @returns {undefined} - */ - write: (row) => { - if (row.length !== config.columnCount) { - throw new Error('Row cell count does not match the config.columnCount.'); - } - - if (empty) { - empty = false; - - return create(row, columnWidthIndex, config); - } else { - return append(row, columnWidthIndex, config); - } - }, - }; -}; diff --git a/node_modules/table/dist/createStream.js.map b/node_modules/table/dist/createStream.js.map deleted file mode 100644 index db2abb738..000000000 --- a/node_modules/table/dist/createStream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/createStream.js"],"names":["prepareData","data","config","rows","rowHeightIndex","create","row","columnWidthIndex","body","map","literalRow","border","join","output","trimEnd","process","stdout","write","append","bottom","userConfig","Object","values","columns","column","width","paddingLeft","paddingRight","empty","length","columnCount","Error"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA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,CAACuB,MAAJ,KAAe3B,MAAM,CAAC4B,WAA1B,EAAuC;AACrC,cAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAED,UAAIH,KAAJ,EAAW;AACTA,QAAAA,KAAK,GAAG,KAAR;AAEA,eAAOvB,MAAM,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD,OAJD,MAIO;AACL,eAAOgB,MAAM,CAACZ,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD;AACF;AAjBI,GAAP;AAmBD,C","sourcesContent":["import _ from 'lodash';\nimport alignTableData from './alignTableData';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\nimport {\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop,\n} from './drawBorder';\nimport drawRow from './drawRow';\nimport makeStreamConfig from './makeStreamConfig';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport padTableData from './padTableData';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\n\n/**\n * @param {Array} data\n * @param {object} config\n * @returns {Array}\n */\nconst prepareData = (data, config) => {\n let rows;\n\n rows = stringifyTableData(data);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n return rows;\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {object} config\n * @returns {undefined}\n */\nconst create = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output;\n\n output = '';\n\n output += drawBorderTop(columnWidthIndex, config.border);\n output += body;\n output += drawBorderBottom(columnWidthIndex, config.border);\n\n output = output.trimEnd();\n\n process.stdout.write(output);\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {object} config\n * @returns {undefined}\n */\nconst append = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output = '';\n const bottom = drawBorderBottom(columnWidthIndex, config.border);\n\n if (bottom !== '\\n') {\n output = '\\r\\u001B[K';\n }\n\n output += drawBorderJoin(columnWidthIndex, config.border);\n output += body;\n output += bottom;\n\n output = output.trimEnd();\n\n process.stdout.write(output);\n};\n\n/**\n * @param {object} userConfig\n * @returns {object}\n */\nexport default (userConfig = {}) => {\n const config = makeStreamConfig(userConfig);\n\n const columnWidthIndex = Object.values(_.mapValues(config.columns, (column) => {\n return column.width + column.paddingLeft + column.paddingRight;\n }));\n\n let empty;\n\n empty = true;\n\n return {\n /**\n * @param {string[]} row\n * @returns {undefined}\n */\n write: (row) => {\n if (row.length !== config.columnCount) {\n throw new Error('Row cell count does not match the config.columnCount.');\n }\n\n if (empty) {\n empty = false;\n\n return create(row, columnWidthIndex, config);\n } else {\n return append(row, columnWidthIndex, config);\n }\n },\n };\n};\n"],"file":"createStream.js"} \ No newline at end of file diff --git a/node_modules/table/dist/drawBorder.js b/node_modules/table/dist/drawBorder.js deleted file mode 100644 index 67227e2a0..000000000 --- a/node_modules/table/dist/drawBorder.js +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = void 0; - -/** - * @typedef drawBorder~parts - * @property {string} left - * @property {string} right - * @property {string} body - * @property {string} join - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorder~parts} parts - * @returns {string} - */ -const drawBorder = (columnSizeIndex, parts) => { - const columns = columnSizeIndex.map(size => { - return parts.body.repeat(size); - }).join(parts.join); - return parts.left + columns + parts.right + '\n'; -}; -/** - * @typedef drawBorderTop~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderTop~parts} parts - * @returns {string} - */ - - -exports.drawBorder = drawBorder; - -const drawBorderTop = (columnSizeIndex, parts) => { - const border = drawBorder(columnSizeIndex, { - body: parts.topBody, - join: parts.topJoin, - left: parts.topLeft, - right: parts.topRight - }); - - if (border === '\n') { - return ''; - } - - return border; -}; -/** - * @typedef drawBorderJoin~parts - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinBody - * @property {string} joinJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderJoin~parts} parts - * @returns {string} - */ - - -exports.drawBorderTop = drawBorderTop; - -const drawBorderJoin = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.joinBody, - join: parts.joinJoin, - left: parts.joinLeft, - right: parts.joinRight - }); -}; -/** - * @typedef drawBorderBottom~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderBottom~parts} parts - * @returns {string} - */ - - -exports.drawBorderJoin = drawBorderJoin; - -const drawBorderBottom = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.bottomBody, - join: parts.bottomJoin, - left: parts.bottomLeft, - right: parts.bottomRight - }); -}; - -exports.drawBorderBottom = drawBorderBottom; -//# sourceMappingURL=drawBorder.js.map \ No newline at end of file diff --git a/node_modules/table/dist/drawBorder.js.flow b/node_modules/table/dist/drawBorder.js.flow deleted file mode 100644 index 85de2475e..000000000 --- a/node_modules/table/dist/drawBorder.js.flow +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @typedef drawBorder~parts - * @property {string} left - * @property {string} right - * @property {string} body - * @property {string} join - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorder~parts} parts - * @returns {string} - */ -const drawBorder = (columnSizeIndex, parts) => { - const columns = columnSizeIndex - .map((size) => { - return parts.body.repeat(size); - }) - .join(parts.join); - - return parts.left + columns + parts.right + '\n'; -}; - -/** - * @typedef drawBorderTop~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderTop~parts} parts - * @returns {string} - */ -const drawBorderTop = (columnSizeIndex, parts) => { - const border = drawBorder(columnSizeIndex, { - body: parts.topBody, - join: parts.topJoin, - left: parts.topLeft, - right: parts.topRight, - }); - - if (border === '\n') { - return ''; - } - - return border; -}; - -/** - * @typedef drawBorderJoin~parts - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinBody - * @property {string} joinJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderJoin~parts} parts - * @returns {string} - */ -const drawBorderJoin = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.joinBody, - join: parts.joinJoin, - left: parts.joinLeft, - right: parts.joinRight, - }); -}; - -/** - * @typedef drawBorderBottom~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderBottom~parts} parts - * @returns {string} - */ -const drawBorderBottom = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.bottomBody, - join: parts.bottomJoin, - left: parts.bottomLeft, - right: parts.bottomRight, - }); -}; - -export { - drawBorder, - drawBorderBottom, - drawBorderJoin, - drawBorderTop, -}; diff --git a/node_modules/table/dist/drawBorder.js.map b/node_modules/table/dist/drawBorder.js.map deleted file mode 100644 index 85d123eef..000000000 --- a/node_modules/table/dist/drawBorder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/drawBorder.js"],"names":["drawBorder","columnSizeIndex","parts","columns","map","size","body","repeat","join","left","right","drawBorderTop","border","topBody","topJoin","topLeft","topRight","drawBorderJoin","joinBody","joinJoin","joinLeft","joinRight","drawBorderBottom","bottomBody","bottomJoin","bottomLeft","bottomRight"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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ACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;AACA,MAAMC,gBAAgB,GAAG,CAACrB,eAAD,EAAkBC,KAAlB,KAA4B;AACnD,SAAOF,UAAU,CAACC,eAAD,EAAkB;AACjCK,IAAAA,IAAI,EAAEJ,KAAK,CAACqB,UADqB;AAEjCf,IAAAA,IAAI,EAAEN,KAAK,CAACsB,UAFqB;AAGjCf,IAAAA,IAAI,EAAEP,KAAK,CAACuB,UAHqB;AAIjCf,IAAAA,KAAK,EAAER,KAAK,CAACwB;AAJoB,GAAlB,CAAjB;AAMD,CAPD","sourcesContent":["/**\n * @typedef drawBorder~parts\n * @property {string} left\n * @property {string} right\n * @property {string} body\n * @property {string} join\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorder~parts} parts\n * @returns {string}\n */\nconst drawBorder = (columnSizeIndex, parts) => {\n const columns = columnSizeIndex\n .map((size) => {\n return parts.body.repeat(size);\n })\n .join(parts.join);\n\n return parts.left + columns + parts.right + '\\n';\n};\n\n/**\n * @typedef drawBorderTop~parts\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} topBody\n * @property {string} topJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderTop~parts} parts\n * @returns {string}\n */\nconst drawBorderTop = (columnSizeIndex, parts) => {\n const border = drawBorder(columnSizeIndex, {\n body: parts.topBody,\n join: parts.topJoin,\n left: parts.topLeft,\n right: parts.topRight,\n });\n\n if (border === '\\n') {\n return '';\n }\n\n return border;\n};\n\n/**\n * @typedef drawBorderJoin~parts\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinBody\n * @property {string} joinJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderJoin~parts} parts\n * @returns {string}\n */\nconst drawBorderJoin = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.joinBody,\n join: parts.joinJoin,\n left: parts.joinLeft,\n right: parts.joinRight,\n });\n};\n\n/**\n * @typedef drawBorderBottom~parts\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} topBody\n * @property {string} topJoin\n */\n\n/**\n * @param {number[]} columnSizeIndex\n * @param {drawBorderBottom~parts} parts\n * @returns {string}\n */\nconst drawBorderBottom = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n body: parts.bottomBody,\n join: parts.bottomJoin,\n left: parts.bottomLeft,\n right: parts.bottomRight,\n });\n};\n\nexport {\n drawBorder,\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop,\n};\n"],"file":"drawBorder.js"} \ No newline at end of file diff --git a/node_modules/table/dist/drawRow.js b/node_modules/table/dist/drawRow.js deleted file mode 100644 index 9126c4ffb..000000000 --- a/node_modules/table/dist/drawRow.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * @typedef {object} drawRow~border - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - */ - -/** - * @param {number[]} columns - * @param {drawRow~border} border - * @returns {string} - */ -const drawRow = (columns, border) => { - return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; -}; - -var _default = drawRow; -exports.default = _default; -//# sourceMappingURL=drawRow.js.map \ No newline at end of file diff --git a/node_modules/table/dist/drawRow.js.flow b/node_modules/table/dist/drawRow.js.flow deleted file mode 100644 index 978eab2de..000000000 --- a/node_modules/table/dist/drawRow.js.flow +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @typedef {object} drawRow~border - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - */ - -/** - * @param {number[]} columns - * @param {drawRow~border} border - * @returns {string} - */ -export default (columns, border) => { - return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; -}; diff --git a/node_modules/table/dist/drawRow.js.map b/node_modules/table/dist/drawRow.js.map deleted file mode 100644 index 5baffb160..000000000 --- a/node_modules/table/dist/drawRow.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/drawRow.js"],"names":["columns","border","bodyLeft","join","bodyJoin","bodyRight"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;iBACgBA,O,EAASC,M,KAAW;AAClC,SAAOA,MAAM,CAACC,QAAP,GAAkBF,OAAO,CAACG,IAAR,CAAaF,MAAM,CAACG,QAApB,CAAlB,GAAkDH,MAAM,CAACI,SAAzD,GAAqE,IAA5E;AACD,C","sourcesContent":["/**\n * @typedef {object} drawRow~border\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n */\n\n/**\n * @param {number[]} columns\n * @param {drawRow~border} border\n * @returns {string}\n */\nexport default (columns, border) => {\n return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\\n';\n};\n"],"file":"drawRow.js"} \ No newline at end of file diff --git a/node_modules/table/dist/drawTable.js b/node_modules/table/dist/drawTable.js deleted file mode 100644 index 18c9ff669..000000000 --- a/node_modules/table/dist/drawTable.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _drawBorder = require("./drawBorder"); - -var _drawRow = _interopRequireDefault(require("./drawRow")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {Array} rows - * @param {object} border - * @param {Array} columnSizeIndex - * @param {Array} rowSpanIndex - * @param {Function} drawHorizontalLine - * @param {boolean} singleLine - * @returns {string} - */ -const drawTable = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => { - let output; - let realRowIndex; - let rowHeight; - const rowCount = rows.length; - realRowIndex = 0; - output = ''; - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += (0, _drawBorder.drawBorderTop)(columnSizeIndex, border); - } - - rows.forEach((row, index0) => { - output += (0, _drawRow.default)(row, border); - - if (!rowHeight) { - rowHeight = rowSpanIndex[realRowIndex]; - realRowIndex++; - } - - rowHeight--; - - if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { - output += (0, _drawBorder.drawBorderJoin)(columnSizeIndex, border); - } - }); - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += (0, _drawBorder.drawBorderBottom)(columnSizeIndex, border); - } - - return output; -}; - -var _default = drawTable; -exports.default = _default; -//# sourceMappingURL=drawTable.js.map \ No newline at end of file diff --git a/node_modules/table/dist/drawTable.js.flow b/node_modules/table/dist/drawTable.js.flow deleted file mode 100644 index 84707caa8..000000000 --- a/node_modules/table/dist/drawTable.js.flow +++ /dev/null @@ -1,53 +0,0 @@ -import { - drawBorderTop, - drawBorderJoin, - drawBorderBottom, -} from './drawBorder'; -import drawRow from './drawRow'; - -/** - * @param {Array} rows - * @param {object} border - * @param {Array} columnSizeIndex - * @param {Array} rowSpanIndex - * @param {Function} drawHorizontalLine - * @param {boolean} singleLine - * @returns {string} - */ -export default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => { - let output; - let realRowIndex; - let rowHeight; - - const rowCount = rows.length; - - realRowIndex = 0; - - output = ''; - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += drawBorderTop(columnSizeIndex, border); - } - - rows.forEach((row, index0) => { - output += drawRow(row, border); - - if (!rowHeight) { - rowHeight = rowSpanIndex[realRowIndex]; - - realRowIndex++; - } - - rowHeight--; - - if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { - output += drawBorderJoin(columnSizeIndex, border); - } - }); - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += drawBorderBottom(columnSizeIndex, border); - } - - return output; -}; diff --git a/node_modules/table/dist/drawTable.js.map b/node_modules/table/dist/drawTable.js.map deleted file mode 100644 index 7bf3904b3..000000000 --- a/node_modules/table/dist/drawTable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/drawTable.js"],"names":["rows","border","columnSizeIndex","rowSpanIndex","drawHorizontalLine","singleLine","output","realRowIndex","rowHeight","rowCount","length","forEach","row","index0"],"mappings":";;;;;;;AAAA;;AAKA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;mBACgBA,I,EAAMC,M,EAAQC,e,EAAiBC,Y,EAAcC,kB,EAAoBC,U,KAAe;AAC9F,MAAIC,MAAJ;AACA,MAAIC,YAAJ;AACA,MAAIC,SAAJ;AAEA,QAAMC,QAAQ,GAAGT,IAAI,CAACU,MAAtB;AAEAH,EAAAA,YAAY,GAAG,CAAf;AAEAD,EAAAA,MAAM,GAAG,EAAT;;AAEA,MAAIF,kBAAkB,CAACG,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,+BAAcJ,eAAd,EAA+BD,MAA/B,CAAV;AACD;;AAEDD,EAAAA,IAAI,CAACW,OAAL,CAAa,CAACC,GAAD,EAAMC,MAAN,KAAiB;AAC5BP,IAAAA,MAAM,IAAI,sBAAQM,GAAR,EAAaX,MAAb,CAAV;;AAEA,QAAI,CAACO,SAAL,EAAgB;AACdA,MAAAA,SAAS,GAAGL,YAAY,CAACI,YAAD,CAAxB;AAEAA,MAAAA,YAAY;AACb;;AAEDC,IAAAA,SAAS;;AAET,QAAI,CAACH,UAAD,IAAeG,SAAS,KAAK,CAA7B,IAAkCK,MAAM,KAAKJ,QAAQ,GAAG,CAAxD,IAA6DL,kBAAkB,CAACG,YAAD,EAAeE,QAAf,CAAnF,EAA6G;AAC3GH,MAAAA,MAAM,IAAI,gCAAeJ,eAAf,EAAgCD,MAAhC,CAAV;AACD;AACF,GAdD;;AAgBA,MAAIG,kBAAkB,CAACG,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,kCAAiBJ,eAAjB,EAAkCD,MAAlC,CAAV;AACD;;AAED,SAAOK,MAAP;AACD,C","sourcesContent":["import {\n drawBorderTop,\n drawBorderJoin,\n drawBorderBottom,\n} from './drawBorder';\nimport drawRow from './drawRow';\n\n/**\n * @param {Array} rows\n * @param {object} border\n * @param {Array} columnSizeIndex\n * @param {Array} rowSpanIndex\n * @param {Function} drawHorizontalLine\n * @param {boolean} singleLine\n * @returns {string}\n */\nexport default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => {\n let output;\n let realRowIndex;\n let rowHeight;\n\n const rowCount = rows.length;\n\n realRowIndex = 0;\n\n output = '';\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderTop(columnSizeIndex, border);\n }\n\n rows.forEach((row, index0) => {\n output += drawRow(row, border);\n\n if (!rowHeight) {\n rowHeight = rowSpanIndex[realRowIndex];\n\n realRowIndex++;\n }\n\n rowHeight--;\n\n if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderJoin(columnSizeIndex, border);\n }\n });\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderBottom(columnSizeIndex, border);\n }\n\n return output;\n};\n"],"file":"drawTable.js"} \ No newline at end of file diff --git a/node_modules/table/dist/getBorderCharacters.js b/node_modules/table/dist/getBorderCharacters.js deleted file mode 100644 index 00da959fd..000000000 --- a/node_modules/table/dist/getBorderCharacters.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* eslint-disable sort-keys-fix/sort-keys-fix */ - -/** - * @typedef border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * @param {string} name - * @returns {border} - */ -const getBorderCharacters = name => { - if (name === 'honeywell') { - return { - topBody: '═', - topJoin: '╤', - topLeft: '╔', - topRight: '╗', - bottomBody: '═', - bottomJoin: '╧', - bottomLeft: '╚', - bottomRight: '╝', - bodyLeft: '║', - bodyRight: '║', - bodyJoin: '│', - joinBody: '─', - joinLeft: '╟', - joinRight: '╢', - joinJoin: '┼' - }; - } - - if (name === 'norc') { - return { - topBody: '─', - topJoin: '┬', - topLeft: '┌', - topRight: '┐', - bottomBody: '─', - bottomJoin: '┴', - bottomLeft: '└', - bottomRight: '┘', - bodyLeft: '│', - bodyRight: '│', - bodyJoin: '│', - joinBody: '─', - joinLeft: '├', - joinRight: '┤', - joinJoin: '┼' - }; - } - - if (name === 'ramac') { - return { - topBody: '-', - topJoin: '+', - topLeft: '+', - topRight: '+', - bottomBody: '-', - bottomJoin: '+', - bottomLeft: '+', - bottomRight: '+', - bodyLeft: '|', - bodyRight: '|', - bodyJoin: '|', - joinBody: '-', - joinLeft: '|', - joinRight: '|', - joinJoin: '|' - }; - } - - if (name === 'void') { - return { - topBody: '', - topJoin: '', - topLeft: '', - topRight: '', - bottomBody: '', - bottomJoin: '', - bottomLeft: '', - bottomRight: '', - bodyLeft: '', - bodyRight: '', - bodyJoin: '', - joinBody: '', - joinLeft: '', - joinRight: '', - joinJoin: '' - }; - } - - throw new Error('Unknown border template "' + name + '".'); -}; - -var _default = getBorderCharacters; -exports.default = _default; -//# sourceMappingURL=getBorderCharacters.js.map \ No newline at end of file diff --git a/node_modules/table/dist/getBorderCharacters.js.flow b/node_modules/table/dist/getBorderCharacters.js.flow deleted file mode 100644 index bc8b0f263..000000000 --- a/node_modules/table/dist/getBorderCharacters.js.flow +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable sort-keys-fix/sort-keys-fix */ - -/** - * @typedef border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * @param {string} name - * @returns {border} - */ -export default (name) => { - if (name === 'honeywell') { - return { - topBody: '═', - topJoin: '╤', - topLeft: '╔', - topRight: '╗', - - bottomBody: '═', - bottomJoin: '╧', - bottomLeft: '╚', - bottomRight: '╝', - - bodyLeft: '║', - bodyRight: '║', - bodyJoin: '│', - - joinBody: '─', - joinLeft: '╟', - joinRight: '╢', - joinJoin: '┼', - }; - } - - if (name === 'norc') { - return { - topBody: '─', - topJoin: '┬', - topLeft: '┌', - topRight: '┐', - - bottomBody: '─', - bottomJoin: '┴', - bottomLeft: '└', - bottomRight: '┘', - - bodyLeft: '│', - bodyRight: '│', - bodyJoin: '│', - - joinBody: '─', - joinLeft: '├', - joinRight: '┤', - joinJoin: '┼', - }; - } - - if (name === 'ramac') { - return { - topBody: '-', - topJoin: '+', - topLeft: '+', - topRight: '+', - - bottomBody: '-', - bottomJoin: '+', - bottomLeft: '+', - bottomRight: '+', - - bodyLeft: '|', - bodyRight: '|', - bodyJoin: '|', - - joinBody: '-', - joinLeft: '|', - joinRight: '|', - joinJoin: '|', - }; - } - - if (name === 'void') { - return { - topBody: '', - topJoin: '', - topLeft: '', - topRight: '', - - bottomBody: '', - bottomJoin: '', - bottomLeft: '', - bottomRight: '', - - bodyLeft: '', - bodyRight: '', - bodyJoin: '', - - joinBody: '', - joinLeft: '', - joinRight: '', - joinJoin: '', - }; - } - - throw new Error('Unknown border template "' + name + '".'); -}; diff --git a/node_modules/table/dist/getBorderCharacters.js.map b/node_modules/table/dist/getBorderCharacters.js.map deleted file mode 100644 index 999545edf..000000000 --- a/node_modules/table/dist/getBorderCharacters.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/getBorderCharacters.js"],"names":["name","topBody","topJoin","topLeft","topRight","bottomBody","bottomJoin","bottomLeft","bottomRight","bodyLeft","bodyRight","bodyJoin","joinBody","joinLeft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AA/C,CAAN;AACD,C","sourcesContent":["/* eslint-disable sort-keys-fix/sort-keys-fix */\n\n/**\n * @typedef border\n * @property {string} topBody\n * @property {string} topJoin\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} bottomBody\n * @property {string} bottomJoin\n * @property {string} bottomLeft\n * @property {string} bottomRight\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n * @property {string} joinBody\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinJoin\n */\n\n/**\n * @param {string} name\n * @returns {border}\n */\nexport default (name) => {\n if (name === 'honeywell') {\n return {\n topBody: '═',\n topJoin: '╤',\n topLeft: '╔',\n topRight: '╗',\n\n bottomBody: '═',\n bottomJoin: '╧',\n bottomLeft: '╚',\n bottomRight: '╝',\n\n bodyLeft: '║',\n bodyRight: '║',\n bodyJoin: '│',\n\n joinBody: '─',\n joinLeft: '╟',\n joinRight: '╢',\n joinJoin: '┼',\n };\n }\n\n if (name === 'norc') {\n return {\n topBody: '─',\n topJoin: '┬',\n topLeft: '┌',\n topRight: '┐',\n\n bottomBody: '─',\n bottomJoin: '┴',\n bottomLeft: '└',\n bottomRight: '┘',\n\n bodyLeft: '│',\n bodyRight: '│',\n bodyJoin: '│',\n\n joinBody: '─',\n joinLeft: '├',\n joinRight: '┤',\n joinJoin: '┼',\n };\n }\n\n if (name === 'ramac') {\n return {\n topBody: '-',\n topJoin: '+',\n topLeft: '+',\n topRight: '+',\n\n bottomBody: '-',\n bottomJoin: '+',\n bottomLeft: '+',\n bottomRight: '+',\n\n bodyLeft: '|',\n bodyRight: '|',\n bodyJoin: '|',\n\n joinBody: '-',\n joinLeft: '|',\n joinRight: '|',\n joinJoin: '|',\n };\n }\n\n if (name === 'void') {\n return {\n topBody: '',\n topJoin: '',\n topLeft: '',\n topRight: '',\n\n bottomBody: '',\n bottomJoin: '',\n bottomLeft: '',\n bottomRight: '',\n\n bodyLeft: '',\n bodyRight: '',\n bodyJoin: '',\n\n joinBody: '',\n joinLeft: '',\n joinRight: '',\n joinJoin: '',\n };\n }\n\n throw new Error('Unknown border template \"' + name + '\".');\n};\n"],"file":"getBorderCharacters.js"} \ No newline at end of file diff --git a/node_modules/table/dist/index.js b/node_modules/table/dist/index.js deleted file mode 100644 index 010fbae9f..000000000 --- a/node_modules/table/dist/index.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "createStream", { - enumerable: true, - get: function () { - return _createStream.default; - } -}); -Object.defineProperty(exports, "getBorderCharacters", { - enumerable: true, - get: function () { - return _getBorderCharacters.default; - } -}); -Object.defineProperty(exports, "table", { - enumerable: true, - get: function () { - return _table.default; - } -}); - -var _createStream = _interopRequireDefault(require("./createStream")); - -var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); - -var _table = _interopRequireDefault(require("./table")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/dist/index.js.flow b/node_modules/table/dist/index.js.flow deleted file mode 100644 index 4a47c5025..000000000 --- a/node_modules/table/dist/index.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -import createStream from './createStream'; -import getBorderCharacters from './getBorderCharacters'; -import table from './table'; - -export { - table, - createStream, - getBorderCharacters, -}; diff --git a/node_modules/table/dist/index.js.map b/node_modules/table/dist/index.js.map deleted file mode 100644 index 30ffff41d..000000000 --- a/node_modules/table/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA","sourcesContent":["import createStream from './createStream';\nimport getBorderCharacters from './getBorderCharacters';\nimport table from './table';\n\nexport {\n table,\n createStream,\n getBorderCharacters,\n};\n"],"file":"index.js"} \ No newline at end of file diff --git a/node_modules/table/dist/makeConfig.js b/node_modules/table/dist/makeConfig.js deleted file mode 100644 index 8f77c6304..000000000 --- a/node_modules/table/dist/makeConfig.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep")); - -var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined")); - -var _times2 = _interopRequireDefault(require("lodash/times")); - -var _calculateMaximumColumnWidthIndex = _interopRequireDefault(require("./calculateMaximumColumnWidthIndex")); - -var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); - -var _validateConfig = _interopRequireDefault(require("./validateConfig")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} - */ -const makeBorder = (border = {}) => { - return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); -}; -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} columns - * @param {object} columnDefault - * @returns {object} - */ - - -const makeColumns = (rows, columns = {}, columnDefault = {}) => { - const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex.default)(rows); - (0, _times2.default)(rows[0].length, index => { - if ((0, _isUndefined2.default)(columns[index])) { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - width: maximumColumnWidthIndex[index], - wrapWord: false - }, columnDefault, columns[index]); - }); - return columns; -}; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} userConfig - * @returns {object} - */ - - -const makeConfig = (rows, userConfig = {}) => { - (0, _validateConfig.default)('config.json', userConfig); - const config = (0, _cloneDeep2.default)(userConfig); - config.border = makeBorder(config.border); - config.columns = makeColumns(rows, config.columns, config.columnDefault); - - if (!config.drawHorizontalLine) { - /** - * @returns {boolean} - */ - config.drawHorizontalLine = () => { - return true; - }; - } - - if (config.singleLine === undefined) { - config.singleLine = false; - } - - return config; -}; - -var _default = makeConfig; -exports.default = _default; -//# sourceMappingURL=makeConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/makeConfig.js.flow b/node_modules/table/dist/makeConfig.js.flow deleted file mode 100644 index f661220cc..000000000 --- a/node_modules/table/dist/makeConfig.js.flow +++ /dev/null @@ -1,76 +0,0 @@ -import _ from 'lodash'; -import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex'; -import getBorderCharacters from './getBorderCharacters'; -import validateConfig from './validateConfig'; - -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} - */ -const makeBorder = (border = {}) => { - return Object.assign({}, getBorderCharacters('honeywell'), border); -}; - -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} columns - * @param {object} columnDefault - * @returns {object} - */ -const makeColumns = (rows, columns = {}, columnDefault = {}) => { - const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows); - - _.times(rows[0].length, (index) => { - if (_.isUndefined(columns[index])) { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - width: maximumColumnWidthIndex[index], - wrapWord: false, - }, columnDefault, columns[index]); - }); - - return columns; -}; - -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} userConfig - * @returns {object} - */ -export default (rows, userConfig = {}) => { - validateConfig('config.json', userConfig); - - const config = _.cloneDeep(userConfig); - - config.border = makeBorder(config.border); - config.columns = makeColumns(rows, config.columns, config.columnDefault); - - if (!config.drawHorizontalLine) { - /** - * @returns {boolean} - */ - config.drawHorizontalLine = () => { - return true; - }; - } - - if (config.singleLine === undefined) { - config.singleLine = false; - } - - return config; -}; diff --git a/node_modules/table/dist/makeConfig.js.map b/node_modules/table/dist/makeConfig.js.map deleted file mode 100644 index ad0c9aae2..000000000 --- a/node_modules/table/dist/makeConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/makeConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","rows","columns","columnDefault","maximumColumnWidthIndex","length","index","alignment","paddingLeft","paddingRight","truncate","Number","POSITIVE_INFINITY","width","wrapWord","userConfig","config","drawHorizontalLine","singleLine","undefined"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,WAAW,GAAG,CAACC,IAAD,EAAOC,OAAO,GAAG,EAAjB,EAAqBC,aAAa,GAAG,EAArC,KAA4C;AAC9D,QAAMC,uBAAuB,GAAG,+CAAiCH,IAAjC,CAAhC;AAEA,uBAAQA,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAhB,EAAyBC,KAAD,IAAW;AACjC,QAAI,2BAAcJ,OAAO,CAACI,KAAD,CAArB,CAAJ,EAAmC;AACjCJ,MAAAA,OAAO,CAACI,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDJ,IAAAA,OAAO,CAACI,KAAD,CAAP,GAAiBR,MAAM,CAACC,MAAP,CAAc;AAC7BQ,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,MAAM,CAACC,iBAJY;AAK7BC,MAAAA,KAAK,EAAET,uBAAuB,CAACE,KAAD,CALD;AAM7BQ,MAAAA,QAAQ,EAAE;AANmB,KAAd,EAOdX,aAPc,EAOCD,OAAO,CAACI,KAAD,CAPR,CAAjB;AAQD,GAbD;AAeA,SAAOJ,OAAP;AACD,CAnBD;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;oBACgBD,I,EAAMc,UAAU,GAAG,E,KAAO;AACxC,+BAAe,aAAf,EAA8BA,UAA9B;AAEA,QAAMC,MAAM,GAAG,yBAAYD,UAAZ,CAAf;AAEAC,EAAAA,MAAM,CAACnB,MAAP,GAAgBD,UAAU,CAACoB,MAAM,CAACnB,MAAR,CAA1B;AACAmB,EAAAA,MAAM,CAACd,OAAP,GAAiBF,WAAW,CAACC,IAAD,EAAOe,MAAM,CAACd,OAAd,EAAuBc,MAAM,CAACb,aAA9B,CAA5B;;AAEA,MAAI,CAACa,MAAM,CAACC,kBAAZ,EAAgC;AAC9B;AACJ;AACA;AACID,IAAAA,MAAM,CAACC,kBAAP,GAA4B,MAAM;AAChC,aAAO,IAAP;AACD,KAFD;AAGD;;AAED,MAAID,MAAM,CAACE,UAAP,KAAsBC,SAA1B,EAAqC;AACnCH,IAAAA,MAAM,CAACE,UAAP,GAAoB,KAApB;AACD;;AAED,SAAOF,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {object} border\n * @returns {object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {object} columns\n * @param {object} columnDefault\n * @returns {object}\n */\nconst makeColumns = (rows, columns = {}, columnDefault = {}) => {\n const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);\n\n _.times(rows[0].length, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Number.POSITIVE_INFINITY,\n width: maximumColumnWidthIndex[index],\n wrapWord: false,\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {object} userConfig\n * @returns {object}\n */\nexport default (rows, userConfig = {}) => {\n validateConfig('config.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(rows, config.columns, config.columnDefault);\n\n if (!config.drawHorizontalLine) {\n /**\n * @returns {boolean}\n */\n config.drawHorizontalLine = () => {\n return true;\n };\n }\n\n if (config.singleLine === undefined) {\n config.singleLine = false;\n }\n\n return config;\n};\n"],"file":"makeConfig.js"} \ No newline at end of file diff --git a/node_modules/table/dist/makeStreamConfig.js b/node_modules/table/dist/makeStreamConfig.js deleted file mode 100644 index f36fdf3ba..000000000 --- a/node_modules/table/dist/makeStreamConfig.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep")); - -var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined")); - -var _times2 = _interopRequireDefault(require("lodash/times")); - -var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); - -var _validateConfig = _interopRequireDefault(require("./validateConfig")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} - */ -const makeBorder = (border = {}) => { - return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); -}; -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - * - * @param {number} columnCount - * @param {object} columns - * @param {object} columnDefault - * @returns {object} - */ - - -const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { - (0, _times2.default)(columnCount, index => { - if ((0, _isUndefined2.default)(columns[index])) { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - wrapWord: false - }, columnDefault, columns[index]); - }); - return columns; -}; -/** - * @typedef {object} columnConfig - * @property {string} alignment - * @property {number} width - * @property {number} truncate - * @property {number} paddingLeft - * @property {number} paddingRight - */ - -/** - * @typedef {object} streamConfig - * @property {columnConfig} columnDefault - * @property {object} border - * @property {columnConfig[]} - * @property {number} columnCount Number of columns in the table (required). - */ - -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - * - * @param {streamConfig} userConfig - * @returns {object} - */ - - -const makeStreamConfig = (userConfig = {}) => { - (0, _validateConfig.default)('streamConfig.json', userConfig); - const config = (0, _cloneDeep2.default)(userConfig); - - if (!config.columnDefault || !config.columnDefault.width) { - throw new Error('Must provide config.columnDefault.width when creating a stream.'); - } - - if (!config.columnCount) { - throw new Error('Must provide config.columnCount.'); - } - - config.border = makeBorder(config.border); - config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); - return config; -}; - -var _default = makeStreamConfig; -exports.default = _default; -//# sourceMappingURL=makeStreamConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/makeStreamConfig.js.flow b/node_modules/table/dist/makeStreamConfig.js.flow deleted file mode 100644 index 5f361c391..000000000 --- a/node_modules/table/dist/makeStreamConfig.js.flow +++ /dev/null @@ -1,83 +0,0 @@ -import _ from 'lodash'; -import getBorderCharacters from './getBorderCharacters'; -import validateConfig from './validateConfig'; - -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} - */ -const makeBorder = (border = {}) => { - return Object.assign({}, getBorderCharacters('honeywell'), border); -}; - -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - * - * @param {number} columnCount - * @param {object} columns - * @param {object} columnDefault - * @returns {object} - */ -const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { - _.times(columnCount, (index) => { - if (_.isUndefined(columns[index])) { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - wrapWord: false, - }, columnDefault, columns[index]); - }); - - return columns; -}; - -/** - * @typedef {object} columnConfig - * @property {string} alignment - * @property {number} width - * @property {number} truncate - * @property {number} paddingLeft - * @property {number} paddingRight - */ - -/** - * @typedef {object} streamConfig - * @property {columnConfig} columnDefault - * @property {object} border - * @property {columnConfig[]} - * @property {number} columnCount Number of columns in the table (required). - */ - -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - * - * @param {streamConfig} userConfig - * @returns {object} - */ -export default (userConfig = {}) => { - validateConfig('streamConfig.json', userConfig); - - const config = _.cloneDeep(userConfig); - - if (!config.columnDefault || !config.columnDefault.width) { - throw new Error('Must provide config.columnDefault.width when creating a stream.'); - } - - if (!config.columnCount) { - throw new Error('Must provide config.columnCount.'); - } - - config.border = makeBorder(config.border); - config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); - - return config; -}; diff --git a/node_modules/table/dist/makeStreamConfig.js.map b/node_modules/table/dist/makeStreamConfig.js.map deleted file mode 100644 index aa1f46fab..000000000 --- a/node_modules/table/dist/makeStreamConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/makeStreamConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","columnCount","columns","columnDefault","index","alignment","paddingLeft","paddingRight","truncate","Number","POSITIVE_INFINITY","wrapWord","userConfig","config","width","Error"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A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EAAqBY,MAAM,CAACX,OAA5B,EAAqCW,MAAM,CAACV,aAA5C,CAA5B;AAEA,SAAOU,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {object} border\n * @returns {object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {number} columnCount\n * @param {object} columns\n * @param {object} columnDefault\n * @returns {object}\n */\nconst makeColumns = (columnCount, columns = {}, columnDefault = {}) => {\n _.times(columnCount, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Number.POSITIVE_INFINITY,\n wrapWord: false,\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * @typedef {object} columnConfig\n * @property {string} alignment\n * @property {number} width\n * @property {number} truncate\n * @property {number} paddingLeft\n * @property {number} paddingRight\n */\n\n/**\n * @typedef {object} streamConfig\n * @property {columnConfig} columnDefault\n * @property {object} border\n * @property {columnConfig[]}\n * @property {number} columnCount Number of columns in the table (required).\n */\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {streamConfig} userConfig\n * @returns {object}\n */\nexport default (userConfig = {}) => {\n validateConfig('streamConfig.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n if (!config.columnDefault || !config.columnDefault.width) {\n throw new Error('Must provide config.columnDefault.width when creating a stream.');\n }\n\n if (!config.columnCount) {\n throw new Error('Must provide config.columnCount.');\n }\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault);\n\n return config;\n};\n"],"file":"makeStreamConfig.js"} \ No newline at end of file diff --git a/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/node_modules/table/dist/mapDataUsingRowHeightIndex.js deleted file mode 100644 index be1f5a1cd..000000000 --- a/node_modules/table/dist/mapDataUsingRowHeightIndex.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _flatten2 = _interopRequireDefault(require("lodash/flatten")); - -var _times2 = _interopRequireDefault(require("lodash/times")); - -var _wrapCell = _interopRequireDefault(require("./wrapCell")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {Array} unmappedRows - * @param {number[]} rowHeightIndex - * @param {object} config - * @returns {Array} - */ -const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { - const tableWidth = unmappedRows[0].length; - const mappedRows = unmappedRows.map((cells, index0) => { - const rowHeight = (0, _times2.default)(rowHeightIndex[index0], () => { - return new Array(tableWidth).fill(''); - }); // rowHeight - // [{row index within rowSaw; index2}] - // [{cell index within a virtual row; index1}] - - cells.forEach((value, index1) => { - const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); - cellLines.forEach((cellLine, index2) => { - rowHeight[index2][index1] = cellLine; - }); - }); - return rowHeight; - }); - return (0, _flatten2.default)(mappedRows); -}; - -var _default = mapDataUsingRowHeightIndex; -exports.default = _default; -//# sourceMappingURL=mapDataUsingRowHeightIndex.js.map \ No newline at end of file diff --git a/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow b/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow deleted file mode 100644 index f4c08cc44..000000000 --- a/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow +++ /dev/null @@ -1,34 +0,0 @@ -import _ from 'lodash'; -import wrapCell from './wrapCell'; - -/** - * @param {Array} unmappedRows - * @param {number[]} rowHeightIndex - * @param {object} config - * @returns {Array} - */ -export default (unmappedRows, rowHeightIndex, config) => { - const tableWidth = unmappedRows[0].length; - - const mappedRows = unmappedRows.map((cells, index0) => { - const rowHeight = _.times(rowHeightIndex[index0], () => { - return new Array(tableWidth).fill(''); - }); - - // rowHeight - // [{row index within rowSaw; index2}] - // [{cell index within a virtual row; index1}] - - cells.forEach((value, index1) => { - const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord); - - cellLines.forEach((cellLine, index2) => { - rowHeight[index2][index1] = cellLine; - }); - }); - - return rowHeight; - }); - - return _.flatten(mappedRows); -}; diff --git a/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map b/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map deleted file mode 100644 index 239a35d30..000000000 --- a/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","Array","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2"],"mappings":";;;;;;;;;;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;oCACgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAG,qBAAQR,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAIE,KAAJ,CAAUP,UAAV,EAAsBQ,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;AAEAJ,IAAAA,KAAK,CAACK,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBX,MAAM,CAACc,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8Cf,MAAM,CAACc,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCX,QAAAA,SAAS,CAACW,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOV,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAO,uBAAUJ,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = _.times(rowHeightIndex[index0], () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n cellLines.forEach((cellLine, index2) => {\n rowHeight[index2][index1] = cellLine;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"} \ No newline at end of file diff --git a/node_modules/table/dist/padTableData.js b/node_modules/table/dist/padTableData.js deleted file mode 100644 index bdf493841..000000000 --- a/node_modules/table/dist/padTableData.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -const padTableData = (rows, config) => { - return rows.map(cells => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); - }); - }); -}; - -var _default = padTableData; -exports.default = _default; -//# sourceMappingURL=padTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/padTableData.js.flow b/node_modules/table/dist/padTableData.js.flow deleted file mode 100644 index a4e6b142c..000000000 --- a/node_modules/table/dist/padTableData.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -export default (rows, config) => { - return rows.map((cells) => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - - return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); - }); - }); -}; diff --git a/node_modules/table/dist/padTableData.js.map b/node_modules/table/dist/padTableData.js.map deleted file mode 100644 index 666312fb7..000000000 --- a/node_modules/table/dist/padTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/padTableData.js"],"names":["rows","config","map","cells","value","index1","column","columns","repeat","paddingLeft","paddingRight"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;sBACgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,KAAD,EAAQC,MAAR,KAAmB;AAClC,YAAMC,MAAM,GAAGL,MAAM,CAACM,OAAP,CAAeF,MAAf,CAAf;AAEA,aAAO,IAAIG,MAAJ,CAAWF,MAAM,CAACG,WAAlB,IAAiCL,KAAjC,GAAyC,IAAII,MAAJ,CAAWF,MAAM,CAACI,YAAlB,CAAhD;AACD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["/**\n * @param {table~row[]} rows\n * @param {object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((value, index1) => {\n const column = config.columns[index1];\n\n return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight);\n });\n });\n};\n"],"file":"padTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/schemas/config.json b/node_modules/table/dist/schemas/config.json deleted file mode 100644 index 10fc74ab9..000000000 --- a/node_modules/table/dist/schemas/config.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - } - }, - "additionalProperties": false -} diff --git a/node_modules/table/dist/schemas/shared.json b/node_modules/table/dist/schemas/shared.json deleted file mode 100644 index 7d03f9269..000000000 --- a/node_modules/table/dist/schemas/shared.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "$id": "shared.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "columns": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": [ - "left", - "right", - "center" - ] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - } - } -} diff --git a/node_modules/table/dist/schemas/streamConfig.json b/node_modules/table/dist/schemas/streamConfig.json deleted file mode 100644 index 24dfa5628..000000000 --- a/node_modules/table/dist/schemas/streamConfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "columnCount": { - "type": "number" - } - }, - "additionalProperties": false -} diff --git a/node_modules/table/dist/stringifyTableData.js b/node_modules/table/dist/stringifyTableData.js deleted file mode 100644 index 0217e3b7b..000000000 --- a/node_modules/table/dist/stringifyTableData.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * Casts all cell values to a string. - * - * @param {table~row[]} rows - * @returns {table~row[]} - */ -const stringifyTableData = rows => { - return rows.map(cells => { - return cells.map(String); - }); -}; - -var _default = stringifyTableData; -exports.default = _default; -//# sourceMappingURL=stringifyTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/stringifyTableData.js.flow b/node_modules/table/dist/stringifyTableData.js.flow deleted file mode 100644 index a4dffac13..000000000 --- a/node_modules/table/dist/stringifyTableData.js.flow +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Casts all cell values to a string. - * - * @param {table~row[]} rows - * @returns {table~row[]} - */ -export default (rows) => { - return rows.map((cells) => { - return cells.map(String); - }); -}; diff --git a/node_modules/table/dist/stringifyTableData.js.map b/node_modules/table/dist/stringifyTableData.js.map deleted file mode 100644 index b18605c60..000000000 --- a/node_modules/table/dist/stringifyTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/stringifyTableData.js"],"names":["rows","map","cells","String"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;2BACgBA,I,IAAS;AACvB,SAAOA,IAAI,CAACC,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAUE,MAAV,CAAP;AACD,GAFM,CAAP;AAGD,C","sourcesContent":["/**\n * Casts all cell values to a string.\n *\n * @param {table~row[]} rows\n * @returns {table~row[]}\n */\nexport default (rows) => {\n return rows.map((cells) => {\n return cells.map(String);\n });\n};\n"],"file":"stringifyTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/table.js b/node_modules/table/dist/table.js deleted file mode 100644 index 8c22a6e05..000000000 --- a/node_modules/table/dist/table.js +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _alignTableData = _interopRequireDefault(require("./alignTableData")); - -var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); - -var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); - -var _drawTable = _interopRequireDefault(require("./drawTable")); - -var _makeConfig = _interopRequireDefault(require("./makeConfig")); - -var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); - -var _padTableData = _interopRequireDefault(require("./padTableData")); - -var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); - -var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); - -var _validateTableData = _interopRequireDefault(require("./validateTableData")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @typedef {string} table~cell - */ - -/** - * @typedef {table~cell[]} table~row - */ - -/** - * @typedef {object} table~columns - * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). - * @property {number} width Column width (default: auto). - * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). - * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters - * @property {number} paddingLeft Cell content padding width left (default: 1). - * @property {number} paddingRight Cell content padding width right (default: 1). - */ - -/** - * @typedef {object} table~border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * Used to tell whether to draw a horizontal line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - * - * @typedef {Function} drawHorizontalLine - * @param {number} index - * @param {number} size - * @returns {boolean} - */ - -/** - * @typedef {object} table~config - * @property {table~border} border - * @property {table~columns[]} columns Column specific configuration. - * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. - * @property {table~drawHorizontalLine} drawHorizontalLine - * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn. - */ - -/** - * Generates a text table. - * - * @param {table~row[]} data - * @param {table~config} userConfig - * @returns {string} - */ -const table = (data, userConfig = {}) => { - let rows; - (0, _validateTableData.default)(data); - rows = (0, _stringifyTableData.default)(data); - const config = (0, _makeConfig.default)(rows, userConfig); - rows = (0, _truncateTableData.default)(data, config); - const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); - rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); - rows = (0, _alignTableData.default)(rows, config); - rows = (0, _padTableData.default)(rows, config); - const cellWidthIndex = (0, _calculateCellWidthIndex.default)(rows[0]); - return (0, _drawTable.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine); -}; - -var _default = table; -exports.default = _default; -//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/node_modules/table/dist/table.js.flow b/node_modules/table/dist/table.js.flow deleted file mode 100644 index 6790e8cc5..000000000 --- a/node_modules/table/dist/table.js.flow +++ /dev/null @@ -1,96 +0,0 @@ -import alignTableData from './alignTableData'; -import calculateCellWidthIndex from './calculateCellWidthIndex'; -import calculateRowHeightIndex from './calculateRowHeightIndex'; -import drawTable from './drawTable'; -import makeConfig from './makeConfig'; -import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; -import padTableData from './padTableData'; -import stringifyTableData from './stringifyTableData'; -import truncateTableData from './truncateTableData'; -import validateTableData from './validateTableData'; - -/** - * @typedef {string} table~cell - */ - -/** - * @typedef {table~cell[]} table~row - */ - -/** - * @typedef {object} table~columns - * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). - * @property {number} width Column width (default: auto). - * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). - * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters - * @property {number} paddingLeft Cell content padding width left (default: 1). - * @property {number} paddingRight Cell content padding width right (default: 1). - */ - -/** - * @typedef {object} table~border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * Used to tell whether to draw a horizontal line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - * - * @typedef {Function} drawHorizontalLine - * @param {number} index - * @param {number} size - * @returns {boolean} - */ - -/** - * @typedef {object} table~config - * @property {table~border} border - * @property {table~columns[]} columns Column specific configuration. - * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. - * @property {table~drawHorizontalLine} drawHorizontalLine - * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn. - */ - -/** - * Generates a text table. - * - * @param {table~row[]} data - * @param {table~config} userConfig - * @returns {string} - */ -export default (data, userConfig = {}) => { - let rows; - - validateTableData(data); - - rows = stringifyTableData(data); - - const config = makeConfig(rows, userConfig); - - rows = truncateTableData(data, config); - - const rowHeightIndex = calculateRowHeightIndex(rows, config); - - rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); - rows = alignTableData(rows, config); - rows = padTableData(rows, config); - - const cellWidthIndex = calculateCellWidthIndex(rows[0]); - - return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine); -}; diff --git a/node_modules/table/dist/table.js.map b/node_modules/table/dist/table.js.map deleted file mode 100644 index 20eefad25..000000000 --- a/node_modules/table/dist/table.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/table.js"],"names":["data","userConfig","rows","config","rowHeightIndex","cellWidthIndex","border","drawHorizontalLine","singleLine"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;eACgBA,I,EAAMC,UAAU,GAAG,E,KAAO;AACxC,MAAIC,IAAJ;AAEA,kCAAkBF,IAAlB;AAEAE,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEA,QAAMG,MAAM,GAAG,yBAAWD,IAAX,EAAiBD,UAAjB,CAAf;AAEAC,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBG,MAAxB,CAAP;AAEA,QAAMC,cAAc,GAAG,sCAAwBF,IAAxB,EAA8BC,MAA9B,CAAvB;AAEAD,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCE,cAAjC,EAAiDD,MAAjD,CAAP;AACAD,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBC,MAArB,CAAP;AACAD,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBC,MAAnB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBH,IAAI,CAAC,CAAD,CAA5B,CAAvB;AAEA,SAAO,wBAAUA,IAAV,EAAgBC,MAAM,CAACG,MAAvB,EAA+BD,cAA/B,EAA+CD,cAA/C,EAA+DD,MAAM,CAACI,kBAAtE,EAA0FJ,MAAM,CAACK,UAAjG,CAAP;AACD,C","sourcesContent":["import alignTableData from './alignTableData';\nimport calculateCellWidthIndex from './calculateCellWidthIndex';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\nimport drawTable from './drawTable';\nimport makeConfig from './makeConfig';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport padTableData from './padTableData';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\nimport validateTableData from './validateTableData';\n\n/**\n * @typedef {string} table~cell\n */\n\n/**\n * @typedef {table~cell[]} table~row\n */\n\n/**\n * @typedef {object} table~columns\n * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left).\n * @property {number} width Column width (default: auto).\n * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity).\n * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters\n * @property {number} paddingLeft Cell content padding width left (default: 1).\n * @property {number} paddingRight Cell content padding width right (default: 1).\n */\n\n/**\n * @typedef {object} table~border\n * @property {string} topBody\n * @property {string} topJoin\n * @property {string} topLeft\n * @property {string} topRight\n * @property {string} bottomBody\n * @property {string} bottomJoin\n * @property {string} bottomLeft\n * @property {string} bottomRight\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n * @property {string} joinBody\n * @property {string} joinLeft\n * @property {string} joinRight\n * @property {string} joinJoin\n */\n\n/**\n * Used to tell whether to draw a horizontal line.\n * This callback is called for each non-content line of the table.\n * The default behavior is to always return true.\n *\n * @typedef {Function} drawHorizontalLine\n * @param {number} index\n * @param {number} size\n * @returns {boolean}\n */\n\n/**\n * @typedef {object} table~config\n * @property {table~border} border\n * @property {table~columns[]} columns Column specific configuration.\n * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values.\n * @property {table~drawHorizontalLine} drawHorizontalLine\n * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn.\n */\n\n/**\n * Generates a text table.\n *\n * @param {table~row[]} data\n * @param {table~config} userConfig\n * @returns {string}\n */\nexport default (data, userConfig = {}) => {\n let rows;\n\n validateTableData(data);\n\n rows = stringifyTableData(data);\n\n const config = makeConfig(rows, userConfig);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n const cellWidthIndex = calculateCellWidthIndex(rows[0]);\n\n return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine);\n};\n"],"file":"table.js"} \ No newline at end of file diff --git a/node_modules/table/dist/truncateTableData.js b/node_modules/table/dist/truncateTableData.js deleted file mode 100644 index 3e5cbe1cf..000000000 --- a/node_modules/table/dist/truncateTableData.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _truncate2 = _interopRequireDefault(require("lodash/truncate")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @todo Make it work with ASCII content. - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -const truncateTableData = (rows, config) => { - return rows.map(cells => { - return cells.map((content, index) => { - return (0, _truncate2.default)(content, { - length: config.columns[index].truncate - }); - }); - }); -}; - -var _default = truncateTableData; -exports.default = _default; -//# sourceMappingURL=truncateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/truncateTableData.js.flow b/node_modules/table/dist/truncateTableData.js.flow deleted file mode 100644 index de331ab92..000000000 --- a/node_modules/table/dist/truncateTableData.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -import _ from 'lodash'; - -/** - * @todo Make it work with ASCII content. - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -export default (rows, config) => { - return rows.map((cells) => { - return cells.map((content, index) => { - return _.truncate(content, { - length: config.columns[index].truncate, - }); - }); - }); -}; diff --git a/node_modules/table/dist/truncateTableData.js.map b/node_modules/table/dist/truncateTableData.js.map deleted file mode 100644 index 123ed1c8e..000000000 --- a/node_modules/table/dist/truncateTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/truncateTableData.js"],"names":["rows","config","map","cells","content","index","length","columns","truncate"],"mappings":";;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;2BACgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,OAAD,EAAUC,KAAV,KAAoB;AACnC,aAAO,wBAAWD,OAAX,EAAoB;AACzBE,QAAAA,MAAM,EAAEL,MAAM,CAACM,OAAP,CAAeF,KAAf,EAAsBG;AADL,OAApB,CAAP;AAGD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import _ from 'lodash';\n\n/**\n * @todo Make it work with ASCII content.\n * @param {table~row[]} rows\n * @param {object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((content, index) => {\n return _.truncate(content, {\n length: config.columns[index].truncate,\n });\n });\n });\n};\n"],"file":"truncateTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/validateConfig.js b/node_modules/table/dist/validateConfig.js deleted file mode 100644 index cdf7530d2..000000000 --- a/node_modules/table/dist/validateConfig.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validators = _interopRequireDefault(require("../dist/validators")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// eslint-disable-next-line import/default - -/** - * @param {string} schemaId - * @param {formatData~config} config - * @returns {undefined} - */ -const validateConfig = (schemaId, config = {}) => { - const validate = _validators.default[schemaId]; - - if (!validate(config)) { - const errors = validate.errors.map(error => { - return { - dataPath: error.dataPath, - message: error.message, - params: error.params, - schemaPath: error.schemaPath - }; - }); - /* eslint-disable no-console */ - - console.log('config', config); - console.log('errors', errors); - /* eslint-enable no-console */ - - throw new Error('Invalid config.'); - } -}; - -var _default = validateConfig; -exports.default = _default; -//# sourceMappingURL=validateConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/validateConfig.js.flow b/node_modules/table/dist/validateConfig.js.flow deleted file mode 100644 index a8eb2e2ed..000000000 --- a/node_modules/table/dist/validateConfig.js.flow +++ /dev/null @@ -1,28 +0,0 @@ -// eslint-disable-next-line import/default -import validators from '../dist/validators'; - -/** - * @param {string} schemaId - * @param {formatData~config} config - * @returns {undefined} - */ -export default (schemaId, config = {}) => { - const validate = validators[schemaId]; - if (!validate(config)) { - const errors = validate.errors.map((error) => { - return { - dataPath: error.dataPath, - message: error.message, - params: error.params, - schemaPath: error.schemaPath, - }; - }); - - /* eslint-disable no-console */ - console.log('config', config); - console.log('errors', errors); - /* eslint-enable no-console */ - - throw new Error('Invalid config.'); - } -}; diff --git a/node_modules/table/dist/validateConfig.js.map b/node_modules/table/dist/validateConfig.js.map deleted file mode 100644 index 153011cf1..000000000 --- a/node_modules/table/dist/validateConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/validateConfig.js"],"names":["schemaId","config","validate","validators","errors","map","error","dataPath","message","params","schemaPath","console","log","Error"],"mappings":";;;;;;;AACA;;;;AADA;;AAGA;AACA;AACA;AACA;AACA;wBACgBA,Q,EAAUC,MAAM,GAAG,E,KAAO;AACxC,QAAMC,QAAQ,GAAGC,oBAAWH,QAAX,CAAjB;;AACA,MAAI,CAACE,QAAQ,CAACD,MAAD,CAAb,EAAuB;AACrB,UAAMG,MAAM,GAAGF,QAAQ,CAACE,MAAT,CAAgBC,GAAhB,CAAqBC,KAAD,IAAW;AAC5C,aAAO;AACLC,QAAAA,QAAQ,EAAED,KAAK,CAACC,QADX;AAELC,QAAAA,OAAO,EAAEF,KAAK,CAACE,OAFV;AAGLC,QAAAA,MAAM,EAAEH,KAAK,CAACG,MAHT;AAILC,QAAAA,UAAU,EAAEJ,KAAK,CAACI;AAJb,OAAP;AAMD,KAPc,CAAf;AASA;;AACAC,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBX,MAAtB;AACAU,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBR,MAAtB;AACA;;AAEA,UAAM,IAAIS,KAAJ,CAAU,iBAAV,CAAN;AACD;AACF,C","sourcesContent":["// eslint-disable-next-line import/default\nimport validators from '../dist/validators';\n\n/**\n * @param {string} schemaId\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (schemaId, config = {}) => {\n const validate = validators[schemaId];\n if (!validate(config)) {\n const errors = validate.errors.map((error) => {\n return {\n dataPath: error.dataPath,\n message: error.message,\n params: error.params,\n schemaPath: error.schemaPath,\n };\n });\n\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('errors', errors);\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"file":"validateConfig.js"} \ No newline at end of file diff --git a/node_modules/table/dist/validateTableData.js b/node_modules/table/dist/validateTableData.js deleted file mode 100644 index 56a3e1902..000000000 --- a/node_modules/table/dist/validateTableData.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * @typedef {string} cell - */ - -/** - * @typedef {cell[]} validateData~column - */ - -/** - * @param {column[]} rows - * @returns {undefined} - */ -const validateTableData = rows => { - if (!Array.isArray(rows)) { - throw new TypeError('Table data must be an array.'); - } - - if (rows.length === 0) { - throw new Error('Table must define at least one row.'); - } - - if (rows[0].length === 0) { - throw new Error('Table must define at least one column.'); - } - - const columnNumber = rows[0].length; - - for (const cells of rows) { - if (!Array.isArray(cells)) { - throw new TypeError('Table row data must be an array.'); - } - - if (cells.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); - } - - for (const cell of cells) { - // eslint-disable-next-line no-control-regex - if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) { - throw new Error('Table data must not contain control characters.'); - } - } - } -}; - -var _default = validateTableData; -exports.default = _default; -//# sourceMappingURL=validateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/validateTableData.js.flow b/node_modules/table/dist/validateTableData.js.flow deleted file mode 100644 index dcc7fc1d1..000000000 --- a/node_modules/table/dist/validateTableData.js.flow +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @typedef {string} cell - */ - -/** - * @typedef {cell[]} validateData~column - */ - -/** - * @param {column[]} rows - * @returns {undefined} - */ -export default (rows) => { - if (!Array.isArray(rows)) { - throw new TypeError('Table data must be an array.'); - } - - if (rows.length === 0) { - throw new Error('Table must define at least one row.'); - } - - if (rows[0].length === 0) { - throw new Error('Table must define at least one column.'); - } - - const columnNumber = rows[0].length; - - for (const cells of rows) { - if (!Array.isArray(cells)) { - throw new TypeError('Table row data must be an array.'); - } - - if (cells.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); - } - - for (const cell of cells) { - // eslint-disable-next-line no-control-regex - if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) { - throw new Error('Table data must not contain control characters.'); - } - } - } -}; diff --git a/node_modules/table/dist/validateTableData.js.map b/node_modules/table/dist/validateTableData.js.map deleted file mode 100644 index 5c3a1a0a4..000000000 --- a/node_modules/table/dist/validateTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/validateTableData.js"],"names":["rows","Array","isArray","TypeError","length","Error","columnNumber","cells","cell","test"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;0BACgBA,I,IAAS;AACvB,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,IAAd,CAAL,EAA0B;AACxB,UAAM,IAAIG,SAAJ,CAAc,8BAAd,CAAN;AACD;;AAED,MAAIH,IAAI,CAACI,MAAL,KAAgB,CAApB,EAAuB;AACrB,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,MAAIL,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAR,KAAmB,CAAvB,EAA0B;AACxB,UAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;AACD;;AAED,QAAMC,YAAY,GAAGN,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAA7B;;AAEA,OAAK,MAAMG,KAAX,IAAoBP,IAApB,EAA0B;AACxB,QAAI,CAACC,KAAK,CAACC,OAAN,CAAcK,KAAd,CAAL,EAA2B;AACzB,YAAM,IAAIJ,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,QAAII,KAAK,CAACH,MAAN,KAAiBE,YAArB,EAAmC;AACjC,YAAM,IAAID,KAAJ,CAAU,+CAAV,CAAN;AACD;;AAED,SAAK,MAAMG,IAAX,IAAmBD,KAAnB,EAA0B;AACxB;AACA,UAAI,2CAA2CE,IAA3C,CAAgDD,IAAhD,CAAJ,EAA2D;AACzD,cAAM,IAAIH,KAAJ,CAAU,iDAAV,CAAN;AACD;AACF;AACF;AACF,C","sourcesContent":["/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {column[]} rows\n * @returns {undefined}\n */\nexport default (rows) => {\n if (!Array.isArray(rows)) {\n throw new TypeError('Table data must be an array.');\n }\n\n if (rows.length === 0) {\n throw new Error('Table must define at least one row.');\n }\n\n if (rows[0].length === 0) {\n throw new Error('Table must define at least one column.');\n }\n\n const columnNumber = rows[0].length;\n\n for (const cells of rows) {\n if (!Array.isArray(cells)) {\n throw new TypeError('Table row data must be an array.');\n }\n\n if (cells.length !== columnNumber) {\n throw new Error('Table must have a consistent number of cells.');\n }\n\n for (const cell of cells) {\n // eslint-disable-next-line no-control-regex\n if (/[\\u0001-\\u0006\\u0008\\u0009\\u000B-\\u001A]/.test(cell)) {\n throw new Error('Table data must not contain control characters.');\n }\n }\n }\n};\n"],"file":"validateTableData.js"} \ No newline at end of file diff --git a/node_modules/table/dist/validators.js b/node_modules/table/dist/validators.js deleted file mode 100644 index e17b964fe..000000000 --- a/node_modules/table/dist/validators.js +++ /dev/null @@ -1,1492 +0,0 @@ -"use strict"; -exports["config.json"] = validate43; -const schema13 = { - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - } - }, - "additionalProperties": false -}; -const schema15 = { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false -}; -const schema16 = { - "type": "string" -}; - -function validate46(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "string" - }, - message: "should be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - validate46.errors = vErrors; - return errors === 0; -} - -function validate45(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(schema15.properties.hasOwnProperty(key0))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.topBody !== undefined) { - if (!(validate46(data.topBody, { - dataPath: dataPath + "/topBody", - parentData: data, - parentDataProperty: "topBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topJoin !== undefined) { - if (!(validate46(data.topJoin, { - dataPath: dataPath + "/topJoin", - parentData: data, - parentDataProperty: "topJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topLeft !== undefined) { - if (!(validate46(data.topLeft, { - dataPath: dataPath + "/topLeft", - parentData: data, - parentDataProperty: "topLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topRight !== undefined) { - if (!(validate46(data.topRight, { - dataPath: dataPath + "/topRight", - parentData: data, - parentDataProperty: "topRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomBody !== undefined) { - if (!(validate46(data.bottomBody, { - dataPath: dataPath + "/bottomBody", - parentData: data, - parentDataProperty: "bottomBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomJoin !== undefined) { - if (!(validate46(data.bottomJoin, { - dataPath: dataPath + "/bottomJoin", - parentData: data, - parentDataProperty: "bottomJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomLeft !== undefined) { - if (!(validate46(data.bottomLeft, { - dataPath: dataPath + "/bottomLeft", - parentData: data, - parentDataProperty: "bottomLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomRight !== undefined) { - if (!(validate46(data.bottomRight, { - dataPath: dataPath + "/bottomRight", - parentData: data, - parentDataProperty: "bottomRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyLeft !== undefined) { - if (!(validate46(data.bodyLeft, { - dataPath: dataPath + "/bodyLeft", - parentData: data, - parentDataProperty: "bodyLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyRight !== undefined) { - if (!(validate46(data.bodyRight, { - dataPath: dataPath + "/bodyRight", - parentData: data, - parentDataProperty: "bodyRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyJoin !== undefined) { - if (!(validate46(data.bodyJoin, { - dataPath: dataPath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinBody !== undefined) { - if (!(validate46(data.joinBody, { - dataPath: dataPath + "/joinBody", - parentData: data, - parentDataProperty: "joinBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinLeft !== undefined) { - if (!(validate46(data.joinLeft, { - dataPath: dataPath + "/joinLeft", - parentData: data, - parentDataProperty: "joinLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinRight !== undefined) { - if (!(validate46(data.joinRight, { - dataPath: dataPath + "/joinRight", - parentData: data, - parentDataProperty: "joinRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinJoin !== undefined) { - if (!(validate46(data.joinJoin, { - dataPath: dataPath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - } else { - const err1 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - validate45.errors = vErrors; - return errors === 0; -} -const schema17 = { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false -}; -const pattern0 = new RegExp("^[0-9]+$", "u"); -const schema18 = { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": ["left", "right", "center"] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false -}; -const func0 = require("ajv/dist/compile/equal"); - -function validate64(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!((((((key0 === "alignment") || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - let data0 = data.alignment; - if (typeof data0 !== "string") { - const err1 = { - keyword: "type", - dataPath: dataPath + "/alignment", - schemaPath: "#/properties/alignment/type", - params: { - type: "string" - }, - message: "should be string" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - if (!(((data0 === "left") || (data0 === "right")) || (data0 === "center"))) { - const err2 = { - keyword: "enum", - dataPath: dataPath + "/alignment", - schemaPath: "#/properties/alignment/enum", - params: { - allowedValues: schema18.properties.alignment.enum - }, - message: "should be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data.width !== undefined) { - let data1 = data.width; - if (!((typeof data1 == "number") && (isFinite(data1)))) { - const err3 = { - keyword: "type", - dataPath: dataPath + "/width", - schemaPath: "#/properties/width/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err4 = { - keyword: "type", - dataPath: dataPath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - params: { - type: "boolean" - }, - message: "should be boolean" - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data3 = data.truncate; - if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err5 = { - keyword: "type", - dataPath: dataPath + "/truncate", - schemaPath: "#/properties/truncate/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data4 = data.paddingLeft; - if (!((typeof data4 == "number") && (isFinite(data4)))) { - const err6 = { - keyword: "type", - dataPath: dataPath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data5 = data.paddingRight; - if (!((typeof data5 == "number") && (isFinite(data5)))) { - const err7 = { - keyword: "type", - dataPath: dataPath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - } else { - const err8 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - validate64.errors = vErrors; - return errors === 0; -} - -function validate63(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(pattern0.test(key0))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - for (const key1 in data) { - if (pattern0.test(key1)) { - if (!(validate64(data[key1], { - dataPath: dataPath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { - vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); - errors = vErrors.length; - } - } - } - } else { - const err1 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - validate63.errors = vErrors; - return errors === 0; -} - -function validate67(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!((((((key0 === "alignment") || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - let data0 = data.alignment; - if (typeof data0 !== "string") { - const err1 = { - keyword: "type", - dataPath: dataPath + "/alignment", - schemaPath: "#/properties/alignment/type", - params: { - type: "string" - }, - message: "should be string" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - if (!(((data0 === "left") || (data0 === "right")) || (data0 === "center"))) { - const err2 = { - keyword: "enum", - dataPath: dataPath + "/alignment", - schemaPath: "#/properties/alignment/enum", - params: { - allowedValues: schema18.properties.alignment.enum - }, - message: "should be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data.width !== undefined) { - let data1 = data.width; - if (!((typeof data1 == "number") && (isFinite(data1)))) { - const err3 = { - keyword: "type", - dataPath: dataPath + "/width", - schemaPath: "#/properties/width/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err4 = { - keyword: "type", - dataPath: dataPath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - params: { - type: "boolean" - }, - message: "should be boolean" - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data3 = data.truncate; - if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err5 = { - keyword: "type", - dataPath: dataPath + "/truncate", - schemaPath: "#/properties/truncate/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data4 = data.paddingLeft; - if (!((typeof data4 == "number") && (isFinite(data4)))) { - const err6 = { - keyword: "type", - dataPath: dataPath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data5 = data.paddingRight; - if (!((typeof data5 == "number") && (isFinite(data5)))) { - const err7 = { - keyword: "type", - dataPath: dataPath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - } else { - const err8 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - validate67.errors = vErrors; - return errors === 0; -} - -function validate43(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - /*# sourceURL="config.json" */ ; - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawHorizontalLine")) || (key0 === "singleLine"))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.border !== undefined) { - if (!(validate45(data.border, { - dataPath: dataPath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors); - errors = vErrors.length; - } - } - if (data.columns !== undefined) { - if (!(validate63(data.columns, { - dataPath: dataPath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors); - errors = vErrors.length; - } - } - if (data.columnDefault !== undefined) { - if (!(validate67(data.columnDefault, { - dataPath: dataPath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.errors); - errors = vErrors.length; - } - } - if (data.drawHorizontalLine !== undefined) { - if (typeof data.drawHorizontalLine != "function") { - const err1 = { - keyword: "typeof", - dataPath: dataPath + "/drawHorizontalLine", - schemaPath: "#/properties/drawHorizontalLine/typeof", - params: {}, - message: "should pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - if (data.singleLine !== undefined) { - if (typeof data.singleLine != "boolean") { - const err2 = { - keyword: "typeof", - dataPath: dataPath + "/singleLine", - schemaPath: "#/properties/singleLine/typeof", - params: {}, - message: "should pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - } else { - const err3 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - validate43.errors = vErrors; - return errors === 0; -} -exports["streamConfig.json"] = validate69; -const schema20 = { - "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "columnCount": { - "type": "number" - } - }, - "additionalProperties": false -}; - -function validate70(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(schema15.properties.hasOwnProperty(key0))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.topBody !== undefined) { - if (!(validate46(data.topBody, { - dataPath: dataPath + "/topBody", - parentData: data, - parentDataProperty: "topBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topJoin !== undefined) { - if (!(validate46(data.topJoin, { - dataPath: dataPath + "/topJoin", - parentData: data, - parentDataProperty: "topJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topLeft !== undefined) { - if (!(validate46(data.topLeft, { - dataPath: dataPath + "/topLeft", - parentData: data, - parentDataProperty: "topLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topRight !== undefined) { - if (!(validate46(data.topRight, { - dataPath: dataPath + "/topRight", - parentData: data, - parentDataProperty: "topRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomBody !== undefined) { - if (!(validate46(data.bottomBody, { - dataPath: dataPath + "/bottomBody", - parentData: data, - parentDataProperty: "bottomBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomJoin !== undefined) { - if (!(validate46(data.bottomJoin, { - dataPath: dataPath + "/bottomJoin", - parentData: data, - parentDataProperty: "bottomJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomLeft !== undefined) { - if (!(validate46(data.bottomLeft, { - dataPath: dataPath + "/bottomLeft", - parentData: data, - parentDataProperty: "bottomLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomRight !== undefined) { - if (!(validate46(data.bottomRight, { - dataPath: dataPath + "/bottomRight", - parentData: data, - parentDataProperty: "bottomRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyLeft !== undefined) { - if (!(validate46(data.bodyLeft, { - dataPath: dataPath + "/bodyLeft", - parentData: data, - parentDataProperty: "bodyLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyRight !== undefined) { - if (!(validate46(data.bodyRight, { - dataPath: dataPath + "/bodyRight", - parentData: data, - parentDataProperty: "bodyRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyJoin !== undefined) { - if (!(validate46(data.bodyJoin, { - dataPath: dataPath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinBody !== undefined) { - if (!(validate46(data.joinBody, { - dataPath: dataPath + "/joinBody", - parentData: data, - parentDataProperty: "joinBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinLeft !== undefined) { - if (!(validate46(data.joinLeft, { - dataPath: dataPath + "/joinLeft", - parentData: data, - parentDataProperty: "joinLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinRight !== undefined) { - if (!(validate46(data.joinRight, { - dataPath: dataPath + "/joinRight", - parentData: data, - parentDataProperty: "joinRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinJoin !== undefined) { - if (!(validate46(data.joinJoin, { - dataPath: dataPath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - } else { - const err1 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - validate70.errors = vErrors; - return errors === 0; -} - -function validate87(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(pattern0.test(key0))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - for (const key1 in data) { - if (pattern0.test(key1)) { - if (!(validate64(data[key1], { - dataPath: dataPath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { - vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); - errors = vErrors.length; - } - } - } - } else { - const err1 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - validate87.errors = vErrors; - return errors === 0; -} - -function validate90(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!((((((key0 === "alignment") || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - let data0 = data.alignment; - if (typeof data0 !== "string") { - const err1 = { - keyword: "type", - dataPath: dataPath + "/alignment", - schemaPath: "#/properties/alignment/type", - params: { - type: "string" - }, - message: "should be string" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - if (!(((data0 === "left") || (data0 === "right")) || (data0 === "center"))) { - const err2 = { - keyword: "enum", - dataPath: dataPath + "/alignment", - schemaPath: "#/properties/alignment/enum", - params: { - allowedValues: schema18.properties.alignment.enum - }, - message: "should be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data.width !== undefined) { - let data1 = data.width; - if (!((typeof data1 == "number") && (isFinite(data1)))) { - const err3 = { - keyword: "type", - dataPath: dataPath + "/width", - schemaPath: "#/properties/width/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err4 = { - keyword: "type", - dataPath: dataPath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - params: { - type: "boolean" - }, - message: "should be boolean" - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data3 = data.truncate; - if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err5 = { - keyword: "type", - dataPath: dataPath + "/truncate", - schemaPath: "#/properties/truncate/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data4 = data.paddingLeft; - if (!((typeof data4 == "number") && (isFinite(data4)))) { - const err6 = { - keyword: "type", - dataPath: dataPath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data5 = data.paddingRight; - if (!((typeof data5 == "number") && (isFinite(data5)))) { - const err7 = { - keyword: "type", - dataPath: dataPath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - } else { - const err8 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - validate90.errors = vErrors; - return errors === 0; -} - -function validate69(data, { - dataPath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { - /*# sourceURL="streamConfig.json" */ ; - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount"))) { - const err0 = { - keyword: "additionalProperties", - dataPath, - schemaPath: "#/additionalProperties", - params: { - additionalProperty: key0 - }, - message: "should NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (data.border !== undefined) { - if (!(validate70(data.border, { - dataPath: dataPath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors); - errors = vErrors.length; - } - } - if (data.columns !== undefined) { - if (!(validate87(data.columns, { - dataPath: dataPath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate87.errors : vErrors.concat(validate87.errors); - errors = vErrors.length; - } - } - if (data.columnDefault !== undefined) { - if (!(validate90(data.columnDefault, { - dataPath: dataPath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate90.errors : vErrors.concat(validate90.errors); - errors = vErrors.length; - } - } - if (data.columnCount !== undefined) { - let data3 = data.columnCount; - if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err1 = { - keyword: "type", - dataPath: dataPath + "/columnCount", - schemaPath: "#/properties/columnCount/type", - params: { - type: "number" - }, - message: "should be number" - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - } else { - const err2 = { - keyword: "type", - dataPath, - schemaPath: "#/type", - params: { - type: "object" - }, - message: "should be object" - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - validate69.errors = vErrors; - return errors === 0; -} \ No newline at end of file diff --git a/node_modules/table/dist/wrapCell.js b/node_modules/table/dist/wrapCell.js deleted file mode 100644 index 3bddc4cbf..000000000 --- a/node_modules/table/dist/wrapCell.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _wrapString = _interopRequireDefault(require("./wrapString")); - -var _wrapWord = _interopRequireDefault(require("./wrapWord")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Wrap a single cell value into a list of lines - * - * Always wraps on newlines, for the remainder uses either word or string wrapping - * depending on user configuration. - * - * @param {string} cellValue - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {Array} - */ -const wrapCell = (cellValue, columnWidth, useWrapWord) => { - // First split on literal newlines - const cellLines = cellValue.split('\n'); // Then iterate over the list and word-wrap every remaining line if necessary. - - for (let lineNr = 0; lineNr < cellLines.length;) { - let lineChunks; - - if (useWrapWord) { - lineChunks = (0, _wrapWord.default)(cellLines[lineNr], columnWidth); - } else { - lineChunks = (0, _wrapString.default)(cellLines[lineNr], columnWidth); - } // Replace our original array element with whatever the wrapping returned - - - cellLines.splice(lineNr, 1, ...lineChunks); - lineNr += lineChunks.length; - } - - return cellLines; -}; - -var _default = wrapCell; -exports.default = _default; -//# sourceMappingURL=wrapCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/wrapCell.js.flow b/node_modules/table/dist/wrapCell.js.flow deleted file mode 100644 index 0c66260e2..000000000 --- a/node_modules/table/dist/wrapCell.js.flow +++ /dev/null @@ -1,35 +0,0 @@ -import wrapString from './wrapString'; -import wrapWord from './wrapWord'; - -/** - * Wrap a single cell value into a list of lines - * - * Always wraps on newlines, for the remainder uses either word or string wrapping - * depending on user configuration. - * - * @param {string} cellValue - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {Array} - */ -export default (cellValue, columnWidth, useWrapWord) => { - // First split on literal newlines - const cellLines = cellValue.split('\n'); - - // Then iterate over the list and word-wrap every remaining line if necessary. - for (let lineNr = 0; lineNr < cellLines.length;) { - let lineChunks; - - if (useWrapWord) { - lineChunks = wrapWord(cellLines[lineNr], columnWidth); - } else { - lineChunks = wrapString(cellLines[lineNr], columnWidth); - } - - // Replace our original array element with whatever the wrapping returned - cellLines.splice(lineNr, 1, ...lineChunks); - lineNr += lineChunks.length; - } - - return cellLines; -}; diff --git a/node_modules/table/dist/wrapCell.js.map b/node_modules/table/dist/wrapCell.js.map deleted file mode 100644 index f7d23ae0b..000000000 --- a/node_modules/table/dist/wrapCell.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/wrapCell.js"],"names":["cellValue","columnWidth","useWrapWord","cellLines","split","lineNr","length","lineChunks","splice"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;kBACgBA,S,EAAWC,W,EAAaC,W,KAAgB;AACtD;AACA,QAAMC,SAAS,GAAGH,SAAS,CAACI,KAAV,CAAgB,IAAhB,CAAlB,CAFsD,CAItD;;AACA,OAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,MAAM,GAAGF,SAAS,CAACG,MAAxC,GAAiD;AAC/C,QAAIC,UAAJ;;AAEA,QAAIL,WAAJ,EAAiB;AACfK,MAAAA,UAAU,GAAG,uBAASJ,SAAS,CAACE,MAAD,CAAlB,EAA4BJ,WAA5B,CAAb;AACD,KAFD,MAEO;AACLM,MAAAA,UAAU,GAAG,yBAAWJ,SAAS,CAACE,MAAD,CAApB,EAA8BJ,WAA9B,CAAb;AACD,KAP8C,CAS/C;;;AACAE,IAAAA,SAAS,CAACK,MAAV,CAAiBH,MAAjB,EAAyB,CAAzB,EAA4B,GAAGE,UAA/B;AACAF,IAAAA,MAAM,IAAIE,UAAU,CAACD,MAArB;AACD;;AAED,SAAOH,SAAP;AACD,C","sourcesContent":["import wrapString from './wrapString';\nimport wrapWord from './wrapWord';\n\n/**\n * Wrap a single cell value into a list of lines\n *\n * Always wraps on newlines, for the remainder uses either word or string wrapping\n * depending on user configuration.\n *\n * @param {string} cellValue\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {Array}\n */\nexport default (cellValue, columnWidth, useWrapWord) => {\n // First split on literal newlines\n const cellLines = cellValue.split('\\n');\n\n // Then iterate over the list and word-wrap every remaining line if necessary.\n for (let lineNr = 0; lineNr < cellLines.length;) {\n let lineChunks;\n\n if (useWrapWord) {\n lineChunks = wrapWord(cellLines[lineNr], columnWidth);\n } else {\n lineChunks = wrapString(cellLines[lineNr], columnWidth);\n }\n\n // Replace our original array element with whatever the wrapping returned\n cellLines.splice(lineNr, 1, ...lineChunks);\n lineNr += lineChunks.length;\n }\n\n return cellLines;\n};\n"],"file":"wrapCell.js"} \ No newline at end of file diff --git a/node_modules/table/dist/wrapString.js b/node_modules/table/dist/wrapString.js deleted file mode 100644 index c0dd8c8d6..000000000 --- a/node_modules/table/dist/wrapString.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Creates an array of strings split into groups the length of size. - * This function works with strings that contain ASCII characters. - * - * wrapText is different from would-be "chunk" implementation - * in that whitespace characters that occur on a chunk size limit are trimmed. - * - * @param {string} subject - * @param {number} size - * @returns {Array} - */ -const wrapString = (subject, size) => { - let subjectSlice; - subjectSlice = subject; - const chunks = []; - - do { - chunks.push((0, _sliceAnsi.default)(subjectSlice, 0, size)); - subjectSlice = (0, _sliceAnsi.default)(subjectSlice, size).trim(); - } while ((0, _stringWidth.default)(subjectSlice)); - - return chunks; -}; - -var _default = wrapString; -exports.default = _default; -//# sourceMappingURL=wrapString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/wrapString.js.flow b/node_modules/table/dist/wrapString.js.flow deleted file mode 100644 index bbb40721e..000000000 --- a/node_modules/table/dist/wrapString.js.flow +++ /dev/null @@ -1,29 +0,0 @@ -import slice from 'slice-ansi'; -import stringWidth from 'string-width'; - -/** - * Creates an array of strings split into groups the length of size. - * This function works with strings that contain ASCII characters. - * - * wrapText is different from would-be "chunk" implementation - * in that whitespace characters that occur on a chunk size limit are trimmed. - * - * @param {string} subject - * @param {number} size - * @returns {Array} - */ -export default (subject, size) => { - let subjectSlice; - - subjectSlice = subject; - - const chunks = []; - - do { - chunks.push(slice(subjectSlice, 0, size)); - - subjectSlice = slice(subjectSlice, size).trim(); - } while (stringWidth(subjectSlice)); - - return chunks; -}; diff --git a/node_modules/table/dist/wrapString.js.map b/node_modules/table/dist/wrapString.js.map deleted file mode 100644 index 8cd8d7fc8..000000000 --- a/node_modules/table/dist/wrapString.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/wrapString.js"],"names":["subject","size","subjectSlice","chunks","push","trim"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;oBACgBA,O,EAASC,I,KAAS;AAChC,MAAIC,YAAJ;AAEAA,EAAAA,YAAY,GAAGF,OAAf;AAEA,QAAMG,MAAM,GAAG,EAAf;;AAEA,KAAG;AACDA,IAAAA,MAAM,CAACC,IAAP,CAAY,wBAAMF,YAAN,EAAoB,CAApB,EAAuBD,IAAvB,CAAZ;AAEAC,IAAAA,YAAY,GAAG,wBAAMA,YAAN,EAAoBD,IAApB,EAA0BI,IAA1B,EAAf;AACD,GAJD,QAIS,0BAAYH,YAAZ,CAJT;;AAMA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * Creates an array of strings split into groups the length of size.\n * This function works with strings that contain ASCII characters.\n *\n * wrapText is different from would-be \"chunk\" implementation\n * in that whitespace characters that occur on a chunk size limit are trimmed.\n *\n * @param {string} subject\n * @param {number} size\n * @returns {Array}\n */\nexport default (subject, size) => {\n let subjectSlice;\n\n subjectSlice = subject;\n\n const chunks = [];\n\n do {\n chunks.push(slice(subjectSlice, 0, size));\n\n subjectSlice = slice(subjectSlice, size).trim();\n } while (stringWidth(subjectSlice));\n\n return chunks;\n};\n"],"file":"wrapString.js"} \ No newline at end of file diff --git a/node_modules/table/dist/wrapWord.js b/node_modules/table/dist/wrapWord.js deleted file mode 100644 index 790b20bc0..000000000 --- a/node_modules/table/dist/wrapWord.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {string} input - * @param {number} size - * @returns {Array} - */ -const wrapWord = (input, size) => { - let subject; - subject = input; - const chunks = []; // https://regex101.com/r/gY5kZ1/1 - - const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); - - do { - let chunk; - chunk = subject.match(re); - - if (chunk) { - chunk = chunk[0]; - subject = (0, _sliceAnsi.default)(subject, (0, _stringWidth.default)(chunk)); - chunk = chunk.trim(); - } else { - chunk = (0, _sliceAnsi.default)(subject, 0, size); - subject = (0, _sliceAnsi.default)(subject, size); - } - - chunks.push(chunk); - } while ((0, _stringWidth.default)(subject)); - - return chunks; -}; - -var _default = wrapWord; -exports.default = _default; -//# sourceMappingURL=wrapWord.js.map \ No newline at end of file diff --git a/node_modules/table/dist/wrapWord.js.flow b/node_modules/table/dist/wrapWord.js.flow deleted file mode 100644 index 02a8d45ea..000000000 --- a/node_modules/table/dist/wrapWord.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -import slice from 'slice-ansi'; -import stringWidth from 'string-width'; - -/** - * @param {string} input - * @param {number} size - * @returns {Array} - */ -export default (input, size) => { - let subject; - - subject = input; - - const chunks = []; - - // https://regex101.com/r/gY5kZ1/1 - const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); - - do { - let chunk; - - chunk = subject.match(re); - - if (chunk) { - chunk = chunk[0]; - - subject = slice(subject, stringWidth(chunk)); - - chunk = chunk.trim(); - } else { - chunk = slice(subject, 0, size); - subject = slice(subject, size); - } - - chunks.push(chunk); - } while (stringWidth(subject)); - - return chunks; -}; diff --git a/node_modules/table/dist/wrapWord.js.map b/node_modules/table/dist/wrapWord.js.map deleted file mode 100644 index 2f2e575b5..000000000 --- a/node_modules/table/dist/wrapWord.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/wrapWord.js"],"names":["input","size","subject","chunks","re","RegExp","chunk","match","trim","push"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;kBACgBA,K,EAAOC,I,KAAS;AAC9B,MAAIC,OAAJ;AAEAA,EAAAA,OAAO,GAAGF,KAAV;AAEA,QAAMG,MAAM,GAAG,EAAf,CAL8B,CAO9B;;AACA,QAAMC,EAAE,GAAG,IAAIC,MAAJ,CAAW,WAAWJ,IAAX,GAAkB,mBAAlB,IAAyCA,IAAI,GAAG,CAAhD,IAAqD,wBAAhE,CAAX;;AAEA,KAAG;AACD,QAAIK,KAAJ;AAEAA,IAAAA,KAAK,GAAGJ,OAAO,CAACK,KAAR,CAAcH,EAAd,CAAR;;AAEA,QAAIE,KAAJ,EAAW;AACTA,MAAAA,KAAK,GAAGA,KAAK,CAAC,CAAD,CAAb;AAEAJ,MAAAA,OAAO,GAAG,wBAAMA,OAAN,EAAe,0BAAYI,KAAZ,CAAf,CAAV;AAEAA,MAAAA,KAAK,GAAGA,KAAK,CAACE,IAAN,EAAR;AACD,KAND,MAMO;AACLF,MAAAA,KAAK,GAAG,wBAAMJ,OAAN,EAAe,CAAf,EAAkBD,IAAlB,CAAR;AACAC,MAAAA,OAAO,GAAG,wBAAMA,OAAN,EAAeD,IAAf,CAAV;AACD;;AAEDE,IAAAA,MAAM,CAACM,IAAP,CAAYH,KAAZ;AACD,GAjBD,QAiBS,0BAAYJ,OAAZ,CAjBT;;AAmBA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * @param {string} input\n * @param {number} size\n * @returns {Array}\n */\nexport default (input, size) => {\n let subject;\n\n subject = input;\n\n const chunks = [];\n\n // https://regex101.com/r/gY5kZ1/1\n const re = new RegExp('(^.{1,' + size + '}(\\\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\\\\\|/|_|\\\\.|,|;|-))');\n\n do {\n let chunk;\n\n chunk = subject.match(re);\n\n if (chunk) {\n chunk = chunk[0];\n\n subject = slice(subject, stringWidth(chunk));\n\n chunk = chunk.trim();\n } else {\n chunk = slice(subject, 0, size);\n subject = slice(subject, size);\n }\n\n chunks.push(chunk);\n } while (stringWidth(subject));\n\n return chunks;\n};\n"],"file":"wrapWord.js"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/.tonic_example.js b/node_modules/table/node_modules/ajv/.tonic_example.js deleted file mode 100644 index 7579d21c5..000000000 --- a/node_modules/table/node_modules/ajv/.tonic_example.js +++ /dev/null @@ -1,20 +0,0 @@ -const Ajv = require("ajv").default -const ajv = new Ajv({allErrors: true}) - -const schema = { - properties: { - foo: {type: "string"}, - bar: {type: "number", maximum: 3}, - }, -} - -const validate = ajv.compile(schema) - -test({foo: "abc", bar: 2}) -test({foo: 2, bar: 4}) - -function test(data) { - const valid = validate(data) - if (valid) console.log("Valid!") - else console.log("Invalid: " + ajv.errorsText(validate.errors)) -} diff --git a/node_modules/table/node_modules/ajv/README.md b/node_modules/table/node_modules/ajv/README.md deleted file mode 100644 index 3f459a74b..000000000 --- a/node_modules/table/node_modules/ajv/README.md +++ /dev/null @@ -1,331 +0,0 @@ -Ajv logo - -  - -# Ajv: Another JSON schema validator - -Super fast JSON validator for Node.js and browser. - -Supports JSON Schema draft-06/07/2019-09 (draft-04 is supported in [version 6](https://github.com/ajv-validator/ajv/tree/v6)) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). - -[![build](https://github.com/ajv-validator/ajv/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild) -[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) -[![npm (beta)](https://img.shields.io/npm/v/ajv/beta)](https://www.npmjs.com/package/ajv) -[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) -[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) -[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) -[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) - -## Platinum sponsors - -[](https://www.mozilla.org)[](https://opencollective.com/ajv) - -## Using version 7 - -Ajv version 7 has these new features: - -- NEW: support of JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/) (from [v7.1.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v7.1.0)), including generation of [serializers](./docs/api.md#jtd-serialize) and [parsers](./docs/api.md#jtd-parse) from JTD schemas that are more efficient than native JSON serialization/parsing, combining JSON string parsing and validation in one function. -- support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./docs/json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./docs/json-schema.md#unevaluateditems), [dynamic recursive references](./docs/guide/combining-schemas.md#extending-recursive-schemas) and other [additional keywords](./docs/json-schema.md#json-schema-draft-2019-09). -- to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. -- to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe and to allow code optimization (compiled schema code size is reduced by more than 10%). -- to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package was updated to use the new API (in [v4.0.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v4.0.0)) -- schemas are compiled to ES6 code (ES5 code generation is also supported with an option). -- to improve reliability and maintainability the code is migrated to TypeScript. - -**Please note**: - -- the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using [Ajv v6](https://github.com/ajv-validator/ajv/tree/v6) that will be supported until 02/28/2021). -- all formats are separated to ajv-formats package - they have to be explicitly added if you use them. - -See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) for the details. - -To install the new version: - -```bash -npm install ajv -``` - -See [Getting started](#usage) for code example. - -## Contributing - -More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. - -At Ajv, we are committed to creating more equitable and inclusive spaces for our community and team members to contribute to discussions that affect both this project and our ongoing work in the open source ecosystem. - -We strive to create an environment of respect and healthy discourse by setting standards for our interactions and we expect it from all members of our community - from long term project member to first time visitor. For more information, review our [code of conduct](./CODE_OF_CONDUCT.md) and values. - - - -### How we make decisions - -We value conscious curation of our library size, and balancing performance and functionality. To that end, we cannot accept every suggestion. When evaluating pull requests we consider: - -- Will this benefit many users or a niche use case? -- How will this impact the performance of Ajv? -- How will this expand our library size? - -To help us evaluate and understand, when you submit an issue and pull request: - -- Explain why this feature is important to the user base -- Include documentation -- Include test coverage with any new feature implementations - -Please include documentation and test coverage with any new feature implementations. - -To run tests: - -```bash -npm install -git submodule update --init -npm test -``` - -`npm run build` - compiles typescript to `dist` folder. - -Please also review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](./docs/components.md). - -## Contents - -- [Platinum sponsors](#platinum-sponsors) -- [Using version 7](#using-version-7) -- [Contributing](#contributing) -- [Mozilla MOSS grant and OpenJS Foundation](#mozilla-moss-grant-and-openjs-foundation) -- [Sponsors](#sponsors) -- [Performance](#performance) -- [Features](#features) -- [Getting started](#usage) -- [Choosing schema language: JSON Schema vs JSON Type Definition](./docs/guide/schema-language.md#comparison) -- [Frequently Asked Questions](./docs/faq.md) -- [Using in browser](./docs/guide/environments.md#browsers) - - [Content Security Policy](./docs/security.md#content-security-policy) -- [Using in ES5 environment](./docs/guide/environments.md#es5-environments) -- [Command line interface](./docs/guide/environments.md#command-line-interface) -- [API reference](./docs/api.md) - - [Methods](./docs/api.md#ajv-constructor-and-methods) - - [Options](./docs/api.md#options) - - [Validation errors](./docs/api.md#validation-errors) -- NEW: [Strict mode](./docs/strict-mode.md#strict-mode) - - [Prohibit ignored keywords](./docs/strict-mode.md#prohibit-ignored-keywords) - - [Prevent unexpected validation](./docs/strict-mode.md#prevent-unexpected-validation) - - [Strict types](./docs/strict-mode.md#strict-types) - - [Strict number validation](./docs/strict-mode.md#strict-number-validation) -- [Validation guide](./docs/guide/getting-started.md) - - [Getting started](./docs/guide/getting-started.md) - - [Validating formats](./docs/guide/formats.md) - - [Modular schemas](./docs/guide/combining-schemas.md): [combining with \$ref](./docs/guide/combining-schemas#ref), [\$data reference](./docs/guide/combining-schemas.md#data-reference), [$merge and $patch](./docs/guide/combining-schemas#merge-and-patch-keywords) - - [Asynchronous schema compilation](./docs/guide/managing-schemas.md#asynchronous-schema-compilation) - - [Standalone validation code](./docs/standalone.md) - - [Asynchronous validation](./docs/guide/async-validation.md) - - [Modifying data](./docs/guide/modifying-data.md): [additional properties](./docs/guide/modifying-data.md#removing-additional-properties), [defaults](./docs/guide/modifying-data.md#assigning-defaults), [type coercion](./docs/guide/modifying-data.md#coercing-data-types) -- [Extending Ajv](#extending-ajv) - - User-defined keywords: - - [basics](./docs/guide/user-keywords.md) - - [guide](./docs/keywords.md) - - [Plugins](#plugins) - - [Related packages](#related-packages) -- [Security considerations](./docs/security.md) - - [Security contact](./docs/security.md#security-contact) - - [Untrusted schemas](./docs/security.md#untrusted-schemas) - - [Circular references in objects](./docs/security.md#circular-references-in-javascript-objects) - - [Trusted schemas](./docs/security.md#security-risks-of-trusted-schemas) - - [ReDoS attack](./docs/security.md#redos-attack) - - [Content Security Policy](./docs/security.md#content-security-policy) -- [Some packages using Ajv](#some-packages-using-ajv) -- [Changes history](#changes-history) -- [Support, Code of conduct, Contacts, License](#open-source-software-support) - -## Mozilla MOSS grant and OpenJS Foundation - -[](https://www.mozilla.org/en-US/moss/)[](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) - -Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition (RFC8927)](https://datatracker.ietf.org/doc/rfc8927/). - -Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. - -This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. - -I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. - -## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) - -Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! - -Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. - -Please sponsor Ajv via: - -- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) -- [Ajv Open Collective️](https://opencollective.com/ajv) - -Thank you. - -#### Open Collective sponsors - - - - - - - - - - - - - - -## Performance - -Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. - -Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: - -- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place -- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster -- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) -- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) - -Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): - -[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) - -## Features - -- Ajv implements JSON Schema [draft-06/07/2019-09](http://json-schema.org/) standards (draft-04 is supported in v6): - - all validation keywords (see [JSON Schema validation keywords](./docs/json-schema.md)) - - keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). - - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) - - support of circular references between schemas - - correct string lengths for strings with unicode pairs - - [formats](#formats) defined by JSON Schema draft-07 standard (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin) and additional formats (can be turned off) - - [validates schemas against meta-schema](./docs/api.md#api-validateschema) -- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/): - - all forms (see [JSON Type Definition schema forms](./docs/json-type-definition.md)) - - meta-schema for JTD schemas - - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) -- supports [browsers](#using-in-browser) and Node.js 0.10-14.x -- [asynchronous loading](./docs/guide/managing-schemas.md#asynchronous-schema-compilation) of referenced schemas during compilation -- "All errors" validation mode with [option allErrors](./docs/api.md#options) -- [error messages with parameters](./docs/api.md#validation-errors) describing error reasons to allow error message generation -- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package -- [removing-additional-properties](./docs/guide/modifying-data.md#removing-additional-properties) -- [assigning defaults](./docs/guide/modifying-data.md#assigning-defaults) to missing properties and items -- [coercing data](./docs/guide/modifying-data.md#coercing-data-types) to the types specified in `type` keywords -- [user-defined keywords](#user-defined-keywords) -- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` -- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). -- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package -- [\$data reference](./docs/guide/combining-schemas.md#data-reference) to use values from the validated data as values for the schema keywords -- [asynchronous validation](./docs/api.md#asynchronous-validation) of user-defined formats and keywords - -## Install - -To install version 7: - -``` -npm install ajv -``` - -## Getting started - -Try it in the Node.js REPL: https://runkit.com/npm/ajv - -In JavaScript: - -```javascript -// or ESM/TypeScript import -import Ajv from "ajv" -// Node.js require: -const Ajv = require("ajv").default - -const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} -const validate = ajv.compile(schema) -const valid = validate(data) -if (!valid) console.log(validate.errors) -``` - -See more examples in [Guide: getting started](./docs/guide/getting-started.md) - -## Extending Ajv - -### User defined keywords - -See section in [data validation](./docs/guide/user-keywords.md) and the [detailed guide](./docs/keywords.md). - -### Plugins - -Ajv can be extended with plugins that add keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: - -- it exports a function that accepts ajv instance as the first parameter - it allows using plugins with [ajv-cli](#command-line-interface). -- this function returns the same instance to allow chaining. -- this function can accept an optional configuration as the second parameter. - -You can import `Plugin` interface from ajv if you use Typescript. - -If you have published a useful plugin please submit a PR to add it to the next section. - -### Related packages - -- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats -- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface -- [ajv-formats](https://github.com/ajv-validator/ajv-formats) - formats defined in JSON Schema specification -- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for defining error messages in the schema -- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages -- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas -- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with additional validation keywords (select, typeof, etc.) -- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch -- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't included in [ajv-formats](https://github.com/ajv-validator/ajv-formats) (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`) - -## Some packages using Ajv - -- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser -- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services -- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition -- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator -- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org -- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com -- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js -- [table](https://github.com/gajus/table) - formats data into a string table -- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser -- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content -- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation -- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation -- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages -- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema -- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests -- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema -- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file -- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app -- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter -- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages -- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX -- [Spectral](https://github.com/stoplightio/spectral) - the customizable linting utility for JSON/YAML, OpenAPI, AsyncAPI, and JSON Schema - -## Changes history - -See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) - -**Please note**: [Changes in version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) - -[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). - -## Code of conduct - -Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md). - -Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. - -## Open-source software support - -Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. - -## License - -[MIT](./LICENSE) diff --git a/node_modules/table/node_modules/ajv/dist/2019.d.ts b/node_modules/table/node_modules/ajv/dist/2019.d.ts deleted file mode 100644 index 3059a66a3..000000000 --- a/node_modules/table/node_modules/ajv/dist/2019.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -import KeywordCxt from "./compile/context"; -export { KeywordCxt }; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -import type { AnySchemaObject } from "./types"; -import AjvCore, { Options } from "./core"; -export default class Ajv2019 extends AjvCore { - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} diff --git a/node_modules/table/node_modules/ajv/dist/2019.js b/node_modules/table/node_modules/ajv/dist/2019.js deleted file mode 100644 index afb7be6c2..000000000 --- a/node_modules/table/node_modules/ajv/dist/2019.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const context_1 = require("./compile/context"); -exports.KeywordCxt = context_1.default; -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -const core_1 = require("./core"); -const draft7_1 = require("./vocabularies/draft7"); -const dynamic_1 = require("./vocabularies/dynamic"); -const next_1 = require("./vocabularies/next"); -const unevaluated_1 = require("./vocabularies/unevaluated"); -const json_schema_2019_09_1 = require("./refs/json-schema-2019-09"); -const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"; -class Ajv2019 extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }); - } - _addVocabularies() { - super._addVocabularies(); - this.addVocabulary(dynamic_1.default); - draft7_1.default.forEach((v) => this.addVocabulary(v)); - this.addVocabulary(next_1.default); - this.addVocabulary(unevaluated_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - const { $data, meta } = this.opts; - if (!meta) - return; - json_schema_2019_09_1.default.call(this, $data); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } -} -exports.default = Ajv2019; -//# sourceMappingURL=2019.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/2019.js.map b/node_modules/table/node_modules/ajv/dist/2019.js.map deleted file mode 100644 index e36dc480f..000000000 --- a/node_modules/table/node_modules/ajv/dist/2019.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"2019.js","sourceRoot":"","sources":["../lib/2019.ts"],"names":[],"mappings":";;;AAuBA,+CAA0C;AAClC,qBADD,iBAAU,CACC;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAGnD,iCAAuC;AAEvC,kDAAsD;AACtD,oDAAsD;AACtD,8CAAgD;AAChD,4DAA8D;AAC9D,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAqB,OAAQ,SAAQ,cAAO;IAC1C,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAA;QACrC,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAClC,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAA;IAC3C,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AA9BD,0BA8BC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/ajv.d.ts b/node_modules/table/node_modules/ajv/dist/ajv.d.ts deleted file mode 100644 index 2123215ff..000000000 --- a/node_modules/table/node_modules/ajv/dist/ajv.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, SchemaValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -import KeywordCxt from "./compile/context"; -export { KeywordCxt }; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -import type { AnySchemaObject } from "./types"; -import AjvCore from "./core"; -export default class Ajv extends AjvCore { - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} diff --git a/node_modules/table/node_modules/ajv/dist/ajv.js b/node_modules/table/node_modules/ajv/dist/ajv.js deleted file mode 100644 index 8aa639728..000000000 --- a/node_modules/table/node_modules/ajv/dist/ajv.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const context_1 = require("./compile/context"); -exports.KeywordCxt = context_1.default; -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -const core_1 = require("./core"); -const draft7_1 = require("./vocabularies/draft7"); -const draft7MetaSchema = require("./refs/json-schema-draft-07.json"); -const META_SUPPORT_DATA = ["/properties"]; -const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; -class Ajv extends core_1.default { - _addVocabularies() { - super._addVocabularies(); - draft7_1.default.forEach((v) => this.addVocabulary(v)); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - const metaSchema = this.opts.$data - ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) - : draft7MetaSchema; - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } -} -exports.default = Ajv; -//# sourceMappingURL=ajv.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/ajv.js.map b/node_modules/table/node_modules/ajv/dist/ajv.js.map deleted file mode 100644 index 76b607895..000000000 --- a/node_modules/table/node_modules/ajv/dist/ajv.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../lib/ajv.ts"],"names":[],"mappings":";;;AAwBA,+CAA0C;AAClC,qBADD,iBAAU,CACC;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAGnD,iCAA4B;AAC5B,kDAAsD;AACtD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAqB,GAAI,SAAQ,cAAO;IACtC,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;YAChC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YAC3D,CAAC,CAAC,gBAAgB,CAAA;QACpB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;QACrD,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AApBD,sBAoBC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts b/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts deleted file mode 100644 index 73d55d0b5..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export declare abstract class _CodeOrName { - abstract readonly str: string; - abstract readonly names: UsedNames; - abstract toString(): string; - abstract emptyStr(): boolean; -} -export declare const IDENTIFIER: RegExp; -export declare class Name extends _CodeOrName { - readonly str: string; - constructor(s: string); - toString(): string; - emptyStr(): boolean; - get names(): UsedNames; -} -export declare class _Code extends _CodeOrName { - readonly _items: readonly CodeItem[]; - private _str?; - private _names?; - constructor(code: string | readonly CodeItem[]); - toString(): string; - emptyStr(): boolean; - get str(): string; - get names(): UsedNames; -} -export declare type CodeItem = Name | string | number | boolean | null; -export declare type UsedNames = Record; -export declare type Code = _Code | Name; -export declare type SafeExpr = Code | number | boolean | null; -export declare const nil: _Code; -declare type CodeArg = SafeExpr | string | undefined; -export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code; -export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code; -export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void; -export declare function strConcat(c1: Code, c2: Code): Code; -export declare function stringify(x: unknown): Code; -export declare function safeStringify(x: unknown): string; -export declare function getProperty(key: Code | string | number): Code; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js b/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js deleted file mode 100644 index 24ad5c1fe..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; -class _CodeOrName { -} -exports._CodeOrName = _CodeOrName; -exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; -class Name extends _CodeOrName { - constructor(s) { - super(); - if (!exports.IDENTIFIER.test(s)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = s; - } - toString() { - return this.str; - } - emptyStr() { - return false; - } - get names() { - return { [this.str]: 1 }; - } -} -exports.Name = Name; -class _Code extends _CodeOrName { - constructor(code) { - super(); - this._items = typeof code === "string" ? [code] : code; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return false; - const item = this._items[0]; - return item === "" || item === '""'; - } - get str() { - var _a; - return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, ""))); - } - get names() { - var _a; - return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => { - if (c instanceof Name) - names[c.str] = (names[c.str] || 0) + 1; - return names; - }, {}))); - } -} -exports._Code = _Code; -exports.nil = new _Code(""); -function _(strs, ...args) { - const code = [strs[0]]; - let i = 0; - while (i < args.length) { - addCodeArg(code, args[i]); - code.push(strs[++i]); - } - return new _Code(code); -} -exports._ = _; -const plus = new _Code("+"); -function str(strs, ...args) { - const expr = [safeStringify(strs[0])]; - let i = 0; - while (i < args.length) { - expr.push(plus); - addCodeArg(expr, args[i]); - expr.push(plus, safeStringify(strs[++i])); - } - optimize(expr); - return new _Code(expr); -} -exports.str = str; -function addCodeArg(code, arg) { - if (arg instanceof _Code) - code.push(...arg._items); - else if (arg instanceof Name) - code.push(arg); - else - code.push(interpolate(arg)); -} -exports.addCodeArg = addCodeArg; -function optimize(expr) { - let i = 1; - while (i < expr.length - 1) { - if (expr[i] === plus) { - const res = mergeExprItems(expr[i - 1], expr[i + 1]); - if (res !== undefined) { - expr.splice(i - 1, 3, res); - continue; - } - expr[i++] = "+"; - } - i++; - } -} -function mergeExprItems(a, b) { - if (b === '""') - return a; - if (a === '""') - return b; - if (typeof a == "string") { - if (b instanceof Name || a[a.length - 1] !== '"') - return; - if (typeof b != "string") - return `${a.slice(0, -1)}${b}"`; - if (b[0] === '"') - return a.slice(0, -1) + b.slice(1); - return; - } - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) - return `"${a}${b.slice(1)}`; - return; -} -function strConcat(c1, c2) { - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`; -} -exports.strConcat = strConcat; -// TODO do not allow arrays here -function interpolate(x) { - return typeof x == "number" || typeof x == "boolean" || x === null - ? x - : safeStringify(Array.isArray(x) ? x.join(",") : x); -} -function stringify(x) { - return new _Code(safeStringify(x)); -} -exports.stringify = stringify; -function safeStringify(x) { - return JSON.stringify(x) - .replace(/\u2028/g, "\\u2028") - .replace(/\u2029/g, "\\u2029"); -} -exports.safeStringify = safeStringify; -function getProperty(key) { - return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`; -} -exports.getProperty = getProperty; -//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js.map b/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js.map deleted file mode 100644 index c4ab69a61..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../lib/compile/codegen/code.ts"],"names":[],"mappings":";;;AAAA,MAAsB,WAAW;CAKhC;AALD,kCAKC;AAEY,QAAA,UAAU,GAAG,uBAAuB,CAA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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACvD,CAAC;AAED,SAAgB,SAAS,CAAC,CAAU;IAClC,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,CAAC;AAFD,8BAEC;AAED,SAAgB,aAAa,CAAC,CAAU;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAClC,CAAC;AAJD,sCAIC;AAED,SAAgB,WAAW,CAAC,GAA2B;IACrD,OAAO,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,IAAI,GAAG,GAAG,CAAA;AAC5F,CAAC;AAFD,kCAEC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.d.ts b/node_modules/table/node_modules/ajv/dist/compile/codegen/index.d.ts deleted file mode 100644 index 434d69cf9..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from "./scope"; -import { _Code, Code, Name } from "./code"; -import { Scope } from "./scope"; -export { _, str, strConcat, nil, getProperty, stringify, Name, Code } from "./code"; -export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope"; -export declare type SafeExpr = Code | number | boolean | null; -export declare type Block = Code | (() => void); -export declare const operators: { - GT: _Code; - GTE: _Code; - LT: _Code; - LTE: _Code; - EQ: _Code; - NEQ: _Code; - NOT: _Code; - OR: _Code; - AND: _Code; - ADD: _Code; -}; -export interface CodeGenOptions { - es5?: boolean; - lines?: boolean; - ownProperties?: boolean; -} -export declare class CodeGen { - readonly _scope: Scope; - readonly _extScope: ValueScope; - readonly _values: ScopeValueSets; - private readonly _nodes; - private readonly _blockStarts; - private readonly _constants; - private readonly opts; - constructor(extScope: ValueScope, opts?: CodeGenOptions); - toString(): string; - name(prefix: string): Name; - scopeName(prefix: string): ValueScopeName; - scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name; - getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; - scopeRefs(scopeName: Name): Code; - scopeCode(): Code; - private _def; - const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name; - let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; - var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; - assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen; - add(lhs: Code, rhs: SafeExpr): CodeGen; - code(c: Block | SafeExpr): CodeGen; - object(...keyValues: [Name | string, SafeExpr | string][]): _Code; - if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen; - elseIf(condition: Code | boolean): CodeGen; - else(): CodeGen; - endIf(): CodeGen; - private _for; - for(iteration: Code, forBody?: Block): CodeGen; - forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen; - forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; - forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; - endFor(): CodeGen; - label(label: Name): CodeGen; - break(label?: Code): CodeGen; - return(value: Block | SafeExpr): CodeGen; - try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen; - throw(error: Code): CodeGen; - block(body?: Block, nodeCount?: number): CodeGen; - endBlock(nodeCount?: number): CodeGen; - func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen; - endFunc(): CodeGen; - optimize(n?: number): void; - private _leafNode; - private _blockNode; - private _endBlockNode; - private _elseNode; - private get _root(); - private get _currNode(); - private set _currNode(value); -} -export declare function not(x: T): T; -export declare function and(...args: Code[]): Code; -export declare function or(...args: Code[]): Code; diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js b/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js deleted file mode 100644 index d2ff4643d..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js +++ /dev/null @@ -1,696 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; -const code_1 = require("./code"); -const scope_1 = require("./scope"); -var code_2 = require("./code"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } }); -Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return code_2.nil; } }); -Object.defineProperty(exports, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return code_2.stringify; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return code_2.Name; } }); -var scope_2 = require("./scope"); -Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } }); -Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } }); -Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } }); -Object.defineProperty(exports, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } }); -exports.operators = { - GT: new code_1._Code(">"), - GTE: new code_1._Code(">="), - LT: new code_1._Code("<"), - LTE: new code_1._Code("<="), - EQ: new code_1._Code("==="), - NEQ: new code_1._Code("!=="), - NOT: new code_1._Code("!"), - OR: new code_1._Code("||"), - AND: new code_1._Code("&&"), - ADD: new code_1._Code("+"), -}; -class Node { - optimizeNodes() { - return this; - } - optimizeNames(_names, _constants) { - return this; - } -} -class Def extends Node { - constructor(varKind, name, rhs) { - super(); - this.varKind = varKind; - this.name = name; - this.rhs = rhs; - } - render({ es5, _n }) { - const varKind = es5 ? scope_1.varKinds.var : this.varKind; - const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; - return `${varKind} ${this.name}${rhs};` + _n; - } - optimizeNames(names, constants) { - if (!names[this.name.str]) - return; - if (this.rhs) - this.rhs = optimizeExpr(this.rhs, names, constants); - return this; - } - get names() { - return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; - } -} -class Assign extends Node { - constructor(lhs, rhs, sideEffects) { - super(); - this.lhs = lhs; - this.rhs = rhs; - this.sideEffects = sideEffects; - } - render({ _n }) { - return `${this.lhs} = ${this.rhs};` + _n; - } - optimizeNames(names, constants) { - if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) - return; - this.rhs = optimizeExpr(this.rhs, names, constants); - return this; - } - get names() { - const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; - return addExprNames(names, this.rhs); - } -} -class AssignOp extends Assign { - constructor(lhs, op, rhs, sideEffects) { - super(lhs, rhs, sideEffects); - this.op = op; - } - render({ _n }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + _n; - } -} -class Label extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - return `${this.label}:` + _n; - } -} -class Break extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - const label = this.label ? ` ${this.label}` : ""; - return `break${label};` + _n; - } -} -class Throw extends Node { - constructor(error) { - super(); - this.error = error; - } - render({ _n }) { - return `throw ${this.error};` + _n; - } - get names() { - return this.error.names; - } -} -class AnyCode extends Node { - constructor(code) { - super(); - this.code = code; - } - render({ _n }) { - return `${this.code};` + _n; - } - optimizeNodes() { - return `${this.code}` ? this : undefined; - } - optimizeNames(names, constants) { - this.code = optimizeExpr(this.code, names, constants); - return this; - } - get names() { - return this.code instanceof code_1._CodeOrName ? this.code.names : {}; - } -} -class ParentNode extends Node { - constructor(nodes = []) { - super(); - this.nodes = nodes; - } - render(opts) { - return this.nodes.reduce((code, n) => code + n.render(opts), ""); - } - optimizeNodes() { - const { nodes } = this; - let i = nodes.length; - while (i--) { - const n = nodes[i].optimizeNodes(); - if (Array.isArray(n)) - nodes.splice(i, 1, ...n); - else if (n) - nodes[i] = n; - else - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : undefined; - } - optimizeNames(names, constants) { - const { nodes } = this; - let i = nodes.length; - while (i--) { - // iterating backwards improves 1-pass optimization - const n = nodes[i]; - if (n.optimizeNames(names, constants)) - continue; - subtractNames(names, n.names); - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : undefined; - } - get names() { - return this.nodes.reduce((names, n) => addNames(names, n.names), {}); - } -} -class BlockNode extends ParentNode { - render(opts) { - return "{" + opts._n + super.render(opts) + "}" + opts._n; - } -} -class Root extends ParentNode { -} -class Else extends BlockNode { -} -Else.kind = "else"; -class If extends BlockNode { - constructor(condition, nodes) { - super(nodes); - this.condition = condition; - } - render(opts) { - let code = `if(${this.condition})` + super.render(opts); - if (this.else) - code += "else " + this.else.render(opts); - return code; - } - optimizeNodes() { - super.optimizeNodes(); - const cond = this.condition; - if (cond === true) - return this.nodes; // else is ignored here - let e = this.else; - if (e) { - const ns = e.optimizeNodes(); - e = this.else = Array.isArray(ns) ? new Else(ns) : ns; - } - if (e) { - if (cond === false) - return e instanceof If ? e : e.nodes; - if (this.nodes.length) - return this; - return new If(not(cond), e instanceof If ? [e] : e.nodes); - } - if (cond === false || !this.nodes.length) - return undefined; - return this; - } - optimizeNames(names, constants) { - var _a; - this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); - if (!(super.optimizeNames(names, constants) || this.else)) - return; - this.condition = optimizeExpr(this.condition, names, constants); - return this; - } - get names() { - const names = super.names; - addExprNames(names, this.condition); - if (this.else) - addNames(names, this.else.names); - return names; - } -} -If.kind = "if"; -class For extends BlockNode { -} -For.kind = "for"; -class ForLoop extends For { - constructor(iteration) { - super(); - this.iteration = iteration; - } - render(opts) { - return `for(${this.iteration})` + super.render(opts); - } - optimizeNames(names, constants) { - if (!super.optimizeNames(names, constants)) - return; - this.iteration = optimizeExpr(this.iteration, names, constants); - return this; - } - get names() { - return addNames(super.names, this.iteration.names); - } -} -class ForRange extends For { - constructor(varKind, name, from, to) { - super(); - this.varKind = varKind; - this.name = name; - this.from = from; - this.to = to; - } - render(opts) { - const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; - const { name, from, to } = this; - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); - } - get names() { - const names = addExprNames(super.names, this.from); - return addExprNames(names, this.to); - } -} -class ForIter extends For { - constructor(loop, varKind, name, iterable) { - super(); - this.loop = loop; - this.varKind = varKind; - this.name = name; - this.iterable = iterable; - } - render(opts) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); - } - optimizeNames(names, constants) { - if (!super.optimizeNames(names, constants)) - return; - this.iterable = optimizeExpr(this.iterable, names, constants); - return this; - } - get names() { - return addNames(super.names, this.iterable.names); - } -} -class Func extends BlockNode { - constructor(name, args, async) { - super(); - this.name = name; - this.args = args; - this.async = async; - } - render(opts) { - const _async = this.async ? "async " : ""; - return `${_async}function ${this.name}(${this.args})` + super.render(opts); - } -} -Func.kind = "func"; -class Return extends ParentNode { - render(opts) { - return "return " + super.render(opts); - } -} -Return.kind = "return"; -class Try extends BlockNode { - render(opts) { - let code = "try" + super.render(opts); - if (this.catch) - code += this.catch.render(opts); - if (this.finally) - code += this.finally.render(opts); - return code; - } - optimizeNodes() { - var _a, _b; - super.optimizeNodes(); - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); - return this; - } - optimizeNames(names, constants) { - var _a, _b; - super.optimizeNames(names, constants); - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); - return this; - } - get names() { - const names = super.names; - if (this.catch) - addNames(names, this.catch.names); - if (this.finally) - addNames(names, this.finally.names); - return names; - } -} -class Catch extends BlockNode { - constructor(error) { - super(); - this.error = error; - } - render(opts) { - return `catch(${this.error})` + super.render(opts); - } -} -Catch.kind = "catch"; -class Finally extends BlockNode { - render(opts) { - return "finally" + super.render(opts); - } -} -Finally.kind = "finally"; -class CodeGen { - constructor(extScope, opts = {}) { - this._values = {}; - this._blockStarts = []; - this._constants = {}; - this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; - this._extScope = extScope; - this._scope = new scope_1.Scope({ parent: extScope }); - this._nodes = [new Root()]; - } - toString() { - return this._root.render(this.opts); - } - // returns unique name in the internal scope - name(prefix) { - return this._scope.name(prefix); - } - // reserves unique name in the external scope - scopeName(prefix) { - return this._extScope.name(prefix); - } - // reserves unique name in the external scope and assigns value to it - scopeValue(prefixOrName, value) { - const name = this._extScope.value(prefixOrName, value); - const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); - vs.add(name); - return name; - } - getScopeValue(prefix, keyOrRef) { - return this._extScope.getValue(prefix, keyOrRef); - } - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(scopeName) { - return this._extScope.scopeRefs(scopeName, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(varKind, nameOrPrefix, rhs, constant) { - const name = this._scope.toName(nameOrPrefix); - if (rhs !== undefined && constant) - this._constants[name.str] = rhs; - this._leafNode(new Def(varKind, name, rhs)); - return name; - } - // `const` declaration (`var` in es5 mode) - const(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); - } - // `let` declaration with optional assignment (`var` in es5 mode) - let(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); - } - // `var` declaration with optional assignment - var(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); - } - // assignment code - assign(lhs, rhs, sideEffects) { - return this._leafNode(new Assign(lhs, rhs, sideEffects)); - } - // `+=` code - add(lhs, rhs) { - return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); - } - // appends passed SafeExpr to code or executes Block - code(c) { - if (typeof c == "function") - c(); - else if (c !== code_1.nil) - this._leafNode(new AnyCode(c)); - return this; - } - // returns code for object literal for the passed argument list of key-value pairs - object(...keyValues) { - const code = ["{"]; - for (const [key, value] of keyValues) { - if (code.length > 1) - code.push(","); - code.push(key); - if (key !== value || this.opts.es5) { - code.push(":"); - code_1.addCodeArg(code, value); - } - } - code.push("}"); - return new code_1._Code(code); - } - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(condition, thenBody, elseBody) { - this._blockNode(new If(condition)); - if (thenBody && elseBody) { - this.code(thenBody).else().code(elseBody).endIf(); - } - else if (thenBody) { - this.code(thenBody).endIf(); - } - else if (elseBody) { - throw new Error('CodeGen: "else" body without "then" body'); - } - return this; - } - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(condition) { - return this._elseNode(new If(condition)); - } - // `else` clause - only valid after `if` or `else if` clauses - else() { - return this._elseNode(new Else()); - } - // end `if` statement (needed if gen.if was used only with condition) - endIf() { - return this._endBlockNode(If, Else); - } - _for(node, forBody) { - this._blockNode(node); - if (forBody) - this.code(forBody).endFor(); - return this; - } - // a generic `for` clause (or statement if `forBody` is passed) - for(iteration, forBody) { - return this._for(new ForLoop(iteration), forBody); - } - // `for` statement for a range of values - forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); - } - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { - const name = this._scope.toName(nameOrPrefix); - if (this.opts.es5) { - const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); - return this.forRange("_i", 0, code_1._ `${arr}.length`, (i) => { - this.var(name, code_1._ `${arr}[${i}]`); - forBody(name); - }); - } - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); - } - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { - if (this.opts.ownProperties) { - return this.forOf(nameOrPrefix, code_1._ `Object.keys(${obj})`, forBody); - } - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); - } - // end `for` loop - endFor() { - return this._endBlockNode(For); - } - // `label` statement - label(label) { - return this._leafNode(new Label(label)); - } - // `break` statement - break(label) { - return this._leafNode(new Break(label)); - } - // `return` statement - return(value) { - const node = new Return(); - this._blockNode(node); - this.code(value); - if (node.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(Return); - } - // `try` statement - try(tryBody, catchCode, finallyCode) { - if (!catchCode && !finallyCode) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const node = new Try(); - this._blockNode(node); - this.code(tryBody); - if (catchCode) { - const error = this.name("e"); - this._currNode = node.catch = new Catch(error); - catchCode(error); - } - if (finallyCode) { - this._currNode = node.finally = new Finally(); - this.code(finallyCode); - } - return this._endBlockNode(Catch, Finally); - } - // `throw` statement - throw(error) { - return this._leafNode(new Throw(error)); - } - // start self-balancing block - block(body, nodeCount) { - this._blockStarts.push(this._nodes.length); - if (body) - this.code(body).endBlock(nodeCount); - return this; - } - // end the current self-balancing block - endBlock(nodeCount) { - const len = this._blockStarts.pop(); - if (len === undefined) - throw new Error("CodeGen: not in self-balancing block"); - const toClose = this._nodes.length - len; - if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); - } - this._nodes.length = len; - return this; - } - // `function` heading (or definition if funcBody is passed) - func(name, args = code_1.nil, async, funcBody) { - this._blockNode(new Func(name, args, async)); - if (funcBody) - this.code(funcBody).endFunc(); - return this; - } - // end function definition - endFunc() { - return this._endBlockNode(Func); - } - optimize(n = 1) { - while (n-- > 0) { - this._root.optimizeNodes(); - this._root.optimizeNames(this._root.names, this._constants); - } - } - _leafNode(node) { - this._currNode.nodes.push(node); - return this; - } - _blockNode(node) { - this._currNode.nodes.push(node); - this._nodes.push(node); - } - _endBlockNode(N1, N2) { - const n = this._currNode; - if (n instanceof N1 || (N2 && n instanceof N2)) { - this._nodes.pop(); - return this; - } - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); - } - _elseNode(node) { - const n = this._currNode; - if (!(n instanceof If)) { - throw new Error('CodeGen: "else" without "if"'); - } - this._currNode = n.else = node; - return this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const ns = this._nodes; - return ns[ns.length - 1]; - } - set _currNode(node) { - const ns = this._nodes; - ns[ns.length - 1] = node; - } -} -exports.CodeGen = CodeGen; -function addNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) + (from[n] || 0); - return names; -} -function addExprNames(names, from) { - return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; -} -function optimizeExpr(expr, names, constants) { - if (expr instanceof code_1.Name) - return replaceName(expr); - if (!canOptimize(expr)) - return expr; - return new code_1._Code(expr._items.reduce((items, c) => { - if (c instanceof code_1.Name) - c = replaceName(c); - if (c instanceof code_1._Code) - items.push(...c._items); - else - items.push(c); - return items; - }, [])); - function replaceName(n) { - const c = constants[n.str]; - if (c === undefined || names[n.str] !== 1) - return n; - delete names[n.str]; - return c; - } - function canOptimize(e) { - return (e instanceof code_1._Code && - e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined)); - } -} -function subtractNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) - (from[n] || 0); -} -function not(x) { - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : code_1._ `!${par(x)}`; -} -exports.not = not; -const andCode = mappend(exports.operators.AND); -// boolean AND (&&) expression with the passed arguments -function and(...args) { - return args.reduce(andCode); -} -exports.and = and; -const orCode = mappend(exports.operators.OR); -// boolean OR (||) expression with the passed arguments -function or(...args) { - return args.reduce(orCode); -} -exports.or = or; -function mappend(op) { - return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : code_1._ `${par(x)} ${op} ${par(y)}`); -} -function par(x) { - return x instanceof code_1.Name ? x : code_1._ `(${x})`; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js.map b/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js.map deleted file mode 100644 index edccb88d1..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/codegen/index.ts"],"names":[],"mappings":";;;AACA,iCAA8F;AAC9F,mCAAuC;AAEvC,+BAAiF;AAAzE,yFAAA,CAAC,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,mGAAA,WAAW,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,4FAAA,IAAI,OAAA;AAC5D,iCAA+F;AAAvF,8FAAA,KAAK,OAAA;AAAc,mGAAA,UAAU,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAkB,iGAAA,QAAQ,OAAA;AAQlE,QAAA,SAAS,GAAG;IACvB,EAAE,EAAE,IAAI,YAAK,CAAC,GAAG,CAAC;IAClB,GAAG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AAC,CAAA,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjF,CAAC;AAED,SAAS,GAAG,CAAC,CAAO;IAClB,OAAO,CAAC,YAAY,WAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAC,CAAA,IAAI,CAAC,GAAG,CAAA;AAC1C,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.d.ts b/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.d.ts deleted file mode 100644 index 3c351bb63..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Code, Name } from "./code"; -interface NameGroup { - prefix: string; - index: number; -} -export interface NameValue { - ref: ValueReference; - key?: unknown; - code?: Code; -} -export declare type ValueReference = unknown; -interface ScopeOptions { - prefixes?: Set; - parent?: Scope; -} -interface ValueScopeOptions extends ScopeOptions { - scope: ScopeStore; - es5?: boolean; - lines?: boolean; -} -export declare type ScopeStore = Record; -declare type ScopeValues = { - [Prefix in string]?: Map; -}; -export declare type ScopeValueSets = { - [Prefix in string]?: Set; -}; -export declare enum UsedValueState { - Started = 0, - Completed = 1 -} -export declare type UsedScopeValues = { - [Prefix in string]?: Map; -}; -export declare const varKinds: { - const: Name; - let: Name; - var: Name; -}; -export declare class Scope { - protected readonly _names: { - [Prefix in string]?: NameGroup; - }; - protected readonly _prefixes?: Set; - protected readonly _parent?: Scope; - constructor({ prefixes, parent }?: ScopeOptions); - toName(nameOrPrefix: Name | string): Name; - name(prefix: string): Name; - protected _newName(prefix: string): string; - private _nameGroup; -} -interface ScopePath { - property: string; - itemIndex: number; -} -export declare class ValueScopeName extends Name { - readonly prefix: string; - value?: NameValue; - scopePath?: Code; - constructor(prefix: string, nameStr: string); - setValue(value: NameValue, { property, itemIndex }: ScopePath): void; -} -interface VSOptions extends ValueScopeOptions { - _n: Code; -} -export declare class ValueScope extends Scope { - protected readonly _values: ScopeValues; - protected readonly _scope: ScopeStore; - readonly opts: VSOptions; - constructor(opts: ValueScopeOptions); - get(): ScopeStore; - name(prefix: string): ValueScopeName; - value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName; - getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; - scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code; - scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code; - private _reduceValues; -} -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js b/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js deleted file mode 100644 index 91919e888..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; -const code_1 = require("./code"); -class ValueError extends Error { - constructor(name) { - super(`CodeGen: "code" for ${name} not defined`); - this.value = name.value; - } -} -var UsedValueState; -(function (UsedValueState) { - UsedValueState[UsedValueState["Started"] = 0] = "Started"; - UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; -})(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {})); -exports.varKinds = { - const: new code_1.Name("const"), - let: new code_1.Name("let"), - var: new code_1.Name("var"), -}; -class Scope { - constructor({ prefixes, parent } = {}) { - this._names = {}; - this._prefixes = prefixes; - this._parent = parent; - } - toName(nameOrPrefix) { - return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); - } - name(prefix) { - return new code_1.Name(this._newName(prefix)); - } - _newName(prefix) { - const ng = this._names[prefix] || this._nameGroup(prefix); - return `${prefix}${ng.index++}`; - } - _nameGroup(prefix) { - var _a, _b; - if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) { - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); - } - return (this._names[prefix] = { prefix, index: 0 }); - } -} -exports.Scope = Scope; -class ValueScopeName extends code_1.Name { - constructor(prefix, nameStr) { - super(nameStr); - this.prefix = prefix; - } - setValue(value, { property, itemIndex }) { - this.value = value; - this.scopePath = code_1._ `.${new code_1.Name(property)}[${itemIndex}]`; - } -} -exports.ValueScopeName = ValueScopeName; -const line = code_1._ `\n`; -class ValueScope extends Scope { - constructor(opts) { - super(opts); - this._values = {}; - this._scope = opts.scope; - this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; - } - get() { - return this._scope; - } - name(prefix) { - return new ValueScopeName(prefix, this._newName(prefix)); - } - value(nameOrPrefix, value) { - var _a; - if (value.ref === undefined) - throw new Error("CodeGen: ref must be passed in value"); - const name = this.toName(nameOrPrefix); - const { prefix } = name; - const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; - let vs = this._values[prefix]; - if (vs) { - const _name = vs.get(valueKey); - if (_name) - return _name; - } - else { - vs = this._values[prefix] = new Map(); - } - vs.set(valueKey, name); - const s = this._scope[prefix] || (this._scope[prefix] = []); - const itemIndex = s.length; - s[itemIndex] = value.ref; - name.setValue(value, { property: prefix, itemIndex }); - return name; - } - getValue(prefix, keyOrRef) { - const vs = this._values[prefix]; - if (!vs) - return; - return vs.get(keyOrRef); - } - scopeRefs(scopeName, values = this._values) { - return this._reduceValues(values, (name) => { - if (name.scopePath === undefined) - throw new Error(`CodeGen: name "${name}" has no value`); - return code_1._ `${scopeName}${name.scopePath}`; - }); - } - scopeCode(values = this._values, usedValues, getCode) { - return this._reduceValues(values, (name) => { - if (name.value === undefined) - throw new Error(`CodeGen: name "${name}" has no value`); - return name.value.code; - }, usedValues, getCode); - } - _reduceValues(values, valueCode, usedValues = {}, getCode) { - let code = code_1.nil; - for (const prefix in values) { - const vs = values[prefix]; - if (!vs) - continue; - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()); - vs.forEach((name) => { - if (nameSet.has(name)) - return; - nameSet.set(name, UsedValueState.Started); - let c = valueCode(name); - if (c) { - const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; - code = code_1._ `${code}${def} ${name} = ${c};${this.opts._n}`; - } - else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) { - code = code_1._ `${code}${c}${this.opts._n}`; - } - else { - throw new ValueError(name); - } - nameSet.set(name, UsedValueState.Completed); - }); - } - return code; - } -} -exports.ValueScope = ValueScope; -//# sourceMappingURL=scope.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js.map b/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js.map deleted file mode 100644 index 26db7bb90..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../lib/compile/codegen/scope.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAezC,MAAM,UAAW,SAAQ,KAAK;IAE5B,YAAY,IAAoB;QAC9B,KAAK,CAAC,uBAAuB,IAAI,cAAc,CAAC,CAAA;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IACzB,CAAC;CACF;AAuBD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,yDAAO,CAAA;IACP,6DAAS,CAAA;AACX,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAMY,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,IAAI,WAAI,CAAC,OAAO,CAAC;IACxB,GAAG,EAAE,IAAI,WAAI,CAAC,KAAK,CAAC;IACpB,GAAG,EAAE,IAAI,WAAI,CAAC,KAAK,CAAC;CACrB,CAAA;AAED,MAAa,KAAK;IAKhB,YAAY,EAAC,QAAQ,EAA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C,CAAC,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,CAAC,EAAE;oBAChC,IAAI,GAAG,QAAC,CAAA,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;iBACrC;qBAAM;oBACL,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;iBAC3B;gBACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;SACH;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAjGD,gCAiGC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/context.d.ts b/node_modules/table/node_modules/ajv/dist/compile/context.d.ts deleted file mode 100644 index cd8864813..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/context.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { AddedKeywordDefinition, KeywordErrorCxt, KeywordCxtParams, AnySchemaObject } from "../types"; -import { SchemaCxt, SchemaObjCxt } from "./index"; -import { JSONType } from "./rules"; -import { CodeGen, Code, Name } from "./codegen"; -import { SubschemaArgs } from "./subschema"; -export default class KeywordCxt implements KeywordErrorCxt { - readonly gen: CodeGen; - readonly allErrors?: boolean; - readonly keyword: string; - readonly data: Name; - readonly $data?: string | false; - schema: any; - readonly schemaValue: Code | number | boolean; - readonly schemaCode: Code | number | boolean; - readonly schemaType: JSONType[]; - readonly parentSchema: AnySchemaObject; - readonly errsCount?: Name; - params: KeywordCxtParams; - readonly it: SchemaObjCxt; - readonly def: AddedKeywordDefinition; - constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string); - result(condition: Code, successAction?: () => void, failAction?: () => void): void; - pass(condition: Code, failAction?: () => void): void; - fail(condition?: Code): void; - fail$data(condition: Code): void; - error(append?: true): void; - $dataError(): void; - reset(): void; - ok(cond: Code | boolean): void; - setParams(obj: KeywordCxtParams, assign?: true): void; - block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void; - check$data(valid?: Name, $dataValid?: Code): void; - invalid$data(): Code; - subschema(appl: SubschemaArgs, valid: Name): SchemaCxt; - mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void; - mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void; -} -export declare function getData($data: string, { dataLevel, dataNames, dataPathArr }: SchemaCxt): Code | number; diff --git a/node_modules/table/node_modules/ajv/dist/compile/context.js b/node_modules/table/node_modules/ajv/dist/compile/context.js deleted file mode 100644 index 17dd9ba11..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/context.js +++ /dev/null @@ -1,240 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getData = void 0; -const dataType_1 = require("./validate/dataType"); -const util_1 = require("./util"); -const errors_1 = require("./errors"); -const codegen_1 = require("./codegen"); -const names_1 = require("./names"); -const subschema_1 = require("./subschema"); -class KeywordCxt { - constructor(it, def, keyword) { - validateKeywordUsage(it, def, keyword); - this.gen = it.gen; - this.allErrors = it.allErrors; - this.keyword = keyword; - this.data = it.data; - this.schema = it.schema[keyword]; - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; - this.schemaValue = util_1.schemaRefOrVal(it, this.schema, keyword, this.$data); - this.schemaType = def.schemaType; - this.parentSchema = it.schema; - this.params = {}; - this.it = it; - this.def = def; - if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); - } - else { - this.schemaCode = this.schemaValue; - if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) { - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); - } - } - if ("code" in def ? def.trackErrors : def.errors !== false) { - this.errsCount = it.gen.const("_errs", names_1.default.errors); - } - } - result(condition, successAction, failAction) { - this.gen.if(codegen_1.not(condition)); - if (failAction) - failAction(); - else - this.error(); - if (successAction) { - this.gen.else(); - successAction(); - if (this.allErrors) - this.gen.endIf(); - } - else { - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - } - pass(condition, failAction) { - this.result(condition, undefined, failAction); - } - fail(condition) { - if (condition === undefined) { - this.error(); - if (!this.allErrors) - this.gen.if(false); // this branch will be removed by gen.optimize - return; - } - this.gen.if(condition); - this.error(); - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - fail$data(condition) { - if (!this.$data) - return this.fail(condition); - const { schemaCode } = this; - this.fail(codegen_1._ `${schemaCode} !== undefined && (${codegen_1.or(this.invalid$data(), condition)})`); - } - error(append) { - ; - (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error); - } - $dataError() { - errors_1.reportError(this, this.def.$dataError || errors_1.keyword$DataError); - } - reset() { - if (this.errsCount === undefined) - throw new Error('add "trackErrors" to keyword definition'); - errors_1.resetErrorsCount(this.gen, this.errsCount); - } - ok(cond) { - if (!this.allErrors) - this.gen.if(cond); - } - setParams(obj, assign) { - if (assign) - Object.assign(this.params, obj); - else - this.params = obj; - } - block$data(valid, codeBlock, $dataValid = codegen_1.nil) { - this.gen.block(() => { - this.check$data(valid, $dataValid); - codeBlock(); - }); - } - check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { - if (!this.$data) - return; - const { gen, schemaCode, schemaType, def } = this; - gen.if(codegen_1.or(codegen_1._ `${schemaCode} === undefined`, $dataValid)); - if (valid !== codegen_1.nil) - gen.assign(valid, true); - if (schemaType.length || def.validateSchema) { - gen.elseIf(this.invalid$data()); - this.$dataError(); - if (valid !== codegen_1.nil) - gen.assign(valid, false); - } - gen.else(); - } - invalid$data() { - const { gen, schemaCode, schemaType, def, it } = this; - return codegen_1.or(wrong$DataType(), invalid$DataSchema()); - function wrong$DataType() { - if (schemaType.length) { - /* istanbul ignore if */ - if (!(schemaCode instanceof codegen_1.Name)) - throw new Error("ajv implementation error"); - const st = Array.isArray(schemaType) ? schemaType : [schemaType]; - return codegen_1._ `${dataType_1.checkDataTypes(st, schemaCode, it.opts.strict, dataType_1.DataType.Wrong)}`; - } - return codegen_1.nil; - } - function invalid$DataSchema() { - if (def.validateSchema) { - const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone - return codegen_1._ `!${validateSchemaRef}(${schemaCode})`; - } - return codegen_1.nil; - } - } - subschema(appl, valid) { - return subschema_1.applySubschema(this.it, appl, valid); - } - mergeEvaluated(schemaCxt, toName) { - const { it, gen } = this; - if (!it.opts.unevaluated) - return; - if (it.props !== true && schemaCxt.props !== undefined) { - it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); - } - if (it.items !== true && schemaCxt.items !== undefined) { - it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); - } - } - mergeValidEvaluated(schemaCxt, valid) { - const { it, gen } = this; - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { - gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); - return true; - } - } -} -exports.default = KeywordCxt; -function validSchemaType(schema, schemaType, allowUndefined = false) { - // TODO add tests - return (!schemaType.length || - schemaType.some((st) => st === "array" - ? Array.isArray(schema) - : st === "object" - ? schema && typeof schema == "object" && !Array.isArray(schema) - : typeof schema == st || (allowUndefined && typeof schema == "undefined"))); -} -function validateKeywordUsage({ schema, opts, self }, def, keyword) { - /* istanbul ignore if */ - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { - throw new Error("ajv implementation error"); - } - const deps = def.dependencies; - if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); - } - if (def.validateSchema) { - const valid = def.validateSchema(schema[keyword]); - if (!valid) { - const msg = "keyword value is invalid: " + self.errorsText(def.validateSchema.errors); - if (opts.validateSchema === "log") - self.logger.error(msg); - else - throw new Error(msg); - } - } -} -const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; -const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; -function getData($data, { dataLevel, dataNames, dataPathArr }) { - let jsonPointer; - let data; - if ($data === "") - return names_1.default.rootData; - if ($data[0] === "/") { - if (!JSON_POINTER.test($data)) - throw new Error(`Invalid JSON-pointer: ${$data}`); - jsonPointer = $data; - data = names_1.default.rootData; - } - else { - const matches = RELATIVE_JSON_POINTER.exec($data); - if (!matches) - throw new Error(`Invalid JSON-pointer: ${$data}`); - const up = +matches[1]; - jsonPointer = matches[2]; - if (jsonPointer === "#") { - if (up >= dataLevel) - throw new Error(errorMsg("property/index", up)); - return dataPathArr[dataLevel - up]; - } - if (up > dataLevel) - throw new Error(errorMsg("data", up)); - data = dataNames[dataLevel - up]; - if (!jsonPointer) - return data; - } - let expr = data; - const segments = jsonPointer.split("/"); - for (const segment of segments) { - if (segment) { - data = codegen_1._ `${data}${codegen_1.getProperty(util_1.unescapeJsonPointer(segment))}`; - expr = codegen_1._ `${expr} && ${data}`; - } - } - return expr; - function errorMsg(pointerType, up) { - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; - } -} -exports.getData = getData; -//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/context.js.map b/node_modules/table/node_modules/ajv/dist/compile/context.js.map deleted file mode 100644 index 97d36838b..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/context.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"context.js","sourceRoot":"","sources":["../../lib/compile/context.ts"],"names":[],"mappings":";;;AAQA,kDAA4D;AAC5D,iCAA0E;AAC1E,qCAA2F;AAC3F,uCAA2E;AAC3E,mCAAuB;AACvB,2CAAyD;AAEzD,MAAqB,UAAU;IAiB7B,YAAY,EAAgB,EAAE,GAA2B,EAAE,OAAe;QACxE,oBAAoB,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QACtC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC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CAAC,OAAO,CAAC,CAAC,EAAE,CAAA;YAC7D,IAAI,GAAG,WAAC,CAAA,GAAG,IAAI,OAAO,IAAI,EAAE,CAAA;SAC7B;KACF;IACD,OAAO,IAAI,CAAA;IAEX,SAAS,QAAQ,CAAC,WAAmB,EAAE,EAAU;QAC/C,OAAO,iBAAiB,WAAW,IAAI,EAAE,gCAAgC,SAAS,EAAE,CAAA;IACtF,CAAC;AACH,CAAC;AAtCD,0BAsCC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/equal.d.ts b/node_modules/table/node_modules/ajv/dist/compile/equal.d.ts deleted file mode 100644 index b1c21f81c..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/equal.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: (a: any, b: any) => boolean; -export = _exports; diff --git a/node_modules/table/node_modules/ajv/dist/compile/equal.js b/node_modules/table/node_modules/ajv/dist/compile/equal.js deleted file mode 100644 index e5b45c3ca..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/equal.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -// do NOT remove this file - it would break pre-compiled schemas -// https://github.com/ajv-validator/ajv/issues/889 -module.exports = require("fast-deep-equal"); -//# sourceMappingURL=equal.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/equal.js.map b/node_modules/table/node_modules/ajv/dist/compile/equal.js.map deleted file mode 100644 index e9d41727a..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/equal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../lib/compile/equal.js"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,kDAAkD;AAClD,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/error_classes.d.ts b/node_modules/table/node_modules/ajv/dist/compile/error_classes.d.ts deleted file mode 100644 index a3fca521a..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/error_classes.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ErrorObject } from "../types"; -export declare class ValidationError extends Error { - readonly errors: Partial[]; - readonly ajv: true; - readonly validation: true; - constructor(errors: Partial[]); -} -export declare class MissingRefError extends Error { - readonly missingRef: string; - readonly missingSchema: string; - constructor(baseId: string, ref: string, msg?: string); -} diff --git a/node_modules/table/node_modules/ajv/dist/compile/error_classes.js b/node_modules/table/node_modules/ajv/dist/compile/error_classes.js deleted file mode 100644 index ef3910700..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/error_classes.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = void 0; -const resolve_1 = require("./resolve"); -class ValidationError extends Error { - constructor(errors) { - super("validation failed"); - this.errors = errors; - this.ajv = this.validation = true; - } -} -exports.ValidationError = ValidationError; -class MissingRefError extends Error { - constructor(baseId, ref, msg) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`); - this.missingRef = resolve_1.resolveUrl(baseId, ref); - this.missingSchema = resolve_1.normalizeId(resolve_1.getFullPath(this.missingRef)); - } -} -exports.MissingRefError = MissingRefError; -module.exports = { - ValidationError, - MissingRefError, -}; -//# sourceMappingURL=error_classes.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/error_classes.js.map b/node_modules/table/node_modules/ajv/dist/compile/error_classes.js.map deleted file mode 100644 index 47db57c8b..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/error_classes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"error_classes.js","sourceRoot":"","sources":["../../lib/compile/error_classes.ts"],"names":[],"mappings":";;;AACA,uCAA8D;AAE9D,MAAa,eAAgB,SAAQ,KAAK;IAKxC,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;IACnC,CAAC;CACF;AAVD,0CAUC;AAED,MAAa,eAAgB,SAAQ,KAAK;IAIxC,YAAY,MAAc,EAAE,GAAW,EAAE,GAAY;QACnD,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QACzC,IAAI,CAAC,aAAa,GAAG,qBAAW,CAAC,qBAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAChE,CAAC;CACF;AATD,0CASC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,eAAe;IACf,eAAe;CAChB,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/errors.d.ts b/node_modules/table/node_modules/ajv/dist/compile/errors.d.ts deleted file mode 100644 index 3063dc11f..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/errors.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { KeywordErrorCxt, KeywordErrorDefinition } from "../types"; -import { CodeGen, Name } from "./codegen"; -export declare const keywordError: KeywordErrorDefinition; -export declare const keyword$DataError: KeywordErrorDefinition; -export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, overrideAllErrors?: boolean): void; -export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition): void; -export declare function resetErrorsCount(gen: CodeGen, errsCount: Name): void; -export declare function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }: KeywordErrorCxt): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/errors.js b/node_modules/table/node_modules/ajv/dist/compile/errors.js deleted file mode 100644 index fa886d80d..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/errors.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; -const codegen_1 = require("./codegen"); -const names_1 = require("./names"); -exports.keywordError = { - message: ({ keyword }) => codegen_1.str `should pass "${keyword}" keyword validation`, -}; -exports.keyword$DataError = { - message: ({ keyword, schemaType }) => schemaType - ? codegen_1.str `"${keyword}" keyword must be ${schemaType} ($data)` - : codegen_1.str `"${keyword}" keyword is invalid ($data)`, -}; -function reportError(cxt, error = exports.keywordError, overrideAllErrors) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error); - if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) { - addError(gen, errObj); - } - else { - returnErrors(it, codegen_1._ `[${errObj}]`); - } -} -exports.reportError = reportError; -function reportExtraError(cxt, error = exports.keywordError) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error); - addError(gen, errObj); - if (!(compositeRule || allErrors)) { - returnErrors(it, names_1.default.vErrors); - } -} -exports.reportExtraError = reportExtraError; -function resetErrorsCount(gen, errsCount) { - gen.assign(names_1.default.errors, errsCount); - gen.if(codegen_1._ `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign(codegen_1._ `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); -} -exports.resetErrorsCount = resetErrorsCount; -function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) { - /* istanbul ignore if */ - if (errsCount === undefined) - throw new Error("ajv implementation error"); - const err = gen.name("err"); - gen.forRange("i", errsCount, names_1.default.errors, (i) => { - gen.const(err, codegen_1._ `${names_1.default.vErrors}[${i}]`); - gen.if(codegen_1._ `${err}.dataPath === undefined`, () => gen.assign(codegen_1._ `${err}.dataPath`, codegen_1.strConcat(names_1.default.dataPath, it.errorPath))); - gen.assign(codegen_1._ `${err}.schemaPath`, codegen_1.str `${it.errSchemaPath}/${keyword}`); - if (it.opts.verbose) { - gen.assign(codegen_1._ `${err}.schema`, schemaValue); - gen.assign(codegen_1._ `${err}.data`, data); - } - }); -} -exports.extendErrors = extendErrors; -function addError(gen, errObj) { - const err = gen.const("err", errObj); - gen.if(codegen_1._ `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, codegen_1._ `[${err}]`), codegen_1._ `${names_1.default.vErrors}.push(${err})`); - gen.code(codegen_1._ `${names_1.default.errors}++`); -} -function returnErrors(it, errs) { - const { gen, validateName, schemaEnv } = it; - if (schemaEnv.$async) { - gen.throw(codegen_1._ `new ${it.ValidationError}(${errs})`); - } - else { - gen.assign(codegen_1._ `${validateName}.errors`, errs); - gen.return(false); - } -} -const E = { - keyword: new codegen_1.Name("keyword"), - schemaPath: new codegen_1.Name("schemaPath"), - params: new codegen_1.Name("params"), - propertyName: new codegen_1.Name("propertyName"), - message: new codegen_1.Name("message"), - schema: new codegen_1.Name("schema"), - parentSchema: new codegen_1.Name("parentSchema"), - // JTD error properties - instancePath: new codegen_1.Name("instancePath"), -}; -function errorObjectCode(cxt, error) { - const { createErrors, opts } = cxt.it; - if (createErrors === false) - return codegen_1._ `{}`; - return (opts.jtd && !opts.ajvErrors ? jtdErrorObject : ajvErrorObject)(cxt, error); -} -function jtdErrorObject(cxt, { message }) { - const { gen, keyword, it } = cxt; - const { errorPath, errSchemaPath, opts } = it; - const keyValues = [ - [E.instancePath, codegen_1.strConcat(names_1.default.dataPath, errorPath)], - [E.schemaPath, codegen_1.str `${errSchemaPath}/${keyword}`], - ]; - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); - } - return gen.object(...keyValues); -} -function ajvErrorObject(cxt, error) { - const { gen, keyword, data, schemaValue, it } = cxt; - const { topSchemaRef, schemaPath, errorPath, errSchemaPath, propertyName, opts } = it; - const { params, message } = error; - const keyValues = [ - [E.keyword, keyword], - [names_1.default.dataPath, codegen_1.strConcat(names_1.default.dataPath, errorPath)], - [E.schemaPath, codegen_1.str `${errSchemaPath}/${keyword}`], - [E.params, typeof params == "function" ? params(cxt) : params || codegen_1._ `{}`], - ]; - if (propertyName) - keyValues.push([E.propertyName, propertyName]); - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); - } - if (opts.verbose) { - keyValues.push([E.schema, schemaValue], [E.parentSchema, codegen_1._ `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); - } - return gen.object(...keyValues); -} -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/errors.js.map b/node_modules/table/node_modules/ajv/dist/compile/errors.js.map deleted file mode 100644 index bf5872911..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/compile/errors.ts"],"names":[],"mappings":";;;AAEA,uCAAgE;AAEhE,mCAAuB;AAEV,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,gBAAgB,OAAO,sBAAsB;CACzE,CAAA;AAEY,QAAA,iBAAiB,GAA2B;IACvD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CACjC,UAAU;QACR,CAAC,CAAC,aAAG,CAAA,IAAI,OAAO,qBAAqB,UAAU,UAAU;QACzD,CAAC,CAAC,aAAG,CAAA,IAAI,OAAO,8BAA8B;CACnD,CAAA;AAED,SAAgB,WAAW,CACzB,GAAoB,EACpB,QAAgC,oBAAY,EAC5C,iBAA2B;IAE3B,MAAM,EAAC,EAAE,EAAC,GAAG,GAAG,CAAA;IAChB,MAAM,EAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAC,GAAG,EAAE,CAAA;IAC1C,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC1C,IAAI,iBAA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,KAAK,CAAA;IAC/B,MAAM,SAAS,GAAgC;QAC7C,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC;QACpB,CAAC,eAAC,CAAC,QAAQ,EAAE,mBAAS,CAAC,eAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC,UAAU,EAAE,aAAG,CAAA,GAAG,aAAa,IAAI,OAAO,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,WAAC,CAAA,IAAI,CAAC;KACxE,CAAA;IACD,IAAI,YAAY;QAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;IAChE,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;KACnF;IACD,IAAI,IAAI,CAAC,OAAO,EAAE;QAChB,SAAS,CAAC,IAAI,CACZ,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EACvB,CAAC,CAAC,CAAC,YAAY,EAAE,WAAC,CAAA,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC,EACjD,CAAC,eAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CACf,CAAA;KACF;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAA;AACjC,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/index.d.ts b/node_modules/table/node_modules/ajv/dist/compile/index.d.ts deleted file mode 100644 index b8715aaf4..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/index.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from "../types"; -import type Ajv from "../core"; -import type { InstanceOptions } from "../core"; -import { CodeGen, Name, Code, ValueScopeName } from "./codegen"; -import { LocalRefs } from "./resolve"; -import { JSONType } from "./rules"; -export declare type SchemaRefs = { - [Ref in string]?: SchemaEnv | AnySchema; -}; -export interface SchemaCxt { - readonly gen: CodeGen; - readonly allErrors?: boolean; - readonly data: Name; - readonly parentData: Name; - readonly parentDataProperty: Code | number; - readonly dataNames: Name[]; - readonly dataPathArr: (Code | number)[]; - readonly dataLevel: number; - dataTypes: JSONType[]; - definedProperties: Set; - readonly topSchemaRef: Code; - readonly validateName: Name; - evaluated?: Name; - readonly ValidationError?: Name; - readonly schema: AnySchema; - readonly schemaEnv: SchemaEnv; - readonly rootId: string; - baseId: string; - readonly schemaPath: Code; - readonly errSchemaPath: string; - readonly errorPath: Code; - readonly propertyName?: Name; - readonly compositeRule?: boolean; - props?: EvaluatedProperties | Name; - items?: EvaluatedItems | Name; - jtdDiscriminator?: string; - jtdMetadata?: boolean; - readonly createErrors?: boolean; - readonly opts: InstanceOptions; - readonly self: Ajv; -} -export interface SchemaObjCxt extends SchemaCxt { - readonly schema: AnySchemaObject; -} -interface SchemaEnvArgs { - readonly schema: AnySchema; - readonly root?: SchemaEnv; - readonly baseId?: string; - readonly localRefs?: LocalRefs; - readonly meta?: boolean; -} -export declare class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema; - readonly root: SchemaEnv; - baseId: string; - localRefs?: LocalRefs; - readonly meta?: boolean; - readonly $async?: boolean; - readonly refs: SchemaRefs; - readonly dynamicAnchors: { - [Ref in string]?: true; - }; - validate?: AnyValidateFunction; - validateName?: ValueScopeName; - serialize?: (data: unknown) => string; - serializeName?: ValueScopeName; - parse?: (data: string) => unknown; - parseName?: ValueScopeName; - constructor(env: SchemaEnvArgs); -} -export declare function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv; -export declare function resolveRef(this: Ajv, root: SchemaEnv, baseId: string, ref: string): AnySchema | SchemaEnv | undefined; -export declare function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void; -export declare function resolveSchema(this: Ajv, root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it -ref: string): SchemaEnv | undefined; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/compile/index.js b/node_modules/table/node_modules/ajv/dist/compile/index.js deleted file mode 100644 index 1e3d4d967..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/index.js +++ /dev/null @@ -1,235 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; -const codegen_1 = require("./codegen"); -const error_classes_1 = require("./error_classes"); -const names_1 = require("./names"); -const resolve_1 = require("./resolve"); -const util_1 = require("./util"); -const validate_1 = require("./validate"); -const URI = require("uri-js"); -class SchemaEnv { - constructor(env) { - var _a; - this.refs = {}; - this.dynamicAnchors = {}; - let schema; - if (typeof env.schema == "object") - schema = env.schema; - this.schema = env.schema; - this.root = env.root || this; - this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : resolve_1.normalizeId(schema === null || schema === void 0 ? void 0 : schema.$id); - this.localRefs = env.localRefs; - this.meta = env.meta; - this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; - this.refs = {}; - } -} -exports.SchemaEnv = SchemaEnv; -// let codeSize = 0 -// let nodeCount = 0 -// Compiles schema in SchemaEnv -function compileSchema(sch) { - // TODO refactor - remove compilations - const _sch = getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const rootId = resolve_1.getFullPath(sch.root.baseId); // TODO if getFullPath removed 1 tests fails - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - let _ValidationError; - if (sch.$async) { - _ValidationError = gen.scopeValue("Error", { - ref: error_classes_1.ValidationError, - code: codegen_1._ `require("ajv/dist/compile/error_classes").ValidationError`, - }); - } - const validateName = gen.scopeName("validate"); - sch.validateName = validateName; - const schemaCxt = { - gen, - allErrors: this.opts.allErrors, - data: names_1.default.data, - parentData: names_1.default.parentData, - parentDataProperty: names_1.default.parentDataProperty, - dataNames: [names_1.default.data], - dataPathArr: [codegen_1.nil], - dataLevel: 0, - dataTypes: [], - definedProperties: new Set(), - topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true - ? { ref: sch.schema, code: codegen_1.stringify(sch.schema) } - : { ref: sch.schema }), - validateName, - ValidationError: _ValidationError, - schema: sch.schema, - schemaEnv: sch, - rootId, - baseId: sch.baseId || rootId, - schemaPath: codegen_1.nil, - errSchemaPath: this.opts.jtd ? "" : "#", - errorPath: codegen_1._ `""`, - opts: this.opts, - self: this, - }; - let sourceCode; - try { - this._compilations.add(sch); - validate_1.validateFunctionCode(schemaCxt); - gen.optimize(this.opts.code.optimize); - // gen.optimize(1) - const validateCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; - // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) - if (this.opts.code.process) - sourceCode = this.opts.code.process(sourceCode, sch); - // console.log("\n\n\n *** \n", sourceCode) - const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); - const validate = makeValidate(this, this.scope.get()); - this.scope.value(validateName, { ref: validate }); - validate.errors = null; - validate.schema = sch.schema; - validate.schemaEnv = sch; - if (sch.$async) - validate.$async = true; - if (this.opts.code.source === true) { - validate.source = { validateName, validateCode, scopeValues: gen._values }; - } - if (this.opts.unevaluated) { - const { props, items } = schemaCxt; - validate.evaluated = { - props: props instanceof codegen_1.Name ? undefined : props, - items: items instanceof codegen_1.Name ? undefined : items, - dynamicProps: props instanceof codegen_1.Name, - dynamicItems: items instanceof codegen_1.Name, - }; - if (validate.source) - validate.source.evaluated = codegen_1.stringify(validate.evaluated); - } - sch.validate = validate; - return sch; - } - catch (e) { - delete sch.validate; - delete sch.validateName; - if (sourceCode) - this.logger.error("Error compiling schema, function code:", sourceCode); - // console.log("\n\n\n *** \n", sourceCode, this.opts) - throw e; - } - finally { - this._compilations.delete(sch); - } -} -exports.compileSchema = compileSchema; -function resolveRef(root, baseId, ref) { - var _a; - ref = resolve_1.resolveUrl(baseId, ref); - const schOrFunc = root.refs[ref]; - if (schOrFunc) - return schOrFunc; - let _sch = resolve.call(this, root, ref); - if (_sch === undefined) { - const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv - if (schema) - _sch = new SchemaEnv({ schema, root, baseId }); - } - if (_sch === undefined) - return; - return (root.refs[ref] = inlineOrCompile.call(this, _sch)); -} -exports.resolveRef = resolveRef; -function inlineOrCompile(sch) { - if (resolve_1.inlineRef(sch.schema, this.opts.inlineRefs)) - return sch.schema; - return sch.validate ? sch : compileSchema.call(this, sch); -} -// Index of schema compilation in the currently compiled list -function getCompilingSchema(schEnv) { - for (const sch of this._compilations) { - if (sameSchemaEnv(sch, schEnv)) - return sch; - } -} -exports.getCompilingSchema = getCompilingSchema; -function sameSchemaEnv(s1, s2) { - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; -} -// resolve and compile the references ($ref) -// TODO returns AnySchemaObject (if the schema can be inlined) or validation function -function resolve(root, // information about the root schema for the current schema -ref // reference to resolve -) { - let sch; - while (typeof (sch = this.refs[ref]) == "string") - ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); -} -// Resolve schema, its root and baseId -function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it -ref // reference to resolve -) { - const p = URI.parse(ref); - const refPath = resolve_1._getFullPath(p); - let baseId = resolve_1.getFullPath(root.baseId); - // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests - if (Object.keys(root.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root); - } - const id = resolve_1.normalizeId(refPath); - const schOrRef = this.refs[id] || this.schemas[id]; - if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root, schOrRef); - if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") - return; - return getJsonPointer.call(this, p, sch); - } - if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") - return; - if (!schOrRef.validate) - compileSchema.call(this, schOrRef); - if (id === resolve_1.normalizeId(ref)) { - const { schema } = schOrRef; - if (schema.$id) - baseId = resolve_1.resolveUrl(baseId, schema.$id); - return new SchemaEnv({ schema, root, baseId }); - } - return getJsonPointer.call(this, p, schOrRef); -} -exports.resolveSchema = resolveSchema; -const PREVENT_SCOPE_CHANGE = new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions", -]); -function getJsonPointer(parsedRef, { baseId, schema, root }) { - var _a; - if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") - return; - for (const part of parsedRef.fragment.slice(1).split("/")) { - if (typeof schema == "boolean") - return; - schema = schema[util_1.unescapeFragment(part)]; - if (schema === undefined) - return; - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? - if (!PREVENT_SCOPE_CHANGE.has(part) && typeof schema == "object" && schema.$id) { - baseId = resolve_1.resolveUrl(baseId, schema.$id); - } - } - let env; - if (typeof schema != "boolean" && schema.$ref && !util_1.schemaHasRulesButRef(schema, this.RULES)) { - const $ref = resolve_1.resolveUrl(baseId, schema.$ref); - env = resolveSchema.call(this, root, $ref); - } - // even though resolution failed we need to return SchemaEnv to throw exception - // so that compileAsync loads missing schema. - env = env || new SchemaEnv({ schema, root, baseId }); - if (env.schema !== env.root.schema) - return env; - return undefined; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/index.js.map b/node_modules/table/node_modules/ajv/dist/compile/index.js.map deleted file mode 100644 index 4408527ec..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/compile/index.ts"],"names":[],"mappings":";;;AAUA,uCAAgF;AAChF,mDAA+C;AAC/C,mCAAuB;AACvB,uCAAkG;AAClG,iCAA6D;AAC7D,yCAA+C;AAC/C,8BAA6B;AAuD7B,MAAa,SAAS;IAgBpB,YAAY,GAAkB;;QATrB,SAAI,GAAe,EAAE,CAAA;QACrB,mBAAc,GAA6B,EAAE,CAAA;QASpD,IAAI,MAAmC,CAAA;QACvC,IAAI,OAAO,GAAG,CAAC,MAAM,IAAI,QAAQ;YAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACtD,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACxB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAA,GAAG,CAAC,MAAM,mCAAI,qBAAW,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAA;QACpD,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAA;QAC9B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;IAChB,CAAC;CACF;AA3BD,8BA2BC;AAED,mBAAmB;AACnB,oBAAoB;AAEpB,+BAA+B;AAC/B,SAAgB,aAAa,CAAY,GAAc;IACrD,sCAAsC;IACtC,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC/C,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,MAAM,MAAM,GAAG,qBAAW,CAAC,GAAG,CAAC,IAAI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CAAC,MAAM;QAAE,OAAO,GAAG,CAAA;IAC9C,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.d.ts b/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.d.ts deleted file mode 100644 index 618c64aea..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Ajv from "../../core"; -import { SchemaObjectMap } from "./types"; -import { SchemaEnv } from ".."; -export default function compileParser(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js b/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js deleted file mode 100644 index f1427d66d..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js +++ /dev/null @@ -1,341 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const types_1 = require("./types"); -const __1 = require(".."); -const codegen_1 = require("../codegen"); -const error_classes_1 = require("../error_classes"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const ref_1 = require("../../vocabularies/jtd/ref"); -const type_1 = require("../../vocabularies/jtd/type"); -const parseJson_1 = require("../../runtime/parseJson"); -const util_1 = require("../util"); -const timestamp_1 = require("../timestamp"); -const genParse = { - elements: parseElements, - values: parseValues, - discriminator: parseDiscriminator, - properties: parseProperties, - optionalProperties: parseProperties, - enum: parseEnum, - type: parseType, - ref: parseRef, -}; -function compileParser(sch, definitions) { - const _sch = __1.getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - const parseName = gen.scopeName("parse"); - const cxt = { - self: this, - gen, - schema: sch.schema, - schemaEnv: sch, - definitions, - data: names_1.default.data, - parseName, - char: gen.name("c"), - }; - let sourceCode; - try { - this._compilations.add(sch); - sch.parseName = parseName; - parserFunction(cxt); - gen.optimize(this.opts.code.optimize); - const parseFuncCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`; - const makeParse = new Function(`${names_1.default.scope}`, sourceCode); - const parse = makeParse(this.scope.get()); - this.scope.value(parseName, { ref: parse }); - sch.parse = parse; - } - catch (e) { - if (sourceCode) - this.logger.error("Error compiling parser, function code:", sourceCode); - delete sch.parse; - delete sch.parseName; - throw e; - } - finally { - this._compilations.delete(sch); - } - return sch; -} -exports.default = compileParser; -const undef = codegen_1._ `undefined`; -function parserFunction(cxt) { - const { gen, parseName, char } = cxt; - gen.func(parseName, codegen_1._ `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => { - gen.let(names_1.default.data); - gen.let(char); - gen.assign(codegen_1._ `${parseName}.message`, undef); - gen.assign(codegen_1._ `${parseName}.position`, undef); - gen.assign(names_1.default.jsonPos, codegen_1._ `${names_1.default.jsonPos} || 0`); - gen.const(names_1.default.jsonLen, codegen_1._ `${names_1.default.json}.length`); - parseCode(cxt); - skipWhitespace(cxt); - gen.if(names_1.default.jsonPart, () => { - gen.assign(codegen_1._ `${parseName}.position`, names_1.default.jsonPos); - gen.return(names_1.default.data); - }); - gen.if(codegen_1._ `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data)); - jsonSyntaxError(cxt); - }); -} -function parseCode(cxt) { - let form; - for (const key of types_1.jtdForms) { - if (key in cxt.schema) { - form = key; - break; - } - } - if (form) - parseNullable(cxt, genParse[form]); - else - parseEmpty(cxt); -} -const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)); -function parseNullable(cxt, parseForm) { - const { gen, schema, data } = cxt; - if (!schema.nullable) - return parseForm(cxt); - tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)); -} -function parseElements(cxt) { - const { gen, schema, data } = cxt; - parseToken(cxt, "["); - const ix = gen.let("i", 0); - gen.assign(data, codegen_1._ `[]`); - parseItems(cxt, "]", () => { - const el = gen.let("el"); - parseCode({ ...cxt, schema: schema.elements, data: el }); - gen.assign(codegen_1._ `${data}[${ix}++]`, el); - }); -} -function parseValues(cxt) { - const { gen, schema, data } = cxt; - parseToken(cxt, "{"); - gen.assign(data, codegen_1._ `{}`); - parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)); -} -function parseItems(cxt, endToken, block) { - tryParseItems(cxt, endToken, block); - parseToken(cxt, endToken); -} -function tryParseItems(cxt, endToken, block) { - const { gen } = cxt; - gen.for(codegen_1._ `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { - block(); - tryParseToken(cxt, ",", () => gen.break(), hasItem); - }); - function hasItem() { - tryParseToken(cxt, endToken, () => { }, jsonSyntaxError); - } -} -function parseKeyValue(cxt, schema) { - const { gen } = cxt; - const key = gen.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - parsePropertyValue(cxt, key, schema); -} -function parseDiscriminator(cxt) { - const { gen, data, schema } = cxt; - const { discriminator, mapping } = schema; - parseToken(cxt, "{"); - gen.assign(data, codegen_1._ `{}`); - const startPos = gen.const("pos", names_1.default.jsonPos); - const value = gen.let("value"); - const tag = gen.let("tag"); - tryParseItems(cxt, "}", () => { - const key = gen.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - gen.if(codegen_1._ `${key} === ${discriminator}`, () => { - parseString({ ...cxt, data: tag }); - gen.assign(codegen_1._ `${data}[${key}]`, tag); - gen.break(); - }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped - ); - }); - gen.assign(names_1.default.jsonPos, startPos); - gen.if(codegen_1._ `${tag} === undefined`); - parsingError(cxt, codegen_1.str `discriminator tag not found`); - for (const tagValue in mapping) { - gen.elseIf(codegen_1._ `${tag} === ${tagValue}`); - parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); - } - gen.else(); - parsingError(cxt, codegen_1.str `discriminator value not in schema`); - gen.endIf(); -} -function parseProperties(cxt) { - const { gen, data } = cxt; - parseToken(cxt, "{"); - gen.assign(data, codegen_1._ `{}`); - parseSchemaProperties(cxt); -} -function parseSchemaProperties(cxt, discriminator) { - const { gen, schema, data } = cxt; - const { properties, optionalProperties, additionalProperties } = schema; - parseItems(cxt, "}", () => { - const key = gen.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - gen.if(false); - parseDefinedProperty(cxt, key, properties); - parseDefinedProperty(cxt, key, optionalProperties); - if (discriminator) { - gen.elseIf(codegen_1._ `${key} === ${discriminator}`); - const tag = gen.let("tag"); - parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned - } - gen.else(); - if (additionalProperties) { - parseEmpty({ ...cxt, data: codegen_1._ `${data}[${key}]` }); - } - else { - parsingError(cxt, codegen_1.str `property ${key} not allowed`); - } - gen.endIf(); - }); - if (properties) { - const hasProp = code_1.hasPropFunc(gen); - const allProps = codegen_1.and(...Object.keys(properties).map((p) => codegen_1._ `${hasProp}.call(${data}, ${p})`)); - gen.if(codegen_1.not(allProps), () => parsingError(cxt, codegen_1.str `missing required properties`)); - } -} -function parseDefinedProperty(cxt, key, schemas = {}) { - const { gen } = cxt; - for (const prop in schemas) { - gen.elseIf(codegen_1._ `${key} === ${prop}`); - parsePropertyValue(cxt, key, schemas[prop]); - } -} -function parsePropertyValue(cxt, key, schema) { - parseCode({ ...cxt, schema, data: codegen_1._ `${cxt.data}[${key}]` }); -} -function parseType(cxt) { - const { gen, schema, data } = cxt; - switch (schema.type) { - case "boolean": - parseBoolean(cxt); - break; - case "string": - parseString(cxt); - break; - case "timestamp": { - // TODO parse timestamp? - parseString(cxt); - const vts = util_1.func(gen, timestamp_1.default); - gen.if(codegen_1._ `!${vts}(${data})`, () => parsingError(cxt, codegen_1.str `invalid timestamp`)); - break; - } - case "float32": - case "float64": - parseNumber(cxt); - break; - default: { - const [min, max, maxDigits] = type_1.intRange[schema.type]; - parseNumber(cxt, maxDigits); - gen.if(codegen_1._ `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, codegen_1.str `integer out of range`)); - } - } -} -function parseString(cxt) { - parseToken(cxt, '"'); - parseWith(cxt, parseJson_1.parseJsonString); -} -function parseEnum(cxt) { - const { gen, data, schema } = cxt; - const enumSch = schema.enum; - parseToken(cxt, '"'); - // TODO loopEnum - gen.if(false); - for (const value of enumSch) { - const valueStr = JSON.stringify(value).slice(1); // remove starting quote - gen.elseIf(codegen_1._ `${jsonSlice(valueStr.length)} === ${valueStr}`); - gen.assign(data, codegen_1.str `${value}`); - gen.add(names_1.default.jsonPos, valueStr.length); - } - gen.else(); - jsonSyntaxError(cxt); - gen.endIf(); -} -function parseNumber(cxt, maxDigits) { - const { gen } = cxt; - skipWhitespace(cxt); - gen.if(codegen_1._ `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); -} -function parseBooleanToken(bool, fail) { - return (cxt) => { - const { gen, data } = cxt; - tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool)); - }; -} -function parseRef(cxt) { - const { gen, self, definitions, schema, schemaEnv } = cxt; - const { ref } = schema; - const refSchema = definitions[ref]; - if (!refSchema) - throw new error_classes_1.MissingRefError("", ref, `No definition ${ref}`); - if (!ref_1.hasRef(refSchema)) - return parseCode({ ...cxt, schema: refSchema }); - const { root } = schemaEnv; - const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); - partialParse(cxt, getParser(gen, sch), true); -} -function getParser(gen, sch) { - return sch.parse - ? gen.scopeValue("parse", { ref: sch.parse }) - : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.parse`; -} -function parseEmpty(cxt) { - parseWith(cxt, parseJson_1.parseJson); -} -function parseWith(cxt, parseFunc, args) { - const f = cxt.gen.scopeValue("func", { - ref: parseFunc, - code: parseFunc.code, - }); - partialParse(cxt, f, args); -} -function partialParse(cxt, parseFunc, args) { - const { gen, data } = cxt; - gen.assign(data, codegen_1._ `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? codegen_1._ `, ${args}` : codegen_1.nil})`); - gen.assign(names_1.default.jsonPos, codegen_1._ `${parseFunc}.position`); - gen.if(codegen_1._ `${data} === undefined`, () => parsingError(cxt, codegen_1._ `${parseFunc}.message`)); -} -function parseToken(cxt, tok) { - tryParseToken(cxt, tok, jsonSyntaxError); -} -function tryParseToken(cxt, tok, fail, success) { - const { gen } = cxt; - const n = tok.length; - skipWhitespace(cxt); - gen.if(codegen_1._ `${jsonSlice(n)} === ${tok}`, () => { - gen.add(names_1.default.jsonPos, n); - success === null || success === void 0 ? void 0 : success(cxt); - }, () => fail(cxt)); -} -function skipWhitespace({ gen, char: c }) { - gen.code(codegen_1._ `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`); -} -function jsonSlice(len) { - return len === 1 - ? codegen_1._ `${names_1.default.json}[${names_1.default.jsonPos}]` - : codegen_1._ `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; -} -function jsonSyntaxError(cxt) { - parsingError(cxt, codegen_1._ `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); -} -function parsingError({ gen, parseName }, msg) { - gen.assign(codegen_1._ `${parseName}.message`, msg); - gen.assign(codegen_1._ `${parseName}.position`, names_1.default.jsonPos); - gen.return(undef); -} -//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js.map b/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js.map deleted file mode 100644 index 726f71a5f..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../lib/compile/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git a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.d.ts b/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.d.ts deleted file mode 100644 index b0413d716..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Ajv from "../../core"; -import { SchemaObjectMap } from "./types"; -import { SchemaEnv } from ".."; -export default function compileSerializer(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js b/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js deleted file mode 100644 index 26148fef4..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js +++ /dev/null @@ -1,223 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const types_1 = require("./types"); -const __1 = require(".."); -const codegen_1 = require("../codegen"); -const error_classes_1 = require("../error_classes"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const ref_1 = require("../../vocabularies/jtd/ref"); -const quote_1 = require("../../runtime/quote"); -const genSerialize = { - elements: serializeElements, - values: serializeValues, - discriminator: serializeDiscriminator, - properties: serializeProperties, - optionalProperties: serializeProperties, - enum: serializeString, - type: serializeType, - ref: serializeRef, -}; -function compileSerializer(sch, definitions) { - const _sch = __1.getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - const serializeName = gen.scopeName("serialize"); - const cxt = { - self: this, - gen, - schema: sch.schema, - schemaEnv: sch, - definitions, - data: names_1.default.data, - }; - let sourceCode; - try { - this._compilations.add(sch); - sch.serializeName = serializeName; - gen.func(serializeName, names_1.default.data, false, () => { - gen.let(names_1.default.json, codegen_1.str ``); - serializeCode(cxt); - gen.return(names_1.default.json); - }); - gen.optimize(this.opts.code.optimize); - const serializeFuncCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`; - const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode); - const serialize = makeSerialize(this.scope.get()); - this.scope.value(serializeName, { ref: serialize }); - sch.serialize = serialize; - } - catch (e) { - if (sourceCode) - this.logger.error("Error compiling serializer, function code:", sourceCode); - delete sch.serialize; - delete sch.serializeName; - throw e; - } - finally { - this._compilations.delete(sch); - } - return sch; -} -exports.default = compileSerializer; -function serializeCode(cxt) { - let form; - for (const key of types_1.jtdForms) { - if (key in cxt.schema) { - form = key; - break; - } - } - serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty); -} -function serializeNullable(cxt, serializeForm) { - const { gen, schema, data } = cxt; - if (!schema.nullable) - return serializeForm(cxt); - gen.if(codegen_1._ `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, codegen_1._ `"null"`), () => serializeForm(cxt)); -} -function serializeElements(cxt) { - const { gen, schema, data } = cxt; - gen.add(names_1.default.json, codegen_1.str `[`); - const first = gen.let("first", true); - gen.forOf("el", data, (el) => { - addComma(cxt, first); - serializeCode({ ...cxt, schema: schema.elements, data: el }); - }); - gen.add(names_1.default.json, codegen_1.str `]`); -} -function serializeValues(cxt) { - const { gen, schema, data } = cxt; - gen.add(names_1.default.json, codegen_1.str `{`); - const first = gen.let("first", true); - gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)); - gen.add(names_1.default.json, codegen_1.str `}`); -} -function serializeKeyValue(cxt, key, schema, first) { - const { gen, data } = cxt; - addComma(cxt, first); - serializeString({ ...cxt, data: key }); - gen.add(names_1.default.json, codegen_1.str `:`); - const value = gen.const("value", codegen_1._ `${data}${codegen_1.getProperty(key)}`); - serializeCode({ ...cxt, schema, data: value }); -} -function serializeDiscriminator(cxt) { - const { gen, schema, data } = cxt; - const { discriminator } = schema; - gen.add(names_1.default.json, codegen_1.str `{${JSON.stringify(discriminator)}:`); - const tag = gen.const("tag", codegen_1._ `${data}${codegen_1.getProperty(discriminator)}`); - serializeString({ ...cxt, data: tag }); - gen.if(false); - for (const tagValue in schema.mapping) { - gen.elseIf(codegen_1._ `${tag} === ${tagValue}`); - const sch = schema.mapping[tagValue]; - serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); - } - gen.endIf(); - gen.add(names_1.default.json, codegen_1.str `}`); -} -function serializeProperties(cxt) { - const { gen } = cxt; - gen.add(names_1.default.json, codegen_1.str `{`); - serializeSchemaProperties(cxt); - gen.add(names_1.default.json, codegen_1.str `}`); -} -function serializeSchemaProperties(cxt, discriminator) { - const { gen, schema, data } = cxt; - const { properties, optionalProperties } = schema; - const props = keys(properties); - const optProps = keys(optionalProperties); - const allProps = allProperties(props.concat(optProps)); - let first = !discriminator; - for (const key of props) { - serializeProperty(key, properties[key], keyValue(key)); - } - for (const key of optProps) { - const value = keyValue(key); - gen.if(codegen_1.and(codegen_1._ `${value} !== undefined`, code_1.isOwnProperty(gen, data, key)), () => serializeProperty(key, optionalProperties[key], value)); - } - if (schema.additionalProperties) { - gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, gen.let("first", first)))); - } - function keys(ps) { - return ps ? Object.keys(ps) : []; - } - function allProperties(ps) { - if (discriminator) - ps.push(discriminator); - if (new Set(ps).size !== ps.length) { - throw new Error("JTD: properties/optionalProperties/disciminator overlap"); - } - return ps; - } - function keyValue(key) { - return gen.const("value", codegen_1._ `${data}${codegen_1.getProperty(key)}`); - } - function serializeProperty(key, propSchema, value) { - if (first) - first = false; - else - gen.add(names_1.default.json, codegen_1.str `,`); - gen.add(names_1.default.json, codegen_1.str `${JSON.stringify(key)}:`); - serializeCode({ ...cxt, schema: propSchema, data: value }); - } - function isAdditional(key, ps) { - return ps.length ? codegen_1.and(...ps.map((p) => codegen_1._ `${key} !== ${p}`)) : true; - } -} -function serializeType(cxt) { - const { gen, schema, data } = cxt; - switch (schema.type) { - case "boolean": - gen.add(names_1.default.json, codegen_1._ `${data} ? "true" : "false"`); - break; - case "string": - serializeString(cxt); - break; - case "timestamp": - gen.if(codegen_1._ `${data} instanceof Date`, () => gen.add(names_1.default.json, codegen_1._ `${data}.toISOString()`), () => serializeString(cxt)); - break; - default: - serializeNumber(cxt); - } -} -function serializeString({ gen, data }) { - gen.add(names_1.default.json, codegen_1._ `${quoteFunc(gen)}(${data})`); -} -function serializeNumber({ gen, data }) { - gen.add(names_1.default.json, codegen_1._ `"" + ${data}`); -} -function serializeRef(cxt) { - const { gen, self, data, definitions, schema, schemaEnv } = cxt; - const { ref } = schema; - const refSchema = definitions[ref]; - if (!refSchema) - throw new error_classes_1.MissingRefError("", ref, `No definition ${ref}`); - if (!ref_1.hasRef(refSchema)) - return serializeCode({ ...cxt, schema: refSchema }); - const { root } = schemaEnv; - const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); - gen.add(names_1.default.json, codegen_1._ `${getSerialize(gen, sch)}(${data})`); -} -function getSerialize(gen, sch) { - return sch.serialize - ? gen.scopeValue("serialize", { ref: sch.serialize }) - : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.serialize`; -} -function serializeEmpty({ gen, data }) { - gen.add(names_1.default.json, codegen_1._ `JSON.stringify(${data})`); -} -function addComma({ gen }, first) { - gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, codegen_1.str `,`)); -} -function quoteFunc(gen) { - return gen.scopeValue("func", { - ref: quote_1.default, - code: codegen_1._ `require("ajv/dist/runtime/quote").default`, - }); -} -//# sourceMappingURL=serialize.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js.map b/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js.map deleted file mode 100644 index 6d968729c..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../lib/compile/jtd/serialize.ts"],"names":[],"mappings":";;AAEA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Ae,EAAE,KAAW;IAChD,GAAG,CAAC,EAAE,CACJ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9B,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,aAAG,CAAA,GAAG,CAAC,CAC9B,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE;QAC5B,GAAG,EAAE,eAAK;QACV,IAAI,EAAE,WAAC,CAAA,2CAA2C;KACnD,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/types.d.ts b/node_modules/table/node_modules/ajv/dist/compile/jtd/types.d.ts deleted file mode 100644 index 38c8bea7f..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SchemaObject } from "../../types"; -export declare type SchemaObjectMap = { - [Ref in string]?: SchemaObject; -}; -export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"]; -export declare type JTDForm = typeof jtdForms[number]; diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js b/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js deleted file mode 100644 index b9c60a90f..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.jtdForms = void 0; -exports.jtdForms = [ - "elements", - "values", - "discriminator", - "properties", - "optionalProperties", - "enum", - "type", - "ref", -]; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js.map b/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js.map deleted file mode 100644 index 53439e002..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/compile/jtd/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/names.d.ts b/node_modules/table/node_modules/ajv/dist/compile/names.d.ts deleted file mode 100644 index 4a3a70506..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/names.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Name } from "./codegen"; -declare const names: { - data: Name; - valCxt: Name; - dataPath: Name; - parentData: Name; - parentDataProperty: Name; - rootData: Name; - dynamicAnchors: Name; - vErrors: Name; - errors: Name; - this: Name; - self: Name; - scope: Name; - json: Name; - jsonPos: Name; - jsonLen: Name; - jsonPart: Name; -}; -export default names; diff --git a/node_modules/table/node_modules/ajv/dist/compile/names.js b/node_modules/table/node_modules/ajv/dist/compile/names.js deleted file mode 100644 index 02e80b8e3..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/names.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("./codegen"); -const names = { - // validation function arguments - data: new codegen_1.Name("data"), - // args passed from referencing schema - valCxt: new codegen_1.Name("valCxt"), - dataPath: new codegen_1.Name("dataPath"), - parentData: new codegen_1.Name("parentData"), - parentDataProperty: new codegen_1.Name("parentDataProperty"), - rootData: new codegen_1.Name("rootData"), - dynamicAnchors: new codegen_1.Name("dynamicAnchors"), - // function scoped variables - vErrors: new codegen_1.Name("vErrors"), - errors: new codegen_1.Name("errors"), - this: new codegen_1.Name("this"), - // "globals" - self: new codegen_1.Name("self"), - scope: new codegen_1.Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new codegen_1.Name("json"), - jsonPos: new codegen_1.Name("jsonPos"), - jsonLen: new codegen_1.Name("jsonLen"), - jsonPart: new codegen_1.Name("jsonPart"), -}; -exports.default = names; -//# sourceMappingURL=names.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/names.js.map b/node_modules/table/node_modules/ajv/dist/compile/names.js.map deleted file mode 100644 index 658e2f5b4..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/names.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"names.js","sourceRoot":"","sources":["../../lib/compile/names.ts"],"names":[],"mappings":";;AAAA,uCAA8B;AAE9B,MAAM,KAAK,GAAG;IACZ,gCAAgC;IAChC,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,sCAAsC;IACtC,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC;IAC1B,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;IAC9B,UAAU,EAAE,IAAI,cAAI,CAAC,YAAY,CAAC;IAClC,kBAAkB,EAAE,IAAI,cAAI,CAAC,oBAAoB,CAAC;IAClD,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;IAC9B,cAAc,EAAE,IAAI,cAAI,CAAC,gBAAgB,CAAC;IAC1C,4BAA4B;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,YAAY;IACZ,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,IAAI,cAAI,CAAC,OAAO,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;CAC/B,CAAA;AAED,kBAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts b/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts deleted file mode 100644 index 7a84126b4..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AnySchema, AnySchemaObject } from "../types"; -import type Ajv from "../ajv"; -import * as URI from "uri-js"; -export declare type LocalRefs = { - [Ref in string]?: AnySchemaObject; -}; -export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean; -export declare function getFullPath(id?: string, normalize?: boolean): string; -export declare function _getFullPath(p: URI.URIComponents): string; -export declare function normalizeId(id: string | undefined): string; -export declare function resolveUrl(baseId: string, id: string): string; -export declare function getSchemaRefs(this: Ajv, schema: AnySchema): LocalRefs; diff --git a/node_modules/table/node_modules/ajv/dist/compile/resolve.js b/node_modules/table/node_modules/ajv/dist/compile/resolve.js deleted file mode 100644 index 37eb9a865..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/resolve.js +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; -const util_1 = require("./util"); -const equal = require("fast-deep-equal"); -const traverse = require("json-schema-traverse"); -const URI = require("uri-js"); -// TODO refactor to use keyword definitions -const SIMPLE_INLINED = new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const", -]); -function inlineRef(schema, limit = true) { - if (typeof schema == "boolean") - return true; - if (limit === true) - return !hasRef(schema); - if (!limit) - return false; - return countKeys(schema) <= limit; -} -exports.inlineRef = inlineRef; -const REF_KEYWORDS = new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor", -]); -function hasRef(schema) { - for (const key in schema) { - if (REF_KEYWORDS.has(key)) - return true; - const sch = schema[key]; - if (Array.isArray(sch) && sch.some(hasRef)) - return true; - if (typeof sch == "object" && hasRef(sch)) - return true; - } - return false; -} -function countKeys(schema) { - let count = 0; - for (const key in schema) { - if (key === "$ref") - return Infinity; - count++; - if (SIMPLE_INLINED.has(key)) - continue; - if (typeof schema[key] == "object") { - util_1.eachItem(schema[key], (sch) => (count += countKeys(sch))); - } - if (count === Infinity) - return Infinity; - } - return count; -} -function getFullPath(id = "", normalize) { - if (normalize !== false) - id = normalizeId(id); - const p = URI.parse(id); - return _getFullPath(p); -} -exports.getFullPath = getFullPath; -function _getFullPath(p) { - return URI.serialize(p).split("#")[0] + "#"; -} -exports._getFullPath = _getFullPath; -const TRAILING_SLASH_HASH = /#\/?$/; -function normalizeId(id) { - return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; -} -exports.normalizeId = normalizeId; -function resolveUrl(baseId, id) { - id = normalizeId(id); - return URI.resolve(baseId, id); -} -exports.resolveUrl = resolveUrl; -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; -function getSchemaRefs(schema) { - if (typeof schema == "boolean") - return {}; - const schemaId = normalizeId(schema.$id); - const baseIds = { "": schemaId }; - const pathPrefix = getFullPath(schemaId, false); - const localRefs = {}; - const schemaRefs = new Set(); - traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === undefined) - return; - const fullPath = pathPrefix + jsonPtr; - let baseId = baseIds[parentJsonPtr]; - if (typeof sch.$id == "string") - baseId = addRef.call(this, sch.$id); - addAnchor.call(this, sch.$anchor); - addAnchor.call(this, sch.$dynamicAnchor); - baseIds[jsonPtr] = baseId; - function addRef(ref) { - ref = normalizeId(baseId ? URI.resolve(baseId, ref) : ref); - if (schemaRefs.has(ref)) - throw ambiguos(ref); - schemaRefs.add(ref); - let schOrRef = this.refs[ref]; - if (typeof schOrRef == "string") - schOrRef = this.refs[schOrRef]; - if (typeof schOrRef == "object") { - checkAmbiguosRef(sch, schOrRef.schema, ref); - } - else if (ref !== normalizeId(fullPath)) { - if (ref[0] === "#") { - checkAmbiguosRef(sch, localRefs[ref], ref); - localRefs[ref] = sch; - } - else { - this.refs[ref] = fullPath; - } - } - return ref; - } - function addAnchor(anchor) { - if (typeof anchor == "string") { - if (!ANCHOR.test(anchor)) - throw new Error(`invalid anchor "${anchor}"`); - addRef.call(this, `#${anchor}`); - } - } - }); - return localRefs; - function checkAmbiguosRef(sch1, sch2, ref) { - if (sch2 !== undefined && !equal(sch1, sch2)) - throw ambiguos(ref); - } - function ambiguos(ref) { - return new Error(`reference "${ref}" resolves to more than one schema`); - } -} -exports.getSchemaRefs = getSchemaRefs; -//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/resolve.js.map b/node_modules/table/node_modules/ajv/dist/compile/resolve.js.map deleted file mode 100644 index 84ca44c03..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/resolve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../lib/compile/resolve.ts"],"names":[],"mappings":";;;AAEA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAChD,8BAA6B;AAK7B,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,eAAe;IACf,eAAe;IACf,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,UAAU;IACV,MAAM;IACN,OAAO;CACR,CAAC,CAAA;AAEF,SAAgB,SAAS,CAAC,MAAiB,EAAE,QAA0B,IAAI;IACzE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,IAAI,CAAA;I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,EAAE;gBAC/B,gBAAgB,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;aAC5C;iBAAM,IAAI,GAAG,KAAK,WAAW,CAAC,QAAQ,CAAC,EAAE;gBACxC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBAClB,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAA;oBAC1C,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;iBACrB;qBAAM;oBACL,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAA;iBAC1B;aACF;YACD,OAAO,GAAG,CAAA;QACZ,CAAC;QAED,SAAS,SAAS,CAAY,MAAe;YAC3C,IAAI,OAAO,MAAM,IAAI,QAAQ,EAAE;gBAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,GAAG,CAAC,CAAA;gBACvE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;aAChC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,SAAS,CAAA;IAEhB,SAAS,gBAAgB,CAAC,IAAe,EAAE,IAA2B,EAAE,GAAW;QACjF,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnE,CAAC;IAED,SAAS,QAAQ,CAAC,GAAW;QAC3B,OAAO,IAAI,KAAK,CAAC,cAAc,GAAG,oCAAoC,CAAC,CAAA;IACzE,CAAC;AACH,CAAC;AArDD,sCAqDC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/rules.d.ts b/node_modules/table/node_modules/ajv/dist/compile/rules.d.ts deleted file mode 100644 index 7def4b5a3..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/rules.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AddedKeywordDefinition } from "../types"; -declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"]; -export declare type JSONType = typeof _jsonTypes[number]; -export declare function isJSONType(x: unknown): x is JSONType; -declare type ValidationTypes = { - [K in JSONType]: boolean | RuleGroup | undefined; -}; -export interface ValidationRules { - rules: RuleGroup[]; - post: RuleGroup; - all: { - [Key in string]?: boolean | Rule; - }; - keywords: { - [Key in string]?: boolean; - }; - types: ValidationTypes; -} -export interface RuleGroup { - type?: JSONType; - rules: Rule[]; -} -export interface Rule { - keyword: string; - definition: AddedKeywordDefinition; -} -export declare function getRules(): ValidationRules; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/compile/rules.js b/node_modules/table/node_modules/ajv/dist/compile/rules.js deleted file mode 100644 index 82a591ff4..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/rules.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getRules = exports.isJSONType = void 0; -const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; -const jsonTypes = new Set(_jsonTypes); -function isJSONType(x) { - return typeof x == "string" && jsonTypes.has(x); -} -exports.isJSONType = isJSONType; -function getRules() { - const groups = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] }, - }; - return { - types: { ...groups, integer: true, boolean: true, null: true }, - rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], - post: { rules: [] }, - all: {}, - keywords: {}, - }; -} -exports.getRules = getRules; -//# sourceMappingURL=rules.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/rules.js.map b/node_modules/table/node_modules/ajv/dist/compile/rules.js.map deleted file mode 100644 index 084c70f82..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/rules.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../lib/compile/rules.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AAIjG,MAAM,SAAS,GAAgB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;AAElD,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAFD,gCAEC;AAyBD,SAAgB,QAAQ;IACtB,MAAM,MAAM,GAAgE;QAC1E,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAC;QACjC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;KACpC,CAAA;IACD,OAAO;QACL,KAAK,EAAE,EAAC,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC;QAC5D,KAAK,EAAE,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QAC/E,IAAI,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;QACjB,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC;AAdD,4BAcC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/subschema.d.ts b/node_modules/table/node_modules/ajv/dist/compile/subschema.d.ts deleted file mode 100644 index b99d524ac..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/subschema.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AnySchema } from "../types"; -import type { SchemaObjCxt, SchemaCxt } from "./index"; -import { Code, Name } from "./codegen"; -import { JSONType } from "./rules"; -export declare enum Type { - Num = 0, - Str = 1 -} -export declare type SubschemaArgs = Partial<{ - keyword: string; - schemaProp: string | number; - schema: AnySchema; - schemaPath: Code; - errSchemaPath: string; - topSchemaRef: Code; - data: Name | Code; - dataProp: Code | string | number; - dataTypes: JSONType[]; - definedProperties: Set; - propertyName: Name; - dataPropType: Type; - jtdDiscriminator: string; - jtdMetadata: boolean; - compositeRule: true; - createErrors: boolean; - allErrors: boolean; -}>; -export declare function applySubschema(it: SchemaObjCxt, appl: SubschemaArgs, valid: Name): SchemaCxt; diff --git a/node_modules/table/node_modules/ajv/dist/compile/subschema.js b/node_modules/table/node_modules/ajv/dist/compile/subschema.js deleted file mode 100644 index 300448438..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/subschema.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.applySubschema = exports.Type = void 0; -const validate_1 = require("./validate"); -const util_1 = require("./util"); -const codegen_1 = require("./codegen"); -var Type; -(function (Type) { - Type[Type["Num"] = 0] = "Num"; - Type[Type["Str"] = 1] = "Str"; -})(Type = exports.Type || (exports.Type = {})); -function applySubschema(it, appl, valid) { - const subschema = getSubschema(it, appl); - extendSubschemaData(subschema, it, appl); - extendSubschemaMode(subschema, appl); - const nextContext = { ...it, ...subschema, items: undefined, props: undefined }; - validate_1.subschemaCode(nextContext, valid); - return nextContext; -} -exports.applySubschema = applySubschema; -function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { - if (keyword !== undefined && schema !== undefined) { - throw new Error('both "keyword" and "schema" passed, only one allowed'); - } - if (keyword !== undefined) { - const sch = it.schema[keyword]; - return schemaProp === undefined - ? { - schema: sch, - schemaPath: codegen_1._ `${it.schemaPath}${codegen_1.getProperty(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - } - : { - schema: sch[schemaProp], - schemaPath: codegen_1._ `${it.schemaPath}${codegen_1.getProperty(keyword)}${codegen_1.getProperty(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${util_1.escapeFragment(schemaProp)}`, - }; - } - if (schema !== undefined) { - if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - } - return { - schema, - schemaPath, - topSchemaRef, - errSchemaPath, - }; - } - throw new Error('either "keyword" or "schema" must be passed'); -} -function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { - if (data !== undefined && dataProp !== undefined) { - throw new Error('both "data" and "dataProp" passed, only one allowed'); - } - const { gen } = it; - if (dataProp !== undefined) { - const { errorPath, dataPathArr, opts } = it; - const nextData = gen.let("data", codegen_1._ `${it.data}${codegen_1.getProperty(dataProp)}`, true); - dataContextProps(nextData); - subschema.errorPath = codegen_1.str `${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}`; - subschema.parentDataProperty = codegen_1._ `${dataProp}`; - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; - } - if (data !== undefined) { - const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? - dataContextProps(nextData); - if (propertyName !== undefined) - subschema.propertyName = propertyName; - // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr - } - if (dataTypes) - subschema.dataTypes = dataTypes; - function dataContextProps(_nextData) { - subschema.data = _nextData; - subschema.dataLevel = it.dataLevel + 1; - subschema.dataTypes = []; - it.definedProperties = new Set(); - subschema.parentData = it.data; - subschema.dataNames = [...it.dataNames, _nextData]; - } -} -function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { - if (compositeRule !== undefined) - subschema.compositeRule = compositeRule; - if (createErrors !== undefined) - subschema.createErrors = createErrors; - if (allErrors !== undefined) - subschema.allErrors = allErrors; - subschema.jtdDiscriminator = jtdDiscriminator; // not inherited - subschema.jtdMetadata = jtdMetadata; // not inherited -} -function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { - // let path - if (dataProp instanceof codegen_1.Name) { - const isNumber = dataPropType === Type.Num; - return jsPropertySyntax - ? isNumber - ? codegen_1._ `"[" + ${dataProp} + "]"` - : codegen_1._ `"['" + ${dataProp} + "']"` - : isNumber - ? codegen_1._ `"/" + ${dataProp}` - : codegen_1._ `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer - } - return jsPropertySyntax ? codegen_1.getProperty(dataProp).toString() : "/" + util_1.escapeJsonPointer(dataProp); -} -//# sourceMappingURL=subschema.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/subschema.js.map b/node_modules/table/node_modules/ajv/dist/compile/subschema.js.map deleted file mode 100644 index 27a258761..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/subschema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subschema.js","sourceRoot":"","sources":["../../lib/compile/subschema.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AACxC,iCAAwD;AACxD,uCAAyD;AAyBzD,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,6BAAG,CAAA;IACH,6BAAG,CAAA;AACL,CAAC,EAHW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAGf;AAsBD,SAAgB,cAAc,CAAC,EAAgB,EAAE,IAAmB,EAAE,KAAW;IAC/E,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IACxC,mBAAmB,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,CAAA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I,QAAQ,YAAY,cAAI,EAAE;QAC5B,MAAM,QAAQ,GAAG,YAAY,KAAK,IAAI,CAAC,GAAG,CAAA;QAC1C,OAAO,gBAAgB;YACrB,CAAC,CAAC,QAAQ;gBACR,CAAC,CAAC,WAAC,CAAA,SAAS,QAAQ,QAAQ;gBAC5B,CAAC,CAAC,WAAC,CAAA,UAAU,QAAQ,SAAS;YAChC,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,WAAC,CAAA,SAAS,QAAQ,EAAE;gBACtB,CAAC,CAAC,WAAC,CAAA,SAAS,QAAQ,4CAA4C,CAAA,CAAC,sCAAsC;KAC1G;IACD,OAAO,gBAAgB,CAAC,CAAC,CAAC,qBAAW,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,wBAAiB,CAAC,QAAQ,CAAC,CAAA;AAChG,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/timestamp.d.ts b/node_modules/table/node_modules/ajv/dist/compile/timestamp.d.ts deleted file mode 100644 index ee14c37d1..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/timestamp.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function validTimestamp(str: string): boolean; -declare namespace validTimestamp { - var code: import("./codegen/code")._Code; -} -export default validTimestamp; diff --git a/node_modules/table/node_modules/ajv/dist/compile/timestamp.js b/node_modules/table/node_modules/ajv/dist/compile/timestamp.js deleted file mode 100644 index f280d4fdd..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/timestamp.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("./codegen"); -const DATE_TIME = /^(\d\d\d\d)-(\d\d)-(\d\d)(?:t|\s)(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i; -const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -function validTimestamp(str) { - // http://tools.ietf.org/html/rfc3339#section-5.6 - const matches = DATE_TIME.exec(str); - if (!matches) - return false; - const y = +matches[1]; - const m = +matches[2]; - const d = +matches[3]; - const hr = +matches[4]; - const min = +matches[5]; - const sec = +matches[6]; - const tzH = +(matches[7] || 0); - const tzM = +(matches[8] || 0); - return (m >= 1 && - m <= 12 && - d >= 1 && - (d <= DAYS[m] || - // leap year: https://tools.ietf.org/html/rfc3339#appendix-C - (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))) && - ((hr <= 23 && min <= 59 && sec <= 59) || - // leap second - (hr - tzH === 23 && min - tzM === 59 && sec === 60))); -} -exports.default = validTimestamp; -validTimestamp.code = codegen_1._ `require("ajv/dist/compile/timestamp").default`; -//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/timestamp.js.map b/node_modules/table/node_modules/ajv/dist/compile/timestamp.js.map deleted file mode 100644 index dd2a1b666..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/timestamp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../lib/compile/timestamp.ts"],"names":[],"mappings":";;AAAA,uCAA2B;AAE3B,MAAM,SAAS,GAAG,gGAAgG,CAAA;AAClH,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEhE,SAAwB,cAAc,CAAC,GAAW;IAChD,iDAAiD;IACjD,MAAM,OAAO,GAAoB,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpD,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAC1B,MAAM,CAAC,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CA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2length.d.ts deleted file mode 100644 index b51c2341c..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/ucs2length.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function ucs2length(str: string): number; diff --git a/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js b/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js deleted file mode 100644 index ba946089f..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// https://mathiasbynens.be/notes/javascript-encoding -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode -function ucs2length(str) { - const len = str.length; - let length = 0; - let pos = 0; - let value; - while (pos < len) { - length++; - value = str.charCodeAt(pos++); - if (value >= 0xd800 && value <= 0xdbff && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos); - if ((value & 0xfc00) === 0xdc00) - pos++; // low surrogate - } - } - return length; -} -exports.default = ucs2length; -//# sourceMappingURL=ucs2length.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js.map b/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js.map deleted file mode 100644 index 5792bfa06..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/compile/ucs2length.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,iEAAiE;AACjE,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAa,CAAA;IACjB,OAAO,GAAG,GAAG,GAAG,EAAE;QAChB,MAAM,EAAE,CAAA;QACR,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;QAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE;YACnD,gDAAgD;YAChD,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;gBAAE,GAAG,EAAE,CAAA,CAAC,gBAAgB;SACxD;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/util.d.ts b/node_modules/table/node_modules/ajv/dist/compile/util.d.ts deleted file mode 100644 index e10a27e74..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/util.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types"; -import type { SchemaCxt, SchemaObjCxt } from "."; -import { Code, Name, CodeGen } from "./codegen"; -import type { Rule, ValidationRules } from "./rules"; -export declare function toHash(arr: T[]): { - [K in T]?: true; -}; -export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void; -export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void; -export declare function schemaHasRules(schema: AnySchema, rules: { - [Key in string]?: boolean | Rule; -}): boolean; -export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean; -export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean; -export declare function unescapeFragment(str: string): string; -export declare function escapeFragment(str: string | number): string; -export declare function escapeJsonPointer(str: string | number): string; -export declare function unescapeJsonPointer(str: string): string; -export declare function eachItem(xs: T | T[], f: (x: T) => void): void; -declare type SomeEvaluated = EvaluatedProperties | EvaluatedItems; -declare type MergeEvaluatedFunc = (gen: CodeGen, from: Name | T, to: Name | Exclude | undefined, toName?: typeof Name) => Name | T; -interface MergeEvaluated { - props: MergeEvaluatedFunc; - items: MergeEvaluatedFunc; -} -export declare const mergeEvaluated: MergeEvaluated; -export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name; -export declare function setEvaluated(gen: CodeGen, props: Name, ps: { - [K in string]?: true; -}): void; -export declare function func(gen: CodeGen, f: { - code: Code; -}): Name; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/compile/util.js b/node_modules/table/node_modules/ajv/dist/compile/util.js deleted file mode 100644 index 40ac8fa20..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/util.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.func = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; -const codegen_1 = require("./codegen"); -const validate_1 = require("./validate"); -// TODO refactor to use Set -function toHash(arr) { - const hash = {}; - for (const item of arr) - hash[item] = true; - return hash; -} -exports.toHash = toHash; -function alwaysValidSchema(it, schema) { - if (typeof schema == "boolean") - return schema; - if (Object.keys(schema).length === 0) - return true; - checkUnknownRules(it, schema); - return !schemaHasRules(schema, it.self.RULES.all); -} -exports.alwaysValidSchema = alwaysValidSchema; -function checkUnknownRules(it, schema = it.schema) { - const { opts, self } = it; - if (!opts.strict) - return; - if (typeof schema === "boolean") - return; - const rules = self.RULES.keywords; - for (const key in schema) { - if (!rules[key]) - validate_1.checkStrictMode(it, `unknown keyword: "${key}"`); - } -} -exports.checkUnknownRules = checkUnknownRules; -function schemaHasRules(schema, rules) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (rules[key]) - return true; - return false; -} -exports.schemaHasRules = schemaHasRules; -function schemaHasRulesButRef(schema, RULES) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (key !== "$ref" && RULES.all[key]) - return true; - return false; -} -exports.schemaHasRulesButRef = schemaHasRulesButRef; -function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { - if (!$data) { - if (typeof schema == "number" || typeof schema == "boolean") - return schema; - if (typeof schema == "string") - return codegen_1._ `${schema}`; - } - return codegen_1._ `${topSchemaRef}${schemaPath}${codegen_1.getProperty(keyword)}`; -} -exports.schemaRefOrVal = schemaRefOrVal; -function unescapeFragment(str) { - return unescapeJsonPointer(decodeURIComponent(str)); -} -exports.unescapeFragment = unescapeFragment; -function escapeFragment(str) { - return encodeURIComponent(escapeJsonPointer(str)); -} -exports.escapeFragment = escapeFragment; -function escapeJsonPointer(str) { - if (typeof str == "number") - return `${str}`; - return str.replace(/~/g, "~0").replace(/\//g, "~1"); -} -exports.escapeJsonPointer = escapeJsonPointer; -function unescapeJsonPointer(str) { - return str.replace(/~1/g, "/").replace(/~0/g, "~"); -} -exports.unescapeJsonPointer = unescapeJsonPointer; -function eachItem(xs, f) { - if (Array.isArray(xs)) { - for (const x of xs) - f(x); - } - else { - f(xs); - } -} -exports.eachItem = eachItem; -function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) { - return (gen, from, to, toName) => { - const res = to === undefined - ? from - : to instanceof codegen_1.Name - ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) - : from instanceof codegen_1.Name - ? (mergeToName(gen, to, from), from) - : mergeValues(from, to); - return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; - }; -} -exports.mergeEvaluated = { - props: makeMergeEvaluated({ - mergeNames: (gen, from, to) => gen.if(codegen_1._ `${to} !== true && ${from} !== undefined`, () => { - gen.if(codegen_1._ `${from} === true`, () => gen.assign(to, true), () => gen.code(codegen_1._ `Object.assign(${to}, ${from})`)); - }), - mergeToName: (gen, from, to) => gen.if(codegen_1._ `${to} !== true`, () => { - if (from === true) { - gen.assign(to, true); - } - else { - gen.assign(to, codegen_1._ `${to} || {}`); - setEvaluated(gen, to, from); - } - }), - mergeValues: (from, to) => (from === true ? true : { ...from, ...to }), - resultToName: evaluatedPropsToName, - }), - items: makeMergeEvaluated({ - mergeNames: (gen, from, to) => gen.if(codegen_1._ `${to} !== true && ${from} !== undefined`, () => gen.assign(to, codegen_1._ `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), - mergeToName: (gen, from, to) => gen.if(codegen_1._ `${to} !== true`, () => gen.assign(to, from === true ? true : codegen_1._ `${to} > ${from} ? ${to} : ${from}`)), - mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), - resultToName: (gen, items) => gen.var("items", items), - }), -}; -function evaluatedPropsToName(gen, ps) { - if (ps === true) - return gen.var("props", true); - const props = gen.var("props", codegen_1._ `{}`); - if (ps !== undefined) - setEvaluated(gen, props, ps); - return props; -} -exports.evaluatedPropsToName = evaluatedPropsToName; -function setEvaluated(gen, props, ps) { - Object.keys(ps).forEach((p) => gen.assign(codegen_1._ `${props}${codegen_1.getProperty(p)}`, true)); -} -exports.setEvaluated = setEvaluated; -function func(gen, f) { - return gen.scopeValue("func", { - ref: f, - code: f.code, - }); -} -exports.func = func; -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/util.js.map b/node_modules/table/node_modules/ajv/dist/compile/util.js.map deleted file mode 100644 index 23f3d782b..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../lib/compile/util.ts"],"names":[],"mappings":";;;AAEA,uCAA6D;AAE7D,yCAA0C;AAE1C,2BAA2B;AAC3B,SAAgB,MAAM,CAA4B,GAAQ;IACxD,MAAM,IAAI,GAAsB,EAAE,CAAA;IAClC,KAAK,MAAM,IAAI,IAAI,GAAG;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACb,CAA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G,CAAC,MAAM,CAAC,WAAC,CAAA,GAAG,KAAK,GAAG,qBAAW,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAA;AAChF,CAAC;AAFD,oCAEC;AAED,SAAgB,IAAI,CAAC,GAAY,EAAE,CAAe;IAChD,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE;QAC5B,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,IAAI;KACb,CAAC,CAAA;AACJ,CAAC;AALD,oBAKC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.d.ts deleted file mode 100644 index 165d375dc..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AnySchemaObject } from "../../types"; -import type { SchemaObjCxt } from ".."; -import type { JSONType, RuleGroup, Rule } from "../rules"; -export declare function schemaHasRulesForType({ schema, self }: SchemaObjCxt, type: JSONType): boolean | undefined; -export declare function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean; -export declare function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js b/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js deleted file mode 100644 index 6187dbbee..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; -function schemaHasRulesForType({ schema, self }, type) { - const group = self.RULES.types[type]; - return group && group !== true && shouldUseGroup(schema, group); -} -exports.schemaHasRulesForType = schemaHasRulesForType; -function shouldUseGroup(schema, group) { - return group.rules.some((rule) => shouldUseRule(schema, rule)); -} -exports.shouldUseGroup = shouldUseGroup; -function shouldUseRule(schema, rule) { - var _a; - return (schema[rule.keyword] !== undefined || - ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); -} -exports.shouldUseRule = shouldUseRule; -//# sourceMappingURL=applicability.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js.map deleted file mode 100644 index 450cfe75a..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"applicability.js","sourceRoot":"","sources":["../../../lib/compile/validate/applicability.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CACnC,EAAC,MAAM,EAAE,IAAI,EAAe,EAC5B,IAAc;IAEd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACjE,CAAC;AAND,sDAMC;AAED,SAAgB,cAAc,CAAC,MAAuB,EAAE,KAAgB;IACtE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAChE,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,MAAuB,EAAE,IAAU;;IAC/D,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;SAClC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAA,CACrE,CAAA;AACH,CAAC;AALD,sCAKC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.d.ts deleted file mode 100644 index 0ce795201..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SchemaCxt } from ".."; -import { Name } from "../codegen"; -export declare function topBoolOrEmptySchema(it: SchemaCxt): void; -export declare function boolOrEmptySchema(it: SchemaCxt, valid: Name): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js b/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js deleted file mode 100644 index 52919a994..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; -const errors_1 = require("../errors"); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const boolError = { - message: "boolean schema is false", -}; -function topBoolOrEmptySchema(it) { - const { gen, schema, validateName } = it; - if (schema === false) { - falseSchemaError(it, false); - } - else if (typeof schema == "object" && schema.$async === true) { - gen.return(names_1.default.data); - } - else { - gen.assign(codegen_1._ `${validateName}.errors`, null); - gen.return(true); - } -} -exports.topBoolOrEmptySchema = topBoolOrEmptySchema; -function boolOrEmptySchema(it, valid) { - const { gen, schema } = it; - if (schema === false) { - gen.var(valid, false); // TODO var - falseSchemaError(it); - } - else { - gen.var(valid, true); // TODO var - } -} -exports.boolOrEmptySchema = boolOrEmptySchema; -function falseSchemaError(it, overrideAllErrors) { - const { gen, data } = it; - // TODO maybe some other interface should be used for non-keyword validation errors... - const cxt = { - gen, - keyword: "false schema", - data, - schema: false, - schemaCode: false, - schemaValue: false, - params: {}, - it, - }; - errors_1.reportError(cxt, boolError, overrideAllErrors); -} -//# sourceMappingURL=boolSchema.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js.map deleted file mode 100644 index 4a6fd9b59..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolSchema.js","sourceRoot":"","sources":["../../../lib/compile/validate/boolSchema.ts"],"names":[],"mappings":";;;AAEA,sCAAqC;AACrC,wCAAkC;AAClC,oCAAwB;AAExB,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,yBAAyB;CACnC,CAAA;AAED,SAAgB,oBAAoB,CAAC,EAAa;IAChD,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAC,GAAG,EAAE,CAAA;IACtC,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,gBAAgB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;KAC5B;SAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE;QAC9D,GAAG,CAAC,MAAM,CAAC,eAAC,CAAC,IAAI,CAAC,CAAA;KACnB;SAAM;QACL,GAAG,CAAC,MAAM,CAAC,WAAC,CAAA,GAAG,YAAY,SAAS,EAAE,IAAI,CAAC,CAAA;QAC3C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;KACjB;AACH,CAAC;AAVD,oDAUC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,KAAW;IAC1D,MAAM,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IACxB,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA,CAAC,WAAW;QACjC,gBAAgB,CAAC,EAAE,CAAC,CAAA;KACrB;SAAM;QACL,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAC,WAAW;KACjC;AACH,CAAC;AARD,8CAQC;AAED,SAAS,gBAAgB,CAAC,EAAa,EAAE,iBAA2B;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IACtB,sFAAsF;IACtF,MAAM,GAAG,GAAoB;QAC3B,GAAG;QACH,OAAO,EAAE,cAAc;QACvB,IAAI;QACJ,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;IACD,oBAAW,CAAC,GAAG,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.d.ts deleted file mode 100644 index 65c1268ec..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ErrorObject, AnySchemaObject } from "../../types"; -import type { SchemaObjCxt } from ".."; -import { JSONType } from "../rules"; -import { Code, Name } from "../codegen"; -export declare enum DataType { - Correct = 0, - Wrong = 1 -} -export declare function getSchemaTypes(schema: AnySchemaObject): JSONType[]; -export declare function getJSONTypes(ts: unknown | unknown[]): JSONType[]; -export declare function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean; -export declare function checkDataType(dataType: JSONType, data: Name, strictNums?: boolean | "log", correct?: DataType): Code; -export declare function checkDataTypes(dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType): Code; -export declare type TypeError = ErrorObject<"type", { - type: string; -}>; -export declare function reportTypeError(it: SchemaObjCxt): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js b/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js deleted file mode 100644 index 89dee09ad..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; -const rules_1 = require("../rules"); -const applicability_1 = require("./applicability"); -const errors_1 = require("../errors"); -const codegen_1 = require("../codegen"); -const util_1 = require("../util"); -var DataType; -(function (DataType) { - DataType[DataType["Correct"] = 0] = "Correct"; - DataType[DataType["Wrong"] = 1] = "Wrong"; -})(DataType = exports.DataType || (exports.DataType = {})); -function getSchemaTypes(schema) { - const types = getJSONTypes(schema.type); - const hasNull = types.includes("null"); - if (hasNull) { - if (schema.nullable === false) - throw new Error("type: null contradicts nullable: false"); - } - else { - if (!types.length && schema.nullable !== undefined) { - throw new Error('"nullable" cannot be used without "type"'); - } - if (schema.nullable === true) - types.push("null"); - } - return types; -} -exports.getSchemaTypes = getSchemaTypes; -function getJSONTypes(ts) { - const types = Array.isArray(ts) ? ts : ts ? [ts] : []; - if (types.every(rules_1.isJSONType)) - return types; - throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); -} -exports.getJSONTypes = getJSONTypes; -function coerceAndCheckDataType(it, types) { - const { gen, data, opts } = it; - const coerceTo = coerceToTypes(types, opts.coerceTypes); - const checkTypes = types.length > 0 && - !(coerceTo.length === 0 && types.length === 1 && applicability_1.schemaHasRulesForType(it, types[0])); - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strict, DataType.Wrong); - gen.if(wrongType, () => { - if (coerceTo.length) - coerceData(it, types, coerceTo); - else - reportTypeError(it); - }); - } - return checkTypes; -} -exports.coerceAndCheckDataType = coerceAndCheckDataType; -const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); -function coerceToTypes(types, coerceTypes) { - return coerceTypes - ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) - : []; -} -function coerceData(it, types, coerceTo) { - const { gen, data, opts } = it; - const dataType = gen.let("dataType", codegen_1._ `typeof ${data}`); - const coerced = gen.let("coerced", codegen_1._ `undefined`); - if (opts.coerceTypes === "array") { - gen.if(codegen_1._ `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen - .assign(data, codegen_1._ `${data}[0]`) - .assign(dataType, codegen_1._ `typeof ${data}`) - .if(checkDataTypes(types, data, opts.strict), () => gen.assign(coerced, data))); - } - gen.if(codegen_1._ `${coerced} !== undefined`); - for (const t of coerceTo) { - if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { - coerceSpecificType(t); - } - } - gen.else(); - reportTypeError(it); - gen.endIf(); - gen.if(codegen_1._ `${coerced} !== undefined`, () => { - gen.assign(data, coerced); - assignParentData(it, coerced); - }); - function coerceSpecificType(t) { - switch (t) { - case "string": - gen - .elseIf(codegen_1._ `${dataType} == "number" || ${dataType} == "boolean"`) - .assign(coerced, codegen_1._ `"" + ${data}`) - .elseIf(codegen_1._ `${data} === null`) - .assign(coerced, codegen_1._ `""`); - return; - case "number": - gen - .elseIf(codegen_1._ `${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})`) - .assign(coerced, codegen_1._ `+${data}`); - return; - case "integer": - gen - .elseIf(codegen_1._ `${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`) - .assign(coerced, codegen_1._ `+${data}`); - return; - case "boolean": - gen - .elseIf(codegen_1._ `${data} === "false" || ${data} === 0 || ${data} === null`) - .assign(coerced, false) - .elseIf(codegen_1._ `${data} === "true" || ${data} === 1`) - .assign(coerced, true); - return; - case "null": - gen.elseIf(codegen_1._ `${data} === "" || ${data} === 0 || ${data} === false`); - gen.assign(coerced, null); - return; - case "array": - gen - .elseIf(codegen_1._ `${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null`) - .assign(coerced, codegen_1._ `[${data}]`); - } - } -} -function assignParentData({ gen, parentData, parentDataProperty }, expr) { - // TODO use gen.property - gen.if(codegen_1._ `${parentData} !== undefined`, () => gen.assign(codegen_1._ `${parentData}[${parentDataProperty}]`, expr)); -} -function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { - const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; - let cond; - switch (dataType) { - case "null": - return codegen_1._ `${data} ${EQ} null`; - case "array": - cond = codegen_1._ `Array.isArray(${data})`; - break; - case "object": - cond = codegen_1._ `${data} && typeof ${data} == "object" && !Array.isArray(${data})`; - break; - case "integer": - cond = numCond(codegen_1._ `!(${data} % 1) && !isNaN(${data})`); - break; - case "number": - cond = numCond(); - break; - default: - return codegen_1._ `typeof ${data} ${EQ} ${dataType}`; - } - return correct === DataType.Correct ? cond : codegen_1.not(cond); - function numCond(_cond = codegen_1.nil) { - return codegen_1.and(codegen_1._ `typeof ${data} == "number"`, _cond, strictNums ? codegen_1._ `isFinite(${data})` : codegen_1.nil); - } -} -exports.checkDataType = checkDataType; -function checkDataTypes(dataTypes, data, strictNums, correct) { - if (dataTypes.length === 1) { - return checkDataType(dataTypes[0], data, strictNums, correct); - } - let cond; - const types = util_1.toHash(dataTypes); - if (types.array && types.object) { - const notObj = codegen_1._ `typeof ${data} != "object"`; - cond = types.null ? notObj : codegen_1._ `!${data} || ${notObj}`; - delete types.null; - delete types.array; - delete types.object; - } - else { - cond = codegen_1.nil; - } - if (types.number) - delete types.integer; - for (const t in types) - cond = codegen_1.and(cond, checkDataType(t, data, strictNums, correct)); - return cond; -} -exports.checkDataTypes = checkDataTypes; -const typeError = { - message: ({ schema }) => codegen_1.str `should be ${schema}`, - params: ({ schema, schemaValue }) => typeof schema == "string" ? codegen_1._ `{type: ${schema}}` : codegen_1._ `{type: ${schemaValue}}`, -}; -function reportTypeError(it) { - const cxt = getTypeErrorContext(it); - errors_1.reportError(cxt, typeError); -} -exports.reportTypeError = reportTypeError; -function getTypeErrorContext(it) { - const { gen, data, schema } = it; - const schemaCode = util_1.schemaRefOrVal(it, schema, "type"); - return { - gen, - keyword: "type", - data, - schema: schema.type, - schemaCode, - schemaValue: schemaCode, - parentSchema: schema, - params: {}, - it, - }; -} -//# sourceMappingURL=dataType.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js.map deleted file mode 100644 index f33013ef4..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dataType.js","sourceRoot":"","sources":["../../../lib/compile/validate/dataType.ts"],"names":[],"mappings":";;;AAOA,oCAA6C;AAC7C,mDAAqD;AACrD,sCAAqC;AACrC,wCAAuE;AACvE,kCAA8C;AAE9C,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,yCAAK,CAAA;AACP,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,SAAgB,cAAc,CAAC,MAAuB;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,OAAO,EAAE;QACX,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;KACzF;SAAM;QACL,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;SAC5D;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACjD;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAZD,wCAYC;AAED,SAAgB,YAAY,CAAC,EAAuB;IAClD,MAAM,KAAK,GAAc,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,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mB,CAAC,EAAgB;IAC3C,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IAC9B,MAAM,UAAU,GAAG,qBAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD,OAAO;QACL,GAAG;QACH,OAAO,EAAE,MAAM;QACf,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,UAAU;QACV,WAAW,EAAE,UAAU;QACvB,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.d.ts deleted file mode 100644 index 02ba453b2..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SchemaObjCxt } from ".."; -export declare function assignDefaults(it: SchemaObjCxt, ty?: string): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js b/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js deleted file mode 100644 index 542e05a49..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assignDefaults = void 0; -const codegen_1 = require("../codegen"); -const _1 = require("."); -function assignDefaults(it, ty) { - const { properties, items } = it.schema; - if (ty === "object" && properties) { - for (const key in properties) { - assignDefault(it, key, properties[key].default); - } - } - else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i) => assignDefault(it, i, sch.default)); - } -} -exports.assignDefaults = assignDefaults; -function assignDefault(it, prop, defaultValue) { - const { gen, compositeRule, data, opts } = it; - if (defaultValue === undefined) - return; - const childData = codegen_1._ `${data}${codegen_1.getProperty(prop)}`; - if (compositeRule) { - _1.checkStrictMode(it, `default is ignored for: ${childData}`); - return; - } - let condition = codegen_1._ `${childData} === undefined`; - if (opts.useDefaults === "empty") { - condition = codegen_1._ `${condition} || ${childData} === null || ${childData} === ""`; - } - // `${childData} === undefined` + - // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") - gen.if(condition, codegen_1._ `${childData} = ${codegen_1.stringify(defaultValue)}`); -} -//# sourceMappingURL=defaults.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js.map deleted file mode 100644 index 8efc19d62..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../lib/compile/validate/defaults.ts"],"names":[],"mappings":";;;AACA,wCAAoD;AACpD,wBAAiC;AAEjC,SAAgB,cAAc,CAAC,EAAgB,EAAE,EAAW;IAC1D,MAAM,EAAC,UAAU,EAAE,KAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAA;IACrC,IAAI,EAAE,KAAK,QAAQ,IAAI,UAAU,EAAE;QACjC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;YAC5B,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;SAChD;KACF;SAAM,IAAI,EAAE,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;KACrE;AACH,CAAC;AATD,wCASC;AAED,SAAS,aAAa,CAAC,EAAgB,EAAE,IAAqB,EAAE,YAAqB;IACnF,MAAM,EAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IAC3C,IAAI,YAAY,KAAK,SAAS;QAAE,OAAM;IACtC,MAAM,SAAS,GAAG,WAAC,CAAA,GAAG,IAAI,GAAG,qBAAW,CAAC,IAAI,CAAC,EAAE,CAAA;IAChD,IAAI,aAAa,EAAE;QACjB,kBAAe,CAAC,EAAE,EAAE,2BAA2B,SAAS,EAAE,CAAC,CAAA;QAC3D,OAAM;KACP;IAED,IAAI,SAAS,GAAG,WAAC,CAAA,GAAG,SAAS,gBAAgB,CAAA;IAC7C,IAAI,IAAI,CAAC,WAAW,KAAK,OAAO,EAAE;QAChC,SAAS,GAAG,WAAC,CAAA,GAAG,SAAS,OAAO,SAAS,gBAAgB,SAAS,SAAS,CAAA;KAC5E;IACD,iCAAiC;IACjC,2FAA2F;IAC3F,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,WAAC,CAAA,GAAG,SAAS,MAAM,mBAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AACjE,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/index.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/index.d.ts deleted file mode 100644 index bd81b15d0..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SchemaCxt } from ".."; -import { Name } from "../codegen"; -export declare function validateFunctionCode(it: SchemaCxt): void; -export declare function subschemaCode(it: SchemaCxt, valid: Name): void; -export declare function schemaCxtHasRules({ schema, self }: SchemaCxt): boolean; -export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/index.js b/node_modules/table/node_modules/ajv/dist/compile/validate/index.js deleted file mode 100644 index eb26357b1..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/index.js +++ /dev/null @@ -1,187 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkStrictMode = exports.schemaCxtHasRules = exports.subschemaCode = exports.validateFunctionCode = void 0; -const boolSchema_1 = require("./boolSchema"); -const dataType_1 = require("./dataType"); -const iterate_1 = require("./iterate"); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const resolve_1 = require("../resolve"); -const util_1 = require("../util"); -// schema compilation - generates validation function, subschemaCode (below) is used for subschemas -function validateFunctionCode(it) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - topSchemaObjCode(it); - return; - } - } - validateFunction(it, () => boolSchema_1.topBoolOrEmptySchema(it)); -} -exports.validateFunctionCode = validateFunctionCode; -function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { - if (opts.code.es5) { - gen.func(validateName, codegen_1._ `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { - gen.code(codegen_1._ `"use strict"; ${funcSourceUrl(schema, opts)}`); - destructureValCxtES5(gen, opts); - gen.code(body); - }); - } - else { - gen.func(validateName, codegen_1._ `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); - } -} -function destructureValCxt(opts) { - return codegen_1._ `{${names_1.default.dataPath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? codegen_1._ `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; -} -function destructureValCxtES5(gen, opts) { - gen.if(names_1.default.valCxt, () => { - gen.var(names_1.default.dataPath, codegen_1._ `${names_1.default.valCxt}.${names_1.default.dataPath}`); - gen.var(names_1.default.parentData, codegen_1._ `${names_1.default.valCxt}.${names_1.default.parentData}`); - gen.var(names_1.default.parentDataProperty, codegen_1._ `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); - gen.var(names_1.default.rootData, codegen_1._ `${names_1.default.valCxt}.${names_1.default.rootData}`); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, codegen_1._ `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); - }, () => { - gen.var(names_1.default.dataPath, codegen_1._ `""`); - gen.var(names_1.default.parentData, codegen_1._ `undefined`); - gen.var(names_1.default.parentDataProperty, codegen_1._ `undefined`); - gen.var(names_1.default.rootData, names_1.default.data); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, codegen_1._ `{}`); - }); -} -function topSchemaObjCode(it) { - const { schema, opts, gen } = it; - validateFunction(it, () => { - if (opts.$comment && schema.$comment) - commentKeyword(it); - checkNoDefault(it); - gen.let(names_1.default.vErrors, null); - gen.let(names_1.default.errors, 0); - if (opts.unevaluated) - resetEvaluated(it); - typeAndKeywords(it); - returnResults(it); - }); - return; -} -function resetEvaluated(it) { - // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated - const { gen, validateName } = it; - it.evaluated = gen.const("evaluated", codegen_1._ `${validateName}.evaluated`); - gen.if(codegen_1._ `${it.evaluated}.dynamicProps`, () => gen.assign(codegen_1._ `${it.evaluated}.props`, codegen_1._ `undefined`)); - gen.if(codegen_1._ `${it.evaluated}.dynamicItems`, () => gen.assign(codegen_1._ `${it.evaluated}.items`, codegen_1._ `undefined`)); -} -function funcSourceUrl(schema, opts) { - return typeof schema == "object" && schema.$id && (opts.code.source || opts.code.process) - ? codegen_1._ `/*# sourceURL=${schema.$id} */` - : codegen_1.nil; -} -// schema compilation - this function is used recursively to generate code for sub-schemas -function subschemaCode(it, valid) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid); - return; - } - } - boolSchema_1.boolOrEmptySchema(it, valid); -} -exports.subschemaCode = subschemaCode; -function schemaCxtHasRules({ schema, self }) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (self.RULES.all[key]) - return true; - return false; -} -exports.schemaCxtHasRules = schemaCxtHasRules; -function isSchemaObj(it) { - return typeof it.schema != "boolean"; -} -function subSchemaObjCode(it, valid) { - const { schema, gen, opts } = it; - if (opts.$comment && schema.$comment) - commentKeyword(it); - updateContext(it); - checkAsync(it); - const errsCount = gen.const("_errs", names_1.default.errors); - typeAndKeywords(it, errsCount); - // TODO var - gen.var(valid, codegen_1._ `${errsCount} === ${names_1.default.errors}`); -} -function checkKeywords(it) { - util_1.checkUnknownRules(it); - checkRefsAndKeywords(it); -} -function typeAndKeywords(it, errsCount) { - if (it.opts.jtd) - return iterate_1.schemaKeywords(it, [], false, errsCount); - const types = dataType_1.getSchemaTypes(it.schema); - const checkedTypes = dataType_1.coerceAndCheckDataType(it, types); - iterate_1.schemaKeywords(it, types, !checkedTypes, errsCount); -} -function checkRefsAndKeywords(it) { - const { schema, errSchemaPath, opts, self } = it; - if (schema.$ref && opts.ignoreKeywordsWithRef && util_1.schemaHasRulesButRef(schema, self.RULES)) { - self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); - } -} -function checkNoDefault(it) { - const { schema, opts } = it; - if (schema.default !== undefined && opts.useDefaults && opts.strict) { - checkStrictMode(it, "default is ignored in the schema root"); - } -} -function updateContext(it) { - if (it.schema.$id) - it.baseId = resolve_1.resolveUrl(it.baseId, it.schema.$id); -} -function checkAsync(it) { - if (it.schema.$async && !it.schemaEnv.$async) - throw new Error("async schema in sync schema"); -} -function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { - const msg = schema.$comment; - if (opts.$comment === true) { - gen.code(codegen_1._ `${names_1.default.self}.logger.log(${msg})`); - } - else if (typeof opts.$comment == "function") { - const schemaPath = codegen_1.str `${errSchemaPath}/$comment`; - const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); - gen.code(codegen_1._ `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); - } -} -function returnResults(it) { - const { gen, schemaEnv, validateName, ValidationError, opts } = it; - if (schemaEnv.$async) { - // TODO assign unevaluated - gen.if(codegen_1._ `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw(codegen_1._ `new ${ValidationError}(${names_1.default.vErrors})`)); - } - else { - gen.assign(codegen_1._ `${validateName}.errors`, names_1.default.vErrors); - if (opts.unevaluated) - assignEvaluated(it); - gen.return(codegen_1._ `${names_1.default.errors} === 0`); - } -} -function assignEvaluated({ gen, evaluated, props, items }) { - if (props instanceof codegen_1.Name) - gen.assign(codegen_1._ `${evaluated}.props`, props); - if (items instanceof codegen_1.Name) - gen.assign(codegen_1._ `${evaluated}.items`, items); -} -function checkStrictMode(it, msg, mode = it.opts.strict) { - if (!mode) - return; - msg = `strict mode: ${msg}`; - if (mode === true) - throw new Error(msg); - it.self.logger.warn(msg); -} -exports.checkStrictMode = checkStrictMode; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/index.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/index.js.map deleted file mode 100644 index c207811ca..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/validate/index.ts"],"names":[],"mappings":";;;AAGA,6CAAoE;AACpE,yCAAiE;AACjE,uCAAwC;AACxC,wCAAkE;AAClE,oCAAwB;AACxB,wCAAqC;AACrC,kCAA+D;AAE/D,mGAAmG;AACnG,SAAgB,oBAAoB,CAAC,EAAa;IAChD,IAAI,WAAW,CAAC,EAAE,CAAC,EAAE;QACnB,aAAa,CAAC,EAAE,CAAC,CAAA;QACjB,IAAI,iBAAiB,CAAC,EAAE,CAAC,EAAE;YACzB,gBAAgB,CAAC,EAAE,CAAC,CAAA;YACpB,OAAM;SACP;KACF;IACD,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,iCAAoB,CAAC,EAAE,CAAC,CAAC,CAAA;AACtD,CAAC;AATD,oDASC;AAED,SAAS,gBAAgB,CACvB,EAAC,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAY,EACvD,IAAW;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AAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AALD,0CAKC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.d.ts deleted file mode 100644 index 3e1db8fc1..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SchemaObjCxt } from ".."; -import type { JSONType } from "../rules"; -import { Name } from "../codegen"; -export declare function schemaKeywords(it: SchemaObjCxt, types: JSONType[], typeErrors: boolean, errsCount?: Name): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js b/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js deleted file mode 100644 index cabe37a97..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.schemaKeywords = void 0; -const applicability_1 = require("./applicability"); -const dataType_1 = require("./dataType"); -const defaults_1 = require("./defaults"); -const keyword_1 = require("./keyword"); -const util_1 = require("../util"); -const _1 = require("."); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -function schemaKeywords(it, types, typeErrors, errsCount) { - const { gen, schema, data, allErrors, opts, self } = it; - const { RULES } = self; - if (schema.$ref && (opts.ignoreKeywordsWithRef || !util_1.schemaHasRulesButRef(schema, RULES))) { - gen.block(() => keyword_1.keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast - return; - } - if (!opts.jtd) - checkStrictTypes(it, types); - gen.block(() => { - for (const group of RULES.rules) - groupKeywords(group); - groupKeywords(RULES.post); - }); - function groupKeywords(group) { - if (!applicability_1.shouldUseGroup(schema, group)) - return; - if (group.type) { - gen.if(dataType_1.checkDataType(group.type, data, opts.strict)); - iterateKeywords(it, group); - if (types.length === 1 && types[0] === group.type && typeErrors) { - gen.else(); - dataType_1.reportTypeError(it); - } - gen.endIf(); - } - else { - iterateKeywords(it, group); - } - // TODO make it "ok" call? - if (!allErrors) - gen.if(codegen_1._ `${names_1.default.errors} === ${errsCount || 0}`); - } -} -exports.schemaKeywords = schemaKeywords; -function iterateKeywords(it, group) { - const { gen, schema, opts: { useDefaults }, } = it; - if (useDefaults) - defaults_1.assignDefaults(it, group.type); - gen.block(() => { - for (const rule of group.rules) { - if (applicability_1.shouldUseRule(schema, rule)) { - keyword_1.keywordCode(it, rule.keyword, rule.definition, group.type); - } - } - }); -} -function checkStrictTypes(it, types) { - if (it.schemaEnv.meta || !it.opts.strictTypes) - return; - checkContextTypes(it, types); - if (!it.opts.allowUnionTypes) - checkMultipleTypes(it, types); - checkKeywordTypes(it, it.dataTypes); -} -function checkContextTypes(it, types) { - if (!types.length) - return; - if (!it.dataTypes.length) { - it.dataTypes = types; - return; - } - types.forEach((t) => { - if (!includesType(it.dataTypes, t)) { - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); - } - }); - it.dataTypes = it.dataTypes.filter((t) => includesType(types, t)); -} -function checkMultipleTypes(it, ts) { - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { - strictTypesError(it, "use allowUnionTypes to allow union type keyword"); - } -} -function checkKeywordTypes(it, ts) { - const rules = it.self.RULES.all; - for (const keyword in rules) { - const rule = rules[keyword]; - if (typeof rule == "object" && applicability_1.shouldUseRule(it.schema, rule)) { - const { type } = rule.definition; - if (type.length && !type.some((t) => hasApplicableType(ts, t))) { - strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); - } - } - } -} -function hasApplicableType(schTs, kwdT) { - return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")); -} -function includesType(ts, t) { - return ts.includes(t) || (t === "integer" && ts.includes("number")); -} -function strictTypesError(it, msg) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - msg += ` at "${schemaPath}" (strictTypes)`; - _1.checkStrictMode(it, msg, it.opts.strictTypes); -} -//# sourceMappingURL=iterate.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js.map deleted file mode 100644 index 061dd3287..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterate.js","sourceRoot":"","sources":["../../../lib/compile/validate/iterate.ts"],"names":[],"mappings":";;;AAEA,mDAA6D;AAC7D,yCAAyD;AACzD,yCAAyC;AACzC,uCAAqC;AACrC,kCAA4C;AAC5C,wBAAiC;AACjC,wCAAkC;AAClC,oCAAwB;AAExB,SAAgB,cAAc,CAC5B,EAAgB,EAChB,KAAiB,EACjB,UAAmB,EACnB,SAAgB;IAEhB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IACrD,MAAM,EAAC,KAAK,EAAC,GAAG,IAAI,CAAA;IACpB,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,2BAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE;QACvF,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,EAAE,EAAE,MAAM,EAAG,KAAK,CAAC,GAAG,CAAC,IAAa,CAAC,UAAU,CAAC,CAAC,CAAA,CAAC,gBAAgB;QAC9F,OAAM;KACP;IACD,IAAI,CAAC,IAAI,CAAC,GAAG;QAAE,gBAAgB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;IAC1C,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;QACb,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK;YAAE,aAAa,CAAC,KAAK,CAAC,CAAA;QACrD,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,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AAM,UAAU,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC,aAAa,CAAA;IACzD,GAAG,IAAI,QAAQ,UAAU,iBAAiB,CAAA;IAC1C,kBAAe,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;AAC/C,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.d.ts deleted file mode 100644 index a04e94690..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AddedKeywordDefinition } from "../../types"; -import type { SchemaObjCxt } from ".."; -import type { JSONType } from "../rules"; -export declare function keywordCode(it: SchemaObjCxt, keyword: string, def: AddedKeywordDefinition, ruleType?: JSONType): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js b/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js deleted file mode 100644 index 2d67b195a..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.keywordCode = void 0; -const context_1 = require("../context"); -const errors_1 = require("../errors"); -const code_1 = require("../../vocabularies/code"); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -function keywordCode(it, keyword, def, ruleType) { - const cxt = new context_1.default(it, def, keyword); - if ("code" in def) { - def.code(cxt, ruleType); - } - else if (cxt.$data && def.validate) { - funcKeywordCode(cxt, def); - } - else if ("macro" in def) { - macroKeywordCode(cxt, def); - } - else if (def.compile || def.validate) { - funcKeywordCode(cxt, def); - } -} -exports.keywordCode = keywordCode; -function macroKeywordCode(cxt, def) { - const { gen, keyword, schema, parentSchema, it } = cxt; - const macroSchema = def.macro.call(it.self, schema, parentSchema, it); - const schemaRef = useKeyword(gen, keyword, macroSchema); - if (it.opts.validateSchema !== false) - it.self.validateSchema(macroSchema, true); - const valid = gen.name("valid"); - cxt.subschema({ - schema: macroSchema, - schemaPath: codegen_1.nil, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - topSchemaRef: schemaRef, - compositeRule: true, - }, valid); - cxt.pass(valid, () => cxt.error(true)); -} -function funcKeywordCode(cxt, def) { - var _a; - const { gen, keyword, schema, parentSchema, $data, it } = cxt; - checkAsync(it, def); - const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; - const validateRef = useKeyword(gen, keyword, validate); - const valid = gen.let("valid"); - cxt.block$data(valid, validateKeyword); - cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); - function validateKeyword() { - if (def.errors === false) { - assignValid(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => cxt.error()); - } - else { - const ruleErrs = def.async ? validateAsync() : validateSync(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => addErrs(cxt, ruleErrs)); - } - } - function validateAsync() { - const ruleErrs = gen.let("ruleErrs", null); - gen.try(() => assignValid(codegen_1._ `await `), (e) => gen.assign(valid, false).if(codegen_1._ `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, codegen_1._ `${e}.errors`), () => gen.throw(e))); - return ruleErrs; - } - function validateSync() { - const validateErrs = codegen_1._ `${validateRef}.errors`; - gen.assign(validateErrs, null); - assignValid(codegen_1.nil); - return validateErrs; - } - function assignValid(_await = def.async ? codegen_1._ `await ` : codegen_1.nil) { - const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; - const passSchema = !(("compile" in def && !$data) || def.schema === false); - gen.assign(valid, codegen_1._ `${_await}${code_1.callValidateCode(cxt, validateRef, passCxt, passSchema)}`, def.modifying); - } - function reportErrs(errors) { - var _a; - gen.if(codegen_1.not((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); - } -} -function modifyData(cxt) { - const { gen, data, it } = cxt; - gen.if(it.parentData, () => gen.assign(data, codegen_1._ `${it.parentData}[${it.parentDataProperty}]`)); -} -function addErrs(cxt, errs) { - const { gen } = cxt; - gen.if(codegen_1._ `Array.isArray(${errs})`, () => { - gen - .assign(names_1.default.vErrors, codegen_1._ `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`) - .assign(names_1.default.errors, codegen_1._ `${names_1.default.vErrors}.length`); - errors_1.extendErrors(cxt); - }, () => cxt.error()); -} -function checkAsync({ schemaEnv }, def) { - if (def.async && !schemaEnv.$async) - throw new Error("async keyword in sync schema"); -} -function useKeyword(gen, keyword, result) { - if (result === undefined) - throw new Error(`keyword "${keyword}" failed to compile`); - return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: codegen_1.stringify(result) }); -} -//# sourceMappingURL=keyword.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js.map deleted file mode 100644 index 0fb2baeca..000000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../lib/compile/validate/keyword.ts"],"names":[],"mappings":";;;AAUA,wCAAmC;AACnC,sCAAsC;AACtC,kDAAwD;AACxD,wCAAsE;AACtE,oCAAwB;AAIxB,SAAgB,WAAW,CACzB,EAAgB,EAChB,OAAe,EACf,GAA2B,EAC3B,QAAmB;IAEnB,MAAM,GAAG,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;IAC5C,IAAI,MAAM,IAAI,GAAG,EAAE;QACjB,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;KACxB;SAAM,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,QAAQ,EAAE;QACpC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC1B;SAAM,IAAI,OAAO,I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AI,KAAK,CAAC,YAAY,OAAO,qBAAqB,CAAC,CAAA;IACnF,OAAO,GAAG,CAAC,UAAU,CACnB,SAAS,EACT,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAS,CAAC,MAAM,CAAC,EAAC,CACrF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/core.d.ts b/node_modules/table/node_modules/ajv/dist/core.d.ts deleted file mode 100644 index ad03f031a..000000000 --- a/node_modules/table/node_modules/ajv/dist/core.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export interface Plugin { - (ajv: Ajv, options?: Opts): Ajv; - [prop: string]: any; -} -import KeywordCxt from "./compile/context"; -export { KeywordCxt }; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { JTDSchemaType } from "./types/jtd-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -import type { Schema, AnySchema, AnySchemaObject, SchemaObject, AsyncSchema, Vocabulary, KeywordDefinition, AddedKeywordDefinition, AnyValidateFunction, ValidateFunction, AsyncValidateFunction, ErrorObject, Format, AddedFormat } from "./types"; -import type { JSONSchemaType } from "./types/json-schema"; -import type { JTDSchemaType } from "./types/jtd-schema"; -import { ValidationError, MissingRefError } from "./compile/error_classes"; -import { ValidationRules } from "./compile/rules"; -import { SchemaEnv } from "./compile"; -import { Code, ValueScope } from "./compile/codegen"; -export declare type Options = CurrentOptions & DeprecatedOptions; -export interface CurrentOptions { - strict?: boolean | "log"; - strictTypes?: boolean | "log"; - strictTuples?: boolean | "log"; - strictRequired?: boolean | "log"; - allowMatchingProperties?: boolean; - allowUnionTypes?: boolean; - validateFormats?: boolean; - $data?: boolean; - allErrors?: boolean; - verbose?: boolean; - $comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown); - formats?: { - [Name in string]?: Format; - }; - keywords?: Vocabulary; - schemas?: AnySchema[] | { - [Key in string]?: AnySchema; - }; - logger?: Logger | false; - loadSchema?: (uri: string) => Promise; - removeAdditional?: boolean | "all" | "failing"; - useDefaults?: boolean | "empty"; - coerceTypes?: boolean | "array"; - next?: boolean; - unevaluated?: boolean; - dynamicRef?: boolean; - jtd?: boolean; - meta?: SchemaObject | boolean; - defaultMeta?: string | AnySchemaObject; - validateSchema?: boolean | "log"; - addUsedSchema?: boolean; - inlineRefs?: boolean | number; - passContext?: boolean; - loopRequired?: number; - loopEnum?: number; - ownProperties?: boolean; - multipleOfPrecision?: number; - messages?: boolean; - code?: CodeOptions; - ajvErrors?: boolean; -} -export interface CodeOptions { - es5?: boolean; - lines?: boolean; - optimize?: boolean | number; - formats?: Code; - source?: boolean; - process?: (code: string, schema?: SchemaEnv) => string; -} -interface InstanceCodeOptions extends CodeOptions { - optimize: number; -} -interface DeprecatedOptions { - /** @deprecated */ - ignoreKeywordsWithRef?: boolean; - /** @deprecated */ - jsPropertySyntax?: boolean; - /** @deprecated */ - unicode?: boolean; -} -declare type RequiredInstanceOptions = { - [K in "strict" | "strictTypes" | "strictTuples" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "addUsedSchema" | "validateSchema" | "validateFormats"]: NonNullable; -} & { - code: InstanceCodeOptions; -}; -export declare type InstanceOptions = Options & RequiredInstanceOptions; -export interface Logger { - log(...args: unknown[]): unknown; - warn(...args: unknown[]): unknown; - error(...args: unknown[]): unknown; -} -export default class Ajv { - opts: InstanceOptions; - errors?: ErrorObject[] | null; - logger: Logger; - readonly scope: ValueScope; - readonly schemas: { - [Key in string]?: SchemaEnv; - }; - readonly refs: { - [Ref in string]?: SchemaEnv | string; - }; - readonly formats: { - [Name in string]?: AddedFormat; - }; - readonly RULES: ValidationRules; - readonly _compilations: Set; - private readonly _loading; - private readonly _cache; - private readonly _metaOpts; - static ValidationError: typeof ValidationError; - static MissingRefError: typeof MissingRefError; - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; - validate(schema: Schema | string, data: unknown): boolean; - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; - validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T; - validate(schema: JTDSchemaType, data: unknown): data is T; - validate(schema: AsyncSchema, data: unknown | T): Promise; - validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise; - compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction; - compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction; - compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction; - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction; - compileAsync(schema: SchemaObject | JSONSchemaType, _meta?: boolean): Promise>; - compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise>; - compileAsync(schema: AsyncSchema, meta?: boolean): Promise>; - compileAsync(schema: AnySchemaObject, meta?: boolean): Promise>; - addSchema(schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored - key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema?: boolean | "log"): Ajv; - addMetaSchema(schema: AnySchemaObject, key?: string, // schema key - _validateSchema?: boolean | "log"): Ajv; - validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise; - getSchema(keyRef: string): AnyValidateFunction | undefined; - removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv; - addVocabulary(definitions: Vocabulary): Ajv; - addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv; - getKeyword(keyword: string): AddedKeywordDefinition | boolean; - removeKeyword(keyword: string): Ajv; - addFormat(name: string, format: Format): Ajv; - errorsText(errors?: ErrorObject[] | null | undefined, // optional array of validation errors - { separator, dataVar }?: ErrorsTextOptions): string; - $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject; - private _removeAllSchemas; - _addSchema(schema: AnySchema, meta?: boolean, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv; - private _checkUnique; - private _compileSchemaEnv; - private _compileMetaSchema; -} -export interface ErrorsTextOptions { - separator?: string; - dataVar?: string; -} diff --git a/node_modules/table/node_modules/ajv/dist/core.js b/node_modules/table/node_modules/ajv/dist/core.js deleted file mode 100644 index d11577134..000000000 --- a/node_modules/table/node_modules/ajv/dist/core.js +++ /dev/null @@ -1,591 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const context_1 = require("./compile/context"); -exports.KeywordCxt = context_1.default; -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -const error_classes_1 = require("./compile/error_classes"); -const rules_1 = require("./compile/rules"); -const compile_1 = require("./compile"); -const codegen_2 = require("./compile/codegen"); -const resolve_1 = require("./compile/resolve"); -const dataType_1 = require("./compile/validate/dataType"); -const util_1 = require("./compile/util"); -const $dataRefSchema = require("./refs/data.json"); -const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; -const EXT_SCOPE_NAMES = new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error", -]); -const removedOptions = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - schemaId: "JSON Schema draft-04 is not supported in Ajv v7.", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - strictNumbers: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", -}; -const deprecatedOptions = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.', -}; -function requiredOptions(o) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; - const strict = (_a = o.strict) !== null && _a !== void 0 ? _a : true; - const strictLog = strict ? "log" : false; - const _optz = (_b = o.code) === null || _b === void 0 ? void 0 : _b.optimize; - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; - return { - strict, - strictTypes: (_c = o.strictTypes) !== null && _c !== void 0 ? _c : strictLog, - strictTuples: (_d = o.strictTuples) !== null && _d !== void 0 ? _d : strictLog, - code: o.code ? { ...o.code, optimize } : { optimize }, - loopRequired: (_e = o.loopRequired) !== null && _e !== void 0 ? _e : Infinity, - loopEnum: (_f = o.loopEnum) !== null && _f !== void 0 ? _f : Infinity, - meta: (_g = o.meta) !== null && _g !== void 0 ? _g : true, - messages: (_h = o.messages) !== null && _h !== void 0 ? _h : true, - inlineRefs: (_j = o.inlineRefs) !== null && _j !== void 0 ? _j : true, - addUsedSchema: (_k = o.addUsedSchema) !== null && _k !== void 0 ? _k : true, - validateSchema: (_l = o.validateSchema) !== null && _l !== void 0 ? _l : true, - validateFormats: (_m = o.validateFormats) !== null && _m !== void 0 ? _m : true, - }; -} -class Ajv { - constructor(opts = {}) { - this.schemas = {}; - this.refs = {}; - this.formats = {}; - this._compilations = new Set(); - this._loading = {}; - this._cache = new Map(); - opts = this.opts = { ...opts, ...requiredOptions(opts) }; - const { es5, lines } = this.opts.code; - this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); - this.logger = getLogger(opts.logger); - const formatOpt = opts.validateFormats; - opts.validateFormats = false; - this.RULES = rules_1.getRules(); - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); - this._metaOpts = getMetaSchemaOptions.call(this); - if (opts.formats) - addInitialFormats.call(this); - this._addVocabularies(); - this._addDefaultMetaSchema(); - if (opts.keywords) - addInitialKeywords.call(this, opts.keywords); - if (typeof opts.meta == "object") - this.addMetaSchema(opts.meta); - addInitialSchemas.call(this); - opts.validateFormats = formatOpt; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data, meta } = this.opts; - if (meta && $data) - this.addMetaSchema($dataRefSchema, $dataRefSchema.$id, false); - } - defaultMeta() { - const { meta } = this.opts; - return (this.opts.defaultMeta = typeof meta == "object" ? meta.$id || meta : undefined); - } - validate(schemaKeyRef, // key, ref or schema object - data // to be validated - ) { - let v; - if (typeof schemaKeyRef == "string") { - v = this.getSchema(schemaKeyRef); - if (!v) - throw new Error(`no schema with key or ref "${schemaKeyRef}"`); - } - else { - v = this.compile(schemaKeyRef); - } - const valid = v(data); - if (!("$async" in v)) - this.errors = v.errors; - return valid; - } - compile(schema, _meta) { - const sch = this._addSchema(schema, _meta); - return (sch.validate || this._compileSchemaEnv(sch)); - } - compileAsync(schema, meta) { - if (typeof this.opts.loadSchema != "function") { - throw new Error("options.loadSchema should be a function"); - } - const { loadSchema } = this.opts; - return runCompileAsync.call(this, schema, meta); - async function runCompileAsync(_schema, _meta) { - await loadMetaSchema.call(this, _schema.$schema); - const sch = this._addSchema(_schema, _meta); - return sch.validate || _compileAsync.call(this, sch); - } - async function loadMetaSchema($ref) { - if ($ref && !this.getSchema($ref)) { - await runCompileAsync.call(this, { $ref }, true); - } - } - async function _compileAsync(sch) { - try { - return this._compileSchemaEnv(sch); - } - catch (e) { - if (!(e instanceof error_classes_1.MissingRefError)) - throw e; - checkLoaded.call(this, e); - await loadMissingSchema.call(this, e.missingSchema); - return _compileAsync.call(this, sch); - } - } - function checkLoaded({ missingSchema: ref, missingRef }) { - if (this.refs[ref]) { - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); - } - } - async function loadMissingSchema(ref) { - const _schema = await _loadSchema.call(this, ref); - if (!this.refs[ref]) - await loadMetaSchema.call(this, _schema.$schema); - if (!this.refs[ref]) - this.addSchema(_schema, ref, meta); - } - async function _loadSchema(ref) { - const p = this._loading[ref]; - if (p) - return p; - try { - return await (this._loading[ref] = loadSchema(ref)); - } - finally { - delete this._loading[ref]; - } - } - } - // Adds schema to the instance - addSchema(schema, // If array is passed, `key` will be ignored - key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. - ) { - if (Array.isArray(schema)) { - for (const sch of schema) - this.addSchema(sch, undefined, _meta, _validateSchema); - return this; - } - let id; - if (typeof schema === "object") { - id = schema.$id; - if (id !== undefined && typeof id != "string") - throw new Error("schema id must be string"); - } - key = resolve_1.normalizeId(key || id); - this._checkUnique(key); - this.schemas[key] = this._addSchema(schema, _meta, _validateSchema, true); - return this; - } - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema(schema, key, // schema key - _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema - ) { - this.addSchema(schema, key, true, _validateSchema); - return this; - } - // Validate schema against its meta-schema - validateSchema(schema, throwOrLogError) { - if (typeof schema == "boolean") - return true; - let $schema; - $schema = schema.$schema; - if ($schema !== undefined && typeof $schema != "string") { - throw new Error("$schema must be a string"); - } - $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); - if (!$schema) { - this.logger.warn("meta-schema not available"); - this.errors = null; - return true; - } - const valid = this.validate($schema, schema); - if (!valid && throwOrLogError) { - const message = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error(message); - else - throw new Error(message); - } - return valid; - } - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(keyRef) { - let sch; - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") - keyRef = sch; - if (sch === undefined) { - const root = new compile_1.SchemaEnv({ schema: {} }); - sch = compile_1.resolveSchema.call(this, root, keyRef); - if (!sch) - return; - this.refs[keyRef] = sch; - } - return (sch.validate || this._compileSchemaEnv(sch)); - } - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(schemaKeyRef) { - if (schemaKeyRef instanceof RegExp) { - this._removeAllSchemas(this.schemas, schemaKeyRef); - this._removeAllSchemas(this.refs, schemaKeyRef); - return this; - } - switch (typeof schemaKeyRef) { - case "undefined": - this._removeAllSchemas(this.schemas); - this._removeAllSchemas(this.refs); - this._cache.clear(); - return this; - case "string": { - const sch = getSchEnv.call(this, schemaKeyRef); - if (typeof sch == "object") - this._cache.delete(sch.schema); - delete this.schemas[schemaKeyRef]; - delete this.refs[schemaKeyRef]; - return this; - } - case "object": { - const cacheKey = schemaKeyRef; - this._cache.delete(cacheKey); - let id = schemaKeyRef.$id; - if (id) { - id = resolve_1.normalizeId(id); - delete this.schemas[id]; - delete this.refs[id]; - } - return this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - // add "vocabulary" - a collection of keywords - addVocabulary(definitions) { - for (const def of definitions) - this.addKeyword(def); - return this; - } - addKeyword(kwdOrDef, def // deprecated - ) { - let keyword; - if (typeof kwdOrDef == "string") { - keyword = kwdOrDef; - if (typeof def == "object") { - this.logger.warn("these parameters are deprecated, see docs for addKeyword"); - def.keyword = keyword; - } - } - else if (typeof kwdOrDef == "object" && def === undefined) { - def = kwdOrDef; - keyword = def.keyword; - if (Array.isArray(keyword) && !keyword.length) { - throw new Error("addKeywords: keyword must be string or non-empty array"); - } - } - else { - throw new Error("invalid addKeywords parameters"); - } - checkKeyword.call(this, keyword, def); - if (!def) { - util_1.eachItem(keyword, (kwd) => addRule.call(this, kwd)); - return this; - } - keywordMetaschema.call(this, def); - const definition = { - ...def, - type: dataType_1.getJSONTypes(def.type), - schemaType: dataType_1.getJSONTypes(def.schemaType), - }; - util_1.eachItem(keyword, definition.type.length === 0 - ? (k) => addRule.call(this, k, definition) - : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); - return this; - } - getKeyword(keyword) { - const rule = this.RULES.all[keyword]; - return typeof rule == "object" ? rule.definition : !!rule; - } - // Remove keyword - removeKeyword(keyword) { - // TODO return type should be Ajv - const { RULES } = this; - delete RULES.keywords[keyword]; - delete RULES.all[keyword]; - for (const group of RULES.rules) { - const i = group.rules.findIndex((rule) => rule.keyword === keyword); - if (i >= 0) - group.rules.splice(i, 1); - } - return this; - } - // Add format - addFormat(name, format) { - if (typeof format == "string") - format = new RegExp(format); - this.formats[name] = format; - return this; - } - errorsText(errors = this.errors, // optional array of validation errors - { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` - ) { - if (!errors || errors.length === 0) - return "No errors"; - return errors - .map((e) => `${dataVar}${e.dataPath} ${e.message}`) - .reduce((text, msg) => text + separator + msg); - } - $dataMetaSchema(metaSchema, keywordsJsonPointers) { - const rules = this.RULES.all; - metaSchema = JSON.parse(JSON.stringify(metaSchema)); - for (const jsonPointer of keywordsJsonPointers) { - const segments = jsonPointer.split("/").slice(1); // first segment is an empty string - let keywords = metaSchema; - for (const seg of segments) - keywords = keywords[seg]; - for (const key in rules) { - const rule = rules[key]; - if (typeof rule != "object") - continue; - const { $data } = rule.definition; - const schema = keywords[key]; - if ($data && schema) - keywords[key] = schemaOrData(schema); - } - } - return metaSchema; - } - _removeAllSchemas(schemas, regex) { - for (const keyRef in schemas) { - const sch = schemas[keyRef]; - if (!regex || regex.test(keyRef)) { - if (typeof sch == "string") { - delete schemas[keyRef]; - } - else if (sch && !sch.meta) { - this._cache.delete(sch.schema); - delete schemas[keyRef]; - } - } - } - } - _addSchema(schema, meta, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { - if (typeof schema != "object") { - if (this.opts.jtd) - throw new Error("schema must be object"); - else if (typeof schema != "boolean") - throw new Error("schema must be object or boolean"); - } - let sch = this._cache.get(schema); - if (sch !== undefined) - return sch; - const localRefs = resolve_1.getSchemaRefs.call(this, schema); - sch = new compile_1.SchemaEnv({ schema, meta, localRefs }); - this._cache.set(sch.schema, sch); - const id = sch.baseId; - if (addSchema && !id.startsWith("#")) { - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) - if (id) - this._checkUnique(id); - this.refs[id] = sch; - } - if (validateSchema) - this.validateSchema(schema, true); - return sch; - } - _checkUnique(id) { - if (this.schemas[id] || this.refs[id]) { - throw new Error(`schema with key or id "${id}" already exists`); - } - } - _compileSchemaEnv(sch) { - if (sch.meta) - this._compileMetaSchema(sch); - else - compile_1.compileSchema.call(this, sch); - /* istanbul ignore if */ - if (!sch.validate) - throw new Error("ajv implementation error"); - return sch.validate; - } - _compileMetaSchema(sch) { - const currentOpts = this.opts; - this.opts = this._metaOpts; - try { - compile_1.compileSchema.call(this, sch); - } - finally { - this.opts = currentOpts; - } - } -} -exports.default = Ajv; -Ajv.ValidationError = error_classes_1.ValidationError; -Ajv.MissingRefError = error_classes_1.MissingRefError; -function checkOptions(checkOpts, options, msg, log = "error") { - for (const key in checkOpts) { - const opt = key; - if (opt in options) - this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); - } -} -function getSchEnv(keyRef) { - keyRef = resolve_1.normalizeId(keyRef); // TODO tests fail without this line - return this.schemas[keyRef] || this.refs[keyRef]; -} -function addInitialSchemas() { - const optsSchemas = this.opts.schemas; - if (!optsSchemas) - return; - if (Array.isArray(optsSchemas)) - this.addSchema(optsSchemas); - else - for (const key in optsSchemas) - this.addSchema(optsSchemas[key], key); -} -function addInitialFormats() { - for (const name in this.opts.formats) { - const format = this.opts.formats[name]; - if (format) - this.addFormat(name, format); - } -} -function addInitialKeywords(defs) { - if (Array.isArray(defs)) { - this.addVocabulary(defs); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const keyword in defs) { - const def = defs[keyword]; - if (!def.keyword) - def.keyword = keyword; - this.addKeyword(def); - } -} -function getMetaSchemaOptions() { - const metaOpts = { ...this.opts }; - for (const opt of META_IGNORE_OPTIONS) - delete metaOpts[opt]; - return metaOpts; -} -const noLogs = { log() { }, warn() { }, error() { } }; -function getLogger(logger) { - if (logger === false) - return noLogs; - if (logger === undefined) - return console; - if (logger.log && logger.warn && logger.error) - return logger; - throw new Error("logger must implement log, warn and error methods"); -} -const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; -function checkKeyword(keyword, def) { - const { RULES } = this; - util_1.eachItem(keyword, (kwd) => { - if (RULES.keywords[kwd]) - throw new Error(`Keyword ${kwd} is already defined`); - if (!KEYWORD_NAME.test(kwd)) - throw new Error(`Keyword ${kwd} has invalid name`); - }); - if (!def) - return; - if (def.$data && !("code" in def || "validate" in def)) { - throw new Error('$data keyword must have "code" or "validate" function'); - } -} -function addRule(keyword, definition, dataType) { - var _a; - const post = definition === null || definition === void 0 ? void 0 : definition.post; - if (dataType && post) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES } = this; - let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); - if (!ruleGroup) { - ruleGroup = { type: dataType, rules: [] }; - RULES.rules.push(ruleGroup); - } - RULES.keywords[keyword] = true; - if (!definition) - return; - const rule = { - keyword, - definition: { - ...definition, - type: dataType_1.getJSONTypes(definition.type), - schemaType: dataType_1.getJSONTypes(definition.schemaType), - }, - }; - if (definition.before) - addBeforeRule.call(this, ruleGroup, rule, definition.before); - else - ruleGroup.rules.push(rule); - RULES.all[keyword] = rule; - (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); -} -function addBeforeRule(ruleGroup, rule, before) { - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); - if (i >= 0) { - ruleGroup.rules.splice(i, 0, rule); - } - else { - ruleGroup.rules.push(rule); - this.logger.warn(`rule ${before} is not defined`); - } -} -function keywordMetaschema(def) { - let { metaSchema } = def; - if (metaSchema === undefined) - return; - if (def.$data && this.opts.$data) - metaSchema = schemaOrData(metaSchema); - def.validateSchema = this.compile(metaSchema, true); -} -const $dataRef = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", -}; -function schemaOrData(schema) { - return { anyOf: [schema, $dataRef] }; -} -//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/core.js.map b/node_modules/table/node_modules/ajv/dist/core.js.map deleted file mode 100644 index 51a04ad94..000000000 --- a/node_modules/table/node_modules/ajv/dist/core.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"core.js","sourceRoot":"","sources":["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line at end of file diff --git a/node_modules/table/node_modules/ajv/dist/jtd.d.ts b/node_modules/table/node_modules/ajv/dist/jtd.d.ts deleted file mode 100644 index 72bc0de48..000000000 --- a/node_modules/table/node_modules/ajv/dist/jtd.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -import KeywordCxt from "./compile/context"; -export { KeywordCxt }; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -import type { AnySchemaObject, SchemaObject, JTDParser } from "./types"; -import type { JTDSchemaType, JTDDataType } from "./types/jtd-schema"; -export { JTDSchemaType, JTDDataType }; -import AjvCore, { CurrentOptions } from "./core"; -export declare type JTDOptions = CurrentOptions & { - strictTypes?: never; - strictTuples?: never; - allowMatchingProperties?: never; - allowUnionTypes?: never; - validateFormats?: never; - $data?: never; - verbose?: never; - $comment?: never; - formats?: never; - loadSchema?: never; - useDefaults?: never; - coerceTypes?: never; - next?: never; - unevaluated?: never; - dynamicRef?: never; - meta?: boolean; - defaultMeta?: never; - inlineRefs?: boolean; - loopRequired?: never; - multipleOfPrecision?: never; - ajvErrors?: boolean; -}; -export default class Ajv extends AjvCore { - constructor(opts?: JTDOptions); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; - compileSerializer(schema: SchemaObject): (data: T) => string; - compileSerializer(schema: JTDSchemaType): (data: T) => string; - compileParser(schema: SchemaObject): JTDParser; - compileParser(schema: JTDSchemaType): JTDParser; - private _compileSerializer; - private _compileParser; -} diff --git a/node_modules/table/node_modules/ajv/dist/jtd.js b/node_modules/table/node_modules/ajv/dist/jtd.js deleted file mode 100644 index 32f2581b1..000000000 --- a/node_modules/table/node_modules/ajv/dist/jtd.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const context_1 = require("./compile/context"); -exports.KeywordCxt = context_1.default; -// export {DefinedError} from "./vocabularies/errors" -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -const core_1 = require("./core"); -const jtd_1 = require("./vocabularies/jtd"); -const jtd_schema_1 = require("./refs/jtd-schema"); -const serialize_1 = require("./compile/jtd/serialize"); -const parse_1 = require("./compile/jtd/parse"); -// const META_SUPPORT_DATA = ["/properties"] -const META_SCHEMA_ID = "JTD-meta-schema"; -class Ajv extends core_1.default { - constructor(opts = {}) { - var _a; - super({ - ...opts, - jtd: true, - messages: (_a = opts.messages) !== null && _a !== void 0 ? _a : false, - }); - } - _addVocabularies() { - super._addVocabularies(); - this.addVocabulary(jtd_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false); - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } - compileSerializer(schema) { - const sch = this._addSchema(schema); - return sch.serialize || this._compileSerializer(sch); - } - compileParser(schema) { - const sch = this._addSchema(schema); - return (sch.parse || this._compileParser(sch)); - } - _compileSerializer(sch) { - serialize_1.default.call(this, sch, sch.schema.definitions || {}); - /* istanbul ignore if */ - if (!sch.serialize) - throw new Error("ajv implementation error"); - return sch.serialize; - } - _compileParser(sch) { - parse_1.default.call(this, sch, sch.schema.definitions || {}); - /* istanbul ignore if */ - if (!sch.parse) - throw new Error("ajv implementation error"); - return sch.parse; - } -} -exports.default = Ajv; -//# sourceMappingURL=jtd.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/jtd.js.map b/node_modules/table/node_modules/ajv/dist/jtd.js.map deleted file mode 100644 index 01adb1b5b..000000000 --- a/node_modules/table/node_modules/ajv/dist/jtd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jtd.js","sourceRoot":"","sources":["../lib/jtd.ts"],"names":[],"mappings":";;;AAwBA,+CAA0C;AAClC,qBADD,iBAAU,CACC;AAClB,qDAAqD;AACrD,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAKnD,iCAA8C;AAC9C,4CAA8C;AAC9C,kDAA6C;AAC7C,uDAAuD;AACvD,+CAA+C;AAG/C,4CAA4C;AAE5C,MAAM,cAAc,GAAG,iBAAiB,CAAA;AA8BxC,MAAqB,GAAI,SAAQ,cAAO;IACtC,YAAY,OAAmB,EAAE;;QAC/B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE,MAAA,IAAI,CAAC,QAAQ,mCAAI,KAAK;SACjC,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,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C,CAAA;QAChF,wBAAwB;QACxB,IAAI,CAAC,GAAG,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,OAAO,GAAG,CAAC,KAAK,CAAA;IAClB,CAAC;CACF;AAxDD,sBAwDC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/refs/data.json b/node_modules/table/node_modules/ajv/dist/refs/data.json deleted file mode 100644 index 9ffc9f5ce..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", - "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", - "type": "object", - "required": ["$data"], - "properties": { - "$data": { - "type": "string", - "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] - } - }, - "additionalProperties": false -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts deleted file mode 100644 index cf008331f..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type Ajv from "../../core"; -export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv; diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js deleted file mode 100644 index 14775366e..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const metaSchema = require("./schema.json"); -const metaApplicator = require("./meta/applicator.json"); -const metaContent = require("./meta/content.json"); -const metaCore = require("./meta/core.json"); -const metaFormat = require("./meta/format.json"); -const metaMetadata = require("./meta/meta-data.json"); -const metaValidation = require("./meta/validation.json"); -const META_SUPPORT_DATA = ["/properties"]; -function addMetaSchema2019($data) { - ; - [ - metaSchema, - metaApplicator, - metaContent, - metaCore, - with$data(this, metaFormat), - metaMetadata, - with$data(this, metaValidation), - ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); - return this; - function with$data(ajv, sch) { - return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; - } -} -exports.default = addMetaSchema2019; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map deleted file mode 100644 index 7bf6333e0..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2019-09/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,yDAAwD;AACxD,mDAAkD;AAClD,6CAA4C;AAC5C,iDAAgD;AAChD,sDAAqD;AACrD,yDAAwD;AAExD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,cAAc;QACd,WAAW;QACX,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;QAC3B,YAAY;QACZ,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC;KAChC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAfD,oCAeC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json deleted file mode 100644 index c5e91cf2a..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/applicator": true - }, - "$recursiveAnchor": true, - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "additionalItems": {"$recursiveRef": "#"}, - "unevaluatedItems": {"$recursiveRef": "#"}, - "items": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] - }, - "contains": {"$recursiveRef": "#"}, - "additionalProperties": {"$recursiveRef": "#"}, - "unevaluatedProperties": {"$recursiveRef": "#"}, - "properties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": { - "$recursiveRef": "#" - } - }, - "propertyNames": {"$recursiveRef": "#"}, - "if": {"$recursiveRef": "#"}, - "then": {"$recursiveRef": "#"}, - "else": {"$recursiveRef": "#"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$recursiveRef": "#"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$recursiveRef": "#"} - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json deleted file mode 100644 index b8f637343..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "contentSchema": {"$recursiveRef": "#"} - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json deleted file mode 100644 index f71adbff0..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true - }, - "$recursiveAnchor": true, - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$anchor": { - "type": "string", - "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveRef": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveAnchor": { - "type": "boolean", - "default": false - }, - "$vocabulary": { - "type": "object", - "propertyNames": { - "type": "string", - "format": "uri" - }, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json deleted file mode 100644 index 03ccfce26..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/format", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/format": true - }, - "$recursiveAnchor": true, - - "title": "Format vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json deleted file mode 100644 index 0e194326f..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/meta-data": true - }, - "$recursiveAnchor": true, - - "title": "Meta-data vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "deprecated": { - "type": "boolean", - "default": false - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json deleted file mode 100644 index 7027a1279..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/validation": true - }, - "$recursiveAnchor": true, - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, - "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, - "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, - "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/$defs/stringArray"}, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - } - }, - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json deleted file mode 100644 index 54eb7157a..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/schema", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true, - "https://json-schema.org/draft/2019-09/vocab/applicator": true, - "https://json-schema.org/draft/2019-09/vocab/validation": true, - "https://json-schema.org/draft/2019-09/vocab/meta-data": true, - "https://json-schema.org/draft/2019-09/vocab/format": false, - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "properties": { - "definitions": { - "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", - "type": "object", - "additionalProperties": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] - } - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json deleted file mode 100644 index 5410064ba..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-06/schema#", - "$id": "http://json-schema.org/draft-06/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "examples": { - "type": "array", - "items": {} - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": {} - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": {}, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": {} -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json deleted file mode 100644 index 6a7485104..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://json-schema.org/draft-07/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": true - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": true, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": true -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json deleted file mode 100644 index 3968abd5d..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", - "title": "Meta-schema for the security assessment of JSON Schemas", - "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - } - }, - "dependencies": { - "patternProperties": { - "description": "prevent slow validation of large property names", - "required": ["propertyNames"], - "properties": { - "propertyNames": { - "required": ["maxLength"] - } - } - }, - "uniqueItems": { - "description": "prevent slow validation of large non-scalar arrays", - "if": { - "properties": { - "uniqueItems": {"const": true}, - "items": { - "properties": { - "type": { - "anyOf": [ - { - "enum": ["object", "array"] - }, - { - "type": "array", - "contains": {"enum": ["object", "array"]} - } - ] - } - } - } - } - }, - "then": { - "required": ["maxItems"] - } - }, - "pattern": { - "description": "prevent slow pattern matching of large strings", - "required": ["maxLength"] - }, - "format": { - "description": "prevent slow format validation of large strings", - "required": ["maxLength"] - } - }, - "properties": { - "additionalItems": {"$ref": "#"}, - "additionalProperties": {"$ref": "#"}, - "dependencies": { - "additionalProperties": { - "anyOf": [{"type": "array"}, {"$ref": "#"}] - } - }, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] - }, - "definitions": { - "additionalProperties": {"$ref": "#"} - }, - "patternProperties": { - "additionalProperties": {"$ref": "#"} - }, - "properties": { - "additionalProperties": {"$ref": "#"} - }, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"}, - "contains": {"$ref": "#"}, - "propertyNames": {"$ref": "#"} - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.d.ts b/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.d.ts deleted file mode 100644 index 932797a38..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SchemaObject } from "../types"; -declare const jtdMetaSchema: SchemaObject; -export default jtdMetaSchema; diff --git a/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js b/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js deleted file mode 100644 index 1ee940afb..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const shared = (root) => { - const sch = { - nullable: { type: "boolean" }, - metadata: { - optionalProperties: { - union: { elements: { ref: "schema" } }, - }, - additionalProperties: true, - }, - }; - if (root) - sch.definitions = { values: { ref: "schema" } }; - return sch; -}; -const emptyForm = (root) => ({ - optionalProperties: shared(root), -}); -const refForm = (root) => ({ - properties: { - ref: { type: "string" }, - }, - optionalProperties: shared(root), -}); -const typeForm = (root) => ({ - properties: { - type: { - enum: [ - "boolean", - "timestamp", - "string", - "float32", - "float64", - "int8", - "uint8", - "int16", - "uint16", - "int32", - "uint32", - ], - }, - }, - optionalProperties: shared(root), -}); -const enumForm = (root) => ({ - properties: { - enum: { elements: { type: "string" } }, - }, - optionalProperties: shared(root), -}); -const elementsForm = (root) => ({ - properties: { - elements: { ref: "schema" }, - }, - optionalProperties: shared(root), -}); -const propertiesForm = (root) => ({ - properties: { - properties: { values: { ref: "schema" } }, - }, - optionalProperties: { - optionalProperties: { values: { ref: "schema" } }, - additionalProperties: { type: "boolean" }, - ...shared(root), - }, -}); -const optionalPropertiesForm = (root) => ({ - properties: { - optionalProperties: { values: { ref: "schema" } }, - }, - optionalProperties: { - additionalProperties: { type: "boolean" }, - ...shared(root), - }, -}); -const discriminatorForm = (root) => ({ - properties: { - discriminator: { type: "string" }, - mapping: { - values: { - metadata: { - union: [propertiesForm(false), optionalPropertiesForm(false)], - }, - }, - }, - }, - optionalProperties: shared(root), -}); -const valuesForm = (root) => ({ - properties: { - values: { ref: "schema" }, - }, - optionalProperties: shared(root), -}); -const schema = (root) => ({ - metadata: { - union: [ - emptyForm, - refForm, - typeForm, - enumForm, - elementsForm, - propertiesForm, - optionalPropertiesForm, - discriminatorForm, - valuesForm, - ].map((s) => s(root)), - }, -}); -const jtdMetaSchema = { - definitions: { - schema: schema(false), - }, - ...schema(true), -}; -exports.default = jtdMetaSchema; -//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js.map b/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js.map deleted file mode 100644 index d46755b21..000000000 --- a/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/refs/jtd-schema.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE;IAClC,MAAM,GAAG,GAAiB;QACxB,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;QAC3B,QAAQ,EAAE;YACR,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAC,QAAQ,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC;aACnC;YACD,oBAAoB,EAAE,IAAI;SAC3B;KACF,CAAA;IACD,IAAI,IAAI;QAAE,GAAG,CAAC,WAAW,GAAG,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC,CAAA;IACrD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,SAAS,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvC,kBAAkB,EAAE,M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,CAAC;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAiB;IAClC,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;KACtB;IACD,GAAG,MAAM,CAAC,IAAI,CAAC;CAChB,CAAA;AAED,kBAAe,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/parseJson.d.ts deleted file mode 100644 index e3cb93c00..000000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare function parseJson(s: string, pos: number): unknown; -export declare namespace parseJson { - var message: string | undefined; - var position: number; - var code: import("../compile/codegen/code")._Code; -} -export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined; -export declare namespace parseJsonNumber { - var message: string | undefined; - var position: number; - var code: import("../compile/codegen/code")._Code; -} -export declare function parseJsonString(s: string, pos: number): string | undefined; -export declare namespace parseJsonString { - var message: string | undefined; - var position: number; - var code: import("../compile/codegen/code")._Code; -} diff --git a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js b/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js deleted file mode 100644 index cd4b8c1c9..000000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js +++ /dev/null @@ -1,183 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0; -const codegen_1 = require("../compile/codegen"); -const rxParseJson = /position\s(\d+)$/; -function parseJson(s, pos) { - let endPos; - parseJson.message = undefined; - let matches; - if (pos) - s = s.slice(pos); - try { - parseJson.position = pos + s.length; - return JSON.parse(s); - } - catch (e) { - matches = rxParseJson.exec(e.message); - if (!matches) { - parseJson.message = "unexpected end"; - return undefined; - } - endPos = +matches[1]; - const c = s[endPos]; - s = s.slice(0, endPos); - parseJson.position = pos + endPos; - try { - return JSON.parse(s); - } - catch (e1) { - parseJson.message = `unexpected token ${c}`; - return undefined; - } - } -} -exports.parseJson = parseJson; -parseJson.message = undefined; -parseJson.position = 0; -parseJson.code = codegen_1._ `require("ajv/dist/runtime/parseJson").parseJson`; -function parseJsonNumber(s, pos, maxDigits) { - let numStr = ""; - let c; - parseJsonNumber.message = undefined; - if (s[pos] === "-") { - numStr += "-"; - pos++; - } - if (s[pos] === "0") { - numStr += "0"; - pos++; - } - else { - if (!parseDigits(maxDigits)) { - errorMessage(); - return undefined; - } - } - if (maxDigits) { - parseJsonNumber.position = pos; - return +numStr; - } - if (s[pos] === ".") { - numStr += "."; - pos++; - if (!parseDigits()) { - errorMessage(); - return undefined; - } - } - if (((c = s[pos]), c === "e" || c === "E")) { - numStr += "e"; - pos++; - if (((c = s[pos]), c === "+" || c === "-")) { - numStr += c; - pos++; - } - if (!parseDigits()) { - errorMessage(); - return undefined; - } - } - parseJsonNumber.position = pos; - return +numStr; - function parseDigits(maxLen) { - let digit = false; - while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { - digit = true; - numStr += c; - pos++; - } - return digit; - } - function errorMessage() { - parseJsonNumber.position = pos; - parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; - } -} -exports.parseJsonNumber = parseJsonNumber; -parseJsonNumber.message = undefined; -parseJsonNumber.position = 0; -parseJsonNumber.code = codegen_1._ `require("ajv/dist/runtime/parseJson").parseJsonNumber`; -const escapedChars = { - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: "\t", - '"': '"', - "/": "/", - "\\": "\\", -}; -const CODE_A = "a".charCodeAt(0); -const CODE_0 = "0".charCodeAt(0); -function parseJsonString(s, pos) { - let str = ""; - let c; - parseJsonString.message = undefined; - // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition - while (true) { - c = s[pos++]; - if (c === '"') - break; - if (c === "\\") { - c = s[pos]; - if (c in escapedChars) { - str += escapedChars[c]; - pos++; - } - else if (c === "u") { - pos++; - let count = 4; - let code = 0; - while (count--) { - code <<= 4; - c = s[pos].toLowerCase(); - if (c >= "a" && c <= "f") { - code += c.charCodeAt(0) - CODE_A + 10; - } - else if (c >= "0" && c <= "9") { - code += c.charCodeAt(0) - CODE_0; - } - else if (c === undefined) { - errorMessage("unexpected end"); - return undefined; - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - pos++; - } - str += String.fromCharCode(code); - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - } - else if (c === undefined) { - errorMessage("unexpected end"); - return undefined; - } - else { - if (c.charCodeAt(0) >= 0x20) { - str += c; - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - } - } - parseJsonString.position = pos; - return str; - function errorMessage(msg) { - parseJsonString.position = pos; - parseJsonString.message = msg; - } -} -exports.parseJsonString = parseJsonString; -parseJsonString.message = undefined; -parseJsonString.position = 0; -parseJsonString.code = codegen_1._ `require("ajv/dist/runtime/parseJson").parseJsonString`; -//# sourceMappingURL=parseJson.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js.map b/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js.map deleted file mode 100644 index 709846303..000000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseJson.js","sourceRoot":"","sources":["../../lib/runtime/parseJson.ts"],"names":[],"mappings":";;;AAAA,gDAAoC;AAEpC,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAEtC,SAAgB,SAAS,CAAC,CAAS,EAAE,GAAW;IAC9C,IAAI,MAA0B,CAAA;IAC9B,SAAS,CAAC,OAAO,GAAG,SAAS,CAAA;IAC7B,IAAI,OAA+B,CAAA;IACnC,IAAI,GAAG;QAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI;QACF,SAAS,CAAC,QAAQ,GAAG,GAAG,GAA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AE;gBAC3B,GAAG,IAAI,CAAC,CAAA;aACT;iBAAM;gBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;aACjB;SACF;KACF;IACD,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;IAC9B,OAAO,GAAG,CAAA;IAEV,SAAS,YAAY,CAAC,GAAW;QAC/B,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;QAC9B,eAAe,CAAC,OAAO,GAAG,GAAG,CAAA;IAC/B,CAAC;AACH,CAAC;AAzDD,0CAyDC;AAED,eAAe,CAAC,OAAO,GAAG,SAA+B,CAAA;AACzD,eAAe,CAAC,QAAQ,GAAG,CAAW,CAAA;AACtC,eAAe,CAAC,IAAI,GAAG,WAAC,CAAA,uDAAuD,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/quote.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/quote.d.ts deleted file mode 100644 index ec03ebf8b..000000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/quote.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function quote(s: string): string; diff --git a/node_modules/table/node_modules/ajv/dist/runtime/quote.js b/node_modules/table/node_modules/ajv/dist/runtime/quote.js deleted file mode 100644 index 361280542..000000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/quote.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// eslint-disable-next-line no-control-regex, no-misleading-character-class -const rxEscapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; -const escaped = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\", -}; -function quote(s) { - rxEscapable.lastIndex = 0; - return ('"' + - (rxEscapable.test(s) - ? s.replace(rxEscapable, (a) => { - const c = escaped[a]; - return typeof c === "string" - ? c - : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); - }) - : s) + - '"'); -} -exports.default = quote; -//# sourceMappingURL=quote.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/quote.js.map b/node_modules/table/node_modules/ajv/dist/runtime/quote.js.map deleted file mode 100644 index 27d322fd4..000000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/quote.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../lib/runtime/quote.ts"],"names":[],"mappings":";;AAAA,2EAA2E;AAC3E,MAAM,WAAW,GAAG,iIAAiI,CAAA;AAErJ,MAAM,OAAO,GAA6B;IACxC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAA;AAED,SAAwB,KAAK,CAAC,CAAS;IACrC,WAAW,CAAC,SAAS,GAAG,CAAC,CAAA;IACzB,OAAO,CACL,GAAG;QACH,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;gBACpB,OAAO,OAAO,CAAC,KAAK,QAAQ;oBAC1B,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC,CAAC;QACN,GAAG,CACJ,CAAA;AACH,CAAC;AAdD,wBAcC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/standalone/index.d.ts b/node_modules/table/node_modules/ajv/dist/standalone/index.d.ts deleted file mode 100644 index e9976d1d8..000000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type AjvCore from "../core"; -import type { AnyValidateFunction } from "../types"; -export default function standaloneCode(ajv: AjvCore, refsOrFunc?: { - [K in string]?: string; -} | AnyValidateFunction): string; diff --git a/node_modules/table/node_modules/ajv/dist/standalone/index.js b/node_modules/table/node_modules/ajv/dist/standalone/index.js deleted file mode 100644 index f58ebb697..000000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/index.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const scope_1 = require("../compile/codegen/scope"); -const code_1 = require("../compile/codegen/code"); -function standaloneCode(ajv, refsOrFunc) { - if (!ajv.opts.code.source) { - throw new Error("moduleCode: ajv instance must have code.source option"); - } - const { _n } = ajv.scope.opts; - return typeof refsOrFunc == "function" - ? funcExportCode(refsOrFunc.source) - : refsOrFunc !== undefined - ? multiExportsCode(refsOrFunc, getValidate) - : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema)); - function getValidate(id) { - const v = ajv.getSchema(id); - if (!v) - throw new Error(`moduleCode: no schema with id ${id}`); - return v; - } - function funcExportCode(source) { - const usedValues = {}; - const n = source === null || source === void 0 ? void 0 : source.validateName; - const vCode = validateCode(usedValues, source); - return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; - } - function multiExportsCode(schemas, getValidateFunc) { - var _a; - const usedValues = {}; - let code = code_1._ `"use strict";`; - for (const name in schemas) { - const v = getValidateFunc(schemas[name]); - if (v) { - const vCode = validateCode(usedValues, v.source); - code = code_1._ `${code}${_n}exports${code_1.getProperty(name)} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`; - } - } - return `${code}`; - } - function validateCode(usedValues, s) { - if (!s) - throw new Error('moduleCode: function does not have "source" property'); - if (usedState(s.validateName) === scope_1.UsedValueState.Completed) - return code_1.nil; - setUsedState(s.validateName, scope_1.UsedValueState.Started); - const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); - const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); - return s.evaluated ? code_1._ `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; - function refValidateCode(n) { - var _a; - const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref; - if (n.prefix === "validate" && typeof vRef == "function") { - const v = vRef; - return validateCode(usedValues, v.source); - } - else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { - const { validate, validateName } = vRef; - if (!validateName) - throw new Error("ajv internal error"); - const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; - const wrapper = code_1._ `${def} ${n} = {validate: ${validateName}};`; - if (usedState(validateName) === scope_1.UsedValueState.Started) - return wrapper; - const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); - return code_1._ `${wrapper}${_n}${vCode}`; - } - return undefined; - } - function usedState(name) { - var _a; - return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name); - } - function setUsedState(name, state) { - const { prefix } = name; - const names = (usedValues[prefix] = usedValues[prefix] || new Map()); - names.set(name, state); - } - } -} -exports.default = standaloneCode; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/standalone/index.js.map b/node_modules/table/node_modules/ajv/dist/standalone/index.js.map deleted file mode 100644 index 00ed6d0d2..000000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/standalone/index.ts"],"names":[],"mappings":";;AAGA,oDAAkG;AAClG,kDAAwE;AA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SAAS,YAAY,CAAC,IAAoB,EAAE,KAAqB;YAC/D,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAA;YACrB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAjFD,iCAiFC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/standalone/instance.d.ts b/node_modules/table/node_modules/ajv/dist/standalone/instance.d.ts deleted file mode 100644 index 156ac3226..000000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/instance.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Ajv, { AnySchema, AnyValidateFunction, ErrorObject } from "../core"; -export default class AjvPack { - readonly ajv: Ajv; - errors?: ErrorObject[] | null; - constructor(ajv: Ajv); - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; - compile(schema: AnySchema, meta?: boolean): AnyValidateFunction; - getSchema(keyRef: string): AnyValidateFunction | undefined; - private getStandalone; - addSchema(...args: Parameters): AjvPack; - addKeyword(...args: Parameters): AjvPack; -} diff --git a/node_modules/table/node_modules/ajv/dist/standalone/instance.js b/node_modules/table/node_modules/ajv/dist/standalone/instance.js deleted file mode 100644 index aa43ac561..000000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/instance.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("../core"); -const _1 = require("."); -const requireFromString = require("require-from-string"); -class AjvPack { - constructor(ajv) { - this.ajv = ajv; - } - validate(schemaKeyRef, data) { - return core_1.default.prototype.validate.call(this, schemaKeyRef, data); - } - compile(schema, meta) { - return this.getStandalone(this.ajv.compile(schema, meta)); - } - getSchema(keyRef) { - const v = this.ajv.getSchema(keyRef); - if (!v) - return undefined; - return this.getStandalone(v); - } - getStandalone(v) { - return requireFromString(_1.default(this.ajv, v)); - } - addSchema(...args) { - this.ajv.addSchema.call(this.ajv, ...args); - return this; - } - addKeyword(...args) { - this.ajv.addKeyword.call(this.ajv, ...args); - return this; - } -} -exports.default = AjvPack; -//# sourceMappingURL=instance.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/standalone/instance.js.map b/node_modules/table/node_modules/ajv/dist/standalone/instance.js.map deleted file mode 100644 index 2b5852c4c..000000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/instance.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../lib/standalone/instance.ts"],"names":[],"mappings":";;AAAA,kCAAwE;AACxE,wBAA8B;AAC9B,yDAAwD;AAExD,MAAqB,OAAO;IAE1B,YAAqB,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;IAAG,CAAC;IAEjC,QAAQ,CAAC,YAAgC,EAAE,IAAa;QACtD,OAAO,cAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,CAAc,MAAiB,EAAE,IAAc;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,SAAS,CAAc,MAAc;QACnC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAI,MAAM,CAAC,CAAA;QACvC,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAA;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;IAEO,aAAa,CAAc,CAAyB;QAC1D,OAAO,iBAAiB,CAAC,UAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAA2B,CAAA;IACjF,CAAC;IAED,SAAS,CAAC,GAAG,IAAgD;QAC3D,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU,CAAC,GAAG,IAAiD;QAC7D,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA/BD,0BA+BC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/types/index.d.ts b/node_modules/table/node_modules/ajv/dist/types/index.d.ts deleted file mode 100644 index 79237c40a..000000000 --- a/node_modules/table/node_modules/ajv/dist/types/index.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen"; -import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile"; -import type { JSONType } from "../compile/rules"; -import type KeywordCxt from "../compile/context"; -import type Ajv from "../core"; -interface _SchemaObject { - $id?: string; - $schema?: string; - [x: string]: any; -} -export interface SchemaObject extends _SchemaObject { - $id?: string; - $schema?: string; - $async?: false; - [x: string]: any; -} -export interface AsyncSchema extends _SchemaObject { - $async: true; -} -export declare type AnySchemaObject = SchemaObject | AsyncSchema; -export declare type Schema = SchemaObject | boolean; -export declare type AnySchema = Schema | AsyncSchema; -export declare type SchemaMap = { - [Key in string]?: AnySchema; -}; -export interface SourceCode { - validateName: ValueScopeName; - validateCode: string; - scopeValues: ScopeValueSets; - evaluated?: Code; -} -export interface DataValidationCxt { - dataPath: string; - parentData: { - [K in T]: any; - }; - parentDataProperty: T; - rootData: Record | any[]; - dynamicAnchors: { - [Ref in string]?: ValidateFunction; - }; -} -export interface ValidateFunction { - (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T; - errors?: null | ErrorObject[]; - evaluated?: Evaluated; - schema: AnySchema; - schemaEnv: SchemaEnv; - source?: SourceCode; -} -export interface JTDParser { - (json: string): T | undefined; - message?: string; - position?: number; -} -export declare type EvaluatedProperties = { - [K in string]?: true; -} | true; -export declare type EvaluatedItems = number | true; -export interface Evaluated { - props?: EvaluatedProperties; - items?: EvaluatedItems; - dynamicProps: boolean; - dynamicItems: boolean; -} -export interface AsyncValidateFunction extends ValidateFunction { - (...args: Parameters>): Promise; - $async: true; -} -export declare type AnyValidateFunction = ValidateFunction | AsyncValidateFunction; -export interface ErrorObject, S = unknown> { - keyword: K; - dataPath: string; - instancePath?: string; - schemaPath: string; - params: P; - propertyName?: string; - message?: string; - schema?: S; - parentSchema?: AnySchemaObject; - data?: unknown; -} -export declare type ErrorNoParams = ErrorObject, S>; -interface _KeywordDef { - keyword: string | string[]; - type?: JSONType | JSONType[]; - schemaType?: JSONType | JSONType[]; - allowUndefined?: boolean; - $data?: boolean; - implements?: string[]; - before?: string; - post?: boolean; - metaSchema?: AnySchemaObject; - validateSchema?: AnyValidateFunction; - dependencies?: string[]; - error?: KeywordErrorDefinition; - $dataError?: KeywordErrorDefinition; -} -export interface CodeKeywordDefinition extends _KeywordDef { - code: (cxt: KeywordCxt, ruleType?: string) => void; - trackErrors?: boolean; -} -export declare type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema; -export declare type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction; -export interface DataValidateFunction { - (...args: Parameters): boolean | Promise; - errors?: Partial[]; -} -export interface SchemaValidateFunction { - (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise; - errors?: Partial[]; -} -export interface FuncKeywordDefinition extends _KeywordDef { - validate?: SchemaValidateFunction | DataValidateFunction; - compile?: CompileKeywordFunc; - schema?: boolean; - modifying?: boolean; - async?: boolean; - valid?: boolean; - errors?: boolean | "full"; -} -export interface MacroKeywordDefinition extends FuncKeywordDefinition { - macro: MacroKeywordFunc; -} -export declare type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition; -export declare type AddedKeywordDefinition = KeywordDefinition & { - type: JSONType[]; - schemaType: JSONType[]; -}; -export interface KeywordErrorDefinition { - message: string | Code | ((cxt: KeywordErrorCxt) => Code); - params?: Code | ((cxt: KeywordErrorCxt) => Code); -} -export declare type Vocabulary = (KeywordDefinition | string)[]; -export interface KeywordErrorCxt { - gen: CodeGen; - keyword: string; - data: Name; - $data?: string | false; - schema: any; - parentSchema?: AnySchemaObject; - schemaCode: Code | number | boolean; - schemaValue: Code | number | boolean; - schemaType?: JSONType[]; - errsCount?: Name; - params: KeywordCxtParams; - it: SchemaCxt; -} -export declare type KeywordCxtParams = { - [P in string]?: Code | string | number; -}; -export declare type FormatValidator = (data: T) => boolean; -export declare type FormatCompare = (data1: T, data2: T) => number | undefined; -export declare type AsyncFormatValidator = (data: T) => Promise; -export interface FormatDefinition { - type?: T extends string ? "string" | undefined : "number"; - validate: FormatValidator | (T extends string ? string | RegExp : never); - async?: false | undefined; - compare?: FormatCompare; -} -export interface AsyncFormatDefinition { - type?: T extends string ? "string" | undefined : "number"; - validate: AsyncFormatValidator; - async: true; - compare?: FormatCompare; -} -export declare type AddedFormat = true | RegExp | FormatValidator | FormatDefinition | FormatDefinition | AsyncFormatDefinition | AsyncFormatDefinition; -export declare type Format = AddedFormat | string; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/types/index.js.map b/node_modules/table/node_modules/ajv/dist/types/index.js.map deleted file mode 100644 index 1f80f85ec..000000000 --- a/node_modules/table/node_modules/ajv/dist/types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts b/node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts deleted file mode 100644 index 597b8da93..000000000 --- a/node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -export declare type SomeJSONSchema = JSONSchemaType; -export declare type PartialSchema = Partial>; -declare type JSONType = _partial extends true ? T | undefined : T; -export declare type JSONSchemaType = (T extends number ? { - type: JSONType<"number" | "integer", _partial>; - minimum?: number; - maximum?: number; - exclusiveMinimum?: number; - exclusiveMaximum?: number; - multipleOf?: number; - format?: string; -} : T extends string ? { - type: JSONType<"string", _partial>; - minLength?: number; - maxLength?: number; - pattern?: string; - format?: string; -} : T extends boolean ? { - type: "boolean"; -} : T extends [any, ...any[]] ? { - type: JSONType<"array", _partial>; - items: { - readonly [K in keyof T]-?: JSONSchemaType & Nullable; - } & { - length: T["length"]; - }; - minItems: T["length"]; -} & ({ - maxItems: T["length"]; -} | { - additionalItems: false; -}) : T extends readonly any[] ? { - type: JSONType<"array", _partial>; - items: JSONSchemaType; - contains?: PartialSchema; - minItems?: number; - maxItems?: number; - minContains?: number; - maxContains?: number; - uniqueItems?: true; - additionalItems?: never; -} : T extends Record ? { - type: JSONType<"object", _partial>; - required: _partial extends true ? Readonly<(keyof T)[]> : Readonly[]>; - additionalProperties?: boolean | JSONSchemaType; - unevaluatedProperties?: boolean | JSONSchemaType; - properties?: _partial extends true ? Partial> : PropertiesSchema; - patternProperties?: { - [Pattern in string]?: JSONSchemaType; - }; - propertyNames?: JSONSchemaType; - dependencies?: { - [K in keyof T]?: Readonly<(keyof T)[]> | PartialSchema; - }; - dependentRequired?: { - [K in keyof T]?: Readonly<(keyof T)[]>; - }; - dependentSchemas?: { - [K in keyof T]?: PartialSchema; - }; - minProperties?: number; - maxProperties?: number; -} : T extends null ? { - nullable: true; -} : never) & { - [keyword: string]: any; - $id?: string; - $ref?: string; - $defs?: { - [Key in string]?: JSONSchemaType; - }; - definitions?: { - [Key in string]?: JSONSchemaType; - }; - allOf?: Readonly[]>; - anyOf?: Readonly[]>; - oneOf?: Readonly[]>; - if?: PartialSchema; - then?: PartialSchema; - else?: PartialSchema; - not?: PartialSchema; -}; -declare type Known = KnownRecord | [Known, ...Known[]] | Known[] | number | string | boolean | null; -interface KnownRecord extends Record { -} -export declare type PropertiesSchema = { - [K in keyof T]-?: (JSONSchemaType & Nullable) | { - $ref: string; - }; -}; -export declare type RequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -declare type Nullable = undefined extends T ? { - nullable: true; - const?: never; - enum?: Readonly<(T | null)[]>; - default?: T | null; -} : { - const?: T; - enum?: Readonly; - default?: T; -}; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/types/json-schema.js.map b/node_modules/table/node_modules/ajv/dist/types/json-schema.js.map deleted file mode 100644 index ae6b4d0fe..000000000 --- a/node_modules/table/node_modules/ajv/dist/types/json-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../../lib/types/json-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts b/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts deleted file mode 100644 index d06b3a2d8..000000000 --- a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -/** required keys of an object, not undefined */ -declare type RequiredKeys = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -/** optional or undifined-able keys of an object */ -declare type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] ? K : never; -}[keyof T]; -/** type is true if T is a union type */ -declare type IsUnion_ = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true; -declare type IsUnion = IsUnion_; -/** type is true if T is identically E */ -declare type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false; -/** type is true if T or null is identically E or null*/ -declare type NullTypeEquality = TypeEquality; -/** gets only the string literals of a type or null if a type isn't a string literal */ -declare type EnumString = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null; -/** true if type is a union of string literals */ -declare type IsEnum = null extends EnumString> ? false : true; -/** true only if all types are array types (not tuples) */ -declare type IsElements = false extends IsUnion ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false; -/** true if the the type is a values type */ -declare type IsValues = false extends IsUnion> ? TypeEquality, string> : false; -/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */ -declare type IsRecord = Union extends IsUnion> ? null extends EnumString> ? false : true : false; -/** numeric strings */ -declare type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -/** string strings */ -declare type StringType = "string" | "timestamp"; -/** actual schema */ -export declare type JTDSchemaType = Record> = (// refs - where null wasn't specified, must match exactly -(null extends EnumString ? never : ({ - [K in keyof D]: [T] extends [D[K]] ? { - ref: K; - } : never; -}[keyof D] & { - nullable?: false; -}) | (null extends T ? { - [K in keyof D]: [Exclude] extends [Exclude] ? { - ref: K; - } : never; -}[keyof D] & { - nullable: true; -} : never)) | (unknown extends T ? { - nullable?: boolean; -} : never) | ((true extends NullTypeEquality ? { - type: NumberType; -} : true extends NullTypeEquality ? { - type: "boolean"; -} : true extends NullTypeEquality ? { - type: StringType; -} : true extends NullTypeEquality ? { - type: "timestamp"; -} : true extends IsEnum ? { - enum: EnumString>[]; -} : true extends IsElements> ? T extends readonly (infer E)[] ? { - elements: JTDSchemaType; -} : never : true extends IsValues ? T extends Record ? { - values: JTDSchemaType; -} : never : true extends IsRecord ? ([RequiredKeys>] extends [never] ? { - properties?: Record; -} : { - properties: { - [K in RequiredKeys]: JTDSchemaType; - }; -}) & ([OptionalKeys>] extends [never] ? { - optionalProperties?: Record; -} : { - optionalProperties: { - [K in OptionalKeys]: JTDSchemaType, D>; - }; -}) & { - additionalProperties?: boolean; -} : true extends IsRecord ? { - [K in keyof Exclude]-?: Exclude[K] extends string ? { - discriminator: K; - mapping: { - [M in Exclude[K]]: JTDSchemaType, D>; - }; - } : never; -}[keyof Exclude] : never) & (null extends T ? { - nullable: true; -} : { - nullable?: false; -}))) & { - metadata?: Record; - definitions?: { - [K in keyof D]: JTDSchemaType; - }; -}; -declare type JTDDataDef> = (S extends { - ref: string; -} ? JTDDataDef : S extends { - type: NumberType; -} ? number : S extends { - type: "string"; -} ? string : S extends { - type: "timestamp"; -} ? string | Date : S extends { - enum: readonly (infer E)[]; -} ? string extends E ? never : [E] extends [string] ? E : never : S extends { - elements: infer E; -} ? JTDDataDef[] : S extends { - properties: Record; - optionalProperties?: Record; - additionalProperties?: boolean; -} ? { - -readonly [K in keyof S["properties"]]-?: JTDDataDef; -} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; -} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { - properties?: Record; - optionalProperties: Record; - additionalProperties?: boolean; -} ? { - -readonly [K in keyof S["properties"]]-?: JTDDataDef; -} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; -} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { - values: infer V; -} ? Record> : S extends { - discriminator: infer M; - mapping: Record; -} ? [M] extends [string] ? { - [K in keyof S["mapping"]]: JTDDataDef & { - [KM in M]: K; - }; -}[keyof S["mapping"]] : never : unknown) | (S extends { - nullable: true; -} ? null : never); -export declare type JTDDataType = S extends { - definitions: Record; -} ? JTDDataDef : JTDDataDef>; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js.map b/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js.map deleted file mode 100644 index add89bd77..000000000 --- a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/types/jtd-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts deleted file mode 100644 index e4a3cac75..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type AdditionalItemsError = ErrorObject<"additionalItems", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js deleted file mode 100644 index 76f8aab9f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const subschema_1 = require("../../compile/subschema"); -const util_1 = require("../../compile/util"); -const validate_1 = require("../../compile/validate"); -const error = { - message: ({ params: { len } }) => codegen_1.str `should NOT have more than ${len} items`, - params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`, -}; -const def = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error, - code(cxt) { - const { gen, schema, parentSchema, data, it } = cxt; - const { items } = parentSchema; - if (!Array.isArray(items)) { - validate_1.checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - it.items = true; - const len = gen.const("len", codegen_1._ `${data}.length`); - if (schema === false) { - cxt.setParams({ len: items.length }); - cxt.pass(codegen_1._ `${len} <= ${items.length}`); - } - else if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) { - const valid = gen.var("valid", codegen_1._ `${len} <= ${items.length}`); // TODO var - gen.if(codegen_1.not(valid), () => validateItems(valid)); - cxt.ok(valid); - } - function validateItems(valid) { - gen.forRange("i", items.length, len, (i) => { - cxt.subschema({ keyword: "additionalItems", dataProp: i, dataPropType: subschema_1.Type.Num }, valid); - if (!it.allErrors) - gen.if(codegen_1.not(valid), () => gen.break()); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=additionalItems.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map deleted file mode 100644 index f590f36c4..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"additionalItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalItems.ts"],"names":[],"mappings":";;AAOA,mDAAuD;AACvD,uDAA4C;AAC5C,6CAAoD;AACpD,qDAAsD;AAItD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,6BAA6B,GAAG,QAAQ;IACzE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,iBAA0B;IACnC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,KAAK,EAAC,GAAG,YAAY,CAAA;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,0BAAe,CAAC,EAAE,EAAE,sEAAsE,CAAC,CAAA;YAC3F,OAAM;SACP;QACD,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAA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abularies/applicator/additionalProperties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts deleted file mode 100644 index f24ba3f5f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type AdditionalPropertiesError = ErrorObject<"additionalProperties", { - additionalProperty: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition & AddedKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js deleted file mode 100644 index bd8264b44..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const subschema_1 = require("../../compile/subschema"); -const util_1 = require("../../compile/util"); -const error = { - message: "should NOT have additional properties", - params: ({ params }) => codegen_1._ `{additionalProperty: ${params.additionalProperty}}`, -}; -const def = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: true, - trackErrors: true, - error, - code(cxt) { - const { gen, schema, parentSchema, data, errsCount, it } = cxt; - /* istanbul ignore if */ - if (!errsCount) - throw new Error("ajv implementation error"); - const { allErrors, opts } = it; - it.props = true; - if (opts.removeAdditional !== "all" && util_1.alwaysValidSchema(it, schema)) - return; - const props = code_1.allSchemaProperties(parentSchema.properties); - const patProps = code_1.allSchemaProperties(parentSchema.patternProperties); - checkAdditionalProperties(); - cxt.ok(codegen_1._ `${errsCount} === ${names_1.default.errors}`); - function checkAdditionalProperties() { - gen.forIn("key", data, (key) => { - if (!props.length && !patProps.length) - additionalPropertyCode(key); - else - gen.if(isAdditional(key), () => additionalPropertyCode(key)); - }); - } - function isAdditional(key) { - let definedProp; - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = util_1.schemaRefOrVal(it, parentSchema.properties, "properties"); - definedProp = code_1.isOwnProperty(gen, propsSchema, key); - } - else if (props.length) { - definedProp = codegen_1.or(...props.map((p) => codegen_1._ `${key} === ${p}`)); - } - else { - definedProp = codegen_1.nil; - } - if (patProps.length) { - definedProp = codegen_1.or(definedProp, ...patProps.map((p) => codegen_1._ `${code_1.usePattern(gen, p)}.test(${key})`)); - } - return codegen_1.not(definedProp); - } - function deleteAdditional(key) { - gen.code(codegen_1._ `delete ${data}[${key}]`); - } - function additionalPropertyCode(key) { - if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { - deleteAdditional(key); - return; - } - if (schema === false) { - cxt.setParams({ additionalProperty: key }); - cxt.error(); - if (!allErrors) - gen.break(); - return; - } - if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) { - const valid = gen.name("valid"); - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false); - gen.if(codegen_1.not(valid), () => { - cxt.reset(); - deleteAdditional(key); - }); - } - else { - applyAdditionalSchema(key, valid); - if (!allErrors) - gen.if(codegen_1.not(valid), () => gen.break()); - } - } - } - function applyAdditionalSchema(key, valid, errors) { - const subschema = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: subschema_1.Type.Str, - }; - if (errors === false) { - Object.assign(subschema, { - compositeRule: true, - createErrors: false, - allErrors: false, - }); - } - cxt.subschema(subschema, valid); - } - }, -}; -exports.default = def; -//# sourceMappingURL=additionalProperties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map deleted file mode 100644 index 18b57048c..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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AE,MAAc;YACnE,MAAM,SAAS,GAAkB;gBAC/B,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,gBAAI,CAAC,GAAG;aACvB,CAAA;YACD,IAAI,MAAM,KAAK,KAAK,EAAE;gBACpB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;oBACvB,aAAa,EAAE,IAAI;oBACnB,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAA;aACH;YACD,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js deleted file mode 100644 index acda3d16b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const def = { - keyword: "allOf", - schemaType: "array", - code(cxt) { - const { gen, schema, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const valid = gen.name("valid"); - schema.forEach((sch, i) => { - if (util_1.alwaysValidSchema(it, sch)) - return; - const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); - cxt.ok(valid); - cxt.mergeEvaluated(schCxt); - }); - }, -}; -exports.default = def; -//# sourceMappingURL=allOf.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map deleted file mode 100644 index 70fb826ee..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"allOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/allOf.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;YAC3C,IAAI,wBAAiB,CAAC,EAAE,EAAE,GAAG,CAAC;gBAAE,OAAM;YACtC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAC,EAAE,KAAK,CAAC,CAAA;YACtE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts deleted file mode 100644 index db3fc0e28..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; -export declare type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js deleted file mode 100644 index 784c475d4..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const def = { - keyword: "anyOf", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, - error: { - message: "should match some schema in anyOf", - }, -}; -exports.default = def; -//# sourceMappingURL=anyOf.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map deleted file mode 100644 index 40f726f4f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anyOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/anyOf.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAIrC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,OAAO,EAAE,mCAAmC;KAC7C;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts deleted file mode 100644 index 7e4e96a0e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type ContainsError = ErrorObject<"contains", { - minContains: number; - maxContains?: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js deleted file mode 100644 index cece62b84..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const subschema_1 = require("../../compile/subschema"); -const util_1 = require("../../compile/util"); -const validate_1 = require("../../compile/validate"); -const error = { - message: ({ params: { min, max } }) => max === undefined - ? codegen_1.str `should contain at least ${min} valid item(s)` - : codegen_1.str `should contain at least ${min} and no more than ${max} valid item(s)`, - params: ({ params: { min, max } }) => max === undefined ? codegen_1._ `{minContains: ${min}}` : codegen_1._ `{minContains: ${min}, maxContains: ${max}}`, -}; -const def = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: true, - error, - code(cxt) { - const { gen, schema, parentSchema, data, it } = cxt; - let min; - let max; - const { minContains, maxContains } = parentSchema; - if (it.opts.next) { - min = minContains === undefined ? 1 : minContains; - max = maxContains; - } - else { - min = 1; - } - const len = gen.const("len", codegen_1._ `${data}.length`); - cxt.setParams({ min, max }); - if (max === undefined && min === 0) { - validate_1.checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); - return; - } - if (max !== undefined && min > max) { - validate_1.checkStrictMode(it, `"minContains" > "maxContains" is always invalid`); - cxt.fail(); - return; - } - if (util_1.alwaysValidSchema(it, schema)) { - let cond = codegen_1._ `${len} >= ${min}`; - if (max !== undefined) - cond = codegen_1._ `${cond} && ${len} <= ${max}`; - cxt.pass(cond); - return; - } - it.items = true; - const valid = gen.name("valid"); - if (max === undefined && min === 1) { - validateItems(valid, () => gen.if(valid, () => gen.break())); - } - else { - gen.let(valid, false); - const schValid = gen.name("_valid"); - const count = gen.let("count", 0); - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); - } - cxt.result(valid, () => cxt.reset()); - function validateItems(_valid, block) { - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword: "contains", - dataProp: i, - dataPropType: subschema_1.Type.Num, - compositeRule: true, - }, _valid); - block(); - }); - } - function checkLimits(count) { - gen.code(codegen_1._ `${count}++`); - if (max === undefined) { - gen.if(codegen_1._ `${count} >= ${min}`, () => gen.assign(valid, true).break()); - } - else { - gen.if(codegen_1._ `${count} > ${max}`, () => gen.assign(valid, false).break()); - if (min === 1) - gen.assign(valid, true); - else - gen.if(codegen_1._ `${count} >= ${min}`, () => gen.assign(valid, true)); - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=contains.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js.map deleted file mode 100644 index 8622f74a2..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/contains.ts"],"names":[],"mappings":";;AAOA,mDAAkD;AAClD,uDAA4C;AAC5C,6CAAoD;AACpD,qDAAsD;AAQtD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC,EAAC,EAAE,EAAE,CAChC,GAAG,KAAK,SAAS;QACf,CAAC,CAAC,aAAG,CAAA,2BAA2B,GAAG,gBAAgB;QACnD,CAAC,CAAC,aAAG,CAAA,2BAA2B,GAAG,qBAAqB,GAAG,gBAAgB;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YACpD,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC9B,GAAG,CAAC,SAAS,CACX;oBACE,OAAO,EAAE,UAAU;oBACnB,QAAQ,EAAE,CAAC;oBACX,YAAY,EAAE,gBAAI,CAAC,GAAG;oBACtB,aAAa,EAAE,IAAI;iBACpB,EACD,MAAM,CACP,CAAA;gBACD,KAAK,EAAE,CAAA;YACT,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,SAAS,WAAW,CAAC,KAAW;YAC9B,GAAG,CAAC,IAAI,CAAC,WAAC,CAAA,GAAG,KAAK,IAAI,CAAC,CAAA;YACvB,IAAI,GAAG,KAAK,SAAS,EAAE;gBACrB,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,GAAG,KAAK,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;aACrE;iBAAM;gBACL,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;gBACpE,IAAI,GAAG,KAAK,CAAC;oBAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;;oBACjC,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,GAAG,KAAK,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;aAClE;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts deleted file mode 100644 index b86db1ade..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types"; -import type KeywordCxt from "../../compile/context"; -export declare type PropertyDependencies = { - [K in string]?: string[]; -}; -export interface DependenciesErrorParams { - property: string; - missingProperty: string; - depsCount: number; - deps: string; -} -export declare type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, { - [K in string]?: string[] | AnySchema; -}>; -export declare const error: KeywordErrorDefinition; -declare const def: CodeKeywordDefinition; -export declare function validatePropertyDeps(cxt: KeywordCxt, propertyDeps?: { - [K in string]?: string[]; -}): void; -export declare function validateSchemaDeps(cxt: KeywordCxt, schemaDeps?: SchemaMap): void; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js deleted file mode 100644 index af1479f1e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -exports.error = { - message: ({ params: { property, depsCount, deps } }) => { - const property_ies = depsCount === 1 ? "property" : "properties"; - return codegen_1.str `should have ${property_ies} ${deps} when property ${property} is present`; - }, - params: ({ params: { property, depsCount, deps, missingProperty } }) => codegen_1._ `{property: ${property}, - missingProperty: ${missingProperty}, - depsCount: ${depsCount}, - deps: ${deps}}`, // TODO change to reference -}; -const def = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: exports.error, - code(cxt) { - const [propDeps, schDeps] = splitDependencies(cxt); - validatePropertyDeps(cxt, propDeps); - validateSchemaDeps(cxt, schDeps); - }, -}; -function splitDependencies({ schema }) { - const propertyDeps = {}; - const schemaDeps = {}; - for (const key in schema) { - if (key === "__proto__") - continue; - const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; - deps[key] = schema[key]; - } - return [propertyDeps, schemaDeps]; -} -function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { - const { gen, data, it } = cxt; - if (Object.keys(propertyDeps).length === 0) - return; - const missing = gen.let("missing"); - for (const prop in propertyDeps) { - const deps = propertyDeps[prop]; - if (deps.length === 0) - continue; - const hasProperty = code_1.propertyInData(gen, data, prop, it.opts.ownProperties); - cxt.setParams({ - property: prop, - depsCount: deps.length, - deps: deps.join(", "), - }); - if (it.allErrors) { - gen.if(hasProperty, () => { - for (const depProp of deps) { - code_1.checkReportMissingProp(cxt, depProp); - } - }); - } - else { - gen.if(codegen_1._ `${hasProperty} && (${code_1.checkMissingProp(cxt, deps, missing)})`); - code_1.reportMissingProp(cxt, missing); - gen.else(); - } - } -} -exports.validatePropertyDeps = validatePropertyDeps; -function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { - const { gen, data, keyword, it } = cxt; - const valid = gen.name("valid"); - for (const prop in schemaDeps) { - if (util_1.alwaysValidSchema(it, schemaDeps[prop])) - continue; - gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties), () => { - const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); - cxt.mergeValidEvaluated(schCxt, valid); - }, () => gen.var(valid, true) // TODO var - ); - cxt.ok(valid); - } -} -exports.validateSchemaDeps = validateSchemaDeps; -exports.default = def; -//# sourceMappingURL=dependencies.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map deleted file mode 100644 index e0896c2b2..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"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AW,QAAQ,uBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;YACtE,wBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;YAC/B,GAAG,CAAC,IAAI,EAAE,CAAA;SACX;KACF;AACH,CAAC;AA5BD,oDA4BC;AAED,SAAgB,kBAAkB,CAAC,GAAe,EAAE,aAAwB,GAAG,CAAC,MAAM;IACpF,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;QAC7B,IAAI,wBAAiB,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAc,CAAC;YAAE,SAAQ;QAClE,GAAG,CAAC,EAAE,CACJ,qBAAc,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EACtD,GAAG,EAAE;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;YAChE,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,WAAW;SACvC,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;KACd;AACH,CAAC;AAfD,gDAeC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js deleted file mode 100644 index 5801980ae..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dependencies_1 = require("./dependencies"); -const def = { - keyword: "dependentSchemas", - type: "object", - schemaType: "object", - code: (cxt) => dependencies_1.validateSchemaDeps(cxt), -}; -exports.default = def; -//# sourceMappingURL=dependentSchemas.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map deleted file mode 100644 index e14007c90..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dependentSchemas.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependentSchemas.ts"],"names":[],"mappings":";;AACA,iDAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,iCAAkB,CAAC,GAAG,CAAC;CACvC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.d.ts deleted file mode 100644 index 3c3e78dd6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type IfKeywordError = ErrorObject<"if", { - failingKeyword: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js deleted file mode 100644 index 79bfee859..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const validate_1 = require("../../compile/validate"); -const error = { - message: ({ params }) => codegen_1.str `should match "${params.ifClause}" schema`, - params: ({ params }) => codegen_1._ `{failingKeyword: ${params.ifClause}}`, -}; -const def = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: true, - error, - code(cxt) { - const { gen, parentSchema, it } = cxt; - if (parentSchema.then === undefined && parentSchema.else === undefined) { - validate_1.checkStrictMode(it, '"if" without "then" and "else" is ignored'); - } - const hasThen = hasSchema(it, "then"); - const hasElse = hasSchema(it, "else"); - if (!hasThen && !hasElse) - return; - const valid = gen.let("valid", true); - const schValid = gen.name("_valid"); - validateIf(); - cxt.reset(); - if (hasThen && hasElse) { - const ifClause = gen.let("ifClause"); - cxt.setParams({ ifClause }); - gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); - } - else if (hasThen) { - gen.if(schValid, validateClause("then")); - } - else { - gen.if(codegen_1.not(schValid), validateClause("else")); - } - cxt.pass(valid, () => cxt.error(true)); - function validateIf() { - const schCxt = cxt.subschema({ - keyword: "if", - compositeRule: true, - createErrors: false, - allErrors: false, - }, schValid); - cxt.mergeEvaluated(schCxt); - } - function validateClause(keyword, ifClause) { - return () => { - const schCxt = cxt.subschema({ keyword }, schValid); - gen.assign(valid, schValid); - cxt.mergeValidEvaluated(schCxt, valid); - if (ifClause) - gen.assign(ifClause, codegen_1._ `${keyword}`); - else - cxt.setParams({ ifClause: keyword }); - }; - } - }, -}; -function hasSchema(it, keyword) { - const schema = it.schema[keyword]; - return schema !== undefined && !util_1.alwaysValidSchema(it, schema); -} -exports.default = def; -//# sourceMappingURL=if.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js.map deleted file mode 100644 index a2dbde77e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/if.ts"],"names":[],"mappings":";;AAQA,mDAAuD;AACvD,6CAAoD;AACpD,qDAAsD;AAItD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,iBAAiB,MAAM,CAAC,QAAQ,UAAU;IACpE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,oBAAoB,MAAM,CAAC,QAAQ,GAAG;CAC9D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,EAAE;YACtE,0BAAe,CAAC,EAAE,EAAE,2CAA2C,CAAC,CAAA;SACjE;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,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V,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAC,EAAE,QAAQ,CAAC,CAAA;gBACjD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;gBAC3B,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;gBACtC,IAAI,QAAQ;oBAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAC,CAAA,GAAG,OAAO,EAAE,CAAC,CAAA;;oBAC5C,GAAG,CAAC,SAAS,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,CAAC,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAS,SAAS,CAAC,EAAgB,EAAE,OAAe;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,MAAM,KAAK,SAAS,IAAI,CAAC,wBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAC/D,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.d.ts deleted file mode 100644 index b08207344..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ErrorNoParams, Vocabulary } from "../../types"; -import { AdditionalItemsError } from "./additionalItems"; -import { ContainsError } from "./contains"; -import { DependenciesError } from "./dependencies"; -import { PropertyNamesError } from "./propertyNames"; -import { AdditionalPropertiesError } from "./additionalProperties"; -import { NotKeywordError } from "./not"; -import { AnyOfError } from "./anyOf"; -import { OneOfError } from "./oneOf"; -import { IfKeywordError } from "./if"; -declare const applicator: Vocabulary; -export default applicator; -export declare type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js deleted file mode 100644 index a4fa17040..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const additionalItems_1 = require("./additionalItems"); -const items_1 = require("./items"); -const contains_1 = require("./contains"); -const dependencies_1 = require("./dependencies"); -const propertyNames_1 = require("./propertyNames"); -const additionalProperties_1 = require("./additionalProperties"); -const properties_1 = require("./properties"); -const patternProperties_1 = require("./patternProperties"); -const not_1 = require("./not"); -const anyOf_1 = require("./anyOf"); -const oneOf_1 = require("./oneOf"); -const allOf_1 = require("./allOf"); -const if_1 = require("./if"); -const thenElse_1 = require("./thenElse"); -const applicator = [ - // any - not_1.default, - anyOf_1.default, - oneOf_1.default, - allOf_1.default, - if_1.default, - thenElse_1.default, - // array - additionalItems_1.default, - items_1.default, - contains_1.default, - // object - propertyNames_1.default, - additionalProperties_1.default, - dependencies_1.default, - properties_1.default, - patternProperties_1.default, -]; -exports.default = applicator; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js.map deleted file mode 100644 index 033420124..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/index.ts"],"names":[],"mappings":";;AACA,uDAAuE;AACvE,mCAA2B;AAC3B,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,MAAM,UAAU,GAAe;IAC7B,MAAM;IACN,aAAU;IACV,eAAK;IACL,eAAK;IACL,eAAK;IACL,YAAS;IACT,kBAAQ;IACR,QAAQ;IACR,yBAAe;IACf,eAAK;IACL,kBAAQ;IACR,SAAS;IACT,uBAAa;IACb,8BAAoB;IACpB,sBAAY;IACZ,oBAAU;IACV,2BAAiB;CAClB,CAAA;AAED,kBAAe,UAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js deleted file mode 100644 index ecc6f1a5c..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const validate_1 = require("../../compile/validate"); -const code_1 = require("../code"); -const def = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt) { - const { gen, schema, it } = cxt; - if (Array.isArray(schema)) { - if (it.opts.unevaluated && schema.length && it.items !== true) { - it.items = util_1.mergeEvaluated.items(gen, schema.length, it.items); - } - validateTuple(schema); - } - else { - it.items = true; - if (util_1.alwaysValidSchema(it, schema)) - return; - cxt.ok(code_1.validateArray(cxt)); - } - function validateTuple(schArr) { - const { parentSchema, data } = cxt; - if (it.opts.strictTuples && !fullTupleSchema(schArr.length, parentSchema)) { - const msg = `"items" is ${schArr.length}-tuple, but minItems or maxItems/additionalItems are not specified or different`; - validate_1.checkStrictMode(it, msg, it.opts.strictTuples); - } - const valid = gen.name("valid"); - const len = gen.const("len", codegen_1._ `${data}.length`); - schArr.forEach((sch, i) => { - if (util_1.alwaysValidSchema(it, sch)) - return; - gen.if(codegen_1._ `${len} > ${i}`, () => cxt.subschema({ - keyword: "items", - schemaProp: i, - dataProp: i, - }, valid)); - cxt.ok(valid); - }); - } - }, -}; -function fullTupleSchema(len, sch) { - return len === sch.minItems && (len === sch.maxItems || sch.additionalItems === false); -} -exports.default = def; -//# sourceMappingURL=items.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js.map deleted file mode 100644 index 89bfdfeea..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,6CAAoE;AACpE,qDAAsD;AACtD,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;IAC1C,MAAM,EAAE,aAAa;IACrB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE;gBAC7D,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAA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AC;IACH,CAAC;CACF,CAAA;AAED,SAAS,eAAe,CAAC,GAAW,EAAE,GAAQ;IAC5C,OAAO,GAAG,KAAK,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,eAAe,KAAK,KAAK,CAAC,CAAA;AACxF,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts deleted file mode 100644 index b8c37cab6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; -export declare type NotKeywordError = ErrorNoParams<"not", AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js deleted file mode 100644 index 6e7f363be..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const def = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: true, - code(cxt) { - const { gen, schema, it } = cxt; - if (util_1.alwaysValidSchema(it, schema)) { - cxt.fail(); - return; - } - const valid = gen.name("valid"); - cxt.subschema({ - keyword: "not", - compositeRule: true, - createErrors: false, - allErrors: false, - }, valid); - cxt.result(valid, () => cxt.error(), () => cxt.reset()); - }, - error: { - message: "should NOT be valid", - }, -}; -exports.default = def; -//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js.map deleted file mode 100644 index f08e193f2..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/not.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAIpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,wBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE;YACjC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;SACP;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CACX;YACE,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB,EACD,KAAK,CACN,CAAA;QAED,GAAG,CAAC,MAAM,CACR,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE;QACL,OAAO,EAAE,qBAAqB;KAC/B;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts deleted file mode 100644 index 01df87ab4..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type OneOfError = ErrorObject<"oneOf", { - passingSchemas: [number, number] | null; -}, AnySchema[]>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js deleted file mode 100644 index 21135cd7e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: "should match exactly one schema in oneOf", - params: ({ params }) => codegen_1._ `{passingSchemas: ${params.passing}}`, -}; -const def = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error, - code(cxt) { - const { gen, schema, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const schArr = schema; - const valid = gen.let("valid", false); - const passing = gen.let("passing", null); - const schValid = gen.name("_valid"); - cxt.setParams({ passing }); - // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas - gen.block(validateOneOf); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); - function validateOneOf() { - schArr.forEach((sch, i) => { - let schCxt; - if (util_1.alwaysValidSchema(it, sch)) { - gen.var(schValid, true); - } - else { - schCxt = cxt.subschema({ - keyword: "oneOf", - schemaProp: i, - compositeRule: true, - }, schValid); - } - if (i > 0) { - gen - .if(codegen_1._ `${schValid} && ${valid}`) - .assign(valid, false) - .assign(passing, codegen_1._ `[${passing}, ${i}]`) - .else(); - } - gen.if(schValid, () => { - gen.assign(valid, true); - gen.assign(passing, i); - if (schCxt) - cxt.mergeEvaluated(schCxt, codegen_1.Name); - }); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=oneOf.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map deleted file mode 100644 index a188a6eb2..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/oneOf.ts"],"names":[],"mappings":";;AAOA,mDAA6C;AAC7C,6CAAoD;AASpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,0CAA0C;IACnD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,oBAAoB,MAAM,CAAC,OAAO,GAAG;CAC7D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,MAAM,GAAgB,MAAM,CAAA;QAClC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;QACxC,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAC,CAAC,CAAA;QACxB,2GAA2G;QAE3G,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAExB,GAAG,CAAC,MAAM,CACR,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAA;QAED,SAAS,aAAa;YACpB,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;gBAC3C,IAAI,MAA6B,CAAA;gBACjC,IAAI,wBAAiB,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE;oBAC9B,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;iBACxB;qBAAM;oBACL,MAAM,GAAG,GAAG,CAAC,SAAS,CACpB;wBACE,OAAO,EAAE,OAAO;wBAChB,UAAU,EAAE,CAAC;wBACb,aAAa,EAAE,IAAI;qBACpB,EACD,QAAQ,CACT,CAAA;iBACF;gBAED,IAAI,CAAC,GAAG,CAAC,EAAE;oBACT,GAAG;yBACA,EAAE,CAAC,WAAC,CAAA,GAAG,QAAQ,OAAO,KAAK,EAAE,CAAC;yBAC9B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;yBACpB,MAAM,CAAC,OAAO,EAAE,WAAC,CAAA,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC;yBACtC,IAAI,EAAE,CAAA;iBACV;gBAED,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACpB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;oBACvB,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;oBACtB,IAAI,MAAM;wBAAE,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,cAAI,CAAC,CAAA;gBAC9C,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js deleted file mode 100644 index 5b188c240..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const subschema_1 = require("../../compile/subschema"); -const validate_1 = require("../../compile/validate"); -const util_1 = require("../../compile/util"); -const def = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen, schema, data, parentSchema, it } = cxt; - const { opts } = it; - const patterns = code_1.schemaProperties(it, schema); - // TODO mark properties matching patterns with always valid schemas as evaluated - if (patterns.length === 0) - return; - const checkProperties = opts.strict && !opts.allowMatchingProperties && parentSchema.properties; - const valid = gen.name("valid"); - if (it.props !== true && !(it.props instanceof codegen_1.Name)) { - it.props = util_1.evaluatedPropsToName(gen, it.props); - } - const { props } = it; - validatePatternProperties(); - function validatePatternProperties() { - for (const pat of patterns) { - if (checkProperties) - checkMatchingProperties(pat); - if (it.allErrors) { - validateProperties(pat); - } - else { - gen.var(valid, true); // TODO var - validateProperties(pat); - gen.if(valid); - } - } - } - function checkMatchingProperties(pat) { - for (const prop in checkProperties) { - if (new RegExp(pat).test(prop)) { - validate_1.checkStrictMode(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); - } - } - } - function validateProperties(pat) { - gen.forIn("key", data, (key) => { - gen.if(codegen_1._ `${code_1.usePattern(gen, pat)}.test(${key})`, () => { - cxt.subschema({ - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: subschema_1.Type.Str, - }, valid); - if (it.opts.unevaluated && props !== true) { - gen.assign(codegen_1._ `${props}[${key}]`, true); - } - else if (!it.allErrors) { - // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) - // or if all properties were evaluated (props === true) - gen.if(codegen_1.not(valid), () => gen.break()); - } - }); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=patternProperties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map deleted file mode 100644 index 9d1342412..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"patternProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/patternProperties.ts"],"names":[],"mappings":";;AAEA,kCAAoD;AACpD,mDAAkD;AAClD,uDAA4C;AAC5C,qDAAsD;AACtD,6CAAuD;AAEvD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,MAAM,QAAQ,GAAG,uBAAgB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC7C,gFAAgF;QAChF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAM;QACjC,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,YAAY,CAAC,UAAU,CAAA;QAC/F,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,cAAI,CAAC,EAAE;YACpD,EAAE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AE,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,KAAK,IAAI,EAAE;wBACzC,GAAG,CAAC,MAAM,CAAC,WAAC,CAAA,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;qBACtC;yBAAM,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE;wBACxB,sFAAsF;wBACtF,uDAAuD;wBACvD,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;qBACtC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js deleted file mode 100644 index 7d127ae72..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const context_1 = require("../../compile/context"); -const code_1 = require("../code"); -const util_1 = require("../../compile/util"); -const additionalProperties_1 = require("./additionalProperties"); -const def = { - keyword: "properties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen, schema, parentSchema, data, it } = cxt; - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { - additionalProperties_1.default.code(new context_1.default(it, additionalProperties_1.default, "additionalProperties")); - } - const allProps = code_1.allSchemaProperties(schema); - for (const prop of allProps) { - it.definedProperties.add(prop); - } - if (it.opts.unevaluated && allProps.length && it.props !== true) { - it.props = util_1.mergeEvaluated.props(gen, util_1.toHash(allProps), it.props); - } - const properties = allProps.filter((p) => !util_1.alwaysValidSchema(it, schema[p])); - if (properties.length === 0) - return; - const valid = gen.name("valid"); - for (const prop of properties) { - if (hasDefault(prop)) { - applyPropertySchema(prop); - } - else { - gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties)); - applyPropertySchema(prop); - if (!it.allErrors) - gen.else().var(valid, true); - gen.endIf(); - } - cxt.it.definedProperties.add(prop); - cxt.ok(valid); - } - function hasDefault(prop) { - return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; - } - function applyPropertySchema(prop) { - cxt.subschema({ - keyword: "properties", - schemaProp: prop, - dataProp: prop, - }, valid); - } - }, -}; -exports.default = def; -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js.map deleted file mode 100644 index a82ec8cbd..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/properties.ts"],"names":[],"mappings":";;AACA,mDAA8C;AAC9C,kCAA2D;AAC3D,6CAA4E;AAC5E,iEAA0C;AAE1C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,KAAK,IAAI,YAAY,CAAC,oBAAoB,KAAK,SAAS,EAA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C9C,GAAG,CAAC,KAAK,EAAE,CAAA;aACZ;YACD,GAAG,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAClC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;SACd;QAED,SAAS,UAAU,CAAC,IAAY;YAC9B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,CAAA;QACvF,CAAC;QAED,SAAS,mBAAmB,CAAC,IAAY;YACvC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI;aACf,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts deleted file mode 100644 index 90f7ad5b2..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type PropertyNamesError = ErrorObject<"propertyNames", { - propertyName: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js deleted file mode 100644 index d38f9a5eb..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params }) => codegen_1.str `property name '${params.propertyName}' is invalid`, - params: ({ params }) => codegen_1._ `{propertyName: ${params.propertyName}}`, -}; -const def = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error, - code(cxt) { - const { gen, schema, data, it } = cxt; - if (util_1.alwaysValidSchema(it, schema)) - return; - const valid = gen.name("valid"); - gen.forIn("key", data, (key) => { - cxt.setParams({ propertyName: key }); - cxt.subschema({ - keyword: "propertyNames", - data: key, - dataTypes: ["string"], - propertyName: key, - compositeRule: true, - }, valid); - gen.if(codegen_1.not(valid), () => { - cxt.error(true); - if (!it.allErrors) - gen.break(); - }); - }); - cxt.ok(valid); - }, -}; -exports.default = def; -//# sourceMappingURL=propertyNames.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map deleted file mode 100644 index b531f0768..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"propertyNames.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/propertyNames.ts"],"names":[],"mappings":";;AAOA,mDAAiD;AACjD,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,kBAAkB,MAAM,CAAC,YAAY,cAAc;IAC7E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,kBAAkB,MAAM,CAAC,YAAY,GAAG;CAChE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,wBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE/B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7B,GAAG,CAAC,SAAS,CAAC,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;YAClC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,eAAe;gBACxB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,IAAI;aACpB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACf,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js deleted file mode 100644 index f5138c081..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const validate_1 = require("../../compile/validate"); -const def = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword, parentSchema, it }) { - if (parentSchema.if === undefined) - validate_1.checkStrictMode(it, `"${keyword}" without "if" is ignored`); - }, -}; -exports.default = def; -//# sourceMappingURL=thenElse.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map deleted file mode 100644 index 16c3eebbe..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"thenElse.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/thenElse.ts"],"names":[],"mappings":";;AAEA,qDAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,EAAE,KAAK,SAAS;YAAE,0BAAe,CAAC,EAAE,EAAE,IAAI,OAAO,2BAA2B,CAAC,CAAA;IAChG,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/code.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/code.d.ts deleted file mode 100644 index 1c5d6f220..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/code.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { SchemaMap } from "../types"; -import type { SchemaCxt } from "../compile"; -import type KeywordCxt from "../compile/context"; -import { CodeGen, Code, Name } from "../compile/codegen"; -export declare function checkReportMissingProp(cxt: KeywordCxt, prop: string): void; -export declare function checkMissingProp({ gen, data, it: { opts } }: KeywordCxt, properties: string[], missing: Name): Code; -export declare function reportMissingProp(cxt: KeywordCxt, missing: Name): void; -export declare function hasPropFunc(gen: CodeGen): Name; -export declare function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code; -export declare function propertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; -export declare function noPropertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; -export declare function allSchemaProperties(schemaMap?: SchemaMap): string[]; -export declare function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[]; -export declare function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }: KeywordCxt, func: Code, context: Code, passSchema?: boolean): Code; -export declare function usePattern(gen: CodeGen, pattern: string): Name; -export declare function validateArray(cxt: KeywordCxt): Name; -export declare function validateUnion(cxt: KeywordCxt): void; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/code.js b/node_modules/table/node_modules/ajv/dist/vocabularies/code.js deleted file mode 100644 index c5021669d..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/code.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; -const codegen_1 = require("../compile/codegen"); -const util_1 = require("../compile/util"); -const subschema_1 = require("../compile/subschema"); -const names_1 = require("../compile/names"); -function checkReportMissingProp(cxt, prop) { - const { gen, data, it } = cxt; - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { - cxt.setParams({ missingProperty: codegen_1._ `${prop}` }, true); - cxt.error(); - }); -} -exports.checkReportMissingProp = checkReportMissingProp; -function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { - return codegen_1.or(...properties.map((prop) => codegen_1.and(noPropertyInData(gen, data, prop, opts.ownProperties), codegen_1._ `${missing} = ${prop}`))); -} -exports.checkMissingProp = checkMissingProp; -function reportMissingProp(cxt, missing) { - cxt.setParams({ missingProperty: missing }, true); - cxt.error(); -} -exports.reportMissingProp = reportMissingProp; -function hasPropFunc(gen) { - return gen.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: codegen_1._ `Object.prototype.hasOwnProperty`, - }); -} -exports.hasPropFunc = hasPropFunc; -function isOwnProperty(gen, data, property) { - return codegen_1._ `${hasPropFunc(gen)}.call(${data}, ${property})`; -} -exports.isOwnProperty = isOwnProperty; -function propertyInData(gen, data, property, ownProperties) { - const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} !== undefined`; - return ownProperties ? codegen_1._ `${cond} && ${isOwnProperty(gen, data, property)}` : cond; -} -exports.propertyInData = propertyInData; -function noPropertyInData(gen, data, property, ownProperties) { - const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} === undefined`; - return ownProperties ? codegen_1.or(cond, codegen_1.not(isOwnProperty(gen, data, property))) : cond; -} -exports.noPropertyInData = noPropertyInData; -function allSchemaProperties(schemaMap) { - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; -} -exports.allSchemaProperties = allSchemaProperties; -function schemaProperties(it, schemaMap) { - return allSchemaProperties(schemaMap).filter((p) => !util_1.alwaysValidSchema(it, schemaMap[p])); -} -exports.schemaProperties = schemaProperties; -function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { - const dataAndSchema = passSchema ? codegen_1._ `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; - const valCxt = [ - [names_1.default.dataPath, codegen_1.strConcat(names_1.default.dataPath, errorPath)], - [names_1.default.parentData, it.parentData], - [names_1.default.parentDataProperty, it.parentDataProperty], - [names_1.default.rootData, names_1.default.rootData], - ]; - if (it.opts.dynamicRef) - valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); - const args = codegen_1._ `${dataAndSchema}, ${gen.object(...valCxt)}`; - return context !== codegen_1.nil ? codegen_1._ `${func}.call(${context}, ${args})` : codegen_1._ `${func}(${args})`; -} -exports.callValidateCode = callValidateCode; -function usePattern(gen, pattern) { - return gen.scopeValue("pattern", { - key: pattern, - ref: new RegExp(pattern, "u"), - code: codegen_1._ `new RegExp(${pattern}, "u")`, - }); -} -exports.usePattern = usePattern; -function validateArray(cxt) { - const { gen, data, keyword, it } = cxt; - const valid = gen.name("valid"); - if (it.allErrors) { - const validArr = gen.let("valid", true); - validateItems(() => gen.assign(validArr, false)); - return validArr; - } - gen.var(valid, true); - validateItems(() => gen.break()); - return valid; - function validateItems(notValid) { - const len = gen.const("len", codegen_1._ `${data}.length`); - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword, - dataProp: i, - dataPropType: subschema_1.Type.Num, - }, valid); - gen.if(codegen_1.not(valid), notValid); - }); - } -} -exports.validateArray = validateArray; -function validateUnion(cxt) { - const { gen, schema, keyword, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const alwaysValid = schema.some((sch) => util_1.alwaysValidSchema(it, sch)); - if (alwaysValid && !it.opts.unevaluated) - return; - const valid = gen.let("valid", false); - const schValid = gen.name("_valid"); - gen.block(() => schema.forEach((_sch, i) => { - const schCxt = cxt.subschema({ - keyword, - schemaProp: i, - compositeRule: true, - }, schValid); - gen.assign(valid, codegen_1._ `${valid} || ${schValid}`); - const merged = cxt.mergeValidEvaluated(schCxt, schValid); - // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) - // or if all properties and items were evaluated (it.props === true && it.items === true) - if (!merged) - gen.if(codegen_1.not(valid)); - })); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); -} -exports.validateUnion = validateUnion; -//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/code.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/code.js.map deleted file mode 100644 index 01d94fc91..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"code.js","sourceRoot":"","sources":["../../lib/vocabularies/code.ts"],"names":[],"mappings":";;;AAGA,gDAAoG;AACpG,0CAAiD;AACjD,oDAAyC;AACzC,4CAAgC;AAEhC,SAAgB,sBAAsB,CAAC,GAAe,EAAE,IAAY;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC3B,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE;QACpE,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,WAAC,CAAA,GAAG,IAAI,EAAE,EAAC,EAAE,IAAI,CAAC,CAAA;QAClD,GAAG,CAAC,KAAK,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAND,wDAMC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EACnC,UAAoB,EACpB,OAAa;IAEb,OAAO,YAAE,CACP,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,aAAG,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,WAAC,CAAA,GAAG,OAAO,MAAM,IAAI,EAAE,CAAC,CACpF,CACF,CAAA;AACH,CAAC;AAVD,4CAUC;AAED,SAAgB,iBAAiB,CAAC,GAAe,EAAE,OAAa;IAC9D,GAAG,CAA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AI;SACpB,EACD,QAAQ,CACT,CAAA;QACD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,WAAC,CAAA,GAAG,KAAK,OAAO,QAAQ,EAAE,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACxD,+FAA+F;QAC/F,yFAAyF;QACzF,IAAI,CAAC,MAAM;YAAE,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,CAAC,CAAA;IACjC,CAAC,CAAC,CACH,CAAA;IAED,GAAG,CAAC,MAAM,CACR,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAA;AACH,CAAC;AAjCD,sCAiCC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js b/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js deleted file mode 100644 index 313598aab..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const def = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - }, -}; -exports.default = def; -//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js.map deleted file mode 100644 index 4eb27eb33..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/id.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.d.ts deleted file mode 100644 index f2e34ee36..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const core: Vocabulary; -export default core; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js deleted file mode 100644 index 87656d743..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const id_1 = require("./id"); -const ref_1 = require("./ref"); -const core = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - id_1.default, - ref_1.default, -]; -exports.default = core; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js.map deleted file mode 100644 index 5bf65f941..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/index.ts"],"names":[],"mappings":";;AACA,6BAA4B;AAC5B,+BAA8B;AAE9B,MAAM,IAAI,GAAe;IACvB,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,EAAC,OAAO,EAAE,UAAU,EAAC;IACrB,aAAa;IACb,YAAS;IACT,aAAU;CACX,CAAA;AAED,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.d.ts deleted file mode 100644 index 617cef9cb..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type KeywordCxt from "../../compile/context"; -import { Code } from "../../compile/codegen"; -import { SchemaEnv } from "../../compile"; -declare const def: CodeKeywordDefinition; -export declare function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code; -export declare function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js b/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js deleted file mode 100644 index 10e68389d..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.callRef = exports.getValidate = void 0; -const error_classes_1 = require("../../compile/error_classes"); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const compile_1 = require("../../compile"); -const util_1 = require("../../compile/util"); -const def = { - keyword: "$ref", - schemaType: "string", - code(cxt) { - const { gen, schema, it } = cxt; - const { baseId, schemaEnv: env, validateName, opts, self } = it; - // TODO See comment in dynamicRef.ts - // This has to be improved to resolve #815. - if (schema === "#" || schema === "#/") - return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self, env.root, baseId, schema); - if (schOrEnv === undefined) - throw new error_classes_1.MissingRefError(baseId, schema); - if (schOrEnv instanceof compile_1.SchemaEnv) - return callValidate(schOrEnv); - return inlineRefSchema(schOrEnv); - function callRootRef() { - if (env === env.root) - return callRef(cxt, validateName, env, env.$async); - const rootName = gen.scopeValue("root", { ref: env.root }); - return callRef(cxt, codegen_1._ `${rootName}.validate`, env.root, env.root.$async); - } - function callValidate(sch) { - const v = getValidate(cxt, sch); - callRef(cxt, v, sch, sch.$async); - } - function inlineRefSchema(sch) { - const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: codegen_1.stringify(sch) } : { ref: sch }); - const valid = gen.name("valid"); - const schCxt = cxt.subschema({ - schema: sch, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: schema, - }, valid); - cxt.mergeEvaluated(schCxt); - cxt.ok(valid); - } - }, -}; -function getValidate(cxt, sch) { - const { gen } = cxt; - return sch.validate - ? gen.scopeValue("validate", { ref: sch.validate }) - : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.validate`; -} -exports.getValidate = getValidate; -function callRef(cxt, v, sch, $async) { - const { gen, it } = cxt; - const { allErrors, schemaEnv: env, opts } = it; - const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; - if ($async) - callAsyncRef(); - else - callSyncRef(); - function callAsyncRef() { - if (!env.$async) - throw new Error("async schema referenced by sync schema"); - const valid = gen.let("valid"); - gen.try(() => { - gen.code(codegen_1._ `await ${code_1.callValidateCode(cxt, v, passCxt)}`); - addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result - if (!allErrors) - gen.assign(valid, true); - }, (e) => { - gen.if(codegen_1._ `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); - addErrorsFrom(e); - if (!allErrors) - gen.assign(valid, false); - }); - cxt.ok(valid); - } - function callSyncRef() { - cxt.result(code_1.callValidateCode(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); - } - function addErrorsFrom(source) { - const errs = codegen_1._ `${source}.errors`; - gen.assign(names_1.default.vErrors, codegen_1._ `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged - gen.assign(names_1.default.errors, codegen_1._ `${names_1.default.vErrors}.length`); - } - function addEvaluatedFrom(source) { - var _a; - if (!it.opts.unevaluated) - return; - const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; - // TODO refactor - if (it.props !== true) { - if (schEvaluated && !schEvaluated.dynamicProps) { - if (schEvaluated.props !== undefined) { - it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); - } - } - else { - const props = gen.var("props", codegen_1._ `${source}.evaluated.props`); - it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); - } - } - if (it.items !== true) { - if (schEvaluated && !schEvaluated.dynamicItems) { - if (schEvaluated.items !== undefined) { - it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); - } - } - else { - const items = gen.var("items", codegen_1._ `${source}.evaluated.items`); - it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); - } - } - } -} -exports.callRef = callRef; -exports.default = def; -//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js.map deleted file mode 100644 index 29792164c..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/ref.ts"],"names":[],"mappings":";;;AAEA,+DAA2D;AAC3D,kCAAwC;AACxC,mDAAmE;AACnE,+CAAmC;AACnC,2CAAmD;AACnD,6CAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7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,CAAC,KAAK,KAAK,SAAS,EAAE;oBACpC,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;iBACnE;aACF;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,WAAC,CAAA,GAAG,MAAM,kBAAkB,CAAC,CAAA;gBAC5D,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,cAAI,CAAC,CAAA;aAC5D;SACF;IACH,CAAC;AACH,CAAC;AAhED,0BAgEC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.d.ts deleted file mode 100644 index 469fb8444..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -declare const draft7Vocabularies: Vocabulary[]; -export default draft7Vocabularies; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js b/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js deleted file mode 100644 index a9755d2fb..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("./core"); -const validation_1 = require("./validation"); -const applicator_1 = require("./applicator"); -const format_1 = require("./format"); -const metadata_1 = require("./metadata"); -const draft7Vocabularies = [ - core_1.default, - validation_1.default, - applicator_1.default, - format_1.default, - metadata_1.metadataVocabulary, - metadata_1.contentVocabulary, -]; -exports.default = draft7Vocabularies; -//# sourceMappingURL=draft7.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js.map deleted file mode 100644 index 5539b8b95..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"draft7.js","sourceRoot":"","sources":["../../lib/vocabularies/draft7.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAA+C;AAC/C,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,oBAAoB;IACpB,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts deleted file mode 100644 index 263284ebb..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type KeywordCxt from "../../compile/context"; -declare const def: CodeKeywordDefinition; -export declare function dynamicAnchor(cxt: KeywordCxt, anchor: string): void; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js deleted file mode 100644 index 8beea65ce..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.dynamicAnchor = void 0; -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const compile_1 = require("../../compile"); -const ref_1 = require("../core/ref"); -const def = { - keyword: "$dynamicAnchor", - schemaType: "string", - code: (cxt) => dynamicAnchor(cxt, cxt.schema), -}; -function dynamicAnchor(cxt, anchor) { - const { gen, it } = cxt; - it.schemaEnv.root.dynamicAnchors[anchor] = true; - const v = codegen_1._ `${names_1.default.dynamicAnchors}${codegen_1.getProperty(anchor)}`; - const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt); - gen.if(codegen_1._ `!${v}`, () => gen.assign(v, validate)); -} -exports.dynamicAnchor = dynamicAnchor; -function _getValidate(cxt) { - const { schemaEnv, schema, self } = cxt.it; - const { root, baseId, localRefs, meta } = schemaEnv.root; - const sch = new compile_1.SchemaEnv({ schema, root, baseId, localRefs, meta }); - compile_1.compileSchema.call(self, sch); - return ref_1.getValidate(cxt, sch); -} -exports.default = def; -//# sourceMappingURL=dynamicAnchor.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map deleted file mode 100644 index 27190e8b6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicAnchor.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,+CAAmC;AACnC,2CAAsD;AACtD,qCAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC9C,CAAA;AAED,SAAgB,aAAa,CAAC,GAAe,EAAE,MAAc;IAC3D,MAAM,EAAC,GAAG,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACrB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAC/C,MAAM,CAAC,GAAG,WAAC,CAAA,GAAG,eAAC,CAAC,cAAc,GAAG,qBAAW,CAAC,MAAM,CAAC,EAAE,CAAA;IACtD,MAAM,QAAQ,GAAG,EAAE,CAAC,aAAa,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC/E,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;AACjD,CAAC;AAND,sCAMC;AAED,SAAS,YAAY,CAAC,GAAe;IACnC,MAAM,EAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAC,GAAG,GAAG,CAAC,EAAE,CAAA;IACxC,MAAM,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,SAAS,CAAC,IAAI,CAAA;IACtD,MAAM,GAAG,GAAG,IAAI,mBAAS,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;IAClE,uBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7B,OAAO,iBAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts deleted file mode 100644 index f42238004..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type KeywordCxt from "../../compile/context"; -declare const def: CodeKeywordDefinition; -export declare function dynamicRef(cxt: KeywordCxt, ref: string): void; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js deleted file mode 100644 index 6e67b1cc9..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.dynamicRef = void 0; -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const ref_1 = require("../core/ref"); -const def = { - keyword: "$dynamicRef", - schemaType: "string", - code: (cxt) => dynamicRef(cxt, cxt.schema), -}; -function dynamicRef(cxt, ref) { - const { gen, keyword, it } = cxt; - if (ref[0] !== "#") - throw new Error(`"${keyword}" only supports hash fragment reference`); - const anchor = ref.slice(1); - if (it.allErrors) { - _dynamicRef(); - } - else { - const valid = gen.let("valid", false); - _dynamicRef(valid); - cxt.ok(valid); - } - function _dynamicRef(valid) { - // TODO the assumption here is that `recursiveRef: #` always points to the root - // of the schema object, which is not correct, because there may be $id that - // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. - // Because of that 2 tests in recursiveRef.json fail. - // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). - // (This problem is not tested in JSON-Schema-Test-Suite) - if (it.schemaEnv.root.dynamicAnchors[anchor]) { - const v = gen.let("_v", codegen_1._ `${names_1.default.dynamicAnchors}${codegen_1.getProperty(anchor)}`); - gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)); - } - else { - _callRef(it.validateName, valid)(); - } - } - function _callRef(validate, valid) { - return valid - ? () => gen.block(() => { - ref_1.callRef(cxt, validate); - gen.let(valid, true); - }) - : () => ref_1.callRef(cxt, validate); - } -} -exports.dynamicRef = dynamicRef; -exports.default = def; -//# sourceMappingURL=dynamicRef.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map deleted file mode 100644 index 25ad7a6af..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicRef.ts"],"names":[],"mappings":";;;AAEA,mDAAgE;AAChE,+CAAmC;AACnC,qCAAmC;AAEnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,SAAgB,UAAU,CAAC,GAAe,EAAE,GAAW;IACrD,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,yCAAyC,CAAC,CAAA;IACzF,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,IAAI,EAAE,CAAC,SAAS,EAAE;QAChB,WAAW,EAAE,CAAA;KACd;SAAM;QACL,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACrC,WAAW,CAAC,KAAK,CAAC,CAAA;QAClB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;KACd;IAED,SAAS,WAAW,CAAC,KAAY;QAC/B,+EAA+E;QAC/E,4EAA4E;QAC5E,sFAAsF;QACtF,qDAAqD;QACrD,kGAAkG;QAClG,yDAAyD;QACzD,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;YAC5C,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,WAAC,CAAA,GAAG,eAAC,CAAC,cAAc,GAAG,qBAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YACrE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;SAChE;aAAM;YACL,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;SACnC;IACH,CAAC;IAED,SAAS,QAAQ,CAAC,QAAc,EAAE,KAAY;QAC5C,OAAO,KAAK;YACV,CAAC,CAAC,GAAG,EAAE,CACH,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;gBACb,aAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;gBACtB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACtB,CAAC,CAAC;YACN,CAAC,CAAC,GAAG,EAAE,CAAC,aAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAClC,CAAC;AACH,CAAC;AApCD,gCAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts deleted file mode 100644 index 0c751d93f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const dynamic: Vocabulary; -export default dynamic; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js deleted file mode 100644 index f2388a757..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dynamicAnchor_1 = require("./dynamicAnchor"); -const dynamicRef_1 = require("./dynamicRef"); -const recursiveAnchor_1 = require("./recursiveAnchor"); -const recursiveRef_1 = require("./recursiveRef"); -const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default]; -exports.default = dynamic; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js.map deleted file mode 100644 index f96ba76dd..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/index.ts"],"names":[],"mappings":";;AACA,mDAA2C;AAC3C,6CAAqC;AACrC,uDAA+C;AAC/C,iDAAyC;AAEzC,MAAM,OAAO,GAAe,CAAC,uBAAa,EAAE,oBAAU,EAAE,yBAAe,EAAE,sBAAY,CAAC,CAAA;AAEtF,kBAAe,OAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js deleted file mode 100644 index 3e0bb6146..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dynamicAnchor_1 = require("./dynamicAnchor"); -const validate_1 = require("../../compile/validate"); -const def = { - keyword: "$recursiveAnchor", - schemaType: "boolean", - code(cxt) { - if (cxt.schema) - dynamicAnchor_1.dynamicAnchor(cxt, ""); - else - validate_1.checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored"); - }, -}; -exports.default = def; -//# sourceMappingURL=recursiveAnchor.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map deleted file mode 100644 index dbba0940b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recursiveAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveAnchor.ts"],"names":[],"mappings":";;AACA,mDAA6C;AAC7C,qDAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,6BAAa,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,0BAAe,CAAC,GAAG,CAAC,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js deleted file mode 100644 index f421c4cbe..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dynamicRef_1 = require("./dynamicRef"); -const def = { - keyword: "$recursiveRef", - schemaType: "string", - code: (cxt) => dynamicRef_1.dynamicRef(cxt, cxt.schema), -}; -exports.default = def; -//# sourceMappingURL=recursiveRef.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map deleted file mode 100644 index da36878d4..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recursiveRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveRef.ts"],"names":[],"mappings":";;AACA,6CAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts deleted file mode 100644 index 7570ca81b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TypeError } from "../compile/validate/dataType"; -import type { ApplicatorKeywordError } from "./applicator"; -import type { ValidationKeywordError } from "./validation"; -import type { FormatError } from "./format/format"; -import type { UnevaluatedPropertiesError } from "./unevaluated/unevaluatedProperties"; -import type { UnevaluatedItemsError } from "./unevaluated/unevaluatedItems"; -import type { DependentRequiredError } from "./validation/dependentRequired"; -export declare type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js.map deleted file mode 100644 index 56bad7362..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/vocabularies/errors.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.d.ts deleted file mode 100644 index 855d0a2a1..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type FormatError = ErrorObject<"format", { - format: string; -}, string | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js b/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js deleted file mode 100644 index 69c6d2a9b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => codegen_1.str `should match format "${schemaCode}"`, - params: ({ schemaCode }) => codegen_1._ `{format: ${schemaCode}}`, -}; -const def = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: true, - error, - code(cxt, ruleType) { - const { gen, data, $data, schema, schemaCode, it } = cxt; - const { opts, errSchemaPath, schemaEnv, self } = it; - if (!opts.validateFormats) - return; - if ($data) - validate$DataFormat(); - else - validateFormat(); - function validate$DataFormat() { - const fmts = gen.scopeValue("formats", { - ref: self.formats, - code: opts.code.formats, - }); - const fDef = gen.const("fDef", codegen_1._ `${fmts}[${schemaCode}]`); - const fType = gen.let("fType"); - const format = gen.let("format"); - // TODO simplify - gen.if(codegen_1._ `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, codegen_1._ `${fDef}.type || "string"`).assign(format, codegen_1._ `${fDef}.validate`), () => gen.assign(fType, codegen_1._ `"string"`).assign(format, fDef)); - cxt.fail$data(codegen_1.or(unknownFmt(), invalidFmt())); - function unknownFmt() { - if (opts.strict === false) - return codegen_1.nil; - return codegen_1._ `${schemaCode} && !${format}`; - } - function invalidFmt() { - const callFormat = schemaEnv.$async - ? codegen_1._ `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` - : codegen_1._ `${format}(${data})`; - const validData = codegen_1._ `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; - return codegen_1._ `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; - } - } - function validateFormat() { - const formatDef = self.formats[schema]; - if (!formatDef) { - unknownFormat(); - return; - } - if (formatDef === true) - return; - const [fmtType, format, fmtRef] = getFormat(formatDef); - if (fmtType === ruleType) - cxt.pass(validCondition()); - function unknownFormat() { - if (opts.strict === false) { - self.logger.warn(unknownMsg()); - return; - } - throw new Error(unknownMsg()); - function unknownMsg() { - return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; - } - } - function getFormat(fmtDef) { - const fmt = gen.scopeValue("formats", { - key: schema, - ref: fmtDef, - code: opts.code.formats ? codegen_1._ `${opts.code.formats}${codegen_1.getProperty(schema)}` : undefined, - }); - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, codegen_1._ `${fmt}.validate`]; - } - return ["string", fmtDef, fmt]; - } - function validCondition() { - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { - if (!schemaEnv.$async) - throw new Error("async format in sync schema"); - return codegen_1._ `await ${fmtRef}(${data})`; - } - return typeof format == "function" ? codegen_1._ `${fmtRef}(${data})` : codegen_1._ `${fmtRef}.test(${data})`; - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js.map deleted file mode 100644 index b8a1e7bb1..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/format.ts"],"names":[],"mappings":";;AASA,mDAAwE;AAaxE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,wBAAwB,UAAU,GAAG;IACnE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,YAAY,UAAU,GAAG;CACrD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe,EAAE,QAAiB;QACrC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QACjD,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAM;QAEjC,IAAI,KAAK;YAAE,mBAAmB,EAAE,CAAA;;YAC3B,cAAc,EAAE,CAAA;QAErB,SAAS,mBAAmB;YAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC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AC,SAAS;iBACpF,CAAC,CAAA;gBACF,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,CAAC,MAAM,YAAY,MAAM,CAAC,EAAE;oBAC5D,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAC,CAAA,GAAG,GAAG,WAAW,CAAC,CAAA;iBACtE;gBAED,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;YAChC,CAAC;YAED,SAAS,cAAc;gBACrB,IAAI,OAAO,SAAS,IAAI,QAAQ,IAAI,CAAC,CAAC,SAAS,YAAY,MAAM,CAAC,IAAI,SAAS,CAAC,KAAK,EAAE;oBACrF,IAAI,CAAC,SAAS,CAAC,MAAM;wBAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;oBACrE,OAAO,WAAC,CAAA,SAAS,MAAM,IAAI,IAAI,GAAG,CAAA;iBACnC;gBACD,OAAO,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,WAAC,CAAA,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,WAAC,CAAA,GAAG,MAAM,SAAS,IAAI,GAAG,CAAA;YACzF,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.d.ts deleted file mode 100644 index c8019c9d6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const format: Vocabulary; -export default format; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js deleted file mode 100644 index d19023d24..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const format_1 = require("./format"); -const format = [format_1.default]; -exports.default = format; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js.map deleted file mode 100644 index 6315bfe1f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js deleted file mode 100644 index ca5d4d0ad..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const def = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - code(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, schema, parentSchema } = cxt; - const [valid, cond] = nullable_1.checkNullableObject(cxt, data); - gen.if(cond, () => { - const tag = gen.const("tag", codegen_1._ `${data}${codegen_1.getProperty(schema)}`); - gen.if(codegen_1._ `typeof ${tag} == "string"`, () => { - gen.if(false); - for (const tagValue in parentSchema.mapping) { - gen.elseIf(codegen_1._ `${tag} === ${tagValue}`); - gen.assign(valid, applyTagSchema(tagValue)); - } - gen.endIf(); - }); - }); - cxt.pass(valid); - function applyTagSchema(schemaProp) { - const _valid = gen.name("valid"); - cxt.subschema({ - keyword: "mapping", - schemaProp, - jtdDiscriminator: schema, - }, _valid); - return _valid; - } - }, -}; -exports.default = def; -//# sourceMappingURL=discriminator.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map deleted file mode 100644 index 99021c24a..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"discriminator.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/discriminator.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,yCAAwC;AACxC,yCAA8C;AAE9C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,GAAe;QAClB,wBAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAC,GAAG,GAAG,CAAA;QAC7C,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,8BAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QAEpD,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE;YAChB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,WAAC,CAAA,GAAG,IAAI,GAAG,qBAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YAC9D,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,UAAU,GAAG,cAAc,EAAE,GAAG,EAAE;gBACxC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;gBACb,KAAK,MAAM,QAAQ,IAAI,YAAY,CAAC,OAAO,EAAE;oBAC3C,GAAG,CAAC,MAAM,CAAC,WAAC,CAAA,GAAG,GAAG,QAAQ,QAAQ,EAAE,CAAC,CAAA;oBACrC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAA;iBAC5C;gBACD,GAAG,CAAC,KAAK,EAAE,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEf,SAAS,cAAc,CAAC,UAAkB;YACxC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,SAAS;gBAClB,UAAU;gBACV,gBAAgB,EAAE,MAAM;aACzB,EACD,MAAM,CACP,CAAA;YACD,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js deleted file mode 100644 index 77a46ca11..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const def = { - keyword: "elements", - schemaType: "object", - code(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, schema, it } = cxt; - if (util_1.alwaysValidSchema(it, schema)) - return; - const [valid, cond] = nullable_1.checkNullable(cxt, codegen_1.nil); - gen.if(codegen_1.and(cond, codegen_1._ `Array.isArray(${data})`), () => gen.assign(valid, code_1.validateArray(cxt))); - cxt.pass(valid); - }, -}; -exports.default = def; -//# sourceMappingURL=elements.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js.map deleted file mode 100644 index f355b8471..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/elements.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AACpD,kCAAqC;AACrC,mDAAiD;AACjD,yCAAwC;AACxC,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,wBAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,wBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,wBAAa,CAAC,GAAG,EAAE,aAAG,CAAC,CAAA;QAC7C,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,IAAI,EAAE,WAAC,CAAA,iBAAiB,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,oBAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACzF,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js deleted file mode 100644 index 299590904..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const def = { - keyword: "enum", - schemaType: "array", - code(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, schema, schemaValue, parentSchema, it } = cxt; - if (schema.length === 0) - throw new Error("enum must have non-empty array"); - if (schema.length !== new Set(schema).size) - throw new Error("enum items must be unique"); - let valid; - if (schema.length >= it.opts.loopEnum) { - if (parentSchema.nullable) { - valid = gen.let("valid", codegen_1._ `${data} === null`); - gen.if(codegen_1.not(valid), loopEnum); - } - else { - valid = gen.let("valid", false); - loopEnum(); - } - } - else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - valid = codegen_1.or(...schema.map((value) => codegen_1._ `${data} === ${value}`)); - if (parentSchema.nullable) - valid = codegen_1.or(codegen_1._ `${data} === null`, valid); - } - cxt.pass(valid); - function loopEnum() { - gen.forOf("v", schemaValue, (v) => gen.if(codegen_1._ `${valid} = ${data} === ${v}`, () => gen.break())); - } - }, -}; -exports.default = def; -//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js.map deleted file mode 100644 index 1c9b018a5..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/enum.ts"],"names":[],"mappings":";;AAEA,mDAAsD;AACtD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,wBAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QAC1E,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;QACxF,IAAI,KAAW,CAAA;QACf,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;YACrC,IAAI,YAAY,CAAC,QAAQ,EAAE;gBACzB,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,WAAC,CAAA,GAAG,IAAI,WAAW,CAAC,CAAA;gBAC7C,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAA;aAC7B;iBAAM;gBACL,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;gBAC/B,QAAQ,EAAE,CAAA;aACX;SACF;aAAM;YACL,wBAAwB;YACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;YACvE,KAAK,GAAG,YAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,WAAC,CAAA,GAAG,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAA;YACrE,IAAI,YAAY,CAAC,QAAQ;gBAAE,KAAK,GAAG,YAAE,CAAC,WAAC,CAAA,GAAG,IAAI,WAAW,EAAE,KAAK,CAAC,CAAA;SAClE;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEf,SAAS,QAAQ;YACf,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,WAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACxC,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,GAAG,KAAK,MAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAC1D,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts deleted file mode 100644 index db7b966cc..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const jtdVocabulary: Vocabulary; -export default jtdVocabulary; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js deleted file mode 100644 index f0ba74daf..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// import definitions from "./definitions" -const ref_1 = require("./ref"); -const type_1 = require("./type"); -const enum_1 = require("./enum"); -const elements_1 = require("./elements"); -const properties_1 = require("./properties"); -const optionalProperties_1 = require("./optionalProperties"); -const discriminator_1 = require("./discriminator"); -const values_1 = require("./values"); -const union_1 = require("./union"); -const metadata_1 = require("./metadata"); -const jtdVocabulary = [ - "definitions", - ref_1.default, - type_1.default, - enum_1.default, - elements_1.default, - properties_1.default, - optionalProperties_1.default, - discriminator_1.default, - values_1.default, - union_1.default, - metadata_1.default, - { keyword: "additionalProperties", schemaType: "boolean" }, - { keyword: "nullable", schemaType: "boolean" }, -]; -exports.default = jtdVocabulary; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js.map deleted file mode 100644 index baa9e9cbc..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/index.ts"],"names":[],"mappings":";;AACA,0CAA0C;AAC1C,+BAA8B;AAC9B,iCAAgC;AAChC,iCAAgC;AAChC,yCAAiC;AACjC,6CAAqC;AACrC,6DAAqD;AACrD,mDAA2C;AAC3C,qCAA6B;AAC7B,mCAA2B;AAC3B,yCAAiC;AAEjC,MAAM,aAAa,GAAe;IAChC,aAAa;IACb,aAAU;IACV,cAAW;IACX,cAAW;IACX,kBAAQ;IACR,oBAAU;IACV,4BAAkB;IAClB,uBAAa;IACb,gBAAM;IACN,eAAK;IACL,kBAAQ;IACR,EAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAC;IACxD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;CAC7C,CAAA;AAED,kBAAe,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts deleted file mode 100644 index 86e15a8ed..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { KeywordCxt } from "../../ajv"; -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export declare function checkMetadata({ it, keyword }: KeywordCxt, metadata?: boolean): void; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js deleted file mode 100644 index acd00ffca..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkMetadata = void 0; -const util_1 = require("../../compile/util"); -const def = { - keyword: "metadata", - schemaType: "object", - code(cxt) { - checkMetadata(cxt); - const { gen, schema, it } = cxt; - if (util_1.alwaysValidSchema(it, schema)) - return; - const valid = gen.name("valid"); - cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid); - cxt.ok(valid); - }, -}; -function checkMetadata({ it, keyword }, metadata) { - if (it.jtdMetadata !== metadata) { - throw new Error(`JTD: "${keyword}" cannot be used in this schema location`); - } -} -exports.checkMetadata = checkMetadata; -exports.default = def; -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map deleted file mode 100644 index e1c84d94e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/metadata.ts"],"names":[],"mappings":";;;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,wBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;QAC9D,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAAC,EAAC,EAAE,EAAE,OAAO,EAAa,EAAE,QAAkB;IACzE,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;KAC5E;AACH,CAAC;AAJD,sCAIC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts deleted file mode 100644 index dfeaa37c4..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type KeywordCxt from "../../compile/context"; -import { Code, Name } from "../../compile/codegen"; -export declare function checkNullable({ gen, data, parentSchema }: KeywordCxt, cond: Code): [Name, Code]; -export declare function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code]; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js deleted file mode 100644 index ee2e6935e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkNullableObject = exports.checkNullable = void 0; -const codegen_1 = require("../../compile/codegen"); -function checkNullable({ gen, data, parentSchema }, cond) { - const valid = gen.name("valid"); - if (parentSchema.nullable) { - gen.let(valid, codegen_1._ `${data} === null`); - cond = codegen_1.not(valid); - } - else { - gen.let(valid, false); - } - return [valid, cond]; -} -exports.checkNullable = checkNullable; -function checkNullableObject(cxt, cond) { - const [valid, cond_] = checkNullable(cxt, cond); - return [valid, codegen_1._ `${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`]; -} -exports.checkNullableObject = checkNullableObject; -//# sourceMappingURL=nullable.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map deleted file mode 100644 index 3f41ab68f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/nullable.ts"],"names":[],"mappings":";;;AACA,mDAAwD;AAExD,SAAgB,aAAa,CAAC,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EAAE,IAAU;IAC7E,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE;QACzB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,WAAC,CAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,CAAA;KAClB;SAAM;QACL,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;KACtB;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AATD,sCASC;AAED,SAAgB,mBAAmB,CAAC,GAAe,EAAE,IAAU;IAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,KAAK,EAAE,WAAC,CAAA,GAAG,KAAK,cAAc,GAAG,CAAC,IAAI,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAA;AAC9F,CAAC;AAHD,kDAGC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js deleted file mode 100644 index c9058251d..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const properties_1 = require("./properties"); -const def = { - keyword: "optionalProperties", - schemaType: "object", - code(cxt) { - if (cxt.parentSchema.properties) - return; - properties_1.validateProperties(cxt); - }, -}; -exports.default = def; -//# sourceMappingURL=optionalProperties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map deleted file mode 100644 index 00ce7a498..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/optionalProperties.ts"],"names":[],"mappings":";;AAEA,6CAA+C;AAE/C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,IAAI,GAAG,CAAC,YAAY,CAAC,UAAU;YAAE,OAAM;QACvC,+BAAkB,CAAC,GAAG,CAAC,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts deleted file mode 100644 index 4eb355856..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type KeywordCxt from "../../compile/context"; -declare const def: CodeKeywordDefinition; -export declare function validateProperties(cxt: KeywordCxt): void; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js deleted file mode 100644 index fe3f17087..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateProperties = void 0; -const code_1 = require("../code"); -const util_1 = require("../../compile/util"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const def = { - keyword: "properties", - schemaType: "object", - code: validateProperties, -}; -function validateProperties(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, parentSchema, it } = cxt; - const { additionalProperties, nullable } = parentSchema; - if (it.jtdDiscriminator && nullable) - throw new Error("JTD: nullable inside discriminator mapping"); - if (commonProperties()) { - throw new Error("JTD: properties and optionalProperties have common members"); - } - const [allProps, properties] = schemaProperties("properties"); - const [allOptProps, optProperties] = schemaProperties("optionalProperties"); - if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { - return; - } - const [valid, cond] = it.jtdDiscriminator === undefined - ? nullable_1.checkNullableObject(cxt, data) - : [gen.let("valid", false), true]; - gen.if(cond, () => gen.assign(valid, true).block(() => { - validateProps(properties, "properties", true); - validateProps(optProperties, "optionalProperties"); - if (!additionalProperties) - validateAdditional(); - })); - cxt.pass(valid); - function commonProperties() { - const props = parentSchema.properties; - const optProps = parentSchema.optionalProperties; - if (!(props && optProps)) - return false; - for (const p in props) { - if (Object.prototype.hasOwnProperty.call(optProps, p)) - return true; - } - return false; - } - function schemaProperties(keyword) { - const schema = parentSchema[keyword]; - const allPs = schema ? code_1.allSchemaProperties(schema) : []; - if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { - throw new Error(`JTD: discriminator tag used in ${keyword}`); - } - const ps = allPs.filter((p) => !util_1.alwaysValidSchema(it, schema[p])); - return [allPs, ps]; - } - function validateProps(props, keyword, required) { - const _valid = gen.var("valid"); - for (const prop of props) { - gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), missingProperty); - cxt.ok(_valid); - } - function missingProperty() { - if (required) { - gen.assign(_valid, false); - cxt.error(); - } - else { - gen.assign(_valid, true); - } - } - } - function applyPropertySchema(prop, keyword, _valid) { - cxt.subschema({ - keyword, - schemaProp: prop, - dataProp: prop, - }, _valid); - } - function validateAdditional() { - gen.forIn("key", data, (key) => { - const _allProps = it.jtdDiscriminator === undefined ? allProps : [it.jtdDiscriminator].concat(allProps); - const addProp = isAdditional(key, _allProps, "properties"); - const addOptProp = isAdditional(key, allOptProps, "optionalProperties"); - const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : codegen_1.and(addProp, addOptProp); - gen.if(extra, () => { - if (it.opts.removeAdditional) { - gen.code(codegen_1._ `delete ${data}[${key}]`); - } - else { - // cxt.setParams({additionalProperty: key}) - cxt.error(); - if (!it.opts.allErrors) - gen.break(); - } - }); - }); - } - function isAdditional(key, props, keyword) { - let additional; - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = util_1.schemaRefOrVal(it, parentSchema[keyword], keyword); - additional = codegen_1.not(code_1.isOwnProperty(gen, propsSchema, key)); - } - else if (props.length) { - additional = codegen_1.and(...props.map((p) => codegen_1._ `${key} !== ${p}`)); - } - else { - additional = true; - } - return additional; - } -} -exports.validateProperties = validateProperties; -exports.default = def; -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js.map deleted file mode 100644 index 5d3242427..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAEA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAE9C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,kBAAkB;CACzB,CAAA;AAED,SAAgB,kBAAkB,CAAC,GAAe;IAChD,wBAAa,CAAC,GAAG,CAAC,CAAA;IAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACzC,MAAM,EAAC,oBAAoB,EAAE,QAAQ,EAAC,GAAG,YAAY,CAAA;IACrD,IAAI,EAAE,CAAC,gBAAgB,IAAI,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,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K,EAAE,CAAA;oBACX,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS;wBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;iBACpC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,YAAY,CAAC,GAAS,EAAE,KAAe,EAAE,OAAe;QAC/D,IAAI,UAA0B,CAAA;QAC9B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,gDAAgD;YAChD,MAAM,WAAW,GAAG,qBAAc,CAAC,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;YACtE,UAAU,GAAG,aAAG,CAAC,oBAAa,CAAC,GAAG,EAAE,WAAmB,EAAE,GAAG,CAAC,CAAC,CAAA;SAC/D;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE;YACvB,UAAU,GAAG,aAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAC,CAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;SAC1D;aAAM;YACL,UAAU,GAAG,IAAI,CAAA;SAClB;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC;AAhHD,gDAgHC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts deleted file mode 100644 index ccdf84c0b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CodeKeywordDefinition, AnySchemaObject } from "../../types"; -declare const def: CodeKeywordDefinition; -export declare function hasRef(schema: AnySchemaObject): boolean; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js deleted file mode 100644 index a3b341ab0..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hasRef = void 0; -const compile_1 = require("../../compile"); -const codegen_1 = require("../../compile/codegen"); -const error_classes_1 = require("../../compile/error_classes"); -const names_1 = require("../../compile/names"); -const ref_1 = require("../core/ref"); -const metadata_1 = require("./metadata"); -const def = { - keyword: "ref", - schemaType: "string", - code(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, schema: ref, parentSchema, it } = cxt; - const { schemaEnv: { root }, } = it; - const valid = gen.name("valid"); - if (parentSchema.nullable) { - gen.var(valid, codegen_1._ `${data} === null`); - gen.if(codegen_1.not(valid), validateJtdRef); - } - else { - gen.var(valid, false); - validateJtdRef(); - } - cxt.ok(valid); - function validateJtdRef() { - var _a; - const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref]; - if (!refSchema) - throw new error_classes_1.MissingRefError("", ref, `No definition ${ref}`); - if (hasRef(refSchema) || !it.opts.inlineRefs) - callValidate(refSchema); - else - inlineRefSchema(refSchema); - } - function callValidate(schema) { - const sch = compile_1.compileSchema.call(it.self, new compile_1.SchemaEnv({ schema, root })); - const v = ref_1.getValidate(cxt, sch); - const errsCount = gen.const("_errs", names_1.default.errors); - ref_1.callRef(cxt, v, sch, sch.$async); - gen.assign(valid, codegen_1._ `${errsCount} === ${names_1.default.errors}`); - } - function inlineRefSchema(schema) { - const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: codegen_1.stringify(schema) } : { ref: schema }); - cxt.subschema({ - schema, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: `/definitions/${ref}`, - }, valid); - } - }, -}; -function hasRef(schema) { - for (const key in schema) { - let sch; - if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) - return true; - } - return false; -} -exports.hasRef = hasRef; -exports.default = def; -//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js.map deleted file mode 100644 index 9d3ac222f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/ref.ts"],"names":[],"mappings":";;;AAEA,2CAAsD;AACtD,mDAA4D;AAC5D,+DAA2D;AAC3D,+CAAmC;AACnC,qCAAgD;AAChD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,wBAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EACJ,SAAS,EAAE,EAAC,IAAI,EAAC,GAClB,GAAG,EAAE,CAAA;QACN,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,WAAC,CAAA,GAAG,IAAI,WAAW,CAAC,CAAA;YACnC,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,CAAA;SACnC;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACrB,cAAc,EAAE,CAAA;SACjB;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QAEb,SAAS,cAAc;;YACrB,MAAM,SAAS,GAAG,MAAC,IAAI,CAAC,MAA0B,CAAC,WAAW,0CAAG,GAAG,CAAC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AO;gBACrB,aAAa,EAAE,gBAAgB,GAAG,EAAE;aACrC,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAgB,MAAM,CAAC,MAAuB;IAC5C,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,IAAI,GAAoB,CAAA;QACxB,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAA;KAC1F;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAND,wBAMC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts deleted file mode 100644 index a299c11dc..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -export declare type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -export declare const intRange: { - [T in IntType]: [number, number, number]; -}; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js deleted file mode 100644 index 96ff3a7e6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.intRange = void 0; -const codegen_1 = require("../../compile/codegen"); -const timestamp_1 = require("../../compile/timestamp"); -const util_1 = require("../../compile/util"); -const metadata_1 = require("./metadata"); -exports.intRange = { - int8: [-128, 127, 3], - uint8: [0, 255, 3], - int16: [-32768, 32767, 5], - uint16: [0, 65535, 5], - int32: [-2147483648, 2147483647, 10], - uint32: [0, 4294967295, 10], -}; -const def = { - keyword: "type", - schemaType: "string", - code(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, schema, parentSchema } = cxt; - let cond; - switch (schema) { - case "boolean": - case "string": - cond = codegen_1._ `typeof ${data} == ${schema}`; - break; - case "timestamp": { - const vts = util_1.func(gen, timestamp_1.default); - cond = codegen_1._ `${data} instanceof Date || (typeof ${data} == "string" && ${vts}(${data}))`; - break; - } - case "float32": - case "float64": - cond = codegen_1._ `typeof ${data} == "number"`; - break; - default: { - const [min, max] = exports.intRange[schema]; - cond = codegen_1._ `typeof ${data} == "number" && isFinite(${data}) && ${data} >= ${min} && ${data} <= ${max} && !(${data} % 1)`; - } - } - cxt.pass(parentSchema.nullable ? codegen_1.or(codegen_1._ `${data} === null`, cond) : cond); - }, -}; -exports.default = def; -//# sourceMappingURL=type.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js.map deleted file mode 100644 index 7584bc63a..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/type.ts"],"names":[],"mappings":";;;AAEA,mDAAiD;AACjD,uDAAoD;AACpD,6CAAuC;AACvC,yCAAwC;AAI3B,QAAA,QAAQ,GAA+C;IAClE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;IACpC,M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\ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js deleted file mode 100644 index e3bc5033e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const def = { - keyword: "union", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, -}; -exports.default = def; -//# sourceMappingURL=union.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js.map deleted file mode 100644 index c2da4f34f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/union.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;CACpB,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js deleted file mode 100644 index 68682ef11..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const subschema_1 = require("../../compile/subschema"); -const util_1 = require("../../compile/util"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const def = { - keyword: "values", - schemaType: "object", - code(cxt) { - metadata_1.checkMetadata(cxt); - const { gen, data, schema, it } = cxt; - if (util_1.alwaysValidSchema(it, schema)) - return; - const [valid, cond] = nullable_1.checkNullableObject(cxt, data); - gen.if(cond, () => gen.assign(valid, validateMap())); - cxt.pass(valid); - function validateMap() { - const _valid = gen.name("valid"); - if (it.allErrors) { - const validMap = gen.let("valid", true); - validateValues(() => gen.assign(validMap, false)); - return validMap; - } - gen.var(_valid, true); - validateValues(() => gen.break()); - return _valid; - function validateValues(notValid) { - gen.forIn("key", data, (key) => { - cxt.subschema({ - keyword: "values", - dataProp: key, - dataPropType: subschema_1.Type.Str, - }, _valid); - gen.if(codegen_1.not(_valid), notValid); - }); - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js.map deleted file mode 100644 index dacfe57db..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,uDAA4C;AAC5C,6CAAoD;AACpD,mDAA+C;AAC/C,yCAA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,QAAQ,EAAE,GAAG;wBACb,YAAY,EAAE,gBAAI,CAAC,GAAG;qBACvB,EACD,MAAM,CACP,CAAA;oBACD,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;gBAC/B,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.d.ts deleted file mode 100644 index df9cc07ca..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -export declare const metadataVocabulary: Vocabulary; -export declare const contentVocabulary: Vocabulary; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js b/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js deleted file mode 100644 index f07bf28b5..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.contentVocabulary = exports.metadataVocabulary = void 0; -exports.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples", -]; -exports.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema", -]; -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js.map deleted file mode 100644 index 0d61f0831..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../lib/vocabularies/metadata.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAe;IAC5C,OAAO;IACP,aAAa;IACb,SAAS;IACT,YAAY;IACZ,UAAU;IACV,WAAW;IACX,UAAU;CACX,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;CAChB,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/next.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/next.d.ts deleted file mode 100644 index 7fd5c644b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/next.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -declare const next: Vocabulary; -export default next; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/next.js b/node_modules/table/node_modules/ajv/dist/vocabularies/next.js deleted file mode 100644 index c861b3243..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/next.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dependentRequired_1 = require("./validation/dependentRequired"); -const dependentSchemas_1 = require("./applicator/dependentSchemas"); -const limitContains_1 = require("./validation/limitContains"); -const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default]; -exports.default = next; -//# sourceMappingURL=next.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/next.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/next.js.map deleted file mode 100644 index 474a6d4e7..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/next.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"next.js","sourceRoot":"","sources":["../../lib/vocabularies/next.ts"],"names":[],"mappings":";;AACA,sEAA8D;AAC9D,oEAA4D;AAC5D,8DAAsD;AAEtD,MAAM,IAAI,GAAe,CAAC,2BAAiB,EAAE,0BAAgB,EAAE,uBAAa,CAAC,CAAA;AAE7E,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts deleted file mode 100644 index ec67e63ea..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const unevaluated: Vocabulary; -export default unevaluated; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js deleted file mode 100644 index 30e316748..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const unevaluatedProperties_1 = require("./unevaluatedProperties"); -const unevaluatedItems_1 = require("./unevaluatedItems"); -const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default]; -exports.default = unevaluated; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map deleted file mode 100644 index a4872ea43..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/index.ts"],"names":[],"mappings":";;AACA,mEAA2D;AAC3D,yDAAiD;AAEjD,MAAM,WAAW,GAAe,CAAC,+BAAqB,EAAE,0BAAgB,CAAC,CAAA;AAEzE,kBAAe,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts deleted file mode 100644 index f108b6e4e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js deleted file mode 100644 index 6ae74763f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const subschema_1 = require("../../compile/subschema"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { len } }) => codegen_1.str `should NOT have more than ${len} items`, - params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`, -}; -const def = { - keyword: "unevaluatedItems", - type: "array", - schemaType: ["boolean", "object"], - error, - code(cxt) { - const { gen, schema, data, it } = cxt; - const items = it.items || 0; - if (items === true) - return; - const len = gen.const("len", codegen_1._ `${data}.length`); - if (schema === false) { - cxt.setParams({ len: items }); - cxt.fail(codegen_1._ `${len} > ${items}`); - } - else if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) { - const valid = gen.var("valid", codegen_1._ `${len} <= ${items}`); - gen.if(codegen_1.not(valid), () => validateItems(valid, items)); - cxt.ok(valid); - } - it.items = true; - function validateItems(valid, from) { - gen.forRange("i", from, len, (i) => { - cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: subschema_1.Type.Num }, valid); - if (!it.allErrors) - gen.if(codegen_1.not(valid), () => gen.break()); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=unevaluatedItems.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map deleted file mode 100644 index b37ab55ad..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unevaluatedItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedItems.ts"],"names":[],"mappings":";;AAOA,mDAAuD;AACvD,uDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,6BAA6B,GAAG,QAAQ;IACzE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,CAAA;QAC3B,IAAI,KAAK,KAAK,IAAI;YAAE,OAAM;QAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,WAAC,CAAA,GAAG,IAAI,SAAS,CAAC,CAAA;QAC/C,IAAI,MAAM,KAAK,KAAK,EAAE;YACpB,GAAG,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,KAAK,EAAC,CAAC,CAAA;YAC3B,GAAG,CAAC,IAAI,CAAC,WAAC,CAAA,GAAG,GAAG,MAAM,KAAK,EAAE,CAAC,CAAA;SAC/B;aAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,wBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE;YACtE,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,WAAC,CAAA,GAAG,GAAG,OAAO,KAAK,EAAE,CAAC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;SACd;QACD,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QAEf,SAAS,aAAa,CAAC,KAAW,EAAE,IAAmB;YACrD,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBACjC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,gBAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;gBACxF,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts deleted file mode 100644 index 0a041ff75..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export declare type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", { - unevaluatedProperty: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js deleted file mode 100644 index 6ab14c01a..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const names_1 = require("../../compile/names"); -const subschema_1 = require("../../compile/subschema"); -const error = { - message: "should NOT have unevaluated properties", - params: ({ params }) => codegen_1._ `{unevaluatedProperty: ${params.unevaluatedProperty}}`, -}; -const def = { - keyword: "unevaluatedProperties", - type: "object", - schemaType: ["boolean", "object"], - trackErrors: true, - error, - code(cxt) { - const { gen, schema, data, errsCount, it } = cxt; - /* istanbul ignore if */ - if (!errsCount) - throw new Error("ajv implementation error"); - const { allErrors, props } = it; - if (props instanceof codegen_1.Name) { - gen.if(codegen_1._ `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)))); - } - else if (props !== true) { - gen.forIn("key", data, (key) => props === undefined - ? unevaluatedPropCode(key) - : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))); - } - it.props = true; - cxt.ok(codegen_1._ `${errsCount} === ${names_1.default.errors}`); - function unevaluatedPropCode(key) { - if (schema === false) { - cxt.setParams({ unevaluatedProperty: key }); - cxt.error(); - if (!allErrors) - gen.break(); - return; - } - if (!util_1.alwaysValidSchema(it, schema)) { - const valid = gen.name("valid"); - cxt.subschema({ - keyword: "unevaluatedProperties", - dataProp: key, - dataPropType: subschema_1.Type.Str, - }, valid); - if (!allErrors) - gen.if(codegen_1.not(valid), () => gen.break()); - } - } - function unevaluatedDynamic(evaluatedProps, key) { - return codegen_1._ `!${evaluatedProps} || !${evaluatedProps}[${key}]`; - } - function unevaluatedStatic(evaluatedProps, key) { - const ps = []; - for (const p in evaluatedProps) { - if (evaluatedProps[p] === true) - ps.push(codegen_1._ `${key} !== ${p}`); - } - return codegen_1.and(...ps); - } - }, -}; -exports.default = def; -//# sourceMappingURL=unevaluatedProperties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map deleted file mode 100644 index 28ed0d827..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unevaluatedProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedProperties.ts"],"names":[],"mappings":";;AAMA,mDAA6D;AAC7D,6CAAoD;AACpD,+CAAmC;AACnC,uDAA4C;AAQ5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,wCAAwC;IACjD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,yBAAyB,MAAM,CAAC,mBAAmB,GAAG;CAC9E,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9C,wBAAwB;QACxB,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,MAAM,EAAC,SAAS,EAAE,KAAK,EAAC,GAAG,EAAE,CAAA;QAC7B,IAAI,KAAK,YAAY,cAAI,EAA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B;oBAChC,QAAQ,EAAE,GAAG;oBACb,YAAY,EAAE,gBAAI,CAAC,GAAG;iBACvB,EACD,KAAK,CACN,CAAA;gBACD,IAAI,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;aACtD;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,cAAoB,EAAE,GAAS;YACzD,OAAO,WAAC,CAAA,IAAI,cAAc,QAAQ,cAAc,IAAI,GAAG,GAAG,CAAA;QAC5D,CAAC;QAED,SAAS,iBAAiB,CAAC,cAAsC,EAAE,GAAS;YAC1E,MAAM,EAAE,GAAW,EAAE,CAAA;YACrB,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE;gBAC9B,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;oBAAE,EAAE,CAAC,IAAI,CAAC,WAAC,CAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;aAC5D;YACD,OAAO,aAAG,CAAC,GAAG,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.d.ts deleted file mode 100644 index 85e11ce52..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type ConstError = ErrorObject<"const", { - allowedValue: any; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js deleted file mode 100644 index 24ac5a43e..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const equal = require("fast-deep-equal"); -const error = { - message: "should be equal to constant", - params: ({ schemaCode }) => codegen_1._ `{allowedValue: ${schemaCode}}`, -}; -const def = { - keyword: "const", - $data: true, - error, - code(cxt) { - const eql = cxt.gen.scopeValue("func", { - ref: equal, - code: codegen_1._ `require("ajv/dist/compile/equal")`, - }); - // TODO optimize for scalar values in schema - cxt.fail$data(codegen_1._ `!${eql}(${cxt.data}, ${cxt.schemaCode})`); - }, -}; -exports.default = def; -//# sourceMappingURL=const.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js.map deleted file mode 100644 index b582b5d83..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/const.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,yCAAwC;AAIxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,kBAAkB,UAAU,GAAG;CAC3D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE;YACrC,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,WAAC,CAAA,mCAAmC;SAC3C,CAAC,CAAA;QACF,4CAA4C;QAC5C,GAAG,CAAC,SAAS,CAAC,WAAC,CAAA,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,UAAU,GAAG,CAAC,CAAA;IAC3D,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts deleted file mode 100644 index 2e25408e6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies"; -export declare type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js deleted file mode 100644 index 27c4eb260..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dependencies_1 = require("../applicator/dependencies"); -const def = { - keyword: "dependentRequired", - type: "object", - schemaType: "object", - error: dependencies_1.error, - code: (cxt) => dependencies_1.validatePropertyDeps(cxt), -}; -exports.default = def; -//# sourceMappingURL=dependentRequired.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map deleted file mode 100644 index 0b29911a1..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dependentRequired.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/dependentRequired.ts"],"names":[],"mappings":";;AACA,6DAKmC;AAQnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,oBAAK;IACL,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,mCAAoB,CAAC,GAAG,CAAC;CACzC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.d.ts deleted file mode 100644 index dce653b56..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type EnumError = ErrorObject<"enum", { - allowedValues: any[]; -}, any[] | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js deleted file mode 100644 index ffc7f8462..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const equal = require("fast-deep-equal"); -const error = { - message: "should be equal to one of the allowed values", - params: ({ schemaCode }) => codegen_1._ `{allowedValues: ${schemaCode}}`, -}; -const def = { - keyword: "enum", - schemaType: "array", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schema, schemaCode, it } = cxt; - if (!$data && schema.length === 0) - throw new Error("enum must have non-empty array"); - const useLoop = schema.length >= it.opts.loopEnum; - const eql = cxt.gen.scopeValue("func", { - ref: equal, - code: codegen_1._ `require("ajv/dist/compile/equal")`, - }); - let valid; - if (useLoop || $data) { - valid = gen.let("valid"); - cxt.block$data(valid, loopEnum); - } - else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const vSchema = gen.const("vSchema", schemaCode); - valid = codegen_1.or(...schema.map((_x, i) => equalCode(vSchema, i))); - } - cxt.pass(valid); - function loopEnum() { - gen.assign(valid, false); - gen.forOf("v", schemaCode, (v) => gen.if(codegen_1._ `${eql}(${data}, ${v})`, () => gen.assign(valid, true).break())); - } - function equalCode(vSchema, i) { - const sch = schema[i]; - return sch && typeof sch === "object" - ? codegen_1._ `${eql}(${data}, ${vSchema}[${i}])` - : codegen_1._ `${data} === ${sch}`; - } - }, -}; -exports.default = def; -//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js.map deleted file mode 100644 index 0cc365999..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/enum.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,yCAAwC;AAIxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,8CAA8C;IACvD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACpF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAA;QACjD,MAAM,GAAG,GAAG,GAAG,C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,CAAC,CAAC,WAAC,CAAA,GAAG,GAAG,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI;gBACtC,CAAC,CAAC,WAAC,CAAA,GAAG,IAAI,QAAQ,GAAG,EAAE,CAAA;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.d.ts deleted file mode 100644 index 08cd22396..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ErrorObject, Vocabulary } from "../../types"; -import { LimitNumberError } from "./limitNumber"; -import { MultipleOfError } from "./multipleOf"; -import { PatternError } from "./pattern"; -import { RequiredError } from "./required"; -import { UniqueItemsError } from "./uniqueItems"; -import { ConstError } from "./const"; -import { EnumError } from "./enum"; -declare const validation: Vocabulary; -export default validation; -declare type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", { - limit: number; -}, number | { - $data: string; -}>; -export declare type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js deleted file mode 100644 index 7b56b4e45..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const limitNumber_1 = require("./limitNumber"); -const multipleOf_1 = require("./multipleOf"); -const limitLength_1 = require("./limitLength"); -const pattern_1 = require("./pattern"); -const limitProperties_1 = require("./limitProperties"); -const required_1 = require("./required"); -const limitItems_1 = require("./limitItems"); -const uniqueItems_1 = require("./uniqueItems"); -const const_1 = require("./const"); -const enum_1 = require("./enum"); -const validation = [ - // number - limitNumber_1.default, - multipleOf_1.default, - // string - limitLength_1.default, - pattern_1.default, - // object - limitProperties_1.default, - required_1.default, - // array - limitItems_1.default, - uniqueItems_1.default, - // any - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - const_1.default, - enum_1.default, -]; -exports.default = validation; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js.map deleted file mode 100644 index 69436fb32..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/index.ts"],"names":[],"mappings":";;AACA,+CAA2D;AAC3D,6CAAwD;AACxD,+CAAuC;AACvC,uCAA+C;AAC/C,uDAA+C;AAC/C,yCAAkD;AAClD,6CAAqC;AACrC,+CAA2D;AAC3D,mCAAgD;AAChD,iCAA6C;AAE7C,MAAM,UAAU,GAAe;IAC7B,SAAS;IACT,qBAAW;IACX,oBAAU;IACV,SAAS;IACT,qBAAW;IACX,iBAAO;IACP,SAAS;IACT,yBAAe;IACf,kBAAQ;IACR,QAAQ;IACR,oBAAU;IACV,qBAAW;IACX,MAAM;IACN,EAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;IAClD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;IAC5C,eAAY;IACZ,cAAW;CACZ,CAAA;AAED,kBAAe,UAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js deleted file mode 100644 index 155654b05..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const validate_1 = require("../../compile/validate"); -const def = { - keyword: ["maxContains", "minContains"], - type: "array", - schemaType: "number", - code({ keyword, parentSchema, it }) { - if (parentSchema.contains === undefined) { - validate_1.checkStrictMode(it, `"${keyword}" without "contains" is ignored`); - } - }, -}; -exports.default = def; -//# sourceMappingURL=limitContains.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map deleted file mode 100644 index a977f5f19..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitContains.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitContains.ts"],"names":[],"mappings":";;AAEA,qDAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvC,0BAAe,CAAC,EAAE,EAAE,IAAI,OAAO,iCAAiC,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js deleted file mode 100644 index fbcf8f875..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxItems" ? "more" : "fewer"; - return codegen_1.str `should NOT have ${comp} than ${schemaCode} items`; - }, - params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`, -}; -const def = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data(codegen_1._ `${data}.length ${op} ${schemaCode}`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitItems.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map deleted file mode 100644 index 3cd6c9398..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,aAAG,CAAA,mBAAmB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC9D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,WAAC,CAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js deleted file mode 100644 index 8102ddb13..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const ucs2length_1 = require("../../compile/ucs2length"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxLength" ? "more" : "fewer"; - return codegen_1.str `should NOT have ${comp} than ${schemaCode} characters`; - }, - params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`, -}; -const def = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode, it } = cxt; - const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; - let len; - if (it.opts.unicode === false) { - len = codegen_1._ `${data}.length`; - } - else { - const u2l = cxt.gen.scopeValue("func", { - ref: ucs2length_1.default, - code: codegen_1._ `require("ajv/dist/compile/ucs2length").default`, - }); - len = codegen_1._ `${u2l}(${data})`; - } - cxt.fail$data(codegen_1._ `${len} ${op} ${schemaCode}`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitLength.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map deleted file mode 100644 index d34881cce..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitLength.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitLength.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,yDAAiD;AAEjD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACvD,OAAO,aAAG,CAAA,mBAAmB,IAAI,SAAS,UAAU,aAAa,CAAA;IACnE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC3C,MAAM,EAAE,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAChE,IAAI,GAAG,CAAA;QACP,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE;YAC7B,GAAG,GAAG,WAAC,CAAA,GAAG,IAAI,SAAS,CAAA;SACxB;aAAM;YACL,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE;gBACrC,GAAG,EAAE,oBAAU;gBACf,IAAI,EAAE,WAAC,CAAA,gDAAgD;aACxD,CAAC,CAAA;YACF,GAAG,GAAG,WAAC,CAAA,GAAG,GAAG,IAAI,IAAI,GAAG,CAAA;SACzB;QACD,GAAG,CAAC,SAAS,CAAC,WAAC,CAAA,GAAG,GAAG,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts deleted file mode 100644 index 2d3890855..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -declare type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"; -declare type Comparison = "<=" | ">=" | "<" | ">"; -export declare type LimitNumberError = ErrorObject; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js deleted file mode 100644 index a86bfef7b..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const ops = codegen_1.operators; -const KWDs = { - maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, - minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, - exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, - exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }, -}; -const error = { - message: ({ keyword, schemaCode }) => codegen_1.str `should be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => codegen_1._ `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, -}; -const def = { - keyword: Object.keys(KWDs), - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - cxt.fail$data(codegen_1._ `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitNumber.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map deleted file mode 100644 index 1c7064c25..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitNumber.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitNumber.ts"],"names":[],"mappings":";;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,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,UAAU,aAAa,IAAI,GAAG,CAAC,CAAA;IACxF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js deleted file mode 100644 index 19a558ea6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxProperties" ? "more" : "fewer"; - return codegen_1.str `should NOT have ${comp} than ${schemaCode} items`; - }, - params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`, -}; -const def = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data(codegen_1._ `Object.keys(${data}).length ${op} ${schemaCode}`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitProperties.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map deleted file mode 100644 index 21f262d15..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitProperties.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAC3D,OAAO,aAAG,CAAA,mBAAmB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC9D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QACpE,GAAG,CAAC,SAAS,CAAC,WAAC,CAAA,eAAe,IAAI,YAAY,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACnE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts deleted file mode 100644 index afa29d357..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type MultipleOfError = ErrorObject<"multipleOf", { - multipleOf: number; -}, number | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js deleted file mode 100644 index 6c6fd44a5..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => codegen_1.str `should be multiple of ${schemaCode}`, - params: ({ schemaCode }) => codegen_1._ `{multipleOf: ${schemaCode}}`, -}; -const def = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { gen, data, schemaCode, it } = cxt; - // const bdt = bad$DataType(schemaCode, def.schemaType, $data) - const prec = it.opts.multipleOfPrecision; - const res = gen.let("res"); - const invalid = prec - ? codegen_1._ `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` - : codegen_1._ `${res} !== parseInt(${res})`; - cxt.fail$data(codegen_1._ `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); - }, -}; -exports.default = def; -//# sourceMappingURL=multipleOf.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map deleted file mode 100644 index 89a3e620c..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/multipleOf.ts"],"names":[],"mappings":";;AAEA,mDAA4C;AAQ5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,yBAAyB,UAAU,EAAE;IACnE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,gBAAgB,UAAU,GAAG;CACzD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACvC,sEAAsE;QACtE,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAA;QACxC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,MAAM,OAAO,GAAG,IAAI;YAClB,CAAC,CAAC,WAAC,CAAA,uBAAuB,GAAG,OAAO,GAAG,UAAU,IAAI,EAAE;YACvD,CAAC,CAAC,WAAC,CAAA,GAAG,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAClC,GAAG,CAAC,SAAS,CAAC,WAAC,CAAA,IAAI,UAAU,cAAc,GAAG,MAAM,IAAI,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,CAAA;IACzF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts deleted file mode 100644 index bf232ffc6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type PatternError = ErrorObject<"pattern", { - pattern: string; -}, string | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js deleted file mode 100644 index d17780db3..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => codegen_1.str `should match pattern "${schemaCode}"`, - params: ({ schemaCode }) => codegen_1._ `{pattern: ${schemaCode}}`, -}; -const def = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schema, schemaCode } = cxt; - const regExp = $data ? codegen_1._ `(new RegExp(${schemaCode}, "u"))` : code_1.usePattern(gen, schema); // TODO regexp should be wrapped in try/catch - cxt.fail$data(codegen_1._ `!${regExp}.test(${data})`); - }, -}; -exports.default = def; -//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js.map deleted file mode 100644 index 2a33ae2f6..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/pattern.ts"],"names":[],"mappings":";;AAEA,kCAAkC;AAClC,mDAA4C;AAI5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,yBAAyB,UAAU,GAAG;IACpE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,aAAa,UAAU,GAAG;CACtD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QAClD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,WAAC,CAAA,eAAe,UAAU,SAAS,CAAC,CAAC,CAAC,iBAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA,CAAC,6CAA6C;QAClI,GAAG,CAAC,SAAS,CAAC,WAAC,CAAA,IAAI,MAAM,SAAS,IAAI,GAAG,CAAC,CAAA;IAC5C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.d.ts deleted file mode 100644 index fe94d04ae..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type RequiredError = ErrorObject<"required", { - missingProperty: string; -}, string[] | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js deleted file mode 100644 index 687783fd8..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const validate_1 = require("../../compile/validate"); -const error = { - message: ({ params: { missingProperty } }) => codegen_1.str `should have required property '${missingProperty}'`, - params: ({ params: { missingProperty } }) => codegen_1._ `{missingProperty: ${missingProperty}}`, -}; -const def = { - keyword: "required", - type: "object", - schemaType: "array", - $data: true, - error, - code(cxt) { - const { gen, schema, schemaCode, data, $data, it } = cxt; - const { opts } = it; - if (!$data && schema.length === 0) - return; - const useLoop = schema.length >= opts.loopRequired; - if (it.allErrors) - allErrorsMode(); - else - exitOnErrorMode(); - if (opts.strictRequired) { - const props = cxt.parentSchema.properties; - const { definedProperties } = cxt.it; - for (const requiredKey of schema) { - if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; - validate_1.checkStrictMode(it, msg, it.opts.strictRequired); - } - } - } - function allErrorsMode() { - if (useLoop || $data) { - cxt.block$data(codegen_1.nil, loopAllRequired); - } - else { - for (const prop of schema) { - code_1.checkReportMissingProp(cxt, prop); - } - } - } - function exitOnErrorMode() { - const missing = gen.let("missing"); - if (useLoop || $data) { - const valid = gen.let("valid", true); - cxt.block$data(valid, () => loopUntilMissing(missing, valid)); - cxt.ok(valid); - } - else { - gen.if(code_1.checkMissingProp(cxt, schema, missing)); - code_1.reportMissingProp(cxt, missing); - gen.else(); - } - } - function loopAllRequired() { - gen.forOf("prop", schemaCode, (prop) => { - cxt.setParams({ missingProperty: prop }); - gen.if(code_1.noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()); - }); - } - function loopUntilMissing(missing, valid) { - cxt.setParams({ missingProperty: missing }); - gen.forOf(missing, schemaCode, () => { - gen.assign(valid, code_1.propertyInData(gen, data, missing, opts.ownProperties)); - gen.if(codegen_1.not(valid), () => { - cxt.error(); - gen.break(); - }); - }, codegen_1.nil); - } - }, -}; -exports.default = def; -//# sourceMappingURL=required.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js.map deleted file mode 100644 index 3922a2e8f..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"required.js","sourceRoot":"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EAAC,CAAC,CAAA;gBACtC,GAAG,CAAC,EAAE,CAAC,uBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAClF,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,SAAS,gBAAgB,CAAC,OAAa,EAAE,KAAW;YAClD,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,GAAG,CAAC,KAAK,CACP,OAAO,EACP,UAAkB,EAClB,GAAG,EAAE;gBACH,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,qBAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;gBACzE,GAAG,CAAC,EAAE,CAAC,aAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE;oBACtB,GAAG,CAAC,KAAK,EAAE,CAAA;oBACX,GAAG,CAAC,KAAK,EAAE,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,EACD,aAAG,CACJ,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts deleted file mode 100644 index c4f4b4ca7..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export declare type UniqueItemsError = ErrorObject<"uniqueItems", { - i: number; - j: number; -}, boolean | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js deleted file mode 100644 index 68d31a13c..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dataType_1 = require("../../compile/validate/dataType"); -const codegen_1 = require("../../compile/codegen"); -const equal = require("fast-deep-equal"); -const error = { - message: ({ params: { i, j } }) => codegen_1.str `should NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({ params: { i, j } }) => codegen_1._ `{i: ${i}, j: ${j}}`, -}; -const def = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; - if (!$data && !schema) - return; - const valid = gen.let("valid"); - const itemTypes = parentSchema.items ? dataType_1.getSchemaTypes(parentSchema.items) : []; - cxt.block$data(valid, validateUniqueItems, codegen_1._ `${schemaCode} === false`); - cxt.ok(valid); - function validateUniqueItems() { - const i = gen.let("i", codegen_1._ `${data}.length`); - const j = gen.let("j"); - cxt.setParams({ i, j }); - gen.assign(valid, true); - gen.if(codegen_1._ `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); - } - function canOptimize() { - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); - } - function loopN(i, j) { - const item = gen.name("item"); - const wrongType = dataType_1.checkDataTypes(itemTypes, item, it.opts.strict, dataType_1.DataType.Wrong); - const indices = gen.const("indices", codegen_1._ `{}`); - gen.for(codegen_1._ `;${i}--;`, () => { - gen.let(item, codegen_1._ `${data}[${i}]`); - gen.if(wrongType, codegen_1._ `continue`); - if (itemTypes.length > 1) - gen.if(codegen_1._ `typeof ${item} == "string"`, codegen_1._ `${item} += "_"`); - gen - .if(codegen_1._ `typeof ${indices}[${item}] == "number"`, () => { - gen.assign(j, codegen_1._ `${indices}[${item}]`); - cxt.error(); - gen.assign(valid, false).break(); - }) - .code(codegen_1._ `${indices}[${item}] = ${i}`); - }); - } - function loopN2(i, j) { - const eql = cxt.gen.scopeValue("func", { - ref: equal, - code: codegen_1._ `require("ajv/dist/compile/equal")`, - }); - const outer = gen.name("outer"); - gen.label(outer).for(codegen_1._ `;${i}--;`, () => gen.for(codegen_1._ `${j} = ${i}; ${j}--;`, () => gen.if(codegen_1._ `${eql}(${data}[${i}], ${data}[${j}])`, () => { - cxt.error(); - gen.assign(valid, false).break(outer); - }))); - } - }, -}; -exports.default = def; -//# sourceMappingURL=uniqueItems.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map deleted file mode 100644 index e9adad473..000000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uniqueItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/uniqueItems.ts"],"names":[],"mappings":";;AAEA,8DAAwF;AACxF,mDAAkD;AAClD,yCAAwC;AAQxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAC5B,aAAG,CAAA,6CAA6C,CAAC,QAAQ,CAAC,iBAAiB;IAC7E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAAC,WAAC,CAAA,OAAO,CAAC,QAAQ,CAAC,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE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AK;gBACV,IAAI,EAAE,WAAC,CAAA,mCAAmC;aAC3C,CAAC,CAAA;YACF,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC/B,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,WAAC,CAAA,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CACrC,GAAG,CAAC,GAAG,CAAC,WAAC,CAAA,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CACpC,GAAG,CAAC,EAAE,CAAC,WAAC,CAAA,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;gBACnD,GAAG,CAAC,KAAK,EAAE,CAAA;gBACX,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACvC,CAAC,CAAC,CACH,CACF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/lib/2019.ts b/node_modules/table/node_modules/ajv/lib/2019.ts deleted file mode 100644 index bb33c51e9..000000000 --- a/node_modules/table/node_modules/ajv/lib/2019.ts +++ /dev/null @@ -1,72 +0,0 @@ -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -import KeywordCxt from "./compile/context" -export {KeywordCxt} -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -import type {AnySchemaObject} from "./types" -import AjvCore, {Options} from "./core" - -import draft7Vocabularies from "./vocabularies/draft7" -import dynamicVocabulary from "./vocabularies/dynamic" -import nextVocabulary from "./vocabularies/next" -import unevaluatedVocabulary from "./vocabularies/unevaluated" -import addMetaSchema2019 from "./refs/json-schema-2019-09" - -const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema" - -export default class Ajv2019 extends AjvCore { - constructor(opts: Options = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }) - } - - _addVocabularies(): void { - super._addVocabularies() - this.addVocabulary(dynamicVocabulary) - draft7Vocabularies.forEach((v) => this.addVocabulary(v)) - this.addVocabulary(nextVocabulary) - this.addVocabulary(unevaluatedVocabulary) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - const {$data, meta} = this.opts - if (!meta) return - addMetaSchema2019.call(this, $data) - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } -} diff --git a/node_modules/table/node_modules/ajv/lib/ajv.ts b/node_modules/table/node_modules/ajv/lib/ajv.ts deleted file mode 100644 index b821d15c9..000000000 --- a/node_modules/table/node_modules/ajv/lib/ajv.ts +++ /dev/null @@ -1,61 +0,0 @@ -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - SchemaValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -import KeywordCxt from "./compile/context" -export {KeywordCxt} -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -import type {AnySchemaObject} from "./types" -import AjvCore from "./core" -import draft7Vocabularies from "./vocabularies/draft7" -import * as draft7MetaSchema from "./refs/json-schema-draft-07.json" - -const META_SUPPORT_DATA = ["/properties"] - -const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema" - -export default class Ajv extends AjvCore { - _addVocabularies(): void { - super._addVocabularies() - draft7Vocabularies.forEach((v) => this.addVocabulary(v)) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - if (!this.opts.meta) return - const metaSchema = this.opts.$data - ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) - : draft7MetaSchema - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false) - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/codegen/code.ts b/node_modules/table/node_modules/ajv/lib/compile/codegen/code.ts deleted file mode 100644 index 4739ff006..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/codegen/code.ts +++ /dev/null @@ -1,156 +0,0 @@ -export abstract class _CodeOrName { - abstract readonly str: string - abstract readonly names: UsedNames - abstract toString(): string - abstract emptyStr(): boolean -} - -export const IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i - -export class Name extends _CodeOrName { - readonly str: string - constructor(s: string) { - super() - if (!IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier") - this.str = s - } - - toString(): string { - return this.str - } - - emptyStr(): boolean { - return false - } - - get names(): UsedNames { - return {[this.str]: 1} - } -} - -export class _Code extends _CodeOrName { - readonly _items: readonly CodeItem[] - private _str?: string - private _names?: UsedNames - - constructor(code: string | readonly CodeItem[]) { - super() - this._items = typeof code === "string" ? [code] : code - } - - toString(): string { - return this.str - } - - emptyStr(): boolean { - if (this._items.length > 1) return false - const item = this._items[0] - return item === "" || item === '""' - } - - get str(): string { - return (this._str ??= this._items.reduce((s: string, c: CodeItem) => `${s}${c}`, "")) - } - - get names(): UsedNames { - return (this._names ??= this._items.reduce((names: UsedNames, c) => { - if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1 - return names - }, {})) - } -} - -export type CodeItem = Name | string | number | boolean | null - -export type UsedNames = Record - -export type Code = _Code | Name - -export type SafeExpr = Code | number | boolean | null - -export const nil = new _Code("") - -type CodeArg = SafeExpr | string | undefined - -export function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code { - const code: CodeItem[] = [strs[0]] - let i = 0 - while (i < args.length) { - addCodeArg(code, args[i]) - code.push(strs[++i]) - } - return new _Code(code) -} - -const plus = new _Code("+") - -export function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code { - const expr: CodeItem[] = [safeStringify(strs[0])] - let i = 0 - while (i < args.length) { - expr.push(plus) - addCodeArg(expr, args[i]) - expr.push(plus, safeStringify(strs[++i])) - } - optimize(expr) - return new _Code(expr) -} - -export function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void { - if (arg instanceof _Code) code.push(...arg._items) - else if (arg instanceof Name) code.push(arg) - else code.push(interpolate(arg)) -} - -function optimize(expr: CodeItem[]): void { - let i = 1 - while (i < expr.length - 1) { - if (expr[i] === plus) { - const res = mergeExprItems(expr[i - 1], expr[i + 1]) - if (res !== undefined) { - expr.splice(i - 1, 3, res) - continue - } - expr[i++] = "+" - } - i++ - } -} - -function mergeExprItems(a: CodeItem, b: CodeItem): CodeItem | undefined { - if (b === '""') return a - if (a === '""') return b - if (typeof a == "string") { - if (b instanceof Name || a[a.length - 1] !== '"') return - if (typeof b != "string") return `${a.slice(0, -1)}${b}"` - if (b[0] === '"') return a.slice(0, -1) + b.slice(1) - return - } - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}` - return -} - -export function strConcat(c1: Code, c2: Code): Code { - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}` -} - -// TODO do not allow arrays here -function interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string { - return typeof x == "number" || typeof x == "boolean" || x === null - ? x - : safeStringify(Array.isArray(x) ? x.join(",") : x) -} - -export function stringify(x: unknown): Code { - return new _Code(safeStringify(x)) -} - -export function safeStringify(x: unknown): string { - return JSON.stringify(x) - .replace(/\u2028/g, "\\u2028") - .replace(/\u2029/g, "\\u2029") -} - -export function getProperty(key: Code | string | number): Code { - return typeof key == "string" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]` -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/codegen/index.ts b/node_modules/table/node_modules/ajv/lib/compile/codegen/index.ts deleted file mode 100644 index e33de346b..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/codegen/index.ts +++ /dev/null @@ -1,832 +0,0 @@ -import type {ScopeValueSets, NameValue, ValueScope, ValueScopeName} from "./scope" -import {_, nil, _Code, Code, Name, UsedNames, CodeItem, addCodeArg, _CodeOrName} from "./code" -import {Scope, varKinds} from "./scope" - -export {_, str, strConcat, nil, getProperty, stringify, Name, Code} from "./code" -export {Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds} from "./scope" - -// type for expressions that can be safely inserted in code without quotes -export type SafeExpr = Code | number | boolean | null - -// type that is either Code of function that adds code to CodeGen instance using its methods -export type Block = Code | (() => void) - -export const operators = { - GT: new _Code(">"), - GTE: new _Code(">="), - LT: new _Code("<"), - LTE: new _Code("<="), - EQ: new _Code("==="), - NEQ: new _Code("!=="), - NOT: new _Code("!"), - OR: new _Code("||"), - AND: new _Code("&&"), - ADD: new _Code("+"), -} - -abstract class Node { - abstract readonly names: UsedNames - - optimizeNodes(): this | ChildNode | ChildNode[] | undefined { - return this - } - - optimizeNames(_names: UsedNames, _constants: Constants): this | undefined { - return this - } - - // get count(): number { - // return 1 - // } -} - -class Def extends Node { - constructor(private readonly varKind: Name, private readonly name: Name, private rhs?: SafeExpr) { - super() - } - - render({es5, _n}: CGOptions): string { - const varKind = es5 ? varKinds.var : this.varKind - const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}` - return `${varKind} ${this.name}${rhs};` + _n - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (!names[this.name.str]) return - if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants) - return this - } - - get names(): UsedNames { - return this.rhs instanceof _CodeOrName ? this.rhs.names : {} - } -} - -class Assign extends Node { - constructor(readonly lhs: Code, public rhs: SafeExpr, private readonly sideEffects?: boolean) { - super() - } - - render({_n}: CGOptions): string { - return `${this.lhs} = ${this.rhs};` + _n - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (this.lhs instanceof Name && !names[this.lhs.str] && !this.sideEffects) return - this.rhs = optimizeExpr(this.rhs, names, constants) - return this - } - - get names(): UsedNames { - const names = this.lhs instanceof Name ? {} : {...this.lhs.names} - return addExprNames(names, this.rhs) - } -} - -class AssignOp extends Assign { - constructor(lhs: Code, private readonly op: Code, rhs: SafeExpr, sideEffects?: boolean) { - super(lhs, rhs, sideEffects) - } - - render({_n}: CGOptions): string { - return `${this.lhs} ${this.op}= ${this.rhs};` + _n - } -} - -class Label extends Node { - readonly names: UsedNames = {} - constructor(readonly label: Name) { - super() - } - - render({_n}: CGOptions): string { - return `${this.label}:` + _n - } -} - -class Break extends Node { - readonly names: UsedNames = {} - constructor(readonly label?: Code) { - super() - } - - render({_n}: CGOptions): string { - const label = this.label ? ` ${this.label}` : "" - return `break${label};` + _n - } -} - -class Throw extends Node { - constructor(readonly error: Code) { - super() - } - - render({_n}: CGOptions): string { - return `throw ${this.error};` + _n - } - - get names(): UsedNames { - return this.error.names - } -} - -class AnyCode extends Node { - constructor(private code: SafeExpr) { - super() - } - - render({_n}: CGOptions): string { - return `${this.code};` + _n - } - - optimizeNodes(): this | undefined { - return `${this.code}` ? this : undefined - } - - optimizeNames(names: UsedNames, constants: Constants): this { - this.code = optimizeExpr(this.code, names, constants) - return this - } - - get names(): UsedNames { - return this.code instanceof _CodeOrName ? this.code.names : {} - } -} - -abstract class ParentNode extends Node { - constructor(readonly nodes: ChildNode[] = []) { - super() - } - - render(opts: CGOptions): string { - return this.nodes.reduce((code, n) => code + n.render(opts), "") - } - - optimizeNodes(): this | ChildNode | ChildNode[] | undefined { - const {nodes} = this - let i = nodes.length - while (i--) { - const n = nodes[i].optimizeNodes() - if (Array.isArray(n)) nodes.splice(i, 1, ...n) - else if (n) nodes[i] = n - else nodes.splice(i, 1) - } - return nodes.length > 0 ? this : undefined - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - const {nodes} = this - let i = nodes.length - while (i--) { - // iterating backwards improves 1-pass optimization - const n = nodes[i] - if (n.optimizeNames(names, constants)) continue - subtractNames(names, n.names) - nodes.splice(i, 1) - } - return nodes.length > 0 ? this : undefined - } - - get names(): UsedNames { - return this.nodes.reduce((names: UsedNames, n) => addNames(names, n.names), {}) - } - - // get count(): number { - // return this.nodes.reduce((c, n) => c + n.count, 1) - // } -} - -abstract class BlockNode extends ParentNode { - render(opts: CGOptions): string { - return "{" + opts._n + super.render(opts) + "}" + opts._n - } -} - -class Root extends ParentNode {} - -class Else extends BlockNode { - static readonly kind = "else" -} - -class If extends BlockNode { - static readonly kind = "if" - else?: If | Else - constructor(private condition: Code | boolean, nodes?: ChildNode[]) { - super(nodes) - } - - render(opts: CGOptions): string { - let code = `if(${this.condition})` + super.render(opts) - if (this.else) code += "else " + this.else.render(opts) - return code - } - - optimizeNodes(): If | ChildNode[] | undefined { - super.optimizeNodes() - const cond = this.condition - if (cond === true) return this.nodes // else is ignored here - let e = this.else - if (e) { - const ns = e.optimizeNodes() - e = this.else = Array.isArray(ns) ? new Else(ns) : (ns as Else | undefined) - } - if (e) { - if (cond === false) return e instanceof If ? e : e.nodes - if (this.nodes.length) return this - return new If(not(cond), e instanceof If ? [e] : e.nodes) - } - if (cond === false || !this.nodes.length) return undefined - return this - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - this.else = this.else?.optimizeNames(names, constants) - if (!(super.optimizeNames(names, constants) || this.else)) return - this.condition = optimizeExpr(this.condition, names, constants) - return this - } - - get names(): UsedNames { - const names = super.names - addExprNames(names, this.condition) - if (this.else) addNames(names, this.else.names) - return names - } - - // get count(): number { - // return super.count + (this.else?.count || 0) - // } -} - -abstract class For extends BlockNode { - static readonly kind = "for" -} - -class ForLoop extends For { - constructor(private iteration: Code) { - super() - } - - render(opts: CGOptions): string { - return `for(${this.iteration})` + super.render(opts) - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (!super.optimizeNames(names, constants)) return - this.iteration = optimizeExpr(this.iteration, names, constants) - return this - } - - get names(): UsedNames { - return addNames(super.names, this.iteration.names) - } -} - -class ForRange extends For { - constructor( - private readonly varKind: Name, - private readonly name: Name, - private readonly from: SafeExpr, - private readonly to: SafeExpr - ) { - super() - } - - render(opts: CGOptions): string { - const varKind = opts.es5 ? varKinds.var : this.varKind - const {name, from, to} = this - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts) - } - - get names(): UsedNames { - const names = addExprNames(super.names, this.from) - return addExprNames(names, this.to) - } -} - -class ForIter extends For { - constructor( - private readonly loop: "of" | "in", - private readonly varKind: Name, - private readonly name: Name, - private iterable: Code - ) { - super() - } - - render(opts: CGOptions): string { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts) - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (!super.optimizeNames(names, constants)) return - this.iterable = optimizeExpr(this.iterable, names, constants) - return this - } - - get names(): UsedNames { - return addNames(super.names, this.iterable.names) - } -} - -class Func extends BlockNode { - static readonly kind = "func" - constructor(public name: Name, public args: Code, public async?: boolean) { - super() - } - - render(opts: CGOptions): string { - const _async = this.async ? "async " : "" - return `${_async}function ${this.name}(${this.args})` + super.render(opts) - } -} - -class Return extends ParentNode { - static readonly kind = "return" - - render(opts: CGOptions): string { - return "return " + super.render(opts) - } -} - -class Try extends BlockNode { - catch?: Catch - finally?: Finally - - render(opts: CGOptions): string { - let code = "try" + super.render(opts) - if (this.catch) code += this.catch.render(opts) - if (this.finally) code += this.finally.render(opts) - return code - } - - optimizeNodes(): this { - super.optimizeNodes() - this.catch?.optimizeNodes() as Catch | undefined - this.finally?.optimizeNodes() as Finally | undefined - return this - } - - optimizeNames(names: UsedNames, constants: Constants): this { - super.optimizeNames(names, constants) - this.catch?.optimizeNames(names, constants) - this.finally?.optimizeNames(names, constants) - return this - } - - get names(): UsedNames { - const names = super.names - if (this.catch) addNames(names, this.catch.names) - if (this.finally) addNames(names, this.finally.names) - return names - } - - // get count(): number { - // return super.count + (this.catch?.count || 0) + (this.finally?.count || 0) - // } -} - -class Catch extends BlockNode { - static readonly kind = "catch" - constructor(readonly error: Name) { - super() - } - - render(opts: CGOptions): string { - return `catch(${this.error})` + super.render(opts) - } -} - -class Finally extends BlockNode { - static readonly kind = "finally" - render(opts: CGOptions): string { - return "finally" + super.render(opts) - } -} - -type StartBlockNode = If | For | Func | Return | Try - -type LeafNode = Def | Assign | Label | Break | Throw | AnyCode - -type ChildNode = StartBlockNode | LeafNode - -type EndBlockNodeType = - | typeof If - | typeof Else - | typeof For - | typeof Func - | typeof Return - | typeof Catch - | typeof Finally - -type Constants = Record - -export interface CodeGenOptions { - es5?: boolean - lines?: boolean - ownProperties?: boolean -} - -interface CGOptions extends CodeGenOptions { - _n: "\n" | "" -} - -export class CodeGen { - readonly _scope: Scope - readonly _extScope: ValueScope - readonly _values: ScopeValueSets = {} - private readonly _nodes: ParentNode[] - private readonly _blockStarts: number[] = [] - private readonly _constants: Constants = {} - private readonly opts: CGOptions - - constructor(extScope: ValueScope, opts: CodeGenOptions = {}) { - this.opts = {...opts, _n: opts.lines ? "\n" : ""} - this._extScope = extScope - this._scope = new Scope({parent: extScope}) - this._nodes = [new Root()] - } - - toString(): string { - return this._root.render(this.opts) - } - - // returns unique name in the internal scope - name(prefix: string): Name { - return this._scope.name(prefix) - } - - // reserves unique name in the external scope - scopeName(prefix: string): ValueScopeName { - return this._extScope.name(prefix) - } - - // reserves unique name in the external scope and assigns value to it - scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name { - const name = this._extScope.value(prefixOrName, value) - const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()) - vs.add(name) - return name - } - - getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { - return this._extScope.getValue(prefix, keyOrRef) - } - - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(scopeName: Name): Code { - return this._extScope.scopeRefs(scopeName, this._values) - } - - scopeCode(): Code { - return this._extScope.scopeCode(this._values) - } - - private _def( - varKind: Name, - nameOrPrefix: Name | string, - rhs?: SafeExpr, - constant?: boolean - ): Name { - const name = this._scope.toName(nameOrPrefix) - if (rhs !== undefined && constant) this._constants[name.str] = rhs - this._leafNode(new Def(varKind, name, rhs)) - return name - } - - // `const` declaration (`var` in es5 mode) - const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name { - return this._def(varKinds.const, nameOrPrefix, rhs, _constant) - } - - // `let` declaration with optional assignment (`var` in es5 mode) - let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { - return this._def(varKinds.let, nameOrPrefix, rhs, _constant) - } - - // `var` declaration with optional assignment - var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { - return this._def(varKinds.var, nameOrPrefix, rhs, _constant) - } - - // assignment code - assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen { - return this._leafNode(new Assign(lhs, rhs, sideEffects)) - } - - // `+=` code - add(lhs: Code, rhs: SafeExpr): CodeGen { - return this._leafNode(new AssignOp(lhs, operators.ADD, rhs)) - } - - // appends passed SafeExpr to code or executes Block - code(c: Block | SafeExpr): CodeGen { - if (typeof c == "function") c() - else if (c !== nil) this._leafNode(new AnyCode(c)) - return this - } - - // returns code for object literal for the passed argument list of key-value pairs - object(...keyValues: [Name | string, SafeExpr | string][]): _Code { - const code: CodeItem[] = ["{"] - for (const [key, value] of keyValues) { - if (code.length > 1) code.push(",") - code.push(key) - if (key !== value || this.opts.es5) { - code.push(":") - addCodeArg(code, value) - } - } - code.push("}") - return new _Code(code) - } - - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen { - this._blockNode(new If(condition)) - - if (thenBody && elseBody) { - this.code(thenBody).else().code(elseBody).endIf() - } else if (thenBody) { - this.code(thenBody).endIf() - } else if (elseBody) { - throw new Error('CodeGen: "else" body without "then" body') - } - return this - } - - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(condition: Code | boolean): CodeGen { - return this._elseNode(new If(condition)) - } - - // `else` clause - only valid after `if` or `else if` clauses - else(): CodeGen { - return this._elseNode(new Else()) - } - - // end `if` statement (needed if gen.if was used only with condition) - endIf(): CodeGen { - return this._endBlockNode(If, Else) - } - - private _for(node: For, forBody?: Block): CodeGen { - this._blockNode(node) - if (forBody) this.code(forBody).endFor() - return this - } - - // a generic `for` clause (or statement if `forBody` is passed) - for(iteration: Code, forBody?: Block): CodeGen { - return this._for(new ForLoop(iteration), forBody) - } - - // `for` statement for a range of values - forRange( - nameOrPrefix: Name | string, - from: SafeExpr, - to: SafeExpr, - forBody: (index: Name) => void, - varKind: Code = this.opts.es5 ? varKinds.var : varKinds.let - ): CodeGen { - const name = this._scope.toName(nameOrPrefix) - return this._for(new ForRange(varKind, name, from, to), () => forBody(name)) - } - - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf( - nameOrPrefix: Name | string, - iterable: Code, - forBody: (item: Name) => void, - varKind: Code = varKinds.const - ): CodeGen { - const name = this._scope.toName(nameOrPrefix) - if (this.opts.es5) { - const arr = iterable instanceof Name ? iterable : this.var("_arr", iterable) - return this.forRange("_i", 0, _`${arr}.length`, (i) => { - this.var(name, _`${arr}[${i}]`) - forBody(name) - }) - } - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)) - } - - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn( - nameOrPrefix: Name | string, - obj: Code, - forBody: (item: Name) => void, - varKind: Code = this.opts.es5 ? varKinds.var : varKinds.const - ): CodeGen { - if (this.opts.ownProperties) { - return this.forOf(nameOrPrefix, _`Object.keys(${obj})`, forBody) - } - const name = this._scope.toName(nameOrPrefix) - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)) - } - - // end `for` loop - endFor(): CodeGen { - return this._endBlockNode(For) - } - - // `label` statement - label(label: Name): CodeGen { - return this._leafNode(new Label(label)) - } - - // `break` statement - break(label?: Code): CodeGen { - return this._leafNode(new Break(label)) - } - - // `return` statement - return(value: Block | SafeExpr): CodeGen { - const node = new Return() - this._blockNode(node) - this.code(value) - if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node') - return this._endBlockNode(Return) - } - - // `try` statement - try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen { - if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"') - const node = new Try() - this._blockNode(node) - this.code(tryBody) - if (catchCode) { - const error = this.name("e") - this._currNode = node.catch = new Catch(error) - catchCode(error) - } - if (finallyCode) { - this._currNode = node.finally = new Finally() - this.code(finallyCode) - } - return this._endBlockNode(Catch, Finally) - } - - // `throw` statement - throw(error: Code): CodeGen { - return this._leafNode(new Throw(error)) - } - - // start self-balancing block - block(body?: Block, nodeCount?: number): CodeGen { - this._blockStarts.push(this._nodes.length) - if (body) this.code(body).endBlock(nodeCount) - return this - } - - // end the current self-balancing block - endBlock(nodeCount?: number): CodeGen { - const len = this._blockStarts.pop() - if (len === undefined) throw new Error("CodeGen: not in self-balancing block") - const toClose = this._nodes.length - len - if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`) - } - this._nodes.length = len - return this - } - - // `function` heading (or definition if funcBody is passed) - func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen { - this._blockNode(new Func(name, args, async)) - if (funcBody) this.code(funcBody).endFunc() - return this - } - - // end function definition - endFunc(): CodeGen { - return this._endBlockNode(Func) - } - - optimize(n = 1): void { - while (n-- > 0) { - this._root.optimizeNodes() - this._root.optimizeNames(this._root.names, this._constants) - } - } - - private _leafNode(node: LeafNode): CodeGen { - this._currNode.nodes.push(node) - return this - } - - private _blockNode(node: StartBlockNode): void { - this._currNode.nodes.push(node) - this._nodes.push(node) - } - - private _endBlockNode(N1: EndBlockNodeType, N2?: EndBlockNodeType): CodeGen { - const n = this._currNode - if (n instanceof N1 || (N2 && n instanceof N2)) { - this._nodes.pop() - return this - } - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`) - } - - private _elseNode(node: If | Else): CodeGen { - const n = this._currNode - if (!(n instanceof If)) { - throw new Error('CodeGen: "else" without "if"') - } - this._currNode = n.else = node - return this - } - - private get _root(): Root { - return this._nodes[0] as Root - } - - private get _currNode(): ParentNode { - const ns = this._nodes - return ns[ns.length - 1] - } - - private set _currNode(node: ParentNode) { - const ns = this._nodes - ns[ns.length - 1] = node - } - - // get nodeCount(): number { - // return this._root.count - // } -} - -function addNames(names: UsedNames, from: UsedNames): UsedNames { - for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0) - return names -} - -function addExprNames(names: UsedNames, from: SafeExpr): UsedNames { - return from instanceof _CodeOrName ? addNames(names, from.names) : names -} - -function optimizeExpr(expr: T, names: UsedNames, constants: Constants): T -function optimizeExpr(expr: SafeExpr, names: UsedNames, constants: Constants): SafeExpr { - if (expr instanceof Name) return replaceName(expr) - if (!canOptimize(expr)) return expr - return new _Code( - expr._items.reduce((items: CodeItem[], c: SafeExpr | string) => { - if (c instanceof Name) c = replaceName(c) - if (c instanceof _Code) items.push(...c._items) - else items.push(c) - return items - }, []) - ) - - function replaceName(n: Name): SafeExpr { - const c = constants[n.str] - if (c === undefined || names[n.str] !== 1) return n - delete names[n.str] - return c - } - - function canOptimize(e: SafeExpr): e is _Code { - return ( - e instanceof _Code && - e._items.some( - (c) => c instanceof Name && names[c.str] === 1 && constants[c.str] !== undefined - ) - ) - } -} - -function subtractNames(names: UsedNames, from: UsedNames): void { - for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0) -} - -export function not(x: T): T -export function not(x: Code | SafeExpr): Code | SafeExpr { - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : _`!${par(x)}` -} - -const andCode = mappend(operators.AND) - -// boolean AND (&&) expression with the passed arguments -export function and(...args: Code[]): Code { - return args.reduce(andCode) -} - -const orCode = mappend(operators.OR) - -// boolean OR (||) expression with the passed arguments -export function or(...args: Code[]): Code { - return args.reduce(orCode) -} - -type MAppend = (x: Code, y: Code) => Code - -function mappend(op: Code): MAppend { - return (x, y) => (x === nil ? y : y === nil ? x : _`${par(x)} ${op} ${par(y)}`) -} - -function par(x: Code): Code { - return x instanceof Name ? x : _`(${x})` -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/codegen/scope.ts b/node_modules/table/node_modules/ajv/lib/compile/codegen/scope.ts deleted file mode 100644 index 511992297..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/codegen/scope.ts +++ /dev/null @@ -1,215 +0,0 @@ -import {_, nil, Code, Name} from "./code" - -interface NameGroup { - prefix: string - index: number -} - -export interface NameValue { - ref: ValueReference // this is the reference to any value that can be referred to from generated code via `globals` var in the closure - key?: unknown // any key to identify a global to avoid duplicates, if not passed ref is used - code?: Code // this is the code creating the value needed for standalone code wit_out closure - can be a primitive value, function or import (`require`) -} - -export type ValueReference = unknown // possibly make CodeGen parameterized type on this type - -class ValueError extends Error { - readonly value?: NameValue - constructor(name: ValueScopeName) { - super(`CodeGen: "code" for ${name} not defined`) - this.value = name.value - } -} - -interface ScopeOptions { - prefixes?: Set - parent?: Scope -} - -interface ValueScopeOptions extends ScopeOptions { - scope: ScopeStore - es5?: boolean - lines?: boolean -} - -export type ScopeStore = Record - -type ScopeValues = { - [Prefix in string]?: Map -} - -export type ScopeValueSets = { - [Prefix in string]?: Set -} - -export enum UsedValueState { - Started, - Completed, -} - -export type UsedScopeValues = { - [Prefix in string]?: Map -} - -export const varKinds = { - const: new Name("const"), - let: new Name("let"), - var: new Name("var"), -} - -export class Scope { - protected readonly _names: {[Prefix in string]?: NameGroup} = {} - protected readonly _prefixes?: Set - protected readonly _parent?: Scope - - constructor({prefixes, parent}: ScopeOptions = {}) { - this._prefixes = prefixes - this._parent = parent - } - - toName(nameOrPrefix: Name | string): Name { - return nameOrPrefix instanceof Name ? nameOrPrefix : this.name(nameOrPrefix) - } - - name(prefix: string): Name { - return new Name(this._newName(prefix)) - } - - protected _newName(prefix: string): string { - const ng = this._names[prefix] || this._nameGroup(prefix) - return `${prefix}${ng.index++}` - } - - private _nameGroup(prefix: string): NameGroup { - if (this._parent?._prefixes?.has(prefix) || (this._prefixes && !this._prefixes.has(prefix))) { - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`) - } - return (this._names[prefix] = {prefix, index: 0}) - } -} - -interface ScopePath { - property: string - itemIndex: number -} - -export class ValueScopeName extends Name { - readonly prefix: string - value?: NameValue - scopePath?: Code - - constructor(prefix: string, nameStr: string) { - super(nameStr) - this.prefix = prefix - } - - setValue(value: NameValue, {property, itemIndex}: ScopePath): void { - this.value = value - this.scopePath = _`.${new Name(property)}[${itemIndex}]` - } -} - -interface VSOptions extends ValueScopeOptions { - _n: Code -} - -const line = _`\n` - -export class ValueScope extends Scope { - protected readonly _values: ScopeValues = {} - protected readonly _scope: ScopeStore - readonly opts: VSOptions - - constructor(opts: ValueScopeOptions) { - super(opts) - this._scope = opts.scope - this.opts = {...opts, _n: opts.lines ? line : nil} - } - - get(): ScopeStore { - return this._scope - } - - name(prefix: string): ValueScopeName { - return new ValueScopeName(prefix, this._newName(prefix)) - } - - value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName { - if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value") - const name = this.toName(nameOrPrefix) as ValueScopeName - const {prefix} = name - const valueKey = value.key ?? value.ref - let vs = this._values[prefix] - if (vs) { - const _name = vs.get(valueKey) - if (_name) return _name - } else { - vs = this._values[prefix] = new Map() - } - vs.set(valueKey, name) - - const s = this._scope[prefix] || (this._scope[prefix] = []) - const itemIndex = s.length - s[itemIndex] = value.ref - name.setValue(value, {property: prefix, itemIndex}) - return name - } - - getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { - const vs = this._values[prefix] - if (!vs) return - return vs.get(keyOrRef) - } - - scopeRefs(scopeName: Name, values: ScopeValues | ScopeValueSets = this._values): Code { - return this._reduceValues(values, (name: ValueScopeName) => { - if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`) - return _`${scopeName}${name.scopePath}` - }) - } - - scopeCode( - values: ScopeValues | ScopeValueSets = this._values, - usedValues?: UsedScopeValues, - getCode?: (n: ValueScopeName) => Code | undefined - ): Code { - return this._reduceValues( - values, - (name: ValueScopeName) => { - if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`) - return name.value.code - }, - usedValues, - getCode - ) - } - - private _reduceValues( - values: ScopeValues | ScopeValueSets, - valueCode: (n: ValueScopeName) => Code | undefined, - usedValues: UsedScopeValues = {}, - getCode?: (n: ValueScopeName) => Code | undefined - ): Code { - let code: Code = nil - for (const prefix in values) { - const vs = values[prefix] - if (!vs) continue - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()) - vs.forEach((name: ValueScopeName) => { - if (nameSet.has(name)) return - nameSet.set(name, UsedValueState.Started) - let c = valueCode(name) - if (c) { - const def = this.opts.es5 ? varKinds.var : varKinds.const - code = _`${code}${def} ${name} = ${c};${this.opts._n}` - } else if ((c = getCode?.(name))) { - code = _`${code}${c}${this.opts._n}` - } else { - throw new ValueError(name) - } - nameSet.set(name, UsedValueState.Completed) - }) - } - return code - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/context.ts b/node_modules/table/node_modules/ajv/lib/compile/context.ts deleted file mode 100644 index d2472eedf..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/context.ts +++ /dev/null @@ -1,266 +0,0 @@ -import type { - AddedKeywordDefinition, - KeywordErrorCxt, - KeywordCxtParams, - AnySchemaObject, -} from "../types" -import {SchemaCxt, SchemaObjCxt} from "./index" -import {JSONType} from "./rules" -import {checkDataTypes, DataType} from "./validate/dataType" -import {schemaRefOrVal, unescapeJsonPointer, mergeEvaluated} from "./util" -import {reportError, reportExtraError, resetErrorsCount, keyword$DataError} from "./errors" -import {CodeGen, _, nil, or, not, getProperty, Code, Name} from "./codegen" -import N from "./names" -import {applySubschema, SubschemaArgs} from "./subschema" - -export default class KeywordCxt implements KeywordErrorCxt { - readonly gen: CodeGen - readonly allErrors?: boolean - readonly keyword: string - readonly data: Name // Name referencing the current level of the data instance - readonly $data?: string | false - schema: any // keyword value in the schema - readonly schemaValue: Code | number | boolean // Code reference to keyword schema value or primitive value - readonly schemaCode: Code | number | boolean // Code reference to resolved schema value (different if schema is $data) - readonly schemaType: JSONType[] // allowed type(s) of keyword value in the schema - readonly parentSchema: AnySchemaObject - readonly errsCount?: Name // Name reference to the number of validation errors collected before this keyword, - // requires option trackErrors in keyword definition - params: KeywordCxtParams // object to pass parameters to error messages from keyword code - readonly it: SchemaObjCxt // schema compilation context (schema is guaranteed to be an object, not boolean) - readonly def: AddedKeywordDefinition - - constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) { - validateKeywordUsage(it, def, keyword) - this.gen = it.gen - this.allErrors = it.allErrors - this.keyword = keyword - this.data = it.data - this.schema = it.schema[keyword] - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data - this.schemaValue = schemaRefOrVal(it, this.schema, keyword, this.$data) - this.schemaType = def.schemaType - this.parentSchema = it.schema - this.params = {} - this.it = it - this.def = def - - if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)) - } else { - this.schemaCode = this.schemaValue - if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) { - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`) - } - } - - if ("code" in def ? def.trackErrors : def.errors !== false) { - this.errsCount = it.gen.const("_errs", N.errors) - } - } - - result(condition: Code, successAction?: () => void, failAction?: () => void): void { - this.gen.if(not(condition)) - if (failAction) failAction() - else this.error() - if (successAction) { - this.gen.else() - successAction() - if (this.allErrors) this.gen.endIf() - } else { - if (this.allErrors) this.gen.endIf() - else this.gen.else() - } - } - - pass(condition: Code, failAction?: () => void): void { - this.result(condition, undefined, failAction) - } - - fail(condition?: Code): void { - if (condition === undefined) { - this.error() - if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize - return - } - this.gen.if(condition) - this.error() - if (this.allErrors) this.gen.endIf() - else this.gen.else() - } - - fail$data(condition: Code): void { - if (!this.$data) return this.fail(condition) - const {schemaCode} = this - this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`) - } - - error(append?: true): void { - ;(append ? reportExtraError : reportError)(this, this.def.error) - } - - $dataError(): void { - reportError(this, this.def.$dataError || keyword$DataError) - } - - reset(): void { - if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition') - resetErrorsCount(this.gen, this.errsCount) - } - - ok(cond: Code | boolean): void { - if (!this.allErrors) this.gen.if(cond) - } - - setParams(obj: KeywordCxtParams, assign?: true): void { - if (assign) Object.assign(this.params, obj) - else this.params = obj - } - - block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void { - this.gen.block(() => { - this.check$data(valid, $dataValid) - codeBlock() - }) - } - - check$data(valid: Name = nil, $dataValid: Code = nil): void { - if (!this.$data) return - const {gen, schemaCode, schemaType, def} = this - gen.if(or(_`${schemaCode} === undefined`, $dataValid)) - if (valid !== nil) gen.assign(valid, true) - if (schemaType.length || def.validateSchema) { - gen.elseIf(this.invalid$data()) - this.$dataError() - if (valid !== nil) gen.assign(valid, false) - } - gen.else() - } - - invalid$data(): Code { - const {gen, schemaCode, schemaType, def, it} = this - return or(wrong$DataType(), invalid$DataSchema()) - - function wrong$DataType(): Code { - if (schemaType.length) { - /* istanbul ignore if */ - if (!(schemaCode instanceof Name)) throw new Error("ajv implementation error") - const st = Array.isArray(schemaType) ? schemaType : [schemaType] - return _`${checkDataTypes(st, schemaCode, it.opts.strict, DataType.Wrong)}` - } - return nil - } - - function invalid$DataSchema(): Code { - if (def.validateSchema) { - const validateSchemaRef = gen.scopeValue("validate$data", {ref: def.validateSchema}) // TODO value.code for standalone - return _`!${validateSchemaRef}(${schemaCode})` - } - return nil - } - } - - subschema(appl: SubschemaArgs, valid: Name): SchemaCxt { - return applySubschema(this.it, appl, valid) - } - - mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void { - const {it, gen} = this - if (!it.opts.unevaluated) return - if (it.props !== true && schemaCxt.props !== undefined) { - it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName) - } - if (it.items !== true && schemaCxt.items !== undefined) { - it.items = mergeEvaluated.items(gen, schemaCxt.items, it.items, toName) - } - } - - mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void { - const {it, gen} = this - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { - gen.if(valid, () => this.mergeEvaluated(schemaCxt, Name)) - return true - } - } -} - -function validSchemaType(schema: unknown, schemaType: JSONType[], allowUndefined = false): boolean { - // TODO add tests - return ( - !schemaType.length || - schemaType.some((st) => - st === "array" - ? Array.isArray(schema) - : st === "object" - ? schema && typeof schema == "object" && !Array.isArray(schema) - : typeof schema == st || (allowUndefined && typeof schema == "undefined") - ) - ) -} - -function validateKeywordUsage( - {schema, opts, self}: SchemaObjCxt, - def: AddedKeywordDefinition, - keyword: string -): void { - /* istanbul ignore if */ - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { - throw new Error("ajv implementation error") - } - - const deps = def.dependencies - if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`) - } - - if (def.validateSchema) { - const valid = def.validateSchema(schema[keyword]) - if (!valid) { - const msg = "keyword value is invalid: " + self.errorsText(def.validateSchema.errors) - if (opts.validateSchema === "log") self.logger.error(msg) - else throw new Error(msg) - } - } -} - -const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/ -const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/ -export function getData( - $data: string, - {dataLevel, dataNames, dataPathArr}: SchemaCxt -): Code | number { - let jsonPointer - let data: Code - if ($data === "") return N.rootData - if ($data[0] === "/") { - if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`) - jsonPointer = $data - data = N.rootData - } else { - const matches = RELATIVE_JSON_POINTER.exec($data) - if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`) - const up: number = +matches[1] - jsonPointer = matches[2] - if (jsonPointer === "#") { - if (up >= dataLevel) throw new Error(errorMsg("property/index", up)) - return dataPathArr[dataLevel - up] - } - if (up > dataLevel) throw new Error(errorMsg("data", up)) - data = dataNames[dataLevel - up] - if (!jsonPointer) return data - } - - let expr = data - const segments = jsonPointer.split("/") - for (const segment of segments) { - if (segment) { - data = _`${data}${getProperty(unescapeJsonPointer(segment))}` - expr = _`${expr} && ${data}` - } - } - return expr - - function errorMsg(pointerType: string, up: number): string { - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}` - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/equal.js b/node_modules/table/node_modules/ajv/lib/compile/equal.js deleted file mode 100644 index b67591643..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/equal.js +++ /dev/null @@ -1,3 +0,0 @@ -// do NOT remove this file - it would break pre-compiled schemas -// https://github.com/ajv-validator/ajv/issues/889 -module.exports = require("fast-deep-equal") diff --git a/node_modules/table/node_modules/ajv/lib/compile/error_classes.ts b/node_modules/table/node_modules/ajv/lib/compile/error_classes.ts deleted file mode 100644 index da35f85af..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/error_classes.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type {ErrorObject} from "../types" -import {resolveUrl, normalizeId, getFullPath} from "./resolve" - -export class ValidationError extends Error { - readonly errors: Partial[] - readonly ajv: true - readonly validation: true - - constructor(errors: Partial[]) { - super("validation failed") - this.errors = errors - this.ajv = this.validation = true - } -} - -export class MissingRefError extends Error { - readonly missingRef: string - readonly missingSchema: string - - constructor(baseId: string, ref: string, msg?: string) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`) - this.missingRef = resolveUrl(baseId, ref) - this.missingSchema = normalizeId(getFullPath(this.missingRef)) - } -} - -module.exports = { - ValidationError, - MissingRefError, -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/errors.ts b/node_modules/table/node_modules/ajv/lib/compile/errors.ts deleted file mode 100644 index e1a497c89..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/errors.ts +++ /dev/null @@ -1,154 +0,0 @@ -import type {KeywordErrorCxt, KeywordErrorDefinition} from "../types" -import type {SchemaCxt} from "./index" -import {CodeGen, _, str, strConcat, Code, Name} from "./codegen" -import {SafeExpr} from "./codegen/code" -import N from "./names" - -export const keywordError: KeywordErrorDefinition = { - message: ({keyword}) => str`should pass "${keyword}" keyword validation`, -} - -export const keyword$DataError: KeywordErrorDefinition = { - message: ({keyword, schemaType}) => - schemaType - ? str`"${keyword}" keyword must be ${schemaType} ($data)` - : str`"${keyword}" keyword is invalid ($data)`, -} - -export function reportError( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition = keywordError, - overrideAllErrors?: boolean -): void { - const {it} = cxt - const {gen, compositeRule, allErrors} = it - const errObj = errorObjectCode(cxt, error) - if (overrideAllErrors ?? (compositeRule || allErrors)) { - addError(gen, errObj) - } else { - returnErrors(it, _`[${errObj}]`) - } -} - -export function reportExtraError( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition = keywordError -): void { - const {it} = cxt - const {gen, compositeRule, allErrors} = it - const errObj = errorObjectCode(cxt, error) - addError(gen, errObj) - if (!(compositeRule || allErrors)) { - returnErrors(it, N.vErrors) - } -} - -export function resetErrorsCount(gen: CodeGen, errsCount: Name): void { - gen.assign(N.errors, errsCount) - gen.if(_`${N.vErrors} !== null`, () => - gen.if( - errsCount, - () => gen.assign(_`${N.vErrors}.length`, errsCount), - () => gen.assign(N.vErrors, null) - ) - ) -} - -export function extendErrors({ - gen, - keyword, - schemaValue, - data, - errsCount, - it, -}: KeywordErrorCxt): void { - /* istanbul ignore if */ - if (errsCount === undefined) throw new Error("ajv implementation error") - const err = gen.name("err") - gen.forRange("i", errsCount, N.errors, (i) => { - gen.const(err, _`${N.vErrors}[${i}]`) - gen.if(_`${err}.dataPath === undefined`, () => - gen.assign(_`${err}.dataPath`, strConcat(N.dataPath, it.errorPath)) - ) - gen.assign(_`${err}.schemaPath`, str`${it.errSchemaPath}/${keyword}`) - if (it.opts.verbose) { - gen.assign(_`${err}.schema`, schemaValue) - gen.assign(_`${err}.data`, data) - } - }) -} - -function addError(gen: CodeGen, errObj: Code): void { - const err = gen.const("err", errObj) - gen.if( - _`${N.vErrors} === null`, - () => gen.assign(N.vErrors, _`[${err}]`), - _`${N.vErrors}.push(${err})` - ) - gen.code(_`${N.errors}++`) -} - -function returnErrors(it: SchemaCxt, errs: Code): void { - const {gen, validateName, schemaEnv} = it - if (schemaEnv.$async) { - gen.throw(_`new ${it.ValidationError as Name}(${errs})`) - } else { - gen.assign(_`${validateName}.errors`, errs) - gen.return(false) - } -} - -const E = { - keyword: new Name("keyword"), - schemaPath: new Name("schemaPath"), // also used in JTD errors - params: new Name("params"), - propertyName: new Name("propertyName"), - message: new Name("message"), - schema: new Name("schema"), - parentSchema: new Name("parentSchema"), - // JTD error properties - instancePath: new Name("instancePath"), -} - -function errorObjectCode(cxt: KeywordErrorCxt, error: KeywordErrorDefinition): Code { - const {createErrors, opts} = cxt.it - if (createErrors === false) return _`{}` - return (opts.jtd && !opts.ajvErrors ? jtdErrorObject : ajvErrorObject)(cxt, error) -} - -function jtdErrorObject(cxt: KeywordErrorCxt, {message}: KeywordErrorDefinition): Code { - const {gen, keyword, it} = cxt - const {errorPath, errSchemaPath, opts} = it - const keyValues: [Name, SafeExpr | string][] = [ - [E.instancePath, strConcat(N.dataPath, errorPath)], - [E.schemaPath, str`${errSchemaPath}/${keyword}`], - ] - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]) - } - return gen.object(...keyValues) -} - -function ajvErrorObject(cxt: KeywordErrorCxt, error: KeywordErrorDefinition): Code { - const {gen, keyword, data, schemaValue, it} = cxt - const {topSchemaRef, schemaPath, errorPath, errSchemaPath, propertyName, opts} = it - const {params, message} = error - const keyValues: [Name, SafeExpr | string][] = [ - [E.keyword, keyword], - [N.dataPath, strConcat(N.dataPath, errorPath)], - [E.schemaPath, str`${errSchemaPath}/${keyword}`], - [E.params, typeof params == "function" ? params(cxt) : params || _`{}`], - ] - if (propertyName) keyValues.push([E.propertyName, propertyName]) - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]) - } - if (opts.verbose) { - keyValues.push( - [E.schema, schemaValue], - [E.parentSchema, _`${topSchemaRef}${schemaPath}`], - [N.data, data] - ) - } - return gen.object(...keyValues) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/index.ts b/node_modules/table/node_modules/ajv/lib/compile/index.ts deleted file mode 100644 index 42770a609..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/index.ts +++ /dev/null @@ -1,312 +0,0 @@ -import type { - AnySchema, - AnySchemaObject, - AnyValidateFunction, - AsyncValidateFunction, - EvaluatedProperties, - EvaluatedItems, -} from "../types" -import type Ajv from "../core" -import type {InstanceOptions} from "../core" -import {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from "./codegen" -import {ValidationError} from "./error_classes" -import N from "./names" -import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve" -import {schemaHasRulesButRef, unescapeFragment} from "./util" -import {validateFunctionCode} from "./validate" -import * as URI from "uri-js" -import {JSONType} from "./rules" - -export type SchemaRefs = { - [Ref in string]?: SchemaEnv | AnySchema -} - -export interface SchemaCxt { - readonly gen: CodeGen - readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error - readonly data: Name // Name with reference to the current part of data instance - readonly parentData: Name // should be used in keywords modifying data - readonly parentDataProperty: Code | number // should be used in keywords modifying data - readonly dataNames: Name[] - readonly dataPathArr: (Code | number)[] - readonly dataLevel: number // the level of the currently validated data, - // it can be used to access both the property names and the data on all levels from the top. - dataTypes: JSONType[] // data types applied to the current part of data instance - definedProperties: Set // set of properties to keep track of for required checks - readonly topSchemaRef: Code - readonly validateName: Name - evaluated?: Name - readonly ValidationError?: Name - readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt - readonly schemaEnv: SchemaEnv - readonly rootId: string - baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\$ref) - readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema - readonly errSchemaPath: string // this is actual string, should not be changed to Code - readonly errorPath: Code - readonly propertyName?: Name - readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword, - // where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`). - // This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true. - // You only need to use it if you have many steps in your keywords and potentially can define multiple errors. - props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function - items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function - jtdDiscriminator?: string - jtdMetadata?: boolean - readonly createErrors?: boolean - readonly opts: InstanceOptions // Ajv instance option. - readonly self: Ajv // current Ajv instance -} - -export interface SchemaObjCxt extends SchemaCxt { - readonly schema: AnySchemaObject -} -interface SchemaEnvArgs { - readonly schema: AnySchema - readonly root?: SchemaEnv - readonly baseId?: string - readonly localRefs?: LocalRefs - readonly meta?: boolean -} - -export class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema - readonly root: SchemaEnv - baseId: string // TODO possibly, it should be readonly - localRefs?: LocalRefs - readonly meta?: boolean - readonly $async?: boolean // true if the current schema is asynchronous. - readonly refs: SchemaRefs = {} - readonly dynamicAnchors: {[Ref in string]?: true} = {} - validate?: AnyValidateFunction - validateName?: ValueScopeName - serialize?: (data: unknown) => string - serializeName?: ValueScopeName - parse?: (data: string) => unknown - parseName?: ValueScopeName - - constructor(env: SchemaEnvArgs) { - let schema: AnySchemaObject | undefined - if (typeof env.schema == "object") schema = env.schema - this.schema = env.schema - this.root = env.root || this - this.baseId = env.baseId ?? normalizeId(schema?.$id) - this.localRefs = env.localRefs - this.meta = env.meta - this.$async = schema?.$async - this.refs = {} - } -} - -// let codeSize = 0 -// let nodeCount = 0 - -// Compiles schema in SchemaEnv -export function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv { - // TODO refactor - remove compilations - const _sch = getCompilingSchema.call(this, sch) - if (_sch) return _sch - const rootId = getFullPath(sch.root.baseId) // TODO if getFullPath removed 1 tests fails - const {es5, lines} = this.opts.code - const {ownProperties} = this.opts - const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) - let _ValidationError - if (sch.$async) { - _ValidationError = gen.scopeValue("Error", { - ref: ValidationError, - code: _`require("ajv/dist/compile/error_classes").ValidationError`, - }) - } - - const validateName = gen.scopeName("validate") - sch.validateName = validateName - - const schemaCxt: SchemaCxt = { - gen, - allErrors: this.opts.allErrors, - data: N.data, - parentData: N.parentData, - parentDataProperty: N.parentDataProperty, - dataNames: [N.data], - dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed? - dataLevel: 0, - dataTypes: [], - definedProperties: new Set(), - topSchemaRef: gen.scopeValue( - "schema", - this.opts.code.source === true - ? {ref: sch.schema, code: stringify(sch.schema)} - : {ref: sch.schema} - ), - validateName, - ValidationError: _ValidationError, - schema: sch.schema, - schemaEnv: sch, - rootId, - baseId: sch.baseId || rootId, - schemaPath: nil, - errSchemaPath: this.opts.jtd ? "" : "#", - errorPath: _`""`, - opts: this.opts, - self: this, - } - - let sourceCode: string | undefined - try { - this._compilations.add(sch) - validateFunctionCode(schemaCxt) - gen.optimize(this.opts.code.optimize) - // gen.optimize(1) - const validateCode = gen.toString() - sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}` - // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) - if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch) - // console.log("\n\n\n *** \n", sourceCode) - const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode) - const validate: AnyValidateFunction = makeValidate(this, this.scope.get()) - this.scope.value(validateName, {ref: validate}) - - validate.errors = null - validate.schema = sch.schema - validate.schemaEnv = sch - if (sch.$async) (validate as AsyncValidateFunction).$async = true - if (this.opts.code.source === true) { - validate.source = {validateName, validateCode, scopeValues: gen._values} - } - if (this.opts.unevaluated) { - const {props, items} = schemaCxt - validate.evaluated = { - props: props instanceof Name ? undefined : props, - items: items instanceof Name ? undefined : items, - dynamicProps: props instanceof Name, - dynamicItems: items instanceof Name, - } - if (validate.source) validate.source.evaluated = stringify(validate.evaluated) - } - sch.validate = validate - return sch - } catch (e) { - delete sch.validate - delete sch.validateName - if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode) - // console.log("\n\n\n *** \n", sourceCode, this.opts) - throw e - } finally { - this._compilations.delete(sch) - } -} - -export function resolveRef( - this: Ajv, - root: SchemaEnv, - baseId: string, - ref: string -): AnySchema | SchemaEnv | undefined { - ref = resolveUrl(baseId, ref) - const schOrFunc = root.refs[ref] - if (schOrFunc) return schOrFunc - - let _sch = resolve.call(this, root, ref) - if (_sch === undefined) { - const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv - if (schema) _sch = new SchemaEnv({schema, root, baseId}) - } - - if (_sch === undefined) return - return (root.refs[ref] = inlineOrCompile.call(this, _sch)) -} - -function inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv { - if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema - return sch.validate ? sch : compileSchema.call(this, sch) -} - -// Index of schema compilation in the currently compiled list -export function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void { - for (const sch of this._compilations) { - if (sameSchemaEnv(sch, schEnv)) return sch - } -} - -function sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean { - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId -} - -// resolve and compile the references ($ref) -// TODO returns AnySchemaObject (if the schema can be inlined) or validation function -function resolve( - this: Ajv, - root: SchemaEnv, // information about the root schema for the current schema - ref: string // reference to resolve -): SchemaEnv | undefined { - let sch - while (typeof (sch = this.refs[ref]) == "string") ref = sch - return sch || this.schemas[ref] || resolveSchema.call(this, root, ref) -} - -// Resolve schema, its root and baseId -export function resolveSchema( - this: Ajv, - root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it - ref: string // reference to resolve -): SchemaEnv | undefined { - const p = URI.parse(ref) - const refPath = _getFullPath(p) - let baseId = getFullPath(root.baseId) - // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests - if (Object.keys(root.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root) - } - - const id = normalizeId(refPath) - const schOrRef = this.refs[id] || this.schemas[id] - if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root, schOrRef) - if (typeof sch?.schema !== "object") return - return getJsonPointer.call(this, p, sch) - } - - if (typeof schOrRef?.schema !== "object") return - if (!schOrRef.validate) compileSchema.call(this, schOrRef) - if (id === normalizeId(ref)) { - const {schema} = schOrRef - if (schema.$id) baseId = resolveUrl(baseId, schema.$id) - return new SchemaEnv({schema, root, baseId}) - } - return getJsonPointer.call(this, p, schOrRef) -} - -const PREVENT_SCOPE_CHANGE = new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions", -]) - -function getJsonPointer( - this: Ajv, - parsedRef: URI.URIComponents, - {baseId, schema, root}: SchemaEnv -): SchemaEnv | undefined { - if (parsedRef.fragment?.[0] !== "/") return - for (const part of parsedRef.fragment.slice(1).split("/")) { - if (typeof schema == "boolean") return - schema = schema[unescapeFragment(part)] - if (schema === undefined) return - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? - if (!PREVENT_SCOPE_CHANGE.has(part) && typeof schema == "object" && schema.$id) { - baseId = resolveUrl(baseId, schema.$id) - } - } - let env: SchemaEnv | undefined - if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) { - const $ref = resolveUrl(baseId, schema.$ref) - env = resolveSchema.call(this, root, $ref) - } - // even though resolution failed we need to return SchemaEnv to throw exception - // so that compileAsync loads missing schema. - env = env || new SchemaEnv({schema, root, baseId}) - if (env.schema !== env.root.schema) return env - return undefined -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/jtd/parse.ts b/node_modules/table/node_modules/ajv/lib/compile/jtd/parse.ts deleted file mode 100644 index edb560362..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/jtd/parse.ts +++ /dev/null @@ -1,403 +0,0 @@ -import type Ajv from "../../core" -import type {SchemaObject} from "../../types" -import {jtdForms, JTDForm, SchemaObjectMap} from "./types" -import {SchemaEnv, getCompilingSchema} from ".." -import {_, str, and, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen" -import {MissingRefError} from "../error_classes" -import N from "../names" -import {hasPropFunc} from "../../vocabularies/code" -import {hasRef} from "../../vocabularies/jtd/ref" -import {intRange, IntType} from "../../vocabularies/jtd/type" -import {parseJson, parseJsonNumber, parseJsonString} from "../../runtime/parseJson" -import {func} from "../util" -import validTimestamp from "../timestamp" - -type GenParse = (cxt: ParseCxt) => void - -const genParse: {[F in JTDForm]: GenParse} = { - elements: parseElements, - values: parseValues, - discriminator: parseDiscriminator, - properties: parseProperties, - optionalProperties: parseProperties, - enum: parseEnum, - type: parseType, - ref: parseRef, -} - -interface ParseCxt { - readonly gen: CodeGen - readonly self: Ajv // current Ajv instance - readonly schemaEnv: SchemaEnv - readonly definitions: SchemaObjectMap - schema: SchemaObject - data: Code - parseName: Name - char: Name -} - -export default function compileParser( - this: Ajv, - sch: SchemaEnv, - definitions: SchemaObjectMap -): SchemaEnv { - const _sch = getCompilingSchema.call(this, sch) - if (_sch) return _sch - const {es5, lines} = this.opts.code - const {ownProperties} = this.opts - const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) - const parseName = gen.scopeName("parse") - const cxt: ParseCxt = { - self: this, - gen, - schema: sch.schema as SchemaObject, - schemaEnv: sch, - definitions, - data: N.data, - parseName, - char: gen.name("c"), - } - - let sourceCode: string | undefined - try { - this._compilations.add(sch) - sch.parseName = parseName - parserFunction(cxt) - gen.optimize(this.opts.code.optimize) - const parseFuncCode = gen.toString() - sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}` - const makeParse = new Function(`${N.scope}`, sourceCode) - const parse: (json: string) => unknown = makeParse(this.scope.get()) - this.scope.value(parseName, {ref: parse}) - sch.parse = parse - } catch (e) { - if (sourceCode) this.logger.error("Error compiling parser, function code:", sourceCode) - delete sch.parse - delete sch.parseName - throw e - } finally { - this._compilations.delete(sch) - } - return sch -} - -const undef = _`undefined` - -function parserFunction(cxt: ParseCxt): void { - const {gen, parseName, char} = cxt - gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => { - gen.let(N.data) - gen.let(char) - gen.assign(_`${parseName}.message`, undef) - gen.assign(_`${parseName}.position`, undef) - gen.assign(N.jsonPos, _`${N.jsonPos} || 0`) - gen.const(N.jsonLen, _`${N.json}.length`) - parseCode(cxt) - skipWhitespace(cxt) - gen.if(N.jsonPart, () => { - gen.assign(_`${parseName}.position`, N.jsonPos) - gen.return(N.data) - }) - gen.if(_`${N.jsonPos} === ${N.jsonLen}`, () => gen.return(N.data)) - jsonSyntaxError(cxt) - }) -} - -function parseCode(cxt: ParseCxt): void { - let form: JTDForm | undefined - for (const key of jtdForms) { - if (key in cxt.schema) { - form = key - break - } - } - if (form) parseNullable(cxt, genParse[form]) - else parseEmpty(cxt) -} - -const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)) - -function parseNullable(cxt: ParseCxt, parseForm: GenParse): void { - const {gen, schema, data} = cxt - if (!schema.nullable) return parseForm(cxt) - tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)) -} - -function parseElements(cxt: ParseCxt): void { - const {gen, schema, data} = cxt - parseToken(cxt, "[") - const ix = gen.let("i", 0) - gen.assign(data, _`[]`) - parseItems(cxt, "]", () => { - const el = gen.let("el") - parseCode({...cxt, schema: schema.elements, data: el}) - gen.assign(_`${data}[${ix}++]`, el) - }) -} - -function parseValues(cxt: ParseCxt): void { - const {gen, schema, data} = cxt - parseToken(cxt, "{") - gen.assign(data, _`{}`) - parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)) -} - -function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void { - tryParseItems(cxt, endToken, block) - parseToken(cxt, endToken) -} - -function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void { - const {gen} = cxt - gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { - block() - tryParseToken(cxt, ",", () => gen.break(), hasItem) - }) - - function hasItem(): void { - tryParseToken(cxt, endToken, () => {}, jsonSyntaxError) - } -} - -function parseKeyValue(cxt: ParseCxt, schema: SchemaObject): void { - const {gen} = cxt - const key = gen.let("key") - parseString({...cxt, data: key}) - parseToken(cxt, ":") - parsePropertyValue(cxt, key, schema) -} - -function parseDiscriminator(cxt: ParseCxt): void { - const {gen, data, schema} = cxt - const {discriminator, mapping} = schema - parseToken(cxt, "{") - gen.assign(data, _`{}`) - const startPos = gen.const("pos", N.jsonPos) - const value = gen.let("value") - const tag = gen.let("tag") - tryParseItems(cxt, "}", () => { - const key = gen.let("key") - parseString({...cxt, data: key}) - parseToken(cxt, ":") - gen.if( - _`${key} === ${discriminator}`, - () => { - parseString({...cxt, data: tag}) - gen.assign(_`${data}[${key}]`, tag) - gen.break() - }, - () => parseEmpty({...cxt, data: value}) // can be discarded/skipped - ) - }) - gen.assign(N.jsonPos, startPos) - gen.if(_`${tag} === undefined`) - parsingError(cxt, str`discriminator tag not found`) - for (const tagValue in mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - parseSchemaProperties({...cxt, schema: mapping[tagValue]}, discriminator) - } - gen.else() - parsingError(cxt, str`discriminator value not in schema`) - gen.endIf() -} - -function parseProperties(cxt: ParseCxt): void { - const {gen, data} = cxt - parseToken(cxt, "{") - gen.assign(data, _`{}`) - parseSchemaProperties(cxt) -} - -function parseSchemaProperties(cxt: ParseCxt, discriminator?: string): void { - const {gen, schema, data} = cxt - const {properties, optionalProperties, additionalProperties} = schema - parseItems(cxt, "}", () => { - const key = gen.let("key") - parseString({...cxt, data: key}) - parseToken(cxt, ":") - gen.if(false) - parseDefinedProperty(cxt, key, properties) - parseDefinedProperty(cxt, key, optionalProperties) - if (discriminator) { - gen.elseIf(_`${key} === ${discriminator}`) - const tag = gen.let("tag") - parseString({...cxt, data: tag}) // can be discarded, it is already assigned - } - gen.else() - if (additionalProperties) { - parseEmpty({...cxt, data: _`${data}[${key}]`}) - } else { - parsingError(cxt, str`property ${key} not allowed`) - } - gen.endIf() - }) - if (properties) { - const hasProp = hasPropFunc(gen) - const allProps: Code = and( - ...Object.keys(properties).map((p): Code => _`${hasProp}.call(${data}, ${p})`) - ) - gen.if(not(allProps), () => parsingError(cxt, str`missing required properties`)) - } -} - -function parseDefinedProperty(cxt: ParseCxt, key: Name, schemas: SchemaObjectMap = {}): void { - const {gen} = cxt - for (const prop in schemas) { - gen.elseIf(_`${key} === ${prop}`) - parsePropertyValue(cxt, key, schemas[prop] as SchemaObject) - } -} - -function parsePropertyValue(cxt: ParseCxt, key: Name, schema: SchemaObject): void { - parseCode({...cxt, schema, data: _`${cxt.data}[${key}]`}) -} - -function parseType(cxt: ParseCxt): void { - const {gen, schema, data} = cxt - switch (schema.type) { - case "boolean": - parseBoolean(cxt) - break - case "string": - parseString(cxt) - break - case "timestamp": { - // TODO parse timestamp? - parseString(cxt) - const vts = func(gen, validTimestamp) - gen.if(_`!${vts}(${data})`, () => parsingError(cxt, str`invalid timestamp`)) - break - } - case "float32": - case "float64": - parseNumber(cxt) - break - default: { - const [min, max, maxDigits] = intRange[schema.type as IntType] - parseNumber(cxt, maxDigits) - gen.if(_`${data} < ${min} || ${data} > ${max}`, () => - parsingError(cxt, str`integer out of range`) - ) - } - } -} - -function parseString(cxt: ParseCxt): void { - parseToken(cxt, '"') - parseWith(cxt, parseJsonString) -} - -function parseEnum(cxt: ParseCxt): void { - const {gen, data, schema} = cxt - const enumSch = schema.enum - parseToken(cxt, '"') - // TODO loopEnum - gen.if(false) - for (const value of enumSch) { - const valueStr = JSON.stringify(value).slice(1) // remove starting quote - gen.elseIf(_`${jsonSlice(valueStr.length)} === ${valueStr}`) - gen.assign(data, str`${value}`) - gen.add(N.jsonPos, valueStr.length) - } - gen.else() - jsonSyntaxError(cxt) - gen.endIf() -} - -function parseNumber(cxt: ParseCxt, maxDigits?: number): void { - const {gen} = cxt - skipWhitespace(cxt) - gen.if( - _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`, - () => jsonSyntaxError(cxt), - () => parseWith(cxt, parseJsonNumber, maxDigits) - ) -} - -function parseBooleanToken(bool: boolean, fail: GenParse): GenParse { - return (cxt) => { - const {gen, data} = cxt - tryParseToken( - cxt, - `${bool}`, - () => fail(cxt), - () => gen.assign(data, bool) - ) - } -} - -function parseRef(cxt: ParseCxt): void { - const {gen, self, definitions, schema, schemaEnv} = cxt - const {ref} = schema - const refSchema = definitions[ref] - if (!refSchema) throw new MissingRefError("", ref, `No definition ${ref}`) - if (!hasRef(refSchema)) return parseCode({...cxt, schema: refSchema}) - const {root} = schemaEnv - const sch = compileParser.call(self, new SchemaEnv({schema: refSchema, root}), definitions) - partialParse(cxt, getParser(gen, sch), true) -} - -function getParser(gen: CodeGen, sch: SchemaEnv): Code { - return sch.parse - ? gen.scopeValue("parse", {ref: sch.parse}) - : _`${gen.scopeValue("wrapper", {ref: sch})}.parse` -} - -function parseEmpty(cxt: ParseCxt): void { - parseWith(cxt, parseJson) -} - -function parseWith(cxt: ParseCxt, parseFunc: {code: Code}, args?: SafeExpr): void { - const f = cxt.gen.scopeValue("func", { - ref: parseFunc, - code: parseFunc.code, - }) - partialParse(cxt, f, args) -} - -function partialParse(cxt: ParseCxt, parseFunc: Name, args?: SafeExpr): void { - const {gen, data} = cxt - gen.assign(data, _`${parseFunc}(${N.json}, ${N.jsonPos}${args ? _`, ${args}` : nil})`) - gen.assign(N.jsonPos, _`${parseFunc}.position`) - gen.if(_`${data} === undefined`, () => parsingError(cxt, _`${parseFunc}.message`)) -} - -function parseToken(cxt: ParseCxt, tok: string): void { - tryParseToken(cxt, tok, jsonSyntaxError) -} - -function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void { - const {gen} = cxt - const n = tok.length - skipWhitespace(cxt) - gen.if( - _`${jsonSlice(n)} === ${tok}`, - () => { - gen.add(N.jsonPos, n) - success?.(cxt) - }, - () => fail(cxt) - ) -} - -function skipWhitespace({gen, char: c}: ParseCxt): void { - gen.code( - _`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;` - ) -} - -function jsonSlice(len: number | Name): Code { - return len === 1 - ? _`${N.json}[${N.jsonPos}]` - : _`${N.json}.slice(${N.jsonPos}, ${N.jsonPos}+${len})` -} - -function jsonSyntaxError(cxt: ParseCxt): void { - parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`) -} - -function parsingError({gen, parseName}: ParseCxt, msg: Code): void { - gen.assign(_`${parseName}.message`, msg) - gen.assign(_`${parseName}.position`, N.jsonPos) - gen.return(undef) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/jtd/serialize.ts b/node_modules/table/node_modules/ajv/lib/compile/jtd/serialize.ts deleted file mode 100644 index 63b253dd4..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/jtd/serialize.ts +++ /dev/null @@ -1,266 +0,0 @@ -import type Ajv from "../../core" -import type {SchemaObject} from "../../types" -import {jtdForms, JTDForm, SchemaObjectMap} from "./types" -import {SchemaEnv, getCompilingSchema} from ".." -import {_, str, and, getProperty, CodeGen, Code, Name} from "../codegen" -import {MissingRefError} from "../error_classes" -import N from "../names" -import {isOwnProperty} from "../../vocabularies/code" -import {hasRef} from "../../vocabularies/jtd/ref" -import quote from "../../runtime/quote" - -const genSerialize: {[F in JTDForm]: (cxt: SerializeCxt) => void} = { - elements: serializeElements, - values: serializeValues, - discriminator: serializeDiscriminator, - properties: serializeProperties, - optionalProperties: serializeProperties, - enum: serializeString, - type: serializeType, - ref: serializeRef, -} - -interface SerializeCxt { - readonly gen: CodeGen - readonly self: Ajv // current Ajv instance - readonly schemaEnv: SchemaEnv - readonly definitions: SchemaObjectMap - schema: SchemaObject - data: Code -} - -export default function compileSerializer( - this: Ajv, - sch: SchemaEnv, - definitions: SchemaObjectMap -): SchemaEnv { - const _sch = getCompilingSchema.call(this, sch) - if (_sch) return _sch - const {es5, lines} = this.opts.code - const {ownProperties} = this.opts - const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) - const serializeName = gen.scopeName("serialize") - const cxt: SerializeCxt = { - self: this, - gen, - schema: sch.schema as SchemaObject, - schemaEnv: sch, - definitions, - data: N.data, - } - - let sourceCode: string | undefined - try { - this._compilations.add(sch) - sch.serializeName = serializeName - gen.func(serializeName, N.data, false, () => { - gen.let(N.json, str``) - serializeCode(cxt) - gen.return(N.json) - }) - gen.optimize(this.opts.code.optimize) - const serializeFuncCode = gen.toString() - sourceCode = `${gen.scopeRefs(N.scope)}return ${serializeFuncCode}` - const makeSerialize = new Function(`${N.scope}`, sourceCode) - const serialize: (data: unknown) => string = makeSerialize(this.scope.get()) - this.scope.value(serializeName, {ref: serialize}) - sch.serialize = serialize - } catch (e) { - if (sourceCode) this.logger.error("Error compiling serializer, function code:", sourceCode) - delete sch.serialize - delete sch.serializeName - throw e - } finally { - this._compilations.delete(sch) - } - return sch -} - -function serializeCode(cxt: SerializeCxt): void { - let form: JTDForm | undefined - for (const key of jtdForms) { - if (key in cxt.schema) { - form = key - break - } - } - serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty) -} - -function serializeNullable(cxt: SerializeCxt, serializeForm: (_cxt: SerializeCxt) => void): void { - const {gen, schema, data} = cxt - if (!schema.nullable) return serializeForm(cxt) - gen.if( - _`${data} === undefined || ${data} === null`, - () => gen.add(N.json, _`"null"`), - () => serializeForm(cxt) - ) -} - -function serializeElements(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - gen.add(N.json, str`[`) - const first = gen.let("first", true) - gen.forOf("el", data, (el) => { - addComma(cxt, first) - serializeCode({...cxt, schema: schema.elements, data: el}) - }) - gen.add(N.json, str`]`) -} - -function serializeValues(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - gen.add(N.json, str`{`) - const first = gen.let("first", true) - gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)) - gen.add(N.json, str`}`) -} - -function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first: Name): void { - const {gen, data} = cxt - addComma(cxt, first) - serializeString({...cxt, data: key}) - gen.add(N.json, str`:`) - const value = gen.const("value", _`${data}${getProperty(key)}`) - serializeCode({...cxt, schema, data: value}) -} - -function serializeDiscriminator(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - const {discriminator} = schema - gen.add(N.json, str`{${JSON.stringify(discriminator)}:`) - const tag = gen.const("tag", _`${data}${getProperty(discriminator)}`) - serializeString({...cxt, data: tag}) - gen.if(false) - for (const tagValue in schema.mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - const sch = schema.mapping[tagValue] - serializeSchemaProperties({...cxt, schema: sch}, discriminator) - } - gen.endIf() - gen.add(N.json, str`}`) -} - -function serializeProperties(cxt: SerializeCxt): void { - const {gen} = cxt - gen.add(N.json, str`{`) - serializeSchemaProperties(cxt) - gen.add(N.json, str`}`) -} - -function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): void { - const {gen, schema, data} = cxt - const {properties, optionalProperties} = schema - const props = keys(properties) - const optProps = keys(optionalProperties) - const allProps = allProperties(props.concat(optProps)) - let first = !discriminator - for (const key of props) { - serializeProperty(key, properties[key], keyValue(key)) - } - for (const key of optProps) { - const value = keyValue(key) - gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => - serializeProperty(key, optionalProperties[key], value) - ) - } - if (schema.additionalProperties) { - gen.forIn("key", data, (key) => - gen.if(isAdditional(key, allProps), () => - serializeKeyValue(cxt, key, {}, gen.let("first", first)) - ) - ) - } - - function keys(ps?: SchemaObjectMap): string[] { - return ps ? Object.keys(ps) : [] - } - - function allProperties(ps: string[]): string[] { - if (discriminator) ps.push(discriminator) - if (new Set(ps).size !== ps.length) { - throw new Error("JTD: properties/optionalProperties/disciminator overlap") - } - return ps - } - - function keyValue(key: string): Name { - return gen.const("value", _`${data}${getProperty(key)}`) - } - - function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void { - if (first) first = false - else gen.add(N.json, str`,`) - gen.add(N.json, str`${JSON.stringify(key)}:`) - serializeCode({...cxt, schema: propSchema, data: value}) - } - - function isAdditional(key: Name, ps: string[]): Code | true { - return ps.length ? and(...ps.map((p) => _`${key} !== ${p}`)) : true - } -} - -function serializeType(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - switch (schema.type) { - case "boolean": - gen.add(N.json, _`${data} ? "true" : "false"`) - break - case "string": - serializeString(cxt) - break - case "timestamp": - gen.if( - _`${data} instanceof Date`, - () => gen.add(N.json, _`${data}.toISOString()`), - () => serializeString(cxt) - ) - break - default: - serializeNumber(cxt) - } -} - -function serializeString({gen, data}: SerializeCxt): void { - gen.add(N.json, _`${quoteFunc(gen)}(${data})`) -} - -function serializeNumber({gen, data}: SerializeCxt): void { - gen.add(N.json, _`"" + ${data}`) -} - -function serializeRef(cxt: SerializeCxt): void { - const {gen, self, data, definitions, schema, schemaEnv} = cxt - const {ref} = schema - const refSchema = definitions[ref] - if (!refSchema) throw new MissingRefError("", ref, `No definition ${ref}`) - if (!hasRef(refSchema)) return serializeCode({...cxt, schema: refSchema}) - const {root} = schemaEnv - const sch = compileSerializer.call(self, new SchemaEnv({schema: refSchema, root}), definitions) - gen.add(N.json, _`${getSerialize(gen, sch)}(${data})`) -} - -function getSerialize(gen: CodeGen, sch: SchemaEnv): Code { - return sch.serialize - ? gen.scopeValue("serialize", {ref: sch.serialize}) - : _`${gen.scopeValue("wrapper", {ref: sch})}.serialize` -} - -function serializeEmpty({gen, data}: SerializeCxt): void { - gen.add(N.json, _`JSON.stringify(${data})`) -} - -function addComma({gen}: SerializeCxt, first: Name): void { - gen.if( - first, - () => gen.assign(first, false), - () => gen.add(N.json, str`,`) - ) -} - -function quoteFunc(gen: CodeGen): Name { - return gen.scopeValue("func", { - ref: quote, - code: _`require("ajv/dist/runtime/quote").default`, - }) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/jtd/types.ts b/node_modules/table/node_modules/ajv/lib/compile/jtd/types.ts deleted file mode 100644 index 7f3619576..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/jtd/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {SchemaObject} from "../../types" - -export type SchemaObjectMap = {[Ref in string]?: SchemaObject} - -export const jtdForms = [ - "elements", - "values", - "discriminator", - "properties", - "optionalProperties", - "enum", - "type", - "ref", -] as const - -export type JTDForm = typeof jtdForms[number] diff --git a/node_modules/table/node_modules/ajv/lib/compile/names.ts b/node_modules/table/node_modules/ajv/lib/compile/names.ts deleted file mode 100644 index b7f18ca45..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/names.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {Name} from "./codegen" - -const names = { - // validation function arguments - data: new Name("data"), // data passed to validation function - // args passed from referencing schema - valCxt: new Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below - dataPath: new Name("dataPath"), - parentData: new Name("parentData"), - parentDataProperty: new Name("parentDataProperty"), - rootData: new Name("rootData"), // root data - same as the data passed to the first/top validation function - dynamicAnchors: new Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef - // function scoped variables - vErrors: new Name("vErrors"), // null or array of validation errors - errors: new Name("errors"), // counter of validation errors - this: new Name("this"), - // "globals" - self: new Name("self"), - scope: new Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new Name("json"), - jsonPos: new Name("jsonPos"), - jsonLen: new Name("jsonLen"), - jsonPart: new Name("jsonPart"), -} - -export default names diff --git a/node_modules/table/node_modules/ajv/lib/compile/resolve.ts b/node_modules/table/node_modules/ajv/lib/compile/resolve.ts deleted file mode 100644 index b4ee22b12..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/resolve.ts +++ /dev/null @@ -1,145 +0,0 @@ -import type {AnySchema, AnySchemaObject} from "../types" -import type Ajv from "../ajv" -import {eachItem} from "./util" -import * as equal from "fast-deep-equal" -import * as traverse from "json-schema-traverse" -import * as URI from "uri-js" - -// the hash of local references inside the schema (created by getSchemaRefs), used for inline resolution -export type LocalRefs = {[Ref in string]?: AnySchemaObject} - -// TODO refactor to use keyword definitions -const SIMPLE_INLINED = new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const", -]) - -export function inlineRef(schema: AnySchema, limit: boolean | number = true): boolean { - if (typeof schema == "boolean") return true - if (limit === true) return !hasRef(schema) - if (!limit) return false - return countKeys(schema) <= limit -} - -const REF_KEYWORDS = new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor", -]) - -function hasRef(schema: AnySchemaObject): boolean { - for (const key in schema) { - if (REF_KEYWORDS.has(key)) return true - const sch = schema[key] - if (Array.isArray(sch) && sch.some(hasRef)) return true - if (typeof sch == "object" && hasRef(sch)) return true - } - return false -} - -function countKeys(schema: AnySchemaObject): number { - let count = 0 - for (const key in schema) { - if (key === "$ref") return Infinity - count++ - if (SIMPLE_INLINED.has(key)) continue - if (typeof schema[key] == "object") { - eachItem(schema[key], (sch) => (count += countKeys(sch))) - } - if (count === Infinity) return Infinity - } - return count -} - -export function getFullPath(id = "", normalize?: boolean): string { - if (normalize !== false) id = normalizeId(id) - const p = URI.parse(id) - return _getFullPath(p) -} - -export function _getFullPath(p: URI.URIComponents): string { - return URI.serialize(p).split("#")[0] + "#" -} - -const TRAILING_SLASH_HASH = /#\/?$/ -export function normalizeId(id: string | undefined): string { - return id ? id.replace(TRAILING_SLASH_HASH, "") : "" -} - -export function resolveUrl(baseId: string, id: string): string { - id = normalizeId(id) - return URI.resolve(baseId, id) -} - -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i - -export function getSchemaRefs(this: Ajv, schema: AnySchema): LocalRefs { - if (typeof schema == "boolean") return {} - const schemaId = normalizeId(schema.$id) - const baseIds: {[JsonPtr in string]?: string} = {"": schemaId} - const pathPrefix = getFullPath(schemaId, false) - const localRefs: LocalRefs = {} - const schemaRefs: Set = new Set() - - traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === undefined) return - const fullPath = pathPrefix + jsonPtr - let baseId = baseIds[parentJsonPtr] - if (typeof sch.$id == "string") baseId = addRef.call(this, sch.$id) - addAnchor.call(this, sch.$anchor) - addAnchor.call(this, sch.$dynamicAnchor) - baseIds[jsonPtr] = baseId - - function addRef(this: Ajv, ref: string): string { - ref = normalizeId(baseId ? URI.resolve(baseId, ref) : ref) - if (schemaRefs.has(ref)) throw ambiguos(ref) - schemaRefs.add(ref) - let schOrRef = this.refs[ref] - if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef] - if (typeof schOrRef == "object") { - checkAmbiguosRef(sch, schOrRef.schema, ref) - } else if (ref !== normalizeId(fullPath)) { - if (ref[0] === "#") { - checkAmbiguosRef(sch, localRefs[ref], ref) - localRefs[ref] = sch - } else { - this.refs[ref] = fullPath - } - } - return ref - } - - function addAnchor(this: Ajv, anchor: unknown): void { - if (typeof anchor == "string") { - if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`) - addRef.call(this, `#${anchor}`) - } - } - }) - - return localRefs - - function checkAmbiguosRef(sch1: AnySchema, sch2: AnySchema | undefined, ref: string): void { - if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref) - } - - function ambiguos(ref: string): Error { - return new Error(`reference "${ref}" resolves to more than one schema`) - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/rules.ts b/node_modules/table/node_modules/ajv/lib/compile/rules.ts deleted file mode 100644 index ea65074f9..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/rules.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type {AddedKeywordDefinition} from "../types" - -const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"] as const - -export type JSONType = typeof _jsonTypes[number] - -const jsonTypes: Set = new Set(_jsonTypes) - -export function isJSONType(x: unknown): x is JSONType { - return typeof x == "string" && jsonTypes.has(x) -} - -type ValidationTypes = { - [K in JSONType]: boolean | RuleGroup | undefined -} - -export interface ValidationRules { - rules: RuleGroup[] - post: RuleGroup - all: {[Key in string]?: boolean | Rule} // rules that have to be validated - keywords: {[Key in string]?: boolean} // all known keywords (superset of "all") - types: ValidationTypes -} - -export interface RuleGroup { - type?: JSONType - rules: Rule[] -} - -// This interface wraps KeywordDefinition because definition can have multiple keywords -export interface Rule { - keyword: string - definition: AddedKeywordDefinition -} - -export function getRules(): ValidationRules { - const groups: Record<"number" | "string" | "array" | "object", RuleGroup> = { - number: {type: "number", rules: []}, - string: {type: "string", rules: []}, - array: {type: "array", rules: []}, - object: {type: "object", rules: []}, - } - return { - types: {...groups, integer: true, boolean: true, null: true}, - rules: [{rules: []}, groups.number, groups.string, groups.array, groups.object], - post: {rules: []}, - all: {}, - keywords: {}, - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/subschema.ts b/node_modules/table/node_modules/ajv/lib/compile/subschema.ts deleted file mode 100644 index 2ec2cc81b..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/subschema.ts +++ /dev/null @@ -1,169 +0,0 @@ -import type {AnySchema} from "../types" -import type {SchemaObjCxt, SchemaCxt} from "./index" -import {subschemaCode} from "./validate" -import {escapeFragment, escapeJsonPointer} from "./util" -import {_, str, Code, Name, getProperty} from "./codegen" -import {JSONType} from "./rules" - -interface SubschemaContext { - // TODO use Optional? align with SchemCxt property types - schema: AnySchema - schemaPath: Code - errSchemaPath: string - topSchemaRef?: Code - errorPath?: Code - dataLevel?: number - dataTypes?: JSONType[] - data?: Name - parentData?: Name - parentDataProperty?: Code | number - dataNames?: Name[] - dataPathArr?: (Code | number)[] - propertyName?: Name - jtdDiscriminator?: string - jtdMetadata?: boolean - compositeRule?: true - createErrors?: boolean - allErrors?: boolean -} - -export enum Type { - Num, - Str, -} - -export type SubschemaArgs = Partial<{ - keyword: string - schemaProp: string | number - schema: AnySchema - schemaPath: Code - errSchemaPath: string - topSchemaRef: Code - data: Name | Code - dataProp: Code | string | number - dataTypes: JSONType[] - definedProperties: Set - propertyName: Name - dataPropType: Type - jtdDiscriminator: string - jtdMetadata: boolean - compositeRule: true - createErrors: boolean - allErrors: boolean -}> - -export function applySubschema(it: SchemaObjCxt, appl: SubschemaArgs, valid: Name): SchemaCxt { - const subschema = getSubschema(it, appl) - extendSubschemaData(subschema, it, appl) - extendSubschemaMode(subschema, appl) - const nextContext = {...it, ...subschema, items: undefined, props: undefined} - subschemaCode(nextContext, valid) - return nextContext -} - -function getSubschema( - it: SchemaObjCxt, - {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs -): SubschemaContext { - if (keyword !== undefined && schema !== undefined) { - throw new Error('both "keyword" and "schema" passed, only one allowed') - } - - if (keyword !== undefined) { - const sch = it.schema[keyword] - return schemaProp === undefined - ? { - schema: sch, - schemaPath: _`${it.schemaPath}${getProperty(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - } - : { - schema: sch[schemaProp], - schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`, - } - } - - if (schema !== undefined) { - if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"') - } - return { - schema, - schemaPath, - topSchemaRef, - errSchemaPath, - } - } - - throw new Error('either "keyword" or "schema" must be passed') -} - -function extendSubschemaData( - subschema: SubschemaContext, - it: SchemaObjCxt, - {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs -): void { - if (data !== undefined && dataProp !== undefined) { - throw new Error('both "data" and "dataProp" passed, only one allowed') - } - - const {gen} = it - - if (dataProp !== undefined) { - const {errorPath, dataPathArr, opts} = it - const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true) - dataContextProps(nextData) - subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}` - subschema.parentDataProperty = _`${dataProp}` - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty] - } - - if (data !== undefined) { - const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once? - dataContextProps(nextData) - if (propertyName !== undefined) subschema.propertyName = propertyName - // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr - } - - if (dataTypes) subschema.dataTypes = dataTypes - - function dataContextProps(_nextData: Name): void { - subschema.data = _nextData - subschema.dataLevel = it.dataLevel + 1 - subschema.dataTypes = [] - it.definedProperties = new Set() - subschema.parentData = it.data - subschema.dataNames = [...it.dataNames, _nextData] - } -} - -function extendSubschemaMode( - subschema: SubschemaContext, - {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs -): void { - if (compositeRule !== undefined) subschema.compositeRule = compositeRule - if (createErrors !== undefined) subschema.createErrors = createErrors - if (allErrors !== undefined) subschema.allErrors = allErrors - subschema.jtdDiscriminator = jtdDiscriminator // not inherited - subschema.jtdMetadata = jtdMetadata // not inherited -} - -function getErrorPath( - dataProp: Name | string | number, - dataPropType?: Type, - jsPropertySyntax?: boolean -): Code | string { - // let path - if (dataProp instanceof Name) { - const isNumber = dataPropType === Type.Num - return jsPropertySyntax - ? isNumber - ? _`"[" + ${dataProp} + "]"` - : _`"['" + ${dataProp} + "']"` - : isNumber - ? _`"/" + ${dataProp}` - : _`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")` // TODO maybe use global escapePointer - } - return jsPropertySyntax ? getProperty(dataProp).toString() : "/" + escapeJsonPointer(dataProp) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/timestamp.ts b/node_modules/table/node_modules/ajv/lib/compile/timestamp.ts deleted file mode 100644 index 0a16954a4..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/timestamp.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {_} from "./codegen" - -const DATE_TIME = /^(\d\d\d\d)-(\d\d)-(\d\d)(?:t|\s)(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i -const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] - -export default function validTimestamp(str: string): boolean { - // http://tools.ietf.org/html/rfc3339#section-5.6 - const matches: string[] | null = DATE_TIME.exec(str) - if (!matches) return false - const y: number = +matches[1] - const m: number = +matches[2] - const d: number = +matches[3] - const hr: number = +matches[4] - const min: number = +matches[5] - const sec: number = +matches[6] - const tzH: number = +(matches[7] || 0) - const tzM: number = +(matches[8] || 0) - return ( - m >= 1 && - m <= 12 && - d >= 1 && - (d <= DAYS[m] || - // leap year: https://tools.ietf.org/html/rfc3339#appendix-C - (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))) && - ((hr <= 23 && min <= 59 && sec <= 59) || - // leap second - (hr - tzH === 23 && min - tzM === 59 && sec === 60)) - ) -} - -validTimestamp.code = _`require("ajv/dist/compile/timestamp").default` diff --git a/node_modules/table/node_modules/ajv/lib/compile/ucs2length.ts b/node_modules/table/node_modules/ajv/lib/compile/ucs2length.ts deleted file mode 100644 index cf424e935..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/ucs2length.ts +++ /dev/null @@ -1,18 +0,0 @@ -// https://mathiasbynens.be/notes/javascript-encoding -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode -export default function ucs2length(str: string): number { - const len = str.length - let length = 0 - let pos = 0 - let value: number - while (pos < len) { - length++ - value = str.charCodeAt(pos++) - if (value >= 0xd800 && value <= 0xdbff && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos) - if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate - } - } - return length -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/util.ts b/node_modules/table/node_modules/ajv/lib/compile/util.ts deleted file mode 100644 index e6a40468a..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/util.ts +++ /dev/null @@ -1,176 +0,0 @@ -import type {AnySchema, EvaluatedProperties, EvaluatedItems} from "../types" -import type {SchemaCxt, SchemaObjCxt} from "." -import {_, getProperty, Code, Name, CodeGen} from "./codegen" -import type {Rule, ValidationRules} from "./rules" -import {checkStrictMode} from "./validate" - -// TODO refactor to use Set -export function toHash(arr: T[]): {[K in T]?: true} { - const hash: {[K in T]?: true} = {} - for (const item of arr) hash[item] = true - return hash -} - -export function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void { - if (typeof schema == "boolean") return schema - if (Object.keys(schema).length === 0) return true - checkUnknownRules(it, schema) - return !schemaHasRules(schema, it.self.RULES.all) -} - -export function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void { - const {opts, self} = it - if (!opts.strict) return - if (typeof schema === "boolean") return - const rules = self.RULES.keywords - for (const key in schema) { - if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`) - } -} - -export function schemaHasRules( - schema: AnySchema, - rules: {[Key in string]?: boolean | Rule} -): boolean { - if (typeof schema == "boolean") return !schema - for (const key in schema) if (rules[key]) return true - return false -} - -export function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean { - if (typeof schema == "boolean") return !schema - for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true - return false -} - -export function schemaRefOrVal( - {topSchemaRef, schemaPath}: SchemaObjCxt, - schema: unknown, - keyword: string, - $data?: string | false -): Code | number | boolean { - if (!$data) { - if (typeof schema == "number" || typeof schema == "boolean") return schema - if (typeof schema == "string") return _`${schema}` - } - return _`${topSchemaRef}${schemaPath}${getProperty(keyword)}` -} - -export function unescapeFragment(str: string): string { - return unescapeJsonPointer(decodeURIComponent(str)) -} - -export function escapeFragment(str: string | number): string { - return encodeURIComponent(escapeJsonPointer(str)) -} - -export function escapeJsonPointer(str: string | number): string { - if (typeof str == "number") return `${str}` - return str.replace(/~/g, "~0").replace(/\//g, "~1") -} - -export function unescapeJsonPointer(str: string): string { - return str.replace(/~1/g, "/").replace(/~0/g, "~") -} - -export function eachItem(xs: T | T[], f: (x: T) => void): void { - if (Array.isArray(xs)) { - for (const x of xs) f(x) - } else { - f(xs) - } -} - -type SomeEvaluated = EvaluatedProperties | EvaluatedItems - -type MergeEvaluatedFunc = ( - gen: CodeGen, - from: Name | T, - to: Name | Exclude | undefined, - toName?: typeof Name -) => Name | T - -interface MakeMergeFuncArgs { - mergeNames: (gen: CodeGen, from: Name, to: Name) => void - mergeToName: (gen: CodeGen, from: T, to: Name) => void - mergeValues: (from: T, to: Exclude) => T - resultToName: (gen: CodeGen, res?: T) => Name -} - -function makeMergeEvaluated({ - mergeNames, - mergeToName, - mergeValues, - resultToName, -}: MakeMergeFuncArgs): MergeEvaluatedFunc { - return (gen, from, to, toName) => { - const res = - to === undefined - ? from - : to instanceof Name - ? (from instanceof Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) - : from instanceof Name - ? (mergeToName(gen, to, from), from) - : mergeValues(from, to) - return toName === Name && !(res instanceof Name) ? resultToName(gen, res) : res - } -} - -interface MergeEvaluated { - props: MergeEvaluatedFunc - items: MergeEvaluatedFunc -} - -export const mergeEvaluated: MergeEvaluated = { - props: makeMergeEvaluated({ - mergeNames: (gen, from, to) => - gen.if(_`${to} !== true && ${from} !== undefined`, () => { - gen.if( - _`${from} === true`, - () => gen.assign(to, true), - () => gen.code(_`Object.assign(${to}, ${from})`) - ) - }), - mergeToName: (gen, from, to) => - gen.if(_`${to} !== true`, () => { - if (from === true) { - gen.assign(to, true) - } else { - gen.assign(to, _`${to} || {}`) - setEvaluated(gen, to, from) - } - }), - mergeValues: (from, to) => (from === true ? true : {...from, ...to}), - resultToName: evaluatedPropsToName, - }), - items: makeMergeEvaluated({ - mergeNames: (gen, from, to) => - gen.if(_`${to} !== true && ${from} !== undefined`, () => - gen.assign(to, _`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`) - ), - mergeToName: (gen, from, to) => - gen.if(_`${to} !== true`, () => - gen.assign(to, from === true ? true : _`${to} > ${from} ? ${to} : ${from}`) - ), - mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), - resultToName: (gen, items) => gen.var("items", items), - }), -} - -export function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name { - if (ps === true) return gen.var("props", true) - const props = gen.var("props", _`{}`) - if (ps !== undefined) setEvaluated(gen, props, ps) - return props -} - -export function setEvaluated(gen: CodeGen, props: Name, ps: {[K in string]?: true}): void { - Object.keys(ps).forEach((p) => gen.assign(_`${props}${getProperty(p)}`, true)) -} - -export function func(gen: CodeGen, f: {code: Code}): Name { - return gen.scopeValue("func", { - ref: f, - code: f.code, - }) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/applicability.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/applicability.ts deleted file mode 100644 index 478b704ac..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/applicability.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type {AnySchemaObject} from "../../types" -import type {SchemaObjCxt} from ".." -import type {JSONType, RuleGroup, Rule} from "../rules" - -export function schemaHasRulesForType( - {schema, self}: SchemaObjCxt, - type: JSONType -): boolean | undefined { - const group = self.RULES.types[type] - return group && group !== true && shouldUseGroup(schema, group) -} - -export function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean { - return group.rules.some((rule) => shouldUseRule(schema, rule)) -} - -export function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined { - return ( - schema[rule.keyword] !== undefined || - rule.definition.implements?.some((kwd) => schema[kwd] !== undefined) - ) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/boolSchema.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/boolSchema.ts deleted file mode 100644 index 0e1b252ad..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/boolSchema.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type {KeywordErrorDefinition, KeywordErrorCxt} from "../../types" -import type {SchemaCxt} from ".." -import {reportError} from "../errors" -import {_, Name} from "../codegen" -import N from "../names" - -const boolError: KeywordErrorDefinition = { - message: "boolean schema is false", -} - -export function topBoolOrEmptySchema(it: SchemaCxt): void { - const {gen, schema, validateName} = it - if (schema === false) { - falseSchemaError(it, false) - } else if (typeof schema == "object" && schema.$async === true) { - gen.return(N.data) - } else { - gen.assign(_`${validateName}.errors`, null) - gen.return(true) - } -} - -export function boolOrEmptySchema(it: SchemaCxt, valid: Name): void { - const {gen, schema} = it - if (schema === false) { - gen.var(valid, false) // TODO var - falseSchemaError(it) - } else { - gen.var(valid, true) // TODO var - } -} - -function falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void { - const {gen, data} = it - // TODO maybe some other interface should be used for non-keyword validation errors... - const cxt: KeywordErrorCxt = { - gen, - keyword: "false schema", - data, - schema: false, - schemaCode: false, - schemaValue: false, - params: {}, - it, - } - reportError(cxt, boolError, overrideAllErrors) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/dataType.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/dataType.ts deleted file mode 100644 index 8aa499c9f..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/dataType.ts +++ /dev/null @@ -1,229 +0,0 @@ -import type { - KeywordErrorDefinition, - KeywordErrorCxt, - ErrorObject, - AnySchemaObject, -} from "../../types" -import type {SchemaObjCxt} from ".." -import {isJSONType, JSONType} from "../rules" -import {schemaHasRulesForType} from "./applicability" -import {reportError} from "../errors" -import {_, str, nil, and, not, operators, Code, Name} from "../codegen" -import {toHash, schemaRefOrVal} from "../util" - -export enum DataType { - Correct, - Wrong, -} - -export function getSchemaTypes(schema: AnySchemaObject): JSONType[] { - const types = getJSONTypes(schema.type) - const hasNull = types.includes("null") - if (hasNull) { - if (schema.nullable === false) throw new Error("type: null contradicts nullable: false") - } else { - if (!types.length && schema.nullable !== undefined) { - throw new Error('"nullable" cannot be used without "type"') - } - if (schema.nullable === true) types.push("null") - } - return types -} - -export function getJSONTypes(ts: unknown | unknown[]): JSONType[] { - const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : [] - if (types.every(isJSONType)) return types - throw new Error("type must be JSONType or JSONType[]: " + types.join(",")) -} - -export function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean { - const {gen, data, opts} = it - const coerceTo = coerceToTypes(types, opts.coerceTypes) - const checkTypes = - types.length > 0 && - !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0])) - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strict, DataType.Wrong) - gen.if(wrongType, () => { - if (coerceTo.length) coerceData(it, types, coerceTo) - else reportTypeError(it) - }) - } - return checkTypes -} - -const COERCIBLE: Set = new Set(["string", "number", "integer", "boolean", "null"]) -function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] { - return coerceTypes - ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) - : [] -} - -function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void { - const {gen, data, opts} = it - const dataType = gen.let("dataType", _`typeof ${data}`) - const coerced = gen.let("coerced", _`undefined`) - if (opts.coerceTypes === "array") { - gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => - gen - .assign(data, _`${data}[0]`) - .assign(dataType, _`typeof ${data}`) - .if(checkDataTypes(types, data, opts.strict), () => gen.assign(coerced, data)) - ) - } - gen.if(_`${coerced} !== undefined`) - for (const t of coerceTo) { - if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { - coerceSpecificType(t) - } - } - gen.else() - reportTypeError(it) - gen.endIf() - - gen.if(_`${coerced} !== undefined`, () => { - gen.assign(data, coerced) - assignParentData(it, coerced) - }) - - function coerceSpecificType(t: string): void { - switch (t) { - case "string": - gen - .elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`) - .assign(coerced, _`"" + ${data}`) - .elseIf(_`${data} === null`) - .assign(coerced, _`""`) - return - case "number": - gen - .elseIf( - _`${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})` - ) - .assign(coerced, _`+${data}`) - return - case "integer": - gen - .elseIf( - _`${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))` - ) - .assign(coerced, _`+${data}`) - return - case "boolean": - gen - .elseIf(_`${data} === "false" || ${data} === 0 || ${data} === null`) - .assign(coerced, false) - .elseIf(_`${data} === "true" || ${data} === 1`) - .assign(coerced, true) - return - case "null": - gen.elseIf(_`${data} === "" || ${data} === 0 || ${data} === false`) - gen.assign(coerced, null) - return - - case "array": - gen - .elseIf( - _`${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null` - ) - .assign(coerced, _`[${data}]`) - } - } -} - -function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void { - // TODO use gen.property - gen.if(_`${parentData} !== undefined`, () => - gen.assign(_`${parentData}[${parentDataProperty}]`, expr) - ) -} - -export function checkDataType( - dataType: JSONType, - data: Name, - strictNums?: boolean | "log", - correct = DataType.Correct -): Code { - const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ - let cond: Code - switch (dataType) { - case "null": - return _`${data} ${EQ} null` - case "array": - cond = _`Array.isArray(${data})` - break - case "object": - cond = _`${data} && typeof ${data} == "object" && !Array.isArray(${data})` - break - case "integer": - cond = numCond(_`!(${data} % 1) && !isNaN(${data})`) - break - case "number": - cond = numCond() - break - default: - return _`typeof ${data} ${EQ} ${dataType}` - } - return correct === DataType.Correct ? cond : not(cond) - - function numCond(_cond: Code = nil): Code { - return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil) - } -} - -export function checkDataTypes( - dataTypes: JSONType[], - data: Name, - strictNums?: boolean | "log", - correct?: DataType -): Code { - if (dataTypes.length === 1) { - return checkDataType(dataTypes[0], data, strictNums, correct) - } - let cond: Code - const types = toHash(dataTypes) - if (types.array && types.object) { - const notObj = _`typeof ${data} != "object"` - cond = types.null ? notObj : _`!${data} || ${notObj}` - delete types.null - delete types.array - delete types.object - } else { - cond = nil - } - if (types.number) delete types.integer - for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct)) - return cond -} - -export type TypeError = ErrorObject<"type", {type: string}> - -const typeError: KeywordErrorDefinition = { - message: ({schema}) => str`should be ${schema}`, - params: ({schema, schemaValue}) => - typeof schema == "string" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`, -} - -export function reportTypeError(it: SchemaObjCxt): void { - const cxt = getTypeErrorContext(it) - reportError(cxt, typeError) -} - -function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt { - const {gen, data, schema} = it - const schemaCode = schemaRefOrVal(it, schema, "type") - return { - gen, - keyword: "type", - data, - schema: schema.type, - schemaCode, - schemaValue: schemaCode, - parentSchema: schema, - params: {}, - it, - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/defaults.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/defaults.ts deleted file mode 100644 index 60028faae..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/defaults.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type {SchemaObjCxt} from ".." -import {_, getProperty, stringify} from "../codegen" -import {checkStrictMode} from "." - -export function assignDefaults(it: SchemaObjCxt, ty?: string): void { - const {properties, items} = it.schema - if (ty === "object" && properties) { - for (const key in properties) { - assignDefault(it, key, properties[key].default) - } - } else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i: number) => assignDefault(it, i, sch.default)) - } -} - -function assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void { - const {gen, compositeRule, data, opts} = it - if (defaultValue === undefined) return - const childData = _`${data}${getProperty(prop)}` - if (compositeRule) { - checkStrictMode(it, `default is ignored for: ${childData}`) - return - } - - let condition = _`${childData} === undefined` - if (opts.useDefaults === "empty") { - condition = _`${condition} || ${childData} === null || ${childData} === ""` - } - // `${childData} === undefined` + - // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") - gen.if(condition, _`${childData} = ${stringify(defaultValue)}`) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/index.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/index.ts deleted file mode 100644 index 474d09043..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/index.ts +++ /dev/null @@ -1,199 +0,0 @@ -import type {AnySchema} from "../../types" -import type {SchemaCxt, SchemaObjCxt} from ".." -import type {InstanceOptions} from "../../core" -import {boolOrEmptySchema, topBoolOrEmptySchema} from "./boolSchema" -import {coerceAndCheckDataType, getSchemaTypes} from "./dataType" -import {schemaKeywords} from "./iterate" -import {_, nil, str, Block, Code, Name, CodeGen} from "../codegen" -import N from "../names" -import {resolveUrl} from "../resolve" -import {schemaHasRulesButRef, checkUnknownRules} from "../util" - -// schema compilation - generates validation function, subschemaCode (below) is used for subschemas -export function validateFunctionCode(it: SchemaCxt): void { - if (isSchemaObj(it)) { - checkKeywords(it) - if (schemaCxtHasRules(it)) { - topSchemaObjCode(it) - return - } - } - validateFunction(it, () => topBoolOrEmptySchema(it)) -} - -function validateFunction( - {gen, validateName, schema, schemaEnv, opts}: SchemaCxt, - body: Block -): void { - if (opts.code.es5) { - gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => { - gen.code(_`"use strict"; ${funcSourceUrl(schema, opts)}`) - destructureValCxtES5(gen, opts) - gen.code(body) - }) - } else { - gen.func(validateName, _`${N.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => - gen.code(funcSourceUrl(schema, opts)).code(body) - ) - } -} - -function destructureValCxt(opts: InstanceOptions): Code { - return _`{${N.dataPath}="", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${N.data}${ - opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil - }}={}` -} - -function destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void { - gen.if( - N.valCxt, - () => { - gen.var(N.dataPath, _`${N.valCxt}.${N.dataPath}`) - gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`) - gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`) - gen.var(N.rootData, _`${N.valCxt}.${N.rootData}`) - if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`${N.valCxt}.${N.dynamicAnchors}`) - }, - () => { - gen.var(N.dataPath, _`""`) - gen.var(N.parentData, _`undefined`) - gen.var(N.parentDataProperty, _`undefined`) - gen.var(N.rootData, N.data) - if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`{}`) - } - ) -} - -function topSchemaObjCode(it: SchemaObjCxt): void { - const {schema, opts, gen} = it - validateFunction(it, () => { - if (opts.$comment && schema.$comment) commentKeyword(it) - checkNoDefault(it) - gen.let(N.vErrors, null) - gen.let(N.errors, 0) - if (opts.unevaluated) resetEvaluated(it) - typeAndKeywords(it) - returnResults(it) - }) - return -} - -function resetEvaluated(it: SchemaObjCxt): void { - // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated - const {gen, validateName} = it - it.evaluated = gen.const("evaluated", _`${validateName}.evaluated`) - gen.if(_`${it.evaluated}.dynamicProps`, () => gen.assign(_`${it.evaluated}.props`, _`undefined`)) - gen.if(_`${it.evaluated}.dynamicItems`, () => gen.assign(_`${it.evaluated}.items`, _`undefined`)) -} - -function funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code { - return typeof schema == "object" && schema.$id && (opts.code.source || opts.code.process) - ? _`/*# sourceURL=${schema.$id} */` - : nil -} - -// schema compilation - this function is used recursively to generate code for sub-schemas -export function subschemaCode(it: SchemaCxt, valid: Name): void { - if (isSchemaObj(it)) { - checkKeywords(it) - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid) - return - } - } - boolOrEmptySchema(it, valid) -} - -export function schemaCxtHasRules({schema, self}: SchemaCxt): boolean { - if (typeof schema == "boolean") return !schema - for (const key in schema) if (self.RULES.all[key]) return true - return false -} - -function isSchemaObj(it: SchemaCxt): it is SchemaObjCxt { - return typeof it.schema != "boolean" -} - -function subSchemaObjCode(it: SchemaObjCxt, valid: Name): void { - const {schema, gen, opts} = it - if (opts.$comment && schema.$comment) commentKeyword(it) - updateContext(it) - checkAsync(it) - const errsCount = gen.const("_errs", N.errors) - typeAndKeywords(it, errsCount) - // TODO var - gen.var(valid, _`${errsCount} === ${N.errors}`) -} - -function checkKeywords(it: SchemaObjCxt): void { - checkUnknownRules(it) - checkRefsAndKeywords(it) -} - -function typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void { - if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount) - const types = getSchemaTypes(it.schema) - const checkedTypes = coerceAndCheckDataType(it, types) - schemaKeywords(it, types, !checkedTypes, errsCount) -} - -function checkRefsAndKeywords(it: SchemaObjCxt): void { - const {schema, errSchemaPath, opts, self} = it - if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) { - self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`) - } -} - -function checkNoDefault(it: SchemaObjCxt): void { - const {schema, opts} = it - if (schema.default !== undefined && opts.useDefaults && opts.strict) { - checkStrictMode(it, "default is ignored in the schema root") - } -} - -function updateContext(it: SchemaObjCxt): void { - if (it.schema.$id) it.baseId = resolveUrl(it.baseId, it.schema.$id) -} - -function checkAsync(it: SchemaObjCxt): void { - if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema") -} - -function commentKeyword({gen, schemaEnv, schema, errSchemaPath, opts}: SchemaObjCxt): void { - const msg = schema.$comment - if (opts.$comment === true) { - gen.code(_`${N.self}.logger.log(${msg})`) - } else if (typeof opts.$comment == "function") { - const schemaPath = str`${errSchemaPath}/$comment` - const rootName = gen.scopeValue("root", {ref: schemaEnv.root}) - gen.code(_`${N.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`) - } -} - -function returnResults(it: SchemaCxt): void { - const {gen, schemaEnv, validateName, ValidationError, opts} = it - if (schemaEnv.$async) { - // TODO assign unevaluated - gen.if( - _`${N.errors} === 0`, - () => gen.return(N.data), - () => gen.throw(_`new ${ValidationError as Name}(${N.vErrors})`) - ) - } else { - gen.assign(_`${validateName}.errors`, N.vErrors) - if (opts.unevaluated) assignEvaluated(it) - gen.return(_`${N.errors} === 0`) - } -} - -function assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void { - if (props instanceof Name) gen.assign(_`${evaluated}.props`, props) - if (items instanceof Name) gen.assign(_`${evaluated}.items`, items) -} - -export function checkStrictMode(it: SchemaCxt, msg: string, mode = it.opts.strict): void { - if (!mode) return - msg = `strict mode: ${msg}` - if (mode === true) throw new Error(msg) - it.self.logger.warn(msg) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/iterate.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/iterate.ts deleted file mode 100644 index c68f98d2e..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/iterate.ts +++ /dev/null @@ -1,116 +0,0 @@ -import type {SchemaObjCxt} from ".." -import type {JSONType, Rule, RuleGroup} from "../rules" -import {shouldUseGroup, shouldUseRule} from "./applicability" -import {checkDataType, reportTypeError} from "./dataType" -import {assignDefaults} from "./defaults" -import {keywordCode} from "./keyword" -import {schemaHasRulesButRef} from "../util" -import {checkStrictMode} from "." -import {_, Name} from "../codegen" -import N from "../names" - -export function schemaKeywords( - it: SchemaObjCxt, - types: JSONType[], - typeErrors: boolean, - errsCount?: Name -): void { - const {gen, schema, data, allErrors, opts, self} = it - const {RULES} = self - if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) { - gen.block(() => keywordCode(it, "$ref", (RULES.all.$ref as Rule).definition)) // TODO typecast - return - } - if (!opts.jtd) checkStrictTypes(it, types) - gen.block(() => { - for (const group of RULES.rules) groupKeywords(group) - groupKeywords(RULES.post) - }) - - function groupKeywords(group: RuleGroup): void { - if (!shouldUseGroup(schema, group)) return - if (group.type) { - gen.if(checkDataType(group.type, data, opts.strict)) - iterateKeywords(it, group) - if (types.length === 1 && types[0] === group.type && typeErrors) { - gen.else() - reportTypeError(it) - } - gen.endIf() - } else { - iterateKeywords(it, group) - } - // TODO make it "ok" call? - if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`) - } -} - -function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void { - const { - gen, - schema, - opts: {useDefaults}, - } = it - if (useDefaults) assignDefaults(it, group.type) - gen.block(() => { - for (const rule of group.rules) { - if (shouldUseRule(schema, rule)) { - keywordCode(it, rule.keyword, rule.definition, group.type) - } - } - }) -} - -function checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void { - if (it.schemaEnv.meta || !it.opts.strictTypes) return - checkContextTypes(it, types) - if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types) - checkKeywordTypes(it, it.dataTypes) -} - -function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void { - if (!types.length) return - if (!it.dataTypes.length) { - it.dataTypes = types - return - } - types.forEach((t) => { - if (!includesType(it.dataTypes, t)) { - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`) - } - }) - it.dataTypes = it.dataTypes.filter((t) => includesType(types, t)) -} - -function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void { - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { - strictTypesError(it, "use allowUnionTypes to allow union type keyword") - } -} - -function checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void { - const rules = it.self.RULES.all - for (const keyword in rules) { - const rule = rules[keyword] - if (typeof rule == "object" && shouldUseRule(it.schema, rule)) { - const {type} = rule.definition - if (type.length && !type.some((t) => hasApplicableType(ts, t))) { - strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`) - } - } - } -} - -function hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean { - return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")) -} - -function includesType(ts: JSONType[], t: JSONType): boolean { - return ts.includes(t) || (t === "integer" && ts.includes("number")) -} - -function strictTypesError(it: SchemaObjCxt, msg: string): void { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath - msg += ` at "${schemaPath}" (strictTypes)` - checkStrictMode(it, msg, it.opts.strictTypes) -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/keyword.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/keyword.ts deleted file mode 100644 index 63047af52..000000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/keyword.ts +++ /dev/null @@ -1,144 +0,0 @@ -import type { - AddedKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - AnySchema, - SchemaValidateFunction, - AnyValidateFunction, -} from "../../types" -import type {SchemaObjCxt} from ".." -import type {JSONType} from "../rules" -import KeywordCxt from "../context" -import {extendErrors} from "../errors" -import {callValidateCode} from "../../vocabularies/code" -import {CodeGen, _, nil, not, stringify, Code, Name} from "../codegen" -import N from "../names" - -type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction - -export function keywordCode( - it: SchemaObjCxt, - keyword: string, - def: AddedKeywordDefinition, - ruleType?: JSONType -): void { - const cxt = new KeywordCxt(it, def, keyword) - if ("code" in def) { - def.code(cxt, ruleType) - } else if (cxt.$data && def.validate) { - funcKeywordCode(cxt, def) - } else if ("macro" in def) { - macroKeywordCode(cxt, def) - } else if (def.compile || def.validate) { - funcKeywordCode(cxt, def) - } -} - -function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void { - const {gen, keyword, schema, parentSchema, it} = cxt - const macroSchema = def.macro.call(it.self, schema, parentSchema, it) - const schemaRef = useKeyword(gen, keyword, macroSchema) - if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true) - - const valid = gen.name("valid") - cxt.subschema( - { - schema: macroSchema, - schemaPath: nil, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - topSchemaRef: schemaRef, - compositeRule: true, - }, - valid - ) - cxt.pass(valid, () => cxt.error(true)) -} - -function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void { - const {gen, keyword, schema, parentSchema, $data, it} = cxt - checkAsync(it, def) - const validate = - !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate - const validateRef = useKeyword(gen, keyword, validate) - const valid = gen.let("valid") - cxt.block$data(valid, validateKeyword) - cxt.ok(def.valid ?? valid) - - function validateKeyword(): void { - if (def.errors === false) { - assignValid() - if (def.modifying) modifyData(cxt) - reportErrs(() => cxt.error()) - } else { - const ruleErrs = def.async ? validateAsync() : validateSync() - if (def.modifying) modifyData(cxt) - reportErrs(() => addErrs(cxt, ruleErrs)) - } - } - - function validateAsync(): Name { - const ruleErrs = gen.let("ruleErrs", null) - gen.try( - () => assignValid(_`await `), - (e) => - gen.assign(valid, false).if( - _`${e} instanceof ${it.ValidationError as Name}`, - () => gen.assign(ruleErrs, _`${e}.errors`), - () => gen.throw(e) - ) - ) - return ruleErrs - } - - function validateSync(): Code { - const validateErrs = _`${validateRef}.errors` - gen.assign(validateErrs, null) - assignValid(nil) - return validateErrs - } - - function assignValid(_await: Code = def.async ? _`await ` : nil): void { - const passCxt = it.opts.passContext ? N.this : N.self - const passSchema = !(("compile" in def && !$data) || def.schema === false) - gen.assign( - valid, - _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`, - def.modifying - ) - } - - function reportErrs(errors: () => void): void { - gen.if(not(def.valid ?? valid), errors) - } -} - -function modifyData(cxt: KeywordCxt): void { - const {gen, data, it} = cxt - gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`)) -} - -function addErrs(cxt: KeywordCxt, errs: Code): void { - const {gen} = cxt - gen.if( - _`Array.isArray(${errs})`, - () => { - gen - .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) - .assign(N.errors, _`${N.vErrors}.length`) - extendErrors(cxt) - }, - () => cxt.error() - ) -} - -function checkAsync({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void { - if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema") -} - -function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name { - if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`) - return gen.scopeValue( - "keyword", - typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)} - ) -} diff --git a/node_modules/table/node_modules/ajv/lib/core.ts b/node_modules/table/node_modules/ajv/lib/core.ts deleted file mode 100644 index d85844559..000000000 --- a/node_modules/table/node_modules/ajv/lib/core.ts +++ /dev/null @@ -1,827 +0,0 @@ -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - AnyValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {SchemaCxt, SchemaObjCxt} from "./compile" -export interface Plugin { - (ajv: Ajv, options?: Opts): Ajv - [prop: string]: any -} - -import KeywordCxt from "./compile/context" -export {KeywordCxt} -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {JTDSchemaType} from "./types/jtd-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -import type { - Schema, - AnySchema, - AnySchemaObject, - SchemaObject, - AsyncSchema, - Vocabulary, - KeywordDefinition, - AddedKeywordDefinition, - AnyValidateFunction, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - Format, - AddedFormat, -} from "./types" -import type {JSONSchemaType} from "./types/json-schema" -import type {JTDSchemaType} from "./types/jtd-schema" -import {ValidationError, MissingRefError} from "./compile/error_classes" -import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules" -import {SchemaEnv, compileSchema, resolveSchema} from "./compile" -import {Code, ValueScope} from "./compile/codegen" -import {normalizeId, getSchemaRefs} from "./compile/resolve" -import {getJSONTypes} from "./compile/validate/dataType" -import {eachItem} from "./compile/util" - -import * as $dataRefSchema from "./refs/data.json" - -const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"] -const EXT_SCOPE_NAMES = new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error", -]) - -export type Options = CurrentOptions & DeprecatedOptions - -export interface CurrentOptions { - // strict mode options (NEW) - strict?: boolean | "log" - strictTypes?: boolean | "log" - strictTuples?: boolean | "log" - strictRequired?: boolean | "log" - allowMatchingProperties?: boolean // disables a strict mode restriction - allowUnionTypes?: boolean - validateFormats?: boolean - // validation and reporting options: - $data?: boolean - allErrors?: boolean - verbose?: boolean - $comment?: - | true - | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown) - formats?: {[Name in string]?: Format} - keywords?: Vocabulary - schemas?: AnySchema[] | {[Key in string]?: AnySchema} - logger?: Logger | false - loadSchema?: (uri: string) => Promise - // options to modify validated data: - removeAdditional?: boolean | "all" | "failing" - useDefaults?: boolean | "empty" - coerceTypes?: boolean | "array" - // advanced options: - next?: boolean // NEW - unevaluated?: boolean // NEW - dynamicRef?: boolean // NEW - jtd?: boolean // NEW - meta?: SchemaObject | boolean - defaultMeta?: string | AnySchemaObject - validateSchema?: boolean | "log" - addUsedSchema?: boolean - inlineRefs?: boolean | number - passContext?: boolean - loopRequired?: number - loopEnum?: number // NEW - ownProperties?: boolean - multipleOfPrecision?: number - messages?: boolean - code?: CodeOptions // NEW - ajvErrors?: boolean -} - -export interface CodeOptions { - es5?: boolean - lines?: boolean - optimize?: boolean | number - formats?: Code // code to require (or construct) map of available formats - for standalone code - source?: boolean - process?: (code: string, schema?: SchemaEnv) => string -} - -interface InstanceCodeOptions extends CodeOptions { - optimize: number -} - -interface DeprecatedOptions { - /** @deprecated */ - ignoreKeywordsWithRef?: boolean - /** @deprecated */ - jsPropertySyntax?: boolean // added instead of jsonPointers - /** @deprecated */ - unicode?: boolean -} - -interface RemovedOptions { - format?: boolean - errorDataPath?: "object" | "property" - nullable?: boolean // "nullable" keyword is supported by default - jsonPointers?: boolean - extendRefs?: true | "ignore" | "fail" - missingRefs?: true | "ignore" | "fail" - processCode?: (code: string, schema?: SchemaEnv) => string - sourceCode?: boolean - schemaId?: string - strictDefaults?: boolean - strictKeywords?: boolean - strictNumbers?: boolean - uniqueItems?: boolean - unknownFormats?: true | string[] | "ignore" - cache?: any - serialize?: (schema: AnySchema) => unknown -} - -type OptionsInfo = { - [K in keyof T]-?: string | undefined -} - -const removedOptions: OptionsInfo = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - schemaId: "JSON Schema draft-04 is not supported in Ajv v7.", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - strictNumbers: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", -} - -const deprecatedOptions: OptionsInfo = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.', -} - -type RequiredInstanceOptions = { - [K in - | "strict" - | "strictTypes" - | "strictTuples" - | "inlineRefs" - | "loopRequired" - | "loopEnum" - | "meta" - | "messages" - | "addUsedSchema" - | "validateSchema" - | "validateFormats"]: NonNullable -} & {code: InstanceCodeOptions} - -export type InstanceOptions = Options & RequiredInstanceOptions - -function requiredOptions(o: Options): RequiredInstanceOptions { - const strict = o.strict ?? true - const strictLog = strict ? "log" : false - const _optz = o.code?.optimize - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0 - return { - strict, - strictTypes: o.strictTypes ?? strictLog, - strictTuples: o.strictTuples ?? strictLog, - code: o.code ? {...o.code, optimize} : {optimize}, - loopRequired: o.loopRequired ?? Infinity, - loopEnum: o.loopEnum ?? Infinity, - meta: o.meta ?? true, - messages: o.messages ?? true, - inlineRefs: o.inlineRefs ?? true, - addUsedSchema: o.addUsedSchema ?? true, - validateSchema: o.validateSchema ?? true, - validateFormats: o.validateFormats ?? true, - } -} - -export interface Logger { - log(...args: unknown[]): unknown - warn(...args: unknown[]): unknown - error(...args: unknown[]): unknown -} - -export default class Ajv { - opts: InstanceOptions - errors?: ErrorObject[] | null // errors from the last validation - logger: Logger - // shared external scope values for compiled functions - readonly scope: ValueScope - readonly schemas: {[Key in string]?: SchemaEnv} = {} - readonly refs: {[Ref in string]?: SchemaEnv | string} = {} - readonly formats: {[Name in string]?: AddedFormat} = {} - readonly RULES: ValidationRules - readonly _compilations: Set = new Set() - private readonly _loading: {[Ref in string]?: Promise} = {} - private readonly _cache: Map = new Map() - private readonly _metaOpts: InstanceOptions - - static ValidationError = ValidationError - static MissingRefError = MissingRefError - - constructor(opts: Options = {}) { - opts = this.opts = {...opts, ...requiredOptions(opts)} - const {es5, lines} = this.opts.code - this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines}) - this.logger = getLogger(opts.logger) - const formatOpt = opts.validateFormats - opts.validateFormats = false - - this.RULES = getRules() - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED") - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn") - this._metaOpts = getMetaSchemaOptions.call(this) - - if (opts.formats) addInitialFormats.call(this) - this._addVocabularies() - this._addDefaultMetaSchema() - if (opts.keywords) addInitialKeywords.call(this, opts.keywords) - if (typeof opts.meta == "object") this.addMetaSchema(opts.meta) - addInitialSchemas.call(this) - opts.validateFormats = formatOpt - } - - _addVocabularies(): void { - this.addKeyword("$async") - } - - _addDefaultMetaSchema(): void { - const {$data, meta} = this.opts - if (meta && $data) this.addMetaSchema($dataRefSchema, $dataRefSchema.$id, false) - } - - defaultMeta(): string | AnySchemaObject | undefined { - const {meta} = this.opts - return (this.opts.defaultMeta = typeof meta == "object" ? meta.$id || meta : undefined) - } - - // Validate data using schema - // AnySchema will be compiled and cached using schema itself as a key for Map - validate(schema: Schema | string, data: unknown): boolean - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise - validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - validate(schema: JTDSchemaType, data: unknown): data is T - validate(schema: AsyncSchema, data: unknown | T): Promise - validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise - validate( - schemaKeyRef: AnySchema | string, // key, ref or schema object - data: unknown | T // to be validated - ): boolean | Promise { - let v: AnyValidateFunction | undefined - if (typeof schemaKeyRef == "string") { - v = this.getSchema(schemaKeyRef) - if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`) - } else { - v = this.compile(schemaKeyRef) - } - - const valid = v(data) - if (!("$async" in v)) this.errors = v.errors - return valid - } - - // Create validation function for passed schema - // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords. - compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction - compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction { - const sch = this._addSchema(schema, _meta) - return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction - } - - // Creates validating function for passed schema with asynchronous loading of missing schemas. - // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. - // TODO allow passing schema URI - // meta - optional true to compile meta-schema - compileAsync( - schema: SchemaObject | JSONSchemaType, - _meta?: boolean - ): Promise> - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise> - compileAsync(schema: AsyncSchema, meta?: boolean): Promise> - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileAsync( - schema: AnySchemaObject, - meta?: boolean - ): Promise> - compileAsync( - schema: AnySchemaObject, - meta?: boolean - ): Promise> { - if (typeof this.opts.loadSchema != "function") { - throw new Error("options.loadSchema should be a function") - } - const {loadSchema} = this.opts - return runCompileAsync.call(this, schema, meta) - - async function runCompileAsync( - this: Ajv, - _schema: AnySchemaObject, - _meta?: boolean - ): Promise { - await loadMetaSchema.call(this, _schema.$schema) - const sch = this._addSchema(_schema, _meta) - return sch.validate || _compileAsync.call(this, sch) - } - - async function loadMetaSchema(this: Ajv, $ref?: string): Promise { - if ($ref && !this.getSchema($ref)) { - await runCompileAsync.call(this, {$ref}, true) - } - } - - async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise { - try { - return this._compileSchemaEnv(sch) - } catch (e) { - if (!(e instanceof MissingRefError)) throw e - checkLoaded.call(this, e) - await loadMissingSchema.call(this, e.missingSchema) - return _compileAsync.call(this, sch) - } - } - - function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void { - if (this.refs[ref]) { - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`) - } - } - - async function loadMissingSchema(this: Ajv, ref: string): Promise { - const _schema = await _loadSchema.call(this, ref) - if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema) - if (!this.refs[ref]) this.addSchema(_schema, ref, meta) - } - - async function _loadSchema(this: Ajv, ref: string): Promise { - const p = this._loading[ref] - if (p) return p - try { - return await (this._loading[ref] = loadSchema(ref)) - } finally { - delete this._loading[ref] - } - } - } - - // Adds schema to the instance - addSchema( - schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored - key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. - ): Ajv { - if (Array.isArray(schema)) { - for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema) - return this - } - let id: string | undefined - if (typeof schema === "object") { - id = schema.$id - if (id !== undefined && typeof id != "string") throw new Error("schema id must be string") - } - key = normalizeId(key || id) - this._checkUnique(key) - this.schemas[key] = this._addSchema(schema, _meta, _validateSchema, true) - return this - } - - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema( - schema: AnySchemaObject, - key?: string, // schema key - _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema - ): Ajv { - this.addSchema(schema, key, true, _validateSchema) - return this - } - - // Validate schema against its meta-schema - validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise { - if (typeof schema == "boolean") return true - let $schema: string | AnySchemaObject | undefined - $schema = schema.$schema - if ($schema !== undefined && typeof $schema != "string") { - throw new Error("$schema must be a string") - } - $schema = $schema || this.opts.defaultMeta || this.defaultMeta() - if (!$schema) { - this.logger.warn("meta-schema not available") - this.errors = null - return true - } - const valid = this.validate($schema, schema) - if (!valid && throwOrLogError) { - const message = "schema is invalid: " + this.errorsText() - if (this.opts.validateSchema === "log") this.logger.error(message) - else throw new Error(message) - } - return valid - } - - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(keyRef: string): AnyValidateFunction | undefined { - let sch - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch - if (sch === undefined) { - const root = new SchemaEnv({schema: {}}) - sch = resolveSchema.call(this, root, keyRef) - if (!sch) return - this.refs[keyRef] = sch - } - return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction | undefined - } - - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv { - if (schemaKeyRef instanceof RegExp) { - this._removeAllSchemas(this.schemas, schemaKeyRef) - this._removeAllSchemas(this.refs, schemaKeyRef) - return this - } - switch (typeof schemaKeyRef) { - case "undefined": - this._removeAllSchemas(this.schemas) - this._removeAllSchemas(this.refs) - this._cache.clear() - return this - case "string": { - const sch = getSchEnv.call(this, schemaKeyRef) - if (typeof sch == "object") this._cache.delete(sch.schema) - delete this.schemas[schemaKeyRef] - delete this.refs[schemaKeyRef] - return this - } - case "object": { - const cacheKey = schemaKeyRef - this._cache.delete(cacheKey) - let id = schemaKeyRef.$id - if (id) { - id = normalizeId(id) - delete this.schemas[id] - delete this.refs[id] - } - return this - } - default: - throw new Error("ajv.removeSchema: invalid parameter") - } - } - - // add "vocabulary" - a collection of keywords - addVocabulary(definitions: Vocabulary): Ajv { - for (const def of definitions) this.addKeyword(def) - return this - } - - addKeyword( - kwdOrDef: string | KeywordDefinition, - def?: KeywordDefinition // deprecated - ): Ajv { - let keyword: string | string[] - if (typeof kwdOrDef == "string") { - keyword = kwdOrDef - if (typeof def == "object") { - this.logger.warn("these parameters are deprecated, see docs for addKeyword") - def.keyword = keyword - } - } else if (typeof kwdOrDef == "object" && def === undefined) { - def = kwdOrDef - keyword = def.keyword - if (Array.isArray(keyword) && !keyword.length) { - throw new Error("addKeywords: keyword must be string or non-empty array") - } - } else { - throw new Error("invalid addKeywords parameters") - } - - checkKeyword.call(this, keyword, def) - if (!def) { - eachItem(keyword, (kwd) => addRule.call(this, kwd)) - return this - } - keywordMetaschema.call(this, def) - const definition: AddedKeywordDefinition = { - ...def, - type: getJSONTypes(def.type), - schemaType: getJSONTypes(def.schemaType), - } - eachItem( - keyword, - definition.type.length === 0 - ? (k) => addRule.call(this, k, definition) - : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)) - ) - return this - } - - getKeyword(keyword: string): AddedKeywordDefinition | boolean { - const rule = this.RULES.all[keyword] - return typeof rule == "object" ? rule.definition : !!rule - } - - // Remove keyword - removeKeyword(keyword: string): Ajv { - // TODO return type should be Ajv - const {RULES} = this - delete RULES.keywords[keyword] - delete RULES.all[keyword] - for (const group of RULES.rules) { - const i = group.rules.findIndex((rule) => rule.keyword === keyword) - if (i >= 0) group.rules.splice(i, 1) - } - return this - } - - // Add format - addFormat(name: string, format: Format): Ajv { - if (typeof format == "string") format = new RegExp(format) - this.formats[name] = format - return this - } - - errorsText( - errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors - {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar` - ): string { - if (!errors || errors.length === 0) return "No errors" - return errors - .map((e) => `${dataVar}${e.dataPath} ${e.message}`) - .reduce((text, msg) => text + separator + msg) - } - - $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject { - const rules = this.RULES.all - metaSchema = JSON.parse(JSON.stringify(metaSchema)) - for (const jsonPointer of keywordsJsonPointers) { - const segments = jsonPointer.split("/").slice(1) // first segment is an empty string - let keywords = metaSchema - for (const seg of segments) keywords = keywords[seg] as AnySchemaObject - - for (const key in rules) { - const rule = rules[key] - if (typeof rule != "object") continue - const {$data} = rule.definition - const schema = keywords[key] as AnySchemaObject | undefined - if ($data && schema) keywords[key] = schemaOrData(schema) - } - } - - return metaSchema - } - - private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void { - for (const keyRef in schemas) { - const sch = schemas[keyRef] - if (!regex || regex.test(keyRef)) { - if (typeof sch == "string") { - delete schemas[keyRef] - } else if (sch && !sch.meta) { - this._cache.delete(sch.schema) - delete schemas[keyRef] - } - } - } - } - - _addSchema( - schema: AnySchema, - meta?: boolean, - validateSchema = this.opts.validateSchema, - addSchema = this.opts.addUsedSchema - ): SchemaEnv { - if (typeof schema != "object") { - if (this.opts.jtd) throw new Error("schema must be object") - else if (typeof schema != "boolean") throw new Error("schema must be object or boolean") - } - let sch = this._cache.get(schema) - if (sch !== undefined) return sch - - const localRefs = getSchemaRefs.call(this, schema) - sch = new SchemaEnv({schema, meta, localRefs}) - this._cache.set(sch.schema, sch) - const id = sch.baseId - if (addSchema && !id.startsWith("#")) { - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) - if (id) this._checkUnique(id) - this.refs[id] = sch - } - if (validateSchema) this.validateSchema(schema, true) - return sch - } - - private _checkUnique(id: string): void { - if (this.schemas[id] || this.refs[id]) { - throw new Error(`schema with key or id "${id}" already exists`) - } - } - - private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction { - if (sch.meta) this._compileMetaSchema(sch) - else compileSchema.call(this, sch) - - /* istanbul ignore if */ - if (!sch.validate) throw new Error("ajv implementation error") - return sch.validate - } - - private _compileMetaSchema(sch: SchemaEnv): void { - const currentOpts = this.opts - this.opts = this._metaOpts - try { - compileSchema.call(this, sch) - } finally { - this.opts = currentOpts - } - } -} - -export interface ErrorsTextOptions { - separator?: string - dataVar?: string -} - -function checkOptions( - this: Ajv, - checkOpts: OptionsInfo, - options: Options & RemovedOptions, - msg: string, - log: "warn" | "error" = "error" -): void { - for (const key in checkOpts) { - const opt = key as keyof typeof checkOpts - if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`) - } -} - -function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined { - keyRef = normalizeId(keyRef) // TODO tests fail without this line - return this.schemas[keyRef] || this.refs[keyRef] -} - -function addInitialSchemas(this: Ajv): void { - const optsSchemas = this.opts.schemas - if (!optsSchemas) return - if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas) - else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key) -} - -function addInitialFormats(this: Ajv): void { - for (const name in this.opts.formats) { - const format = this.opts.formats[name] - if (format) this.addFormat(name, format) - } -} - -function addInitialKeywords( - this: Ajv, - defs: Vocabulary | {[K in string]?: KeywordDefinition} -): void { - if (Array.isArray(defs)) { - this.addVocabulary(defs) - return - } - this.logger.warn("keywords option as map is deprecated, pass array") - for (const keyword in defs) { - const def = defs[keyword] as KeywordDefinition - if (!def.keyword) def.keyword = keyword - this.addKeyword(def) - } -} - -function getMetaSchemaOptions(this: Ajv): InstanceOptions { - const metaOpts = {...this.opts} - for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt] - return metaOpts -} - -const noLogs = {log() {}, warn() {}, error() {}} - -function getLogger(logger?: Partial | false): Logger { - if (logger === false) return noLogs - if (logger === undefined) return console - if (logger.log && logger.warn && logger.error) return logger as Logger - throw new Error("logger must implement log, warn and error methods") -} - -const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i - -function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void { - const {RULES} = this - eachItem(keyword, (kwd) => { - if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`) - if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`) - }) - if (!def) return - if (def.$data && !("code" in def || "validate" in def)) { - throw new Error('$data keyword must have "code" or "validate" function') - } -} - -function addRule( - this: Ajv, - keyword: string, - definition?: AddedKeywordDefinition, - dataType?: JSONType -): void { - const post = definition?.post - if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"') - const {RULES} = this - let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType) - if (!ruleGroup) { - ruleGroup = {type: dataType, rules: []} - RULES.rules.push(ruleGroup) - } - RULES.keywords[keyword] = true - if (!definition) return - - const rule: Rule = { - keyword, - definition: { - ...definition, - type: getJSONTypes(definition.type), - schemaType: getJSONTypes(definition.schemaType), - }, - } - if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before) - else ruleGroup.rules.push(rule) - RULES.all[keyword] = rule - definition.implements?.forEach((kwd) => this.addKeyword(kwd)) -} - -function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void { - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before) - if (i >= 0) { - ruleGroup.rules.splice(i, 0, rule) - } else { - ruleGroup.rules.push(rule) - this.logger.warn(`rule ${before} is not defined`) - } -} - -function keywordMetaschema(this: Ajv, def: KeywordDefinition): void { - let {metaSchema} = def - if (metaSchema === undefined) return - if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema) - def.validateSchema = this.compile(metaSchema, true) -} - -const $dataRef = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", -} - -function schemaOrData(schema: AnySchema): AnySchemaObject { - return {anyOf: [schema, $dataRef]} -} diff --git a/node_modules/table/node_modules/ajv/lib/jtd.ts b/node_modules/table/node_modules/ajv/lib/jtd.ts deleted file mode 100644 index 0df1ce204..000000000 --- a/node_modules/table/node_modules/ajv/lib/jtd.ts +++ /dev/null @@ -1,128 +0,0 @@ -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - ErrorNoParams, - JTDParser, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -import KeywordCxt from "./compile/context" -export {KeywordCxt} -// export {DefinedError} from "./vocabularies/errors" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -import type {AnySchemaObject, SchemaObject, JTDParser} from "./types" -import type {JTDSchemaType, JTDDataType} from "./types/jtd-schema" -export {JTDSchemaType, JTDDataType} -import AjvCore, {CurrentOptions} from "./core" -import jtdVocabulary from "./vocabularies/jtd" -import jtdMetaSchema from "./refs/jtd-schema" -import compileSerializer from "./compile/jtd/serialize" -import compileParser from "./compile/jtd/parse" -import {SchemaEnv} from "./compile" - -// const META_SUPPORT_DATA = ["/properties"] - -const META_SCHEMA_ID = "JTD-meta-schema" - -export type JTDOptions = CurrentOptions & { - // strict mode options not supported with JTD: - strictTypes?: never - strictTuples?: never - allowMatchingProperties?: never - allowUnionTypes?: never - validateFormats?: never - // validation and reporting options not supported with JTD: - $data?: never - verbose?: never - $comment?: never - formats?: never - loadSchema?: never - // options to modify validated data: - useDefaults?: never - coerceTypes?: never - // advanced options: - next?: never - unevaluated?: never - dynamicRef?: never - meta?: boolean - defaultMeta?: never - inlineRefs?: boolean - loopRequired?: never - multipleOfPrecision?: never - ajvErrors?: boolean -} - -export default class Ajv extends AjvCore { - constructor(opts: JTDOptions = {}) { - super({ - ...opts, - jtd: true, - messages: opts.messages ?? false, - }) - } - - _addVocabularies(): void { - super._addVocabularies() - this.addVocabulary(jtdVocabulary) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - if (!this.opts.meta) return - this.addMetaSchema(jtdMetaSchema, META_SCHEMA_ID, false) - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } - - compileSerializer(schema: SchemaObject): (data: T) => string - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileSerializer(schema: JTDSchemaType): (data: T) => string - compileSerializer(schema: SchemaObject): (data: T) => string { - const sch = this._addSchema(schema) - return sch.serialize || this._compileSerializer(sch) - } - - compileParser(schema: SchemaObject): JTDParser - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileParser(schema: JTDSchemaType): JTDParser - compileParser(schema: SchemaObject): JTDParser { - const sch = this._addSchema(schema) - return (sch.parse || this._compileParser(sch)) as JTDParser - } - - private _compileSerializer(sch: SchemaEnv): (data: T) => string { - compileSerializer.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) - /* istanbul ignore if */ - if (!sch.serialize) throw new Error("ajv implementation error") - return sch.serialize - } - - private _compileParser(sch: SchemaEnv): JTDParser { - compileParser.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) - /* istanbul ignore if */ - if (!sch.parse) throw new Error("ajv implementation error") - return sch.parse - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/data.json b/node_modules/table/node_modules/ajv/lib/refs/data.json deleted file mode 100644 index 9ffc9f5ce..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", - "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", - "type": "object", - "required": ["$data"], - "properties": { - "$data": { - "type": "string", - "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] - } - }, - "additionalProperties": false -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts deleted file mode 100644 index 8407044c7..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type Ajv from "../../core" -import type {AnySchemaObject} from "../../types" -import * as metaSchema from "./schema.json" -import * as metaApplicator from "./meta/applicator.json" -import * as metaContent from "./meta/content.json" -import * as metaCore from "./meta/core.json" -import * as metaFormat from "./meta/format.json" -import * as metaMetadata from "./meta/meta-data.json" -import * as metaValidation from "./meta/validation.json" - -const META_SUPPORT_DATA = ["/properties"] - -export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv { - ;[ - metaSchema, - metaApplicator, - metaContent, - metaCore, - with$data(this, metaFormat), - metaMetadata, - with$data(this, metaValidation), - ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) - return this - - function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { - return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json deleted file mode 100644 index c5e91cf2a..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/applicator": true - }, - "$recursiveAnchor": true, - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "additionalItems": {"$recursiveRef": "#"}, - "unevaluatedItems": {"$recursiveRef": "#"}, - "items": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] - }, - "contains": {"$recursiveRef": "#"}, - "additionalProperties": {"$recursiveRef": "#"}, - "unevaluatedProperties": {"$recursiveRef": "#"}, - "properties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": { - "$recursiveRef": "#" - } - }, - "propertyNames": {"$recursiveRef": "#"}, - "if": {"$recursiveRef": "#"}, - "then": {"$recursiveRef": "#"}, - "else": {"$recursiveRef": "#"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$recursiveRef": "#"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$recursiveRef": "#"} - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json deleted file mode 100644 index b8f637343..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "contentSchema": {"$recursiveRef": "#"} - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json deleted file mode 100644 index f71adbff0..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true - }, - "$recursiveAnchor": true, - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$anchor": { - "type": "string", - "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveRef": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveAnchor": { - "type": "boolean", - "default": false - }, - "$vocabulary": { - "type": "object", - "propertyNames": { - "type": "string", - "format": "uri" - }, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json deleted file mode 100644 index 03ccfce26..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/format", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/format": true - }, - "$recursiveAnchor": true, - - "title": "Format vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json deleted file mode 100644 index 0e194326f..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/meta-data": true - }, - "$recursiveAnchor": true, - - "title": "Meta-data vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "deprecated": { - "type": "boolean", - "default": false - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json deleted file mode 100644 index 7027a1279..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/validation": true - }, - "$recursiveAnchor": true, - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, - "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, - "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, - "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/$defs/stringArray"}, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - } - }, - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json deleted file mode 100644 index 54eb7157a..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/schema", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true, - "https://json-schema.org/draft/2019-09/vocab/applicator": true, - "https://json-schema.org/draft/2019-09/vocab/validation": true, - "https://json-schema.org/draft/2019-09/vocab/meta-data": true, - "https://json-schema.org/draft/2019-09/vocab/format": false, - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "properties": { - "definitions": { - "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", - "type": "object", - "additionalProperties": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] - } - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json deleted file mode 100644 index 5410064ba..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-06/schema#", - "$id": "http://json-schema.org/draft-06/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "examples": { - "type": "array", - "items": {} - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": {} - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": {}, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": {} -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json deleted file mode 100644 index 6a7485104..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://json-schema.org/draft-07/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": true - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": true, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": true -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json deleted file mode 100644 index 3968abd5d..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", - "title": "Meta-schema for the security assessment of JSON Schemas", - "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - } - }, - "dependencies": { - "patternProperties": { - "description": "prevent slow validation of large property names", - "required": ["propertyNames"], - "properties": { - "propertyNames": { - "required": ["maxLength"] - } - } - }, - "uniqueItems": { - "description": "prevent slow validation of large non-scalar arrays", - "if": { - "properties": { - "uniqueItems": {"const": true}, - "items": { - "properties": { - "type": { - "anyOf": [ - { - "enum": ["object", "array"] - }, - { - "type": "array", - "contains": {"enum": ["object", "array"]} - } - ] - } - } - } - } - }, - "then": { - "required": ["maxItems"] - } - }, - "pattern": { - "description": "prevent slow pattern matching of large strings", - "required": ["maxLength"] - }, - "format": { - "description": "prevent slow format validation of large strings", - "required": ["maxLength"] - } - }, - "properties": { - "additionalItems": {"$ref": "#"}, - "additionalProperties": {"$ref": "#"}, - "dependencies": { - "additionalProperties": { - "anyOf": [{"type": "array"}, {"$ref": "#"}] - } - }, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] - }, - "definitions": { - "additionalProperties": {"$ref": "#"} - }, - "patternProperties": { - "additionalProperties": {"$ref": "#"} - }, - "properties": { - "additionalProperties": {"$ref": "#"} - }, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"}, - "contains": {"$ref": "#"}, - "propertyNames": {"$ref": "#"} - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/jtd-schema.ts b/node_modules/table/node_modules/ajv/lib/refs/jtd-schema.ts deleted file mode 100644 index c01981289..000000000 --- a/node_modules/table/node_modules/ajv/lib/refs/jtd-schema.ts +++ /dev/null @@ -1,130 +0,0 @@ -import {SchemaObject} from "../types" - -type MetaSchema = (root: boolean) => SchemaObject - -const shared: MetaSchema = (root) => { - const sch: SchemaObject = { - nullable: {type: "boolean"}, - metadata: { - optionalProperties: { - union: {elements: {ref: "schema"}}, - }, - additionalProperties: true, - }, - } - if (root) sch.definitions = {values: {ref: "schema"}} - return sch -} - -const emptyForm: MetaSchema = (root) => ({ - optionalProperties: shared(root), -}) - -const refForm: MetaSchema = (root) => ({ - properties: { - ref: {type: "string"}, - }, - optionalProperties: shared(root), -}) - -const typeForm: MetaSchema = (root) => ({ - properties: { - type: { - enum: [ - "boolean", - "timestamp", - "string", - "float32", - "float64", - "int8", - "uint8", - "int16", - "uint16", - "int32", - "uint32", - ], - }, - }, - optionalProperties: shared(root), -}) - -const enumForm: MetaSchema = (root) => ({ - properties: { - enum: {elements: {type: "string"}}, - }, - optionalProperties: shared(root), -}) - -const elementsForm: MetaSchema = (root) => ({ - properties: { - elements: {ref: "schema"}, - }, - optionalProperties: shared(root), -}) - -const propertiesForm: MetaSchema = (root) => ({ - properties: { - properties: {values: {ref: "schema"}}, - }, - optionalProperties: { - optionalProperties: {values: {ref: "schema"}}, - additionalProperties: {type: "boolean"}, - ...shared(root), - }, -}) - -const optionalPropertiesForm: MetaSchema = (root) => ({ - properties: { - optionalProperties: {values: {ref: "schema"}}, - }, - optionalProperties: { - additionalProperties: {type: "boolean"}, - ...shared(root), - }, -}) - -const discriminatorForm: MetaSchema = (root) => ({ - properties: { - discriminator: {type: "string"}, - mapping: { - values: { - metadata: { - union: [propertiesForm(false), optionalPropertiesForm(false)], - }, - }, - }, - }, - optionalProperties: shared(root), -}) - -const valuesForm: MetaSchema = (root) => ({ - properties: { - values: {ref: "schema"}, - }, - optionalProperties: shared(root), -}) - -const schema: MetaSchema = (root) => ({ - metadata: { - union: [ - emptyForm, - refForm, - typeForm, - enumForm, - elementsForm, - propertiesForm, - optionalPropertiesForm, - discriminatorForm, - valuesForm, - ].map((s) => s(root)), - }, -}) - -const jtdMetaSchema: SchemaObject = { - definitions: { - schema: schema(false), - }, - ...schema(true), -} - -export default jtdMetaSchema diff --git a/node_modules/table/node_modules/ajv/lib/runtime/parseJson.ts b/node_modules/table/node_modules/ajv/lib/runtime/parseJson.ts deleted file mode 100644 index ba222c004..000000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/parseJson.ts +++ /dev/null @@ -1,175 +0,0 @@ -import {_} from "../compile/codegen" - -const rxParseJson = /position\s(\d+)$/ - -export function parseJson(s: string, pos: number): unknown { - let endPos: number | undefined - parseJson.message = undefined - let matches: RegExpExecArray | null - if (pos) s = s.slice(pos) - try { - parseJson.position = pos + s.length - return JSON.parse(s) - } catch (e) { - matches = rxParseJson.exec(e.message) - if (!matches) { - parseJson.message = "unexpected end" - return undefined - } - endPos = +matches[1] - const c = s[endPos] - s = s.slice(0, endPos) - parseJson.position = pos + endPos - try { - return JSON.parse(s) - } catch (e1) { - parseJson.message = `unexpected token ${c}` - return undefined - } - } -} - -parseJson.message = undefined as string | undefined -parseJson.position = 0 as number -parseJson.code = _`require("ajv/dist/runtime/parseJson").parseJson` - -export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined { - let numStr = "" - let c: string - parseJsonNumber.message = undefined - if (s[pos] === "-") { - numStr += "-" - pos++ - } - if (s[pos] === "0") { - numStr += "0" - pos++ - } else { - if (!parseDigits(maxDigits)) { - errorMessage() - return undefined - } - } - if (maxDigits) { - parseJsonNumber.position = pos - return +numStr - } - if (s[pos] === ".") { - numStr += "." - pos++ - if (!parseDigits()) { - errorMessage() - return undefined - } - } - if (((c = s[pos]), c === "e" || c === "E")) { - numStr += "e" - pos++ - if (((c = s[pos]), c === "+" || c === "-")) { - numStr += c - pos++ - } - if (!parseDigits()) { - errorMessage() - return undefined - } - } - parseJsonNumber.position = pos - return +numStr - - function parseDigits(maxLen?: number): boolean { - let digit = false - while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { - digit = true - numStr += c - pos++ - } - return digit - } - - function errorMessage(): void { - parseJsonNumber.position = pos - parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end" - } -} - -parseJsonNumber.message = undefined as string | undefined -parseJsonNumber.position = 0 as number -parseJsonNumber.code = _`require("ajv/dist/runtime/parseJson").parseJsonNumber` - -const escapedChars: {[X in string]?: string} = { - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: "\t", - '"': '"', - "/": "/", - "\\": "\\", -} - -const CODE_A: number = "a".charCodeAt(0) -const CODE_0: number = "0".charCodeAt(0) - -export function parseJsonString(s: string, pos: number): string | undefined { - let str = "" - let c: string | undefined - parseJsonString.message = undefined - // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition - while (true) { - c = s[pos++] - if (c === '"') break - if (c === "\\") { - c = s[pos] - if (c in escapedChars) { - str += escapedChars[c] - pos++ - } else if (c === "u") { - pos++ - let count = 4 - let code = 0 - while (count--) { - code <<= 4 - c = s[pos].toLowerCase() - if (c >= "a" && c <= "f") { - code += c.charCodeAt(0) - CODE_A + 10 - } else if (c >= "0" && c <= "9") { - code += c.charCodeAt(0) - CODE_0 - } else if (c === undefined) { - errorMessage("unexpected end") - return undefined - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - pos++ - } - str += String.fromCharCode(code) - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - } else if (c === undefined) { - errorMessage("unexpected end") - return undefined - } else { - if (c.charCodeAt(0) >= 0x20) { - str += c - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - } - } - parseJsonString.position = pos - return str - - function errorMessage(msg: string): void { - parseJsonString.position = pos - parseJsonString.message = msg - } -} - -parseJsonString.message = undefined as string | undefined -parseJsonString.position = 0 as number -parseJsonString.code = _`require("ajv/dist/runtime/parseJson").parseJsonString` diff --git a/node_modules/table/node_modules/ajv/lib/runtime/quote.ts b/node_modules/table/node_modules/ajv/lib/runtime/quote.ts deleted file mode 100644 index c3309a0c4..000000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/quote.ts +++ /dev/null @@ -1,28 +0,0 @@ -// eslint-disable-next-line no-control-regex, no-misleading-character-class -const rxEscapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g - -const escaped: {[K in string]?: string} = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\", -} - -export default function quote(s: string): string { - rxEscapable.lastIndex = 0 - return ( - '"' + - (rxEscapable.test(s) - ? s.replace(rxEscapable, (a) => { - const c = escaped[a] - return typeof c === "string" - ? c - : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) - }) - : s) + - '"' - ) -} diff --git a/node_modules/table/node_modules/ajv/lib/standalone/index.ts b/node_modules/table/node_modules/ajv/lib/standalone/index.ts deleted file mode 100644 index 8cfca1da0..000000000 --- a/node_modules/table/node_modules/ajv/lib/standalone/index.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type AjvCore from "../core" -import type {AnyValidateFunction, SourceCode} from "../types" -import type {SchemaEnv} from "../compile" -import {UsedScopeValues, UsedValueState, ValueScopeName, varKinds} from "../compile/codegen/scope" -import {_, nil, _Code, Code, getProperty} from "../compile/codegen/code" - -export default function standaloneCode( - ajv: AjvCore, - refsOrFunc?: {[K in string]?: string} | AnyValidateFunction -): string { - if (!ajv.opts.code.source) { - throw new Error("moduleCode: ajv instance must have code.source option") - } - const {_n} = ajv.scope.opts - return typeof refsOrFunc == "function" - ? funcExportCode(refsOrFunc.source) - : refsOrFunc !== undefined - ? multiExportsCode(refsOrFunc, getValidate) - : multiExportsCode(ajv.schemas, (sch) => - sch.meta ? undefined : ajv.compile(sch.schema) - ) - - function getValidate(id: string): AnyValidateFunction { - const v = ajv.getSchema(id) - if (!v) throw new Error(`moduleCode: no schema with id ${id}`) - return v - } - - function funcExportCode(source?: SourceCode): string { - const usedValues: UsedScopeValues = {} - const n = source?.validateName - const vCode = validateCode(usedValues, source) - return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}` - } - - function multiExportsCode( - schemas: {[K in string]?: T}, - getValidateFunc: (schOrId: T) => AnyValidateFunction | undefined - ): string { - const usedValues: UsedScopeValues = {} - let code = _`"use strict";` - for (const name in schemas) { - const v = getValidateFunc(schemas[name] as T) - if (v) { - const vCode = validateCode(usedValues, v.source) - code = _`${code}${_n}exports${getProperty(name)} = ${v.source?.validateName};${_n}${vCode}` - } - } - return `${code}` - } - - function validateCode(usedValues: UsedScopeValues, s?: SourceCode): Code { - if (!s) throw new Error('moduleCode: function does not have "source" property') - if (usedState(s.validateName) === UsedValueState.Completed) return nil - setUsedState(s.validateName, UsedValueState.Started) - - const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode) - const code = new _Code(`${scopeCode}${_n}${s.validateCode}`) - return s.evaluated ? _`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code - - function refValidateCode(n: ValueScopeName): Code | undefined { - const vRef = n.value?.ref - if (n.prefix === "validate" && typeof vRef == "function") { - const v = vRef as AnyValidateFunction - return validateCode(usedValues, v.source) - } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { - const {validate, validateName} = vRef as SchemaEnv - if (!validateName) throw new Error("ajv internal error") - const def = ajv.opts.code.es5 ? varKinds.var : varKinds.const - const wrapper = _`${def} ${n} = {validate: ${validateName}};` - if (usedState(validateName) === UsedValueState.Started) return wrapper - const vCode = validateCode(usedValues, validate?.source) - return _`${wrapper}${_n}${vCode}` - } - return undefined - } - - function usedState(name: ValueScopeName): UsedValueState | undefined { - return usedValues[name.prefix]?.get(name) - } - - function setUsedState(name: ValueScopeName, state: UsedValueState): void { - const {prefix} = name - const names = (usedValues[prefix] = usedValues[prefix] || new Map()) - names.set(name, state) - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/standalone/instance.ts b/node_modules/table/node_modules/ajv/lib/standalone/instance.ts deleted file mode 100644 index c4b2c30b5..000000000 --- a/node_modules/table/node_modules/ajv/lib/standalone/instance.ts +++ /dev/null @@ -1,36 +0,0 @@ -import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core" -import standaloneCode from "." -import * as requireFromString from "require-from-string" - -export default class AjvPack { - errors?: ErrorObject[] | null // errors from the last validation - constructor(readonly ajv: Ajv) {} - - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise { - return Ajv.prototype.validate.call(this, schemaKeyRef, data) - } - - compile(schema: AnySchema, meta?: boolean): AnyValidateFunction { - return this.getStandalone(this.ajv.compile(schema, meta)) - } - - getSchema(keyRef: string): AnyValidateFunction | undefined { - const v = this.ajv.getSchema(keyRef) - if (!v) return undefined - return this.getStandalone(v) - } - - private getStandalone(v: AnyValidateFunction): AnyValidateFunction { - return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction - } - - addSchema(...args: Parameters): AjvPack { - this.ajv.addSchema.call(this.ajv, ...args) - return this - } - - addKeyword(...args: Parameters): AjvPack { - this.ajv.addKeyword.call(this.ajv, ...args) - return this - } -} diff --git a/node_modules/table/node_modules/ajv/lib/types/index.ts b/node_modules/table/node_modules/ajv/lib/types/index.ts deleted file mode 100644 index 7aa1c32f6..000000000 --- a/node_modules/table/node_modules/ajv/lib/types/index.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen" -import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile" -import type {JSONType} from "../compile/rules" -import type KeywordCxt from "../compile/context" -import type Ajv from "../core" - -interface _SchemaObject { - $id?: string - $schema?: string - [x: string]: any // TODO -} - -export interface SchemaObject extends _SchemaObject { - $id?: string - $schema?: string - $async?: false - [x: string]: any // TODO -} - -export interface AsyncSchema extends _SchemaObject { - $async: true -} - -export type AnySchemaObject = SchemaObject | AsyncSchema - -export type Schema = SchemaObject | boolean - -export type AnySchema = Schema | AsyncSchema - -export type SchemaMap = {[Key in string]?: AnySchema} - -export interface SourceCode { - validateName: ValueScopeName - validateCode: string - scopeValues: ScopeValueSets - evaluated?: Code -} - -export interface DataValidationCxt { - dataPath: string - parentData: {[K in T]: any} // object or array - parentDataProperty: T // string or number - rootData: Record | any[] - dynamicAnchors: {[Ref in string]?: ValidateFunction} -} - -export interface ValidateFunction { - (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T - errors?: null | ErrorObject[] - evaluated?: Evaluated - schema: AnySchema - schemaEnv: SchemaEnv - source?: SourceCode -} - -export interface JTDParser { - (json: string): T | undefined - message?: string - position?: number -} - -export type EvaluatedProperties = {[K in string]?: true} | true - -export type EvaluatedItems = number | true - -export interface Evaluated { - // determined at compile time if staticProps/Items is true - props?: EvaluatedProperties - items?: EvaluatedItems - // whether props/items determined at compile time - dynamicProps: boolean - dynamicItems: boolean -} - -export interface AsyncValidateFunction extends ValidateFunction { - (...args: Parameters>): Promise - $async: true -} - -export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction - -export interface ErrorObject, S = unknown> { - keyword: K - dataPath: string - instancePath?: string - schemaPath: string - params: P - // Added to validation errors of "propertyNames" keyword schema - propertyName?: string - // Excluded if option `messages` set to false. - message?: string - // These are added with the `verbose` option. - schema?: S - parentSchema?: AnySchemaObject - data?: unknown -} - -export type ErrorNoParams = ErrorObject, S> - -interface _KeywordDef { - keyword: string | string[] - type?: JSONType | JSONType[] // data types that keyword applies to - schemaType?: JSONType | JSONType[] // allowed type(s) of keyword value in the schema - allowUndefined?: boolean // used for keywords that can be invoked by other keywords, not being present in the schema - $data?: boolean // keyword supports [$data reference](../../docs/guide/combining-schemas.md#data-reference) - implements?: string[] // other schema keywords that this keyword implements - before?: string // keyword should be executed before this keyword (should be applicable to the same type) - post?: boolean // keyword should be executed after other keywords without post flag - metaSchema?: AnySchemaObject // meta-schema for keyword schema value - it is better to use schemaType where applicable - validateSchema?: AnyValidateFunction // compiled keyword metaSchema - should not be passed - dependencies?: string[] // keywords that must be present in the same schema - error?: KeywordErrorDefinition - $dataError?: KeywordErrorDefinition -} - -export interface CodeKeywordDefinition extends _KeywordDef { - code: (cxt: KeywordCxt, ruleType?: string) => void - trackErrors?: boolean -} - -export type MacroKeywordFunc = ( - schema: any, - parentSchema: AnySchemaObject, - it: SchemaCxt -) => AnySchema - -export type CompileKeywordFunc = ( - schema: any, - parentSchema: AnySchemaObject, - it: SchemaObjCxt -) => DataValidateFunction - -export interface DataValidateFunction { - (...args: Parameters): boolean | Promise - errors?: Partial[] -} - -export interface SchemaValidateFunction { - (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): - | boolean - | Promise - errors?: Partial[] -} - -export interface FuncKeywordDefinition extends _KeywordDef { - validate?: SchemaValidateFunction | DataValidateFunction - compile?: CompileKeywordFunc - // schema: false makes validate not to expect schema (DataValidateFunction) - schema?: boolean // requires "validate" - modifying?: boolean - async?: boolean - valid?: boolean - errors?: boolean | "full" -} - -export interface MacroKeywordDefinition extends FuncKeywordDefinition { - macro: MacroKeywordFunc -} - -export type KeywordDefinition = - | CodeKeywordDefinition - | FuncKeywordDefinition - | MacroKeywordDefinition - -export type AddedKeywordDefinition = KeywordDefinition & { - type: JSONType[] - schemaType: JSONType[] -} - -export interface KeywordErrorDefinition { - message: string | Code | ((cxt: KeywordErrorCxt) => Code) - params?: Code | ((cxt: KeywordErrorCxt) => Code) -} - -export type Vocabulary = (KeywordDefinition | string)[] - -export interface KeywordErrorCxt { - gen: CodeGen - keyword: string - data: Name - $data?: string | false - schema: any // TODO - parentSchema?: AnySchemaObject - schemaCode: Code | number | boolean - schemaValue: Code | number | boolean - schemaType?: JSONType[] - errsCount?: Name - params: KeywordCxtParams - it: SchemaCxt -} - -export type KeywordCxtParams = {[P in string]?: Code | string | number} - -export type FormatValidator = (data: T) => boolean - -export type FormatCompare = (data1: T, data2: T) => number | undefined - -export type AsyncFormatValidator = (data: T) => Promise - -export interface FormatDefinition { - type?: T extends string ? "string" | undefined : "number" - validate: FormatValidator | (T extends string ? string | RegExp : never) - async?: false | undefined - compare?: FormatCompare -} - -export interface AsyncFormatDefinition { - type?: T extends string ? "string" | undefined : "number" - validate: AsyncFormatValidator - async: true - compare?: FormatCompare -} - -export type AddedFormat = - | true - | RegExp - | FormatValidator - | FormatDefinition - | FormatDefinition - | AsyncFormatDefinition - | AsyncFormatDefinition - -export type Format = AddedFormat | string diff --git a/node_modules/table/node_modules/ajv/lib/types/json-schema.ts b/node_modules/table/node_modules/ajv/lib/types/json-schema.ts deleted file mode 100644 index f9b22672e..000000000 --- a/node_modules/table/node_modules/ajv/lib/types/json-schema.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable @typescript-eslint/no-empty-interface */ -export type SomeJSONSchema = JSONSchemaType - -export type PartialSchema = Partial> - -type JSONType = _partial extends true - ? T | undefined - : T - -export type JSONSchemaType = (T extends number - ? { - type: JSONType<"number" | "integer", _partial> - minimum?: number - maximum?: number - exclusiveMinimum?: number - exclusiveMaximum?: number - multipleOf?: number - format?: string - } - : T extends string - ? { - type: JSONType<"string", _partial> - minLength?: number - maxLength?: number - pattern?: string - format?: string - } - : T extends boolean - ? { - type: "boolean" - } - : T extends [any, ...any[]] - ? { - // JSON AnySchema for tuple - type: JSONType<"array", _partial> - items: { - readonly [K in keyof T]-?: JSONSchemaType & Nullable - } & {length: T["length"]} - minItems: T["length"] - } & ({maxItems: T["length"]} | {additionalItems: false}) - : T extends readonly any[] - ? { - type: JSONType<"array", _partial> - items: JSONSchemaType - contains?: PartialSchema - minItems?: number - maxItems?: number - minContains?: number - maxContains?: number - uniqueItems?: true - additionalItems?: never - } - : T extends Record - ? { - // JSON AnySchema for records and dictionaries - // "required" is not optional because it is often forgotten - // "properties" are optional for more concise dictionary schemas - // "patternProperties" and can be only used with interfaces that have string index - type: JSONType<"object", _partial> - // "required" type does not guarantee that all required properties are listed - // it only asserts that optional cannot be listed - required: _partial extends true ? Readonly<(keyof T)[]> : Readonly[]> - additionalProperties?: boolean | JSONSchemaType - unevaluatedProperties?: boolean | JSONSchemaType - properties?: _partial extends true ? Partial> : PropertiesSchema - patternProperties?: {[Pattern in string]?: JSONSchemaType} - propertyNames?: JSONSchemaType - dependencies?: {[K in keyof T]?: Readonly<(keyof T)[]> | PartialSchema} - dependentRequired?: {[K in keyof T]?: Readonly<(keyof T)[]>} - dependentSchemas?: {[K in keyof T]?: PartialSchema} - minProperties?: number - maxProperties?: number - } - : T extends null - ? { - nullable: true - } - : never) & { - [keyword: string]: any - $id?: string - $ref?: string - $defs?: { - [Key in string]?: JSONSchemaType - } - definitions?: { - [Key in string]?: JSONSchemaType - } - allOf?: Readonly[]> - anyOf?: Readonly[]> - oneOf?: Readonly[]> - if?: PartialSchema - then?: PartialSchema - else?: PartialSchema - not?: PartialSchema -} - -type Known = KnownRecord | [Known, ...Known[]] | Known[] | number | string | boolean | null - -interface KnownRecord extends Record {} - -export type PropertiesSchema = { - [K in keyof T]-?: (JSONSchemaType & Nullable) | {$ref: string} -} - -export type RequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K -}[keyof T] - -type Nullable = undefined extends T - ? { - nullable: true - const?: never // any non-null value would fail `const: null`, `null` would fail any other value in const - enum?: Readonly<(T | null)[]> // `null` must be explicitly included in "enum" for `null` to pass - default?: T | null - } - : { - const?: T - enum?: Readonly - default?: T - } diff --git a/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts b/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts deleted file mode 100644 index 82cca9eaf..000000000 --- a/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts +++ /dev/null @@ -1,228 +0,0 @@ -/** required keys of an object, not undefined */ -type RequiredKeys = { - [K in keyof T]-?: undefined extends T[K] ? never : K -}[keyof T] - -/** optional or undifined-able keys of an object */ -type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] ? K : never -}[keyof T] - -/** type is true if T is a union type */ -type IsUnion_ = false extends ( - T extends unknown ? ([U] extends [T] ? false : true) : never -) - ? false - : true -type IsUnion = IsUnion_ - -/** type is true if T is identically E */ -type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false - -/** type is true if T or null is identically E or null*/ -type NullTypeEquality = TypeEquality - -/** gets only the string literals of a type or null if a type isn't a string literal */ -type EnumString = [T] extends [never] - ? null - : T extends string - ? string extends T - ? null - : T - : null - -/** true if type is a union of string literals */ -type IsEnum = null extends EnumString> ? false : true - -/** true only if all types are array types (not tuples) */ -// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays -// have an index at every number -type IsElements = false extends IsUnion - ? [T] extends [readonly unknown[]] - ? undefined extends T[0.5] - ? false - : true - : false - : false - -/** true if the the type is a values type */ -type IsValues = false extends IsUnion> - ? TypeEquality, string> - : false - -/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */ -type IsRecord = Union extends IsUnion> - ? null extends EnumString> - ? false - : true - : false - -/** numeric strings */ -type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" - -/** string strings */ -type StringType = "string" | "timestamp" - -/** actual schema */ -export type JTDSchemaType = Record> = ( - | // refs - where null wasn't specified, must match exactly - (null extends EnumString - ? never - : - | ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false}) - // nulled refs - if ref is nullable and nullable is specified, then it can - // match either null or non-null definitions - | (null extends T - ? { - [K in keyof D]: [Exclude] extends [Exclude] - ? {ref: K} - : never - }[keyof D] & {nullable: true} - : never)) - // empty - empty schemas also treat nullable differently in that it's now fully ignored - | (unknown extends T ? {nullable?: boolean} : never) - // all other types - | ((// numbers - only accepts the type number - true extends NullTypeEquality - ? {type: NumberType} - : // booleans - accepts the type boolean - true extends NullTypeEquality - ? {type: "boolean"} - : // strings - only accepts the type string - true extends NullTypeEquality - ? {type: StringType} - : // strings - only accepts the type Date - true extends NullTypeEquality - ? {type: "timestamp"} - : // enums - only accepts union of string literals - // TODO we can't actually check that everything in the union was specified - true extends IsEnum - ? {enum: EnumString>[]} - : // arrays - only accepts arrays, could be array of unions to be resolved later - true extends IsElements> - ? T extends readonly (infer E)[] - ? { - elements: JTDSchemaType - } - : never - : // values - true extends IsValues - ? T extends Record - ? { - values: JTDSchemaType - } - : never - : // properties - true extends IsRecord - ? ([RequiredKeys>] extends [never] - ? { - properties?: Record - } - : { - properties: {[K in RequiredKeys]: JTDSchemaType} - }) & - ([OptionalKeys>] extends [never] - ? { - optionalProperties?: Record - } - : { - optionalProperties: { - [K in OptionalKeys]: JTDSchemaType, D> - } - }) & { - additionalProperties?: boolean - } - : // discriminator - true extends IsRecord - ? { - [K in keyof Exclude]-?: Exclude[K] extends string - ? { - discriminator: K - mapping: { - // TODO currently allows descriminator to be present in schema - [M in Exclude[K]]: JTDSchemaType< - Omit, - D - > - } - } - : never - }[keyof Exclude] - : never) & - (null extends T - ? { - nullable: true - } - : {nullable?: false})) -) & { - // extra properties - metadata?: Record - // TODO these should only be allowed at the top level - definitions?: {[K in keyof D]: JTDSchemaType} -} - -type JTDDataDef> = - | (// ref - S extends {ref: string} - ? JTDDataDef - : // type - S extends {type: NumberType} - ? number - : S extends {type: "string"} - ? string - : S extends {type: "timestamp"} - ? string | Date - : // enum - S extends {enum: readonly (infer E)[]} - ? string extends E - ? never - : [E] extends [string] - ? E - : never - : // elements - S extends {elements: infer E} - ? JTDDataDef[] - : // properties - S extends { - properties: Record - optionalProperties?: Record - additionalProperties?: boolean - } - ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & - { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< - S["optionalProperties"][K], - D - > - } & - ([S["additionalProperties"]] extends [true] ? Record : unknown) - : S extends { - properties?: Record - optionalProperties: Record - additionalProperties?: boolean - } - ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & - { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< - S["optionalProperties"][K], - D - > - } & - ([S["additionalProperties"]] extends [true] ? Record : unknown) - : // values - S extends {values: infer V} - ? Record> - : // discriminator - S extends {discriminator: infer M; mapping: Record} - ? [M] extends [string] - ? { - [K in keyof S["mapping"]]: JTDDataDef & {[KM in M]: K} - }[keyof S["mapping"]] - : never - : // empty - unknown) - | (S extends {nullable: true} ? null : never) - -export type JTDDataType = S extends {definitions: Record} - ? JTDDataDef - : JTDDataDef> diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts deleted file mode 100644 index 84ef16157..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, not, Name} from "../../compile/codegen" -import {Type} from "../../compile/subschema" -import {alwaysValidSchema} from "../../compile/util" -import {checkStrictMode} from "../../compile/validate" - -export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`should NOT have more than ${len} items`, - params: ({params: {len}}) => _`{limit: ${len}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "additionalItems" as const, - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error, - code(cxt: KeywordCxt) { - const {gen, schema, parentSchema, data, it} = cxt - const {items} = parentSchema - if (!Array.isArray(items)) { - checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas') - return - } - it.items = true - const len = gen.const("len", _`${data}.length`) - if (schema === false) { - cxt.setParams({len: items.length}) - cxt.pass(_`${len} <= ${items.length}`) - } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { - const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var - gen.if(not(valid), () => validateItems(valid)) - cxt.ok(valid) - } - - function validateItems(valid: Name): void { - gen.forRange("i", items.length, len, (i) => { - cxt.subschema({keyword: "additionalItems", dataProp: i, dataPropType: Type.Num}, valid) - if (!it.allErrors) gen.if(not(valid), () => gen.break()) - }) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts deleted file mode 100644 index b8bdb76a4..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { - CodeKeywordDefinition, - AddedKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import {allSchemaProperties, usePattern, isOwnProperty} from "../code" -import {_, nil, or, not, Code, Name} from "../../compile/codegen" -import N from "../../compile/names" -import {SubschemaArgs, Type} from "../../compile/subschema" -import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util" - -export type AdditionalPropertiesError = ErrorObject< - "additionalProperties", - {additionalProperty: string}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: "should NOT have additional properties", - params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, -} - -const def: CodeKeywordDefinition & AddedKeywordDefinition = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: true, - trackErrors: true, - error, - code(cxt) { - const {gen, schema, parentSchema, data, errsCount, it} = cxt - /* istanbul ignore if */ - if (!errsCount) throw new Error("ajv implementation error") - const {allErrors, opts} = it - it.props = true - if (opts.removeAdditional !== "all" && alwaysValidSchema(it, schema)) return - const props = allSchemaProperties(parentSchema.properties) - const patProps = allSchemaProperties(parentSchema.patternProperties) - checkAdditionalProperties() - cxt.ok(_`${errsCount} === ${N.errors}`) - - function checkAdditionalProperties(): void { - gen.forIn("key", data, (key: Name) => { - if (!props.length && !patProps.length) additionalPropertyCode(key) - else gen.if(isAdditional(key), () => additionalPropertyCode(key)) - }) - } - - function isAdditional(key: Name): Code { - let definedProp: Code - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = schemaRefOrVal(it, parentSchema.properties, "properties") - definedProp = isOwnProperty(gen, propsSchema as Code, key) - } else if (props.length) { - definedProp = or(...props.map((p) => _`${key} === ${p}`)) - } else { - definedProp = nil - } - if (patProps.length) { - definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(gen, p)}.test(${key})`)) - } - return not(definedProp) - } - - function deleteAdditional(key: Name): void { - gen.code(_`delete ${data}[${key}]`) - } - - function additionalPropertyCode(key: Name): void { - if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { - deleteAdditional(key) - return - } - - if (schema === false) { - cxt.setParams({additionalProperty: key}) - cxt.error() - if (!allErrors) gen.break() - return - } - - if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { - const valid = gen.name("valid") - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false) - gen.if(not(valid), () => { - cxt.reset() - deleteAdditional(key) - }) - } else { - applyAdditionalSchema(key, valid) - if (!allErrors) gen.if(not(valid), () => gen.break()) - } - } - } - - function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void { - const subschema: SubschemaArgs = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: Type.Str, - } - if (errors === false) { - Object.assign(subschema, { - compositeRule: true, - createErrors: false, - allErrors: false, - }) - } - cxt.subschema(subschema, valid) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/allOf.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/allOf.ts deleted file mode 100644 index ce8c0780b..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema} from "../../types" -import type KeywordCxt from "../../compile/context" -import {alwaysValidSchema} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "allOf", - schemaType: "array", - code(cxt: KeywordCxt) { - const {gen, schema, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const valid = gen.name("valid") - schema.forEach((sch: AnySchema, i: number) => { - if (alwaysValidSchema(it, sch)) return - const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid) - cxt.ok(valid) - cxt.mergeEvaluated(schCxt) - }) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts deleted file mode 100644 index 87153c613..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" -import {validateUnion} from "../code" - -export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]> - -const def: CodeKeywordDefinition = { - keyword: "anyOf", - schemaType: "array", - trackErrors: true, - code: validateUnion, - error: { - message: "should match some schema in anyOf", - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/contains.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/contains.ts deleted file mode 100644 index f4b2f380c..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/contains.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, Name} from "../../compile/codegen" -import {Type} from "../../compile/subschema" -import {alwaysValidSchema} from "../../compile/util" -import {checkStrictMode} from "../../compile/validate" - -export type ContainsError = ErrorObject< - "contains", - {minContains: number; maxContains?: number}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: ({params: {min, max}}) => - max === undefined - ? str`should contain at least ${min} valid item(s)` - : str`should contain at least ${min} and no more than ${max} valid item(s)`, - params: ({params: {min, max}}) => - max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: true, - error, - code(cxt: KeywordCxt) { - const {gen, schema, parentSchema, data, it} = cxt - let min: number - let max: number | undefined - const {minContains, maxContains} = parentSchema - if (it.opts.next) { - min = minContains === undefined ? 1 : minContains - max = maxContains - } else { - min = 1 - } - const len = gen.const("len", _`${data}.length`) - cxt.setParams({min, max}) - if (max === undefined && min === 0) { - checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`) - return - } - if (max !== undefined && min > max) { - checkStrictMode(it, `"minContains" > "maxContains" is always invalid`) - cxt.fail() - return - } - if (alwaysValidSchema(it, schema)) { - let cond = _`${len} >= ${min}` - if (max !== undefined) cond = _`${cond} && ${len} <= ${max}` - cxt.pass(cond) - return - } - - it.items = true - const valid = gen.name("valid") - if (max === undefined && min === 1) { - validateItems(valid, () => gen.if(valid, () => gen.break())) - } else { - gen.let(valid, false) - const schValid = gen.name("_valid") - const count = gen.let("count", 0) - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) - } - cxt.result(valid, () => cxt.reset()) - - function validateItems(_valid: Name, block: () => void): void { - gen.forRange("i", 0, len, (i) => { - cxt.subschema( - { - keyword: "contains", - dataProp: i, - dataPropType: Type.Num, - compositeRule: true, - }, - _valid - ) - block() - }) - } - - function checkLimits(count: Name): void { - gen.code(_`${count}++`) - if (max === undefined) { - gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break()) - } else { - gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break()) - if (min === 1) gen.assign(valid, true) - else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true)) - } - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts deleted file mode 100644 index 6d6436edd..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +++ /dev/null @@ -1,112 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - SchemaMap, - AnySchema, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from "../code" - -export type PropertyDependencies = {[K in string]?: string[]} - -export interface DependenciesErrorParams { - property: string - missingProperty: string - depsCount: number - deps: string // TODO change to string[] -} - -type SchemaDependencies = SchemaMap - -export type DependenciesError = ErrorObject< - "dependencies", - DependenciesErrorParams, - {[K in string]?: string[] | AnySchema} -> - -export const error: KeywordErrorDefinition = { - message: ({params: {property, depsCount, deps}}) => { - const property_ies = depsCount === 1 ? "property" : "properties" - return str`should have ${property_ies} ${deps} when property ${property} is present` - }, - params: ({params: {property, depsCount, deps, missingProperty}}) => - _`{property: ${property}, - missingProperty: ${missingProperty}, - depsCount: ${depsCount}, - deps: ${deps}}`, // TODO change to reference -} - -const def: CodeKeywordDefinition = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error, - code(cxt: KeywordCxt) { - const [propDeps, schDeps] = splitDependencies(cxt) - validatePropertyDeps(cxt, propDeps) - validateSchemaDeps(cxt, schDeps) - }, -} - -function splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] { - const propertyDeps: PropertyDependencies = {} - const schemaDeps: SchemaDependencies = {} - for (const key in schema) { - if (key === "__proto__") continue - const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps - deps[key] = schema[key] - } - return [propertyDeps, schemaDeps] -} - -export function validatePropertyDeps( - cxt: KeywordCxt, - propertyDeps: {[K in string]?: string[]} = cxt.schema -): void { - const {gen, data, it} = cxt - if (Object.keys(propertyDeps).length === 0) return - const missing = gen.let("missing") - for (const prop in propertyDeps) { - const deps = propertyDeps[prop] as string[] - if (deps.length === 0) continue - const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties) - cxt.setParams({ - property: prop, - depsCount: deps.length, - deps: deps.join(", "), - }) - if (it.allErrors) { - gen.if(hasProperty, () => { - for (const depProp of deps) { - checkReportMissingProp(cxt, depProp) - } - }) - } else { - gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`) - reportMissingProp(cxt, missing) - gen.else() - } - } -} - -export function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void { - const {gen, data, keyword, it} = cxt - const valid = gen.name("valid") - for (const prop in schemaDeps) { - if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue - gen.if( - propertyInData(gen, data, prop, it.opts.ownProperties), - () => { - const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid) - cxt.mergeValidEvaluated(schCxt, valid) - }, - () => gen.var(valid, true) // TODO var - ) - cxt.ok(valid) - } -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts deleted file mode 100644 index dbd3ae45c..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateSchemaDeps} from "./dependencies" - -const def: CodeKeywordDefinition = { - keyword: "dependentSchemas", - type: "object", - schemaType: "object", - code: (cxt) => validateSchemaDeps(cxt), -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/if.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/if.ts deleted file mode 100644 index 02e9a4b2c..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/if.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {SchemaObjCxt} from "../../compile" -import type KeywordCxt from "../../compile/context" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {checkStrictMode} from "../../compile/validate" - -export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params}) => str`should match "${params.ifClause}" schema`, - params: ({params}) => _`{failingKeyword: ${params.ifClause}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: true, - error, - code(cxt: KeywordCxt) { - const {gen, parentSchema, it} = cxt - if (parentSchema.then === undefined && parentSchema.else === undefined) { - checkStrictMode(it, '"if" without "then" and "else" is ignored') - } - const hasThen = hasSchema(it, "then") - const hasElse = hasSchema(it, "else") - if (!hasThen && !hasElse) return - - const valid = gen.let("valid", true) - const schValid = gen.name("_valid") - validateIf() - cxt.reset() - - if (hasThen && hasElse) { - const ifClause = gen.let("ifClause") - cxt.setParams({ifClause}) - gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)) - } else if (hasThen) { - gen.if(schValid, validateClause("then")) - } else { - gen.if(not(schValid), validateClause("else")) - } - - cxt.pass(valid, () => cxt.error(true)) - - function validateIf(): void { - const schCxt = cxt.subschema( - { - keyword: "if", - compositeRule: true, - createErrors: false, - allErrors: false, - }, - schValid - ) - cxt.mergeEvaluated(schCxt) - } - - function validateClause(keyword: string, ifClause?: Name): () => void { - return () => { - const schCxt = cxt.subschema({keyword}, schValid) - gen.assign(valid, schValid) - cxt.mergeValidEvaluated(schCxt, valid) - if (ifClause) gen.assign(ifClause, _`${keyword}`) - else cxt.setParams({ifClause: keyword}) - } - } - }, -} - -function hasSchema(it: SchemaObjCxt, keyword: string): boolean { - const schema = it.schema[keyword] - return schema !== undefined && !alwaysValidSchema(it, schema) -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/index.ts deleted file mode 100644 index 1ccd6db04..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type {ErrorNoParams, Vocabulary} from "../../types" -import additionalItems, {AdditionalItemsError} from "./additionalItems" -import items from "./items" -import contains, {ContainsError} from "./contains" -import dependencies, {DependenciesError} from "./dependencies" -import propertyNames, {PropertyNamesError} from "./propertyNames" -import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties" -import properties from "./properties" -import patternProperties from "./patternProperties" -import notKeyword, {NotKeywordError} from "./not" -import anyOf, {AnyOfError} from "./anyOf" -import oneOf, {OneOfError} from "./oneOf" -import allOf from "./allOf" -import ifKeyword, {IfKeywordError} from "./if" -import thenElse from "./thenElse" - -const applicator: Vocabulary = [ - // any - notKeyword, - anyOf, - oneOf, - allOf, - ifKeyword, - thenElse, - // array - additionalItems, - items, - contains, - // object - propertyNames, - additionalProperties, - dependencies, - properties, - patternProperties, -] - -export default applicator - -export type ApplicatorKeywordError = - | ErrorNoParams<"false schema"> - | AdditionalItemsError - | ContainsError - | AdditionalPropertiesError - | DependenciesError - | IfKeywordError - | AnyOfError - | OneOfError - | NotKeywordError - | PropertyNamesError diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items.ts deleted file mode 100644 index 9b46b46b5..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_} from "../../compile/codegen" -import {alwaysValidSchema, mergeEvaluated} from "../../compile/util" -import {checkStrictMode} from "../../compile/validate" -import {validateArray} from "../code" - -const def: CodeKeywordDefinition = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt: KeywordCxt) { - const {gen, schema, it} = cxt - if (Array.isArray(schema)) { - if (it.opts.unevaluated && schema.length && it.items !== true) { - it.items = mergeEvaluated.items(gen, schema.length, it.items) - } - validateTuple(schema) - } else { - it.items = true - if (alwaysValidSchema(it, schema)) return - cxt.ok(validateArray(cxt)) - } - - function validateTuple(schArr: AnySchema[]): void { - const {parentSchema, data} = cxt - if (it.opts.strictTuples && !fullTupleSchema(schArr.length, parentSchema)) { - const msg = `"items" is ${schArr.length}-tuple, but minItems or maxItems/additionalItems are not specified or different` - checkStrictMode(it, msg, it.opts.strictTuples) - } - const valid = gen.name("valid") - const len = gen.const("len", _`${data}.length`) - schArr.forEach((sch: AnySchema, i: number) => { - if (alwaysValidSchema(it, sch)) return - gen.if(_`${len} > ${i}`, () => - cxt.subschema( - { - keyword: "items", - schemaProp: i, - dataProp: i, - }, - valid - ) - ) - cxt.ok(valid) - }) - } - }, -} - -function fullTupleSchema(len: number, sch: any): boolean { - return len === sch.minItems && (len === sch.maxItems || sch.additionalItems === false) -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/not.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/not.ts deleted file mode 100644 index 3cec06e4f..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/not.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" -import type KeywordCxt from "../../compile/context" -import {alwaysValidSchema} from "../../compile/util" - -export type NotKeywordError = ErrorNoParams<"not", AnySchema> - -const def: CodeKeywordDefinition = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: true, - code(cxt: KeywordCxt) { - const {gen, schema, it} = cxt - if (alwaysValidSchema(it, schema)) { - cxt.fail() - return - } - - const valid = gen.name("valid") - cxt.subschema( - { - keyword: "not", - compositeRule: true, - createErrors: false, - allErrors: false, - }, - valid - ) - - cxt.result( - valid, - () => cxt.error(), - () => cxt.reset() - ) - }, - error: { - message: "should NOT be valid", - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts deleted file mode 100644 index 268c2376e..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, Name} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {SchemaCxt} from "../../compile" - -export type OneOfError = ErrorObject< - "oneOf", - {passingSchemas: [number, number] | null}, - AnySchema[] -> - -const error: KeywordErrorDefinition = { - message: "should match exactly one schema in oneOf", - params: ({params}) => _`{passingSchemas: ${params.passing}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error, - code(cxt: KeywordCxt) { - const {gen, schema, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const schArr: AnySchema[] = schema - const valid = gen.let("valid", false) - const passing = gen.let("passing", null) - const schValid = gen.name("_valid") - cxt.setParams({passing}) - // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas - - gen.block(validateOneOf) - - cxt.result( - valid, - () => cxt.reset(), - () => cxt.error(true) - ) - - function validateOneOf(): void { - schArr.forEach((sch: AnySchema, i: number) => { - let schCxt: SchemaCxt | undefined - if (alwaysValidSchema(it, sch)) { - gen.var(schValid, true) - } else { - schCxt = cxt.subschema( - { - keyword: "oneOf", - schemaProp: i, - compositeRule: true, - }, - schValid - ) - } - - if (i > 0) { - gen - .if(_`${schValid} && ${valid}`) - .assign(valid, false) - .assign(passing, _`[${passing}, ${i}]`) - .else() - } - - gen.if(schValid, () => { - gen.assign(valid, true) - gen.assign(passing, i) - if (schCxt) cxt.mergeEvaluated(schCxt, Name) - }) - }) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts deleted file mode 100644 index 8ee867969..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {schemaProperties, usePattern} from "../code" -import {_, not, Name} from "../../compile/codegen" -import {Type} from "../../compile/subschema" -import {checkStrictMode} from "../../compile/validate" -import {evaluatedPropsToName} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt: KeywordCxt) { - const {gen, schema, data, parentSchema, it} = cxt - const {opts} = it - const patterns = schemaProperties(it, schema) - // TODO mark properties matching patterns with always valid schemas as evaluated - if (patterns.length === 0) return - const checkProperties = opts.strict && !opts.allowMatchingProperties && parentSchema.properties - const valid = gen.name("valid") - if (it.props !== true && !(it.props instanceof Name)) { - it.props = evaluatedPropsToName(gen, it.props) - } - const {props} = it - validatePatternProperties() - - function validatePatternProperties(): void { - for (const pat of patterns) { - if (checkProperties) checkMatchingProperties(pat) - if (it.allErrors) { - validateProperties(pat) - } else { - gen.var(valid, true) // TODO var - validateProperties(pat) - gen.if(valid) - } - } - } - - function checkMatchingProperties(pat: string): void { - for (const prop in checkProperties) { - if (new RegExp(pat).test(prop)) { - checkStrictMode( - it, - `property ${prop} matches pattern ${pat} (use allowMatchingProperties)` - ) - } - } - } - - function validateProperties(pat: string): void { - gen.forIn("key", data, (key) => { - gen.if(_`${usePattern(gen, pat)}.test(${key})`, () => { - cxt.subschema( - { - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: Type.Str, - }, - valid - ) - if (it.opts.unevaluated && props !== true) { - gen.assign(_`${props}[${key}]`, true) - } else if (!it.allErrors) { - // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) - // or if all properties were evaluated (props === true) - gen.if(not(valid), () => gen.break()) - } - }) - }) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/properties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/properties.ts deleted file mode 100644 index 13a345a74..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/properties.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import KeywordCxt from "../../compile/context" -import {propertyInData, allSchemaProperties} from "../code" -import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util" -import apDef from "./additionalProperties" - -const def: CodeKeywordDefinition = { - keyword: "properties", - type: "object", - schemaType: "object", - code(cxt: KeywordCxt) { - const {gen, schema, parentSchema, data, it} = cxt - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { - apDef.code(new KeywordCxt(it, apDef, "additionalProperties")) - } - const allProps = allSchemaProperties(schema) - for (const prop of allProps) { - it.definedProperties.add(prop) - } - if (it.opts.unevaluated && allProps.length && it.props !== true) { - it.props = mergeEvaluated.props(gen, toHash(allProps), it.props) - } - const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p])) - if (properties.length === 0) return - const valid = gen.name("valid") - - for (const prop of properties) { - if (hasDefault(prop)) { - applyPropertySchema(prop) - } else { - gen.if(propertyInData(gen, data, prop, it.opts.ownProperties)) - applyPropertySchema(prop) - if (!it.allErrors) gen.else().var(valid, true) - gen.endIf() - } - cxt.it.definedProperties.add(prop) - cxt.ok(valid) - } - - function hasDefault(prop: string): boolean | undefined { - return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined - } - - function applyPropertySchema(prop: string): void { - cxt.subschema( - { - keyword: "properties", - schemaProp: prop, - dataProp: prop, - }, - valid - ) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts deleted file mode 100644 index 046361635..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, not} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" - -export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params}) => str`property name '${params.propertyName}' is invalid`, // TODO double quotes? - params: ({params}) => _`{propertyName: ${params.propertyName}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error, - code(cxt: KeywordCxt) { - const {gen, schema, data, it} = cxt - if (alwaysValidSchema(it, schema)) return - const valid = gen.name("valid") - - gen.forIn("key", data, (key) => { - cxt.setParams({propertyName: key}) - cxt.subschema( - { - keyword: "propertyNames", - data: key, - dataTypes: ["string"], - propertyName: key, - compositeRule: true, - }, - valid - ) - gen.if(not(valid), () => { - cxt.error(true) - if (!it.allErrors) gen.break() - }) - }) - - cxt.ok(valid) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts deleted file mode 100644 index d975c19ab..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {checkStrictMode} from "../../compile/validate" - -const def: CodeKeywordDefinition = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({keyword, parentSchema, it}: KeywordCxt) { - if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/code.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/code.ts deleted file mode 100644 index 853d4a6d0..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/code.ts +++ /dev/null @@ -1,163 +0,0 @@ -import type {AnySchema, SchemaMap} from "../types" -import type {SchemaCxt} from "../compile" -import type KeywordCxt from "../compile/context" -import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen" -import {alwaysValidSchema} from "../compile/util" -import {Type} from "../compile/subschema" -import N from "../compile/names" - -export function checkReportMissingProp(cxt: KeywordCxt, prop: string): void { - const {gen, data, it} = cxt - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { - cxt.setParams({missingProperty: _`${prop}`}, true) - cxt.error() - }) -} - -export function checkMissingProp( - {gen, data, it: {opts}}: KeywordCxt, - properties: string[], - missing: Name -): Code { - return or( - ...properties.map((prop) => - and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`) - ) - ) -} - -export function reportMissingProp(cxt: KeywordCxt, missing: Name): void { - cxt.setParams({missingProperty: missing}, true) - cxt.error() -} - -export function hasPropFunc(gen: CodeGen): Name { - return gen.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: _`Object.prototype.hasOwnProperty`, - }) -} - -export function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code { - return _`${hasPropFunc(gen)}.call(${data}, ${property})` -} - -export function propertyInData( - gen: CodeGen, - data: Name, - property: Name | string, - ownProperties?: boolean -): Code { - const cond = _`${data}${getProperty(property)} !== undefined` - return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond -} - -export function noPropertyInData( - gen: CodeGen, - data: Name, - property: Name | string, - ownProperties?: boolean -): Code { - const cond = _`${data}${getProperty(property)} === undefined` - return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond -} - -export function allSchemaProperties(schemaMap?: SchemaMap): string[] { - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [] -} - -export function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] { - return allSchemaProperties(schemaMap).filter( - (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema) - ) -} - -export function callValidateCode( - {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt, - func: Code, - context: Code, - passSchema?: boolean -): Code { - const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data - const valCxt: [Name, Code | number][] = [ - [N.dataPath, strConcat(N.dataPath, errorPath)], - [N.parentData, it.parentData], - [N.parentDataProperty, it.parentDataProperty], - [N.rootData, N.rootData], - ] - if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors]) - const args = _`${dataAndSchema}, ${gen.object(...valCxt)}` - return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})` -} - -export function usePattern(gen: CodeGen, pattern: string): Name { - return gen.scopeValue("pattern", { - key: pattern, - ref: new RegExp(pattern, "u"), - code: _`new RegExp(${pattern}, "u")`, - }) -} - -export function validateArray(cxt: KeywordCxt): Name { - const {gen, data, keyword, it} = cxt - const valid = gen.name("valid") - if (it.allErrors) { - const validArr = gen.let("valid", true) - validateItems(() => gen.assign(validArr, false)) - return validArr - } - gen.var(valid, true) - validateItems(() => gen.break()) - return valid - - function validateItems(notValid: () => void): void { - const len = gen.const("len", _`${data}.length`) - gen.forRange("i", 0, len, (i) => { - cxt.subschema( - { - keyword, - dataProp: i, - dataPropType: Type.Num, - }, - valid - ) - gen.if(not(valid), notValid) - }) - } -} - -export function validateUnion(cxt: KeywordCxt): void { - const {gen, schema, keyword, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch)) - if (alwaysValid && !it.opts.unevaluated) return - - const valid = gen.let("valid", false) - const schValid = gen.name("_valid") - - gen.block(() => - schema.forEach((_sch: AnySchema, i: number) => { - const schCxt = cxt.subschema( - { - keyword, - schemaProp: i, - compositeRule: true, - }, - schValid - ) - gen.assign(valid, _`${valid} || ${schValid}`) - const merged = cxt.mergeValidEvaluated(schCxt, schValid) - // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) - // or if all properties and items were evaluated (it.props === true && it.items === true) - if (!merged) gen.if(not(valid)) - }) - ) - - cxt.result( - valid, - () => cxt.reset(), - () => cxt.error(true) - ) -} diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/core/id.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/core/id.ts deleted file mode 100644 index aa36c4bb2..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/core/id.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" - -const def: CodeKeywordDefinition = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID') - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/core/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/core/index.ts deleted file mode 100644 index e63e2895d..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/core/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {Vocabulary} from "../../types" -import idKeyword from "./id" -import refKeyword from "./ref" - -const core: Vocabulary = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - {keyword: "$comment"}, - "definitions", - idKeyword, - refKeyword, -] - -export default core diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/core/ref.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/core/ref.ts deleted file mode 100644 index 077e4491b..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/core/ref.ts +++ /dev/null @@ -1,130 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema} from "../../types" -import type KeywordCxt from "../../compile/context" -import {MissingRefError} from "../../compile/error_classes" -import {callValidateCode} from "../code" -import {_, nil, stringify, Code, Name} from "../../compile/codegen" -import N from "../../compile/names" -import {SchemaEnv, resolveRef} from "../../compile" -import {mergeEvaluated} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "$ref", - schemaType: "string", - code(cxt: KeywordCxt): void { - const {gen, schema, it} = cxt - const {baseId, schemaEnv: env, validateName, opts, self} = it - // TODO See comment in dynamicRef.ts - // This has to be improved to resolve #815. - if (schema === "#" || schema === "#/") return callRootRef() - const schOrEnv = resolveRef.call(self, env.root, baseId, schema) - if (schOrEnv === undefined) throw new MissingRefError(baseId, schema) - if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv) - return inlineRefSchema(schOrEnv) - - function callRootRef(): void { - if (env === env.root) return callRef(cxt, validateName, env, env.$async) - const rootName = gen.scopeValue("root", {ref: env.root}) - return callRef(cxt, _`${rootName}.validate`, env.root, env.root.$async) - } - - function callValidate(sch: SchemaEnv): void { - const v = getValidate(cxt, sch) - callRef(cxt, v, sch, sch.$async) - } - - function inlineRefSchema(sch: AnySchema): void { - const schName = gen.scopeValue( - "schema", - opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch} - ) - const valid = gen.name("valid") - const schCxt = cxt.subschema( - { - schema: sch, - dataTypes: [], - schemaPath: nil, - topSchemaRef: schName, - errSchemaPath: schema, - }, - valid - ) - cxt.mergeEvaluated(schCxt) - cxt.ok(valid) - } - }, -} - -export function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code { - const {gen} = cxt - return sch.validate - ? gen.scopeValue("validate", {ref: sch.validate}) - : _`${gen.scopeValue("wrapper", {ref: sch})}.validate` -} - -export function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void { - const {gen, it} = cxt - const {allErrors, schemaEnv: env, opts} = it - const passCxt = opts.passContext ? N.this : nil - if ($async) callAsyncRef() - else callSyncRef() - - function callAsyncRef(): void { - if (!env.$async) throw new Error("async schema referenced by sync schema") - const valid = gen.let("valid") - gen.try( - () => { - gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`) - addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result - if (!allErrors) gen.assign(valid, true) - }, - (e) => { - gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e)) - addErrorsFrom(e) - if (!allErrors) gen.assign(valid, false) - } - ) - cxt.ok(valid) - } - - function callSyncRef(): void { - cxt.result( - callValidateCode(cxt, v, passCxt), - () => addEvaluatedFrom(v), - () => addErrorsFrom(v) - ) - } - - function addErrorsFrom(source: Code): void { - const errs = _`${source}.errors` - gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged - gen.assign(N.errors, _`${N.vErrors}.length`) - } - - function addEvaluatedFrom(source: Code): void { - if (!it.opts.unevaluated) return - const schEvaluated = sch?.validate?.evaluated - // TODO refactor - if (it.props !== true) { - if (schEvaluated && !schEvaluated.dynamicProps) { - if (schEvaluated.props !== undefined) { - it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props) - } - } else { - const props = gen.var("props", _`${source}.evaluated.props`) - it.props = mergeEvaluated.props(gen, props, it.props, Name) - } - } - if (it.items !== true) { - if (schEvaluated && !schEvaluated.dynamicItems) { - if (schEvaluated.items !== undefined) { - it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items) - } - } else { - const items = gen.var("items", _`${source}.evaluated.items`) - it.items = mergeEvaluated.items(gen, items, it.items, Name) - } - } - } -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/draft7.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/draft7.ts deleted file mode 100644 index 9590f8b05..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/draft7.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type {Vocabulary} from "../types" -import coreVocabulary from "./core" -import validationVocabulary from "./validation" -import applicatorVocabulary from "./applicator" -import formatVocabulary from "./format" -import {metadataVocabulary, contentVocabulary} from "./metadata" - -const draft7Vocabularies: Vocabulary[] = [ - coreVocabulary, - validationVocabulary, - applicatorVocabulary, - formatVocabulary, - metadataVocabulary, - contentVocabulary, -] - -export default draft7Vocabularies diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts deleted file mode 100644 index 1f73623ce..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, getProperty, Code} from "../../compile/codegen" -import N from "../../compile/names" -import {SchemaEnv, compileSchema} from "../../compile" -import {getValidate} from "../core/ref" - -const def: CodeKeywordDefinition = { - keyword: "$dynamicAnchor", - schemaType: "string", - code: (cxt) => dynamicAnchor(cxt, cxt.schema), -} - -export function dynamicAnchor(cxt: KeywordCxt, anchor: string): void { - const {gen, it} = cxt - it.schemaEnv.root.dynamicAnchors[anchor] = true - const v = _`${N.dynamicAnchors}${getProperty(anchor)}` - const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt) - gen.if(_`!${v}`, () => gen.assign(v, validate)) -} - -function _getValidate(cxt: KeywordCxt): Code { - const {schemaEnv, schema, self} = cxt.it - const {root, baseId, localRefs, meta} = schemaEnv.root - const sch = new SchemaEnv({schema, root, baseId, localRefs, meta}) - compileSchema.call(self, sch) - return getValidate(cxt, sch) -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts deleted file mode 100644 index c641a9c79..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, getProperty, Code, Name} from "../../compile/codegen" -import N from "../../compile/names" -import {callRef} from "../core/ref" - -const def: CodeKeywordDefinition = { - keyword: "$dynamicRef", - schemaType: "string", - code: (cxt) => dynamicRef(cxt, cxt.schema), -} - -export function dynamicRef(cxt: KeywordCxt, ref: string): void { - const {gen, keyword, it} = cxt - if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`) - const anchor = ref.slice(1) - if (it.allErrors) { - _dynamicRef() - } else { - const valid = gen.let("valid", false) - _dynamicRef(valid) - cxt.ok(valid) - } - - function _dynamicRef(valid?: Name): void { - // TODO the assumption here is that `recursiveRef: #` always points to the root - // of the schema object, which is not correct, because there may be $id that - // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. - // Because of that 2 tests in recursiveRef.json fail. - // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). - // (This problem is not tested in JSON-Schema-Test-Suite) - if (it.schemaEnv.root.dynamicAnchors[anchor]) { - const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`) - gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)) - } else { - _callRef(it.validateName, valid)() - } - } - - function _callRef(validate: Code, valid?: Name): () => void { - return valid - ? () => - gen.block(() => { - callRef(cxt, validate) - gen.let(valid, true) - }) - : () => callRef(cxt, validate) - } -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/index.ts deleted file mode 100644 index 6d521db66..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type {Vocabulary} from "../../types" -import dynamicAnchor from "./dynamicAnchor" -import dynamicRef from "./dynamicRef" -import recursiveAnchor from "./recursiveAnchor" -import recursiveRef from "./recursiveRef" - -const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef] - -export default dynamic diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts deleted file mode 100644 index ba606691e..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {dynamicAnchor} from "./dynamicAnchor" -import {checkStrictMode} from "../../compile/validate" - -const def: CodeKeywordDefinition = { - keyword: "$recursiveAnchor", - schemaType: "boolean", - code(cxt) { - if (cxt.schema) dynamicAnchor(cxt, "") - else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored") - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts deleted file mode 100644 index c84af0f05..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {dynamicRef} from "./dynamicRef" - -const def: CodeKeywordDefinition = { - keyword: "$recursiveRef", - schemaType: "string", - code: (cxt) => dynamicRef(cxt, cxt.schema), -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/errors.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/errors.ts deleted file mode 100644 index f40aeec7f..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/errors.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {TypeError} from "../compile/validate/dataType" -import type {ApplicatorKeywordError} from "./applicator" -import type {ValidationKeywordError} from "./validation" -import type {FormatError} from "./format/format" -import type {UnevaluatedPropertiesError} from "./unevaluated/unevaluatedProperties" -import type {UnevaluatedItemsError} from "./unevaluated/unevaluatedItems" -import type {DependentRequiredError} from "./validation/dependentRequired" - -export type DefinedError = - | TypeError - | ApplicatorKeywordError - | ValidationKeywordError - | FormatError - | UnevaluatedPropertiesError - | UnevaluatedItemsError - | DependentRequiredError diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/format/format.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/format/format.ts deleted file mode 100644 index e87a0681a..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/format/format.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { - AddedFormat, - FormatValidator, - AsyncFormatValidator, - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, nil, or, Code, getProperty} from "../../compile/codegen" - -type FormatValidate = - | FormatValidator - | FormatValidator - | AsyncFormatValidator - | AsyncFormatValidator - | RegExp - | string - | true - -export type FormatError = ErrorObject<"format", {format: string}, string | {$data: string}> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`should match format "${schemaCode}"`, - params: ({schemaCode}) => _`{format: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: true, - error, - code(cxt: KeywordCxt, ruleType?: string) { - const {gen, data, $data, schema, schemaCode, it} = cxt - const {opts, errSchemaPath, schemaEnv, self} = it - if (!opts.validateFormats) return - - if ($data) validate$DataFormat() - else validateFormat() - - function validate$DataFormat(): void { - const fmts = gen.scopeValue("formats", { - ref: self.formats, - code: opts.code.formats, - }) - const fDef = gen.const("fDef", _`${fmts}[${schemaCode}]`) - const fType = gen.let("fType") - const format = gen.let("format") - // TODO simplify - gen.if( - _`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, - () => gen.assign(fType, _`${fDef}.type || "string"`).assign(format, _`${fDef}.validate`), - () => gen.assign(fType, _`"string"`).assign(format, fDef) - ) - cxt.fail$data(or(unknownFmt(), invalidFmt())) - - function unknownFmt(): Code { - if (opts.strict === false) return nil - return _`${schemaCode} && !${format}` - } - - function invalidFmt(): Code { - const callFormat = schemaEnv.$async - ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` - : _`${format}(${data})` - const validData = _`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))` - return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}` - } - } - - function validateFormat(): void { - const formatDef: AddedFormat | undefined = self.formats[schema] - if (!formatDef) { - unknownFormat() - return - } - if (formatDef === true) return - const [fmtType, format, fmtRef] = getFormat(formatDef) - if (fmtType === ruleType) cxt.pass(validCondition()) - - function unknownFormat(): void { - if (opts.strict === false) { - self.logger.warn(unknownMsg()) - return - } - throw new Error(unknownMsg()) - - function unknownMsg(): string { - return `unknown format "${schema as string}" ignored in schema at path "${errSchemaPath}"` - } - } - - function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] { - const fmt = gen.scopeValue("formats", { - key: schema, - ref: fmtDef, - code: opts.code.formats ? _`${opts.code.formats}${getProperty(schema)}` : undefined, - }) - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, _`${fmt}.validate`] - } - - return ["string", fmtDef, fmt] - } - - function validCondition(): Code { - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { - if (!schemaEnv.$async) throw new Error("async format in sync schema") - return _`await ${fmtRef}(${data})` - } - return typeof format == "function" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})` - } - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/format/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/format/index.ts deleted file mode 100644 index bca2f5b3d..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/format/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type {Vocabulary} from "../../types" -import formatKeyword from "./format" - -const format: Vocabulary = [formatKeyword] - -export default format diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts deleted file mode 100644 index de086b89b..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, getProperty, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" - -const def: CodeKeywordDefinition = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, parentSchema} = cxt - const [valid, cond] = checkNullableObject(cxt, data) - - gen.if(cond, () => { - const tag = gen.const("tag", _`${data}${getProperty(schema)}`) - gen.if(_`typeof ${tag} == "string"`, () => { - gen.if(false) - for (const tagValue in parentSchema.mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - gen.assign(valid, applyTagSchema(tagValue)) - } - gen.endIf() - }) - }) - cxt.pass(valid) - - function applyTagSchema(schemaProp: string): Name { - const _valid = gen.name("valid") - cxt.subschema( - { - keyword: "mapping", - schemaProp, - jtdDiscriminator: schema, - }, - _valid - ) - return _valid - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/elements.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/elements.ts deleted file mode 100644 index d67f2cd6e..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/elements.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {alwaysValidSchema} from "../../compile/util" -import {validateArray} from "../code" -import {_, and, nil} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullable} from "./nullable" - -const def: CodeKeywordDefinition = { - keyword: "elements", - schemaType: "object", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, it} = cxt - if (alwaysValidSchema(it, schema)) return - const [valid, cond] = checkNullable(cxt, nil) - gen.if(and(cond, _`Array.isArray(${data})`), () => gen.assign(valid, validateArray(cxt))) - cxt.pass(valid) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/enum.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/enum.ts deleted file mode 100644 index dd582a140..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/enum.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, or, not, Code} from "../../compile/codegen" -import {checkMetadata} from "./metadata" - -const def: CodeKeywordDefinition = { - keyword: "enum", - schemaType: "array", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, schemaValue, parentSchema, it} = cxt - if (schema.length === 0) throw new Error("enum must have non-empty array") - if (schema.length !== new Set(schema).size) throw new Error("enum items must be unique") - let valid: Code - if (schema.length >= it.opts.loopEnum) { - if (parentSchema.nullable) { - valid = gen.let("valid", _`${data} === null`) - gen.if(not(valid), loopEnum) - } else { - valid = gen.let("valid", false) - loopEnum() - } - } else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - valid = or(...schema.map((value: string) => _`${data} === ${value}`)) - if (parentSchema.nullable) valid = or(_`${data} === null`, valid) - } - cxt.pass(valid) - - function loopEnum(): void { - gen.forOf("v", schemaValue as Code, (v) => - gen.if(_`${valid} = ${data} === ${v}`, () => gen.break()) - ) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/index.ts deleted file mode 100644 index 2a241f61b..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type {Vocabulary} from "../../types" -// import definitions from "./definitions" -import refKeyword from "./ref" -import typeKeyword from "./type" -import enumKeyword from "./enum" -import elements from "./elements" -import properties from "./properties" -import optionalProperties from "./optionalProperties" -import discriminator from "./discriminator" -import values from "./values" -import union from "./union" -import metadata from "./metadata" - -const jtdVocabulary: Vocabulary = [ - "definitions", - refKeyword, - typeKeyword, - enumKeyword, - elements, - properties, - optionalProperties, - discriminator, - values, - union, - metadata, - {keyword: "additionalProperties", schemaType: "boolean"}, - {keyword: "nullable", schemaType: "boolean"}, -] - -export default jtdVocabulary diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/metadata.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/metadata.ts deleted file mode 100644 index 19eeb8c7d..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {KeywordCxt} from "../../ajv" -import type {CodeKeywordDefinition} from "../../types" -import {alwaysValidSchema} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "metadata", - schemaType: "object", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, schema, it} = cxt - if (alwaysValidSchema(it, schema)) return - const valid = gen.name("valid") - cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid) - cxt.ok(valid) - }, -} - -export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void { - if (it.jtdMetadata !== metadata) { - throw new Error(`JTD: "${keyword}" cannot be used in this schema location`) - } -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/nullable.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/nullable.ts deleted file mode 100644 index 89e4cc111..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type KeywordCxt from "../../compile/context" -import {_, not, Code, Name} from "../../compile/codegen" - -export function checkNullable({gen, data, parentSchema}: KeywordCxt, cond: Code): [Name, Code] { - const valid = gen.name("valid") - if (parentSchema.nullable) { - gen.let(valid, _`${data} === null`) - cond = not(valid) - } else { - gen.let(valid, false) - } - return [valid, cond] -} - -export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] { - const [valid, cond_] = checkNullable(cxt, cond) - return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`] -} diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts deleted file mode 100644 index 1efd0438f..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {validateProperties} from "./properties" - -const def: CodeKeywordDefinition = { - keyword: "optionalProperties", - schemaType: "object", - code(cxt: KeywordCxt) { - if (cxt.parentSchema.properties) return - validateProperties(cxt) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts deleted file mode 100644 index b51256d60..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {propertyInData, allSchemaProperties, isOwnProperty} from "../code" -import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util" -import {_, and, not, Code, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" - -const def: CodeKeywordDefinition = { - keyword: "properties", - schemaType: "object", - code: validateProperties, -} - -export function validateProperties(cxt: KeywordCxt): void { - checkMetadata(cxt) - const {gen, data, parentSchema, it} = cxt - const {additionalProperties, nullable} = parentSchema - if (it.jtdDiscriminator && nullable) throw new Error("JTD: nullable inside discriminator mapping") - if (commonProperties()) { - throw new Error("JTD: properties and optionalProperties have common members") - } - const [allProps, properties] = schemaProperties("properties") - const [allOptProps, optProperties] = schemaProperties("optionalProperties") - if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { - return - } - - const [valid, cond] = - it.jtdDiscriminator === undefined - ? checkNullableObject(cxt, data) - : [gen.let("valid", false), true] - gen.if(cond, () => - gen.assign(valid, true).block(() => { - validateProps(properties, "properties", true) - validateProps(optProperties, "optionalProperties") - if (!additionalProperties) validateAdditional() - }) - ) - cxt.pass(valid) - - function commonProperties(): boolean { - const props = parentSchema.properties as Record | undefined - const optProps = parentSchema.optionalProperties as Record | undefined - if (!(props && optProps)) return false - for (const p in props) { - if (Object.prototype.hasOwnProperty.call(optProps, p)) return true - } - return false - } - - function schemaProperties(keyword: string): [string[], string[]] { - const schema = parentSchema[keyword] - const allPs = schema ? allSchemaProperties(schema) : [] - if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { - throw new Error(`JTD: discriminator tag used in ${keyword}`) - } - const ps = allPs.filter((p) => !alwaysValidSchema(it, schema[p])) - return [allPs, ps] - } - - function validateProps(props: string[], keyword: string, required?: boolean): void { - const _valid = gen.var("valid") - for (const prop of props) { - gen.if( - propertyInData(gen, data, prop, it.opts.ownProperties), - () => applyPropertySchema(prop, keyword, _valid), - missingProperty - ) - cxt.ok(_valid) - } - - function missingProperty(): void { - if (required) { - gen.assign(_valid, false) - cxt.error() - } else { - gen.assign(_valid, true) - } - } - } - - function applyPropertySchema(prop: string, keyword: string, _valid: Name): void { - cxt.subschema( - { - keyword, - schemaProp: prop, - dataProp: prop, - }, - _valid - ) - } - - function validateAdditional(): void { - gen.forIn("key", data, (key: Name) => { - const _allProps = - it.jtdDiscriminator === undefined ? allProps : [it.jtdDiscriminator].concat(allProps) - const addProp = isAdditional(key, _allProps, "properties") - const addOptProp = isAdditional(key, allOptProps, "optionalProperties") - const extra = - addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp) - gen.if(extra, () => { - if (it.opts.removeAdditional) { - gen.code(_`delete ${data}[${key}]`) - } else { - // cxt.setParams({additionalProperty: key}) - cxt.error() - if (!it.opts.allErrors) gen.break() - } - }) - }) - } - - function isAdditional(key: Name, props: string[], keyword: string): Code | true { - let additional: Code | boolean - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword) - additional = not(isOwnProperty(gen, propsSchema as Code, key)) - } else if (props.length) { - additional = and(...props.map((p) => _`${key} !== ${p}`)) - } else { - additional = true - } - return additional - } -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/ref.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/ref.ts deleted file mode 100644 index 4aed9a9a9..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/ref.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" -import type KeywordCxt from "../../compile/context" -import {compileSchema, SchemaEnv} from "../../compile" -import {_, not, nil, stringify} from "../../compile/codegen" -import {MissingRefError} from "../../compile/error_classes" -import N from "../../compile/names" -import {getValidate, callRef} from "../core/ref" -import {checkMetadata} from "./metadata" - -const def: CodeKeywordDefinition = { - keyword: "ref", - schemaType: "string", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema: ref, parentSchema, it} = cxt - const { - schemaEnv: {root}, - } = it - const valid = gen.name("valid") - if (parentSchema.nullable) { - gen.var(valid, _`${data} === null`) - gen.if(not(valid), validateJtdRef) - } else { - gen.var(valid, false) - validateJtdRef() - } - cxt.ok(valid) - - function validateJtdRef(): void { - const refSchema = (root.schema as AnySchemaObject).definitions?.[ref] - if (!refSchema) throw new MissingRefError("", ref, `No definition ${ref}`) - if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema) - else inlineRefSchema(refSchema) - } - - function callValidate(schema: AnySchemaObject): void { - const sch = compileSchema.call(it.self, new SchemaEnv({schema, root})) - const v = getValidate(cxt, sch) - const errsCount = gen.const("_errs", N.errors) - callRef(cxt, v, sch, sch.$async) - gen.assign(valid, _`${errsCount} === ${N.errors}`) - } - - function inlineRefSchema(schema: AnySchemaObject): void { - const schName = gen.scopeValue( - "schema", - it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema} - ) - cxt.subschema( - { - schema, - dataTypes: [], - schemaPath: nil, - topSchemaRef: schName, - errSchemaPath: `/definitions/${ref}`, - }, - valid - ) - } - }, -} - -export function hasRef(schema: AnySchemaObject): boolean { - for (const key in schema) { - let sch: AnySchemaObject - if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true - } - return false -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/type.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/type.ts deleted file mode 100644 index 3e7429c86..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/type.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, or, Code} from "../../compile/codegen" -import validTimestamp from "../../compile/timestamp" -import {func} from "../../compile/util" -import {checkMetadata} from "./metadata" - -export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" - -export const intRange: {[T in IntType]: [number, number, number]} = { - int8: [-128, 127, 3], - uint8: [0, 255, 3], - int16: [-32768, 32767, 5], - uint16: [0, 65535, 5], - int32: [-2147483648, 2147483647, 10], - uint32: [0, 4294967295, 10], -} - -const def: CodeKeywordDefinition = { - keyword: "type", - schemaType: "string", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, parentSchema} = cxt - let cond: Code - switch (schema) { - case "boolean": - case "string": - cond = _`typeof ${data} == ${schema}` - break - case "timestamp": { - const vts = func(gen, validTimestamp) - cond = _`${data} instanceof Date || (typeof ${data} == "string" && ${vts}(${data}))` - break - } - case "float32": - case "float64": - cond = _`typeof ${data} == "number"` - break - default: { - const [min, max] = intRange[schema as IntType] - cond = _`typeof ${data} == "number" && isFinite(${data}) && ${data} >= ${min} && ${data} <= ${max} && !(${data} % 1)` - } - } - cxt.pass(parentSchema.nullable ? or(_`${data} === null`, cond) : cond) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/union.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/union.ts deleted file mode 100644 index bd6f142a5..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/union.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateUnion} from "../code" - -const def: CodeKeywordDefinition = { - keyword: "union", - schemaType: "array", - trackErrors: true, - code: validateUnion, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts deleted file mode 100644 index d36c666dc..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {Type} from "../../compile/subschema" -import {alwaysValidSchema} from "../../compile/util" -import {not, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" - -const def: CodeKeywordDefinition = { - keyword: "values", - schemaType: "object", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, it} = cxt - if (alwaysValidSchema(it, schema)) return - const [valid, cond] = checkNullableObject(cxt, data) - gen.if(cond, () => gen.assign(valid, validateMap())) - cxt.pass(valid) - - function validateMap(): Name | boolean { - const _valid = gen.name("valid") - if (it.allErrors) { - const validMap = gen.let("valid", true) - validateValues(() => gen.assign(validMap, false)) - return validMap - } - gen.var(_valid, true) - validateValues(() => gen.break()) - return _valid - - function validateValues(notValid: () => void): void { - gen.forIn("key", data, (key) => { - cxt.subschema( - { - keyword: "values", - dataProp: key, - dataPropType: Type.Str, - }, - _valid - ) - gen.if(not(_valid), notValid) - }) - } - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/metadata.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/metadata.ts deleted file mode 100644 index b9d5af85f..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/metadata.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type {Vocabulary} from "../types" - -export const metadataVocabulary: Vocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples", -] - -export const contentVocabulary: Vocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema", -] diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/next.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/next.ts deleted file mode 100644 index 1e987ad21..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/next.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type {Vocabulary} from "../types" -import dependentRequired from "./validation/dependentRequired" -import dependentSchemas from "./applicator/dependentSchemas" -import limitContains from "./validation/limitContains" - -const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains] - -export default next diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/index.ts deleted file mode 100644 index f7f0815db..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type {Vocabulary} from "../../types" -import unevaluatedProperties from "./unevaluatedProperties" -import unevaluatedItems from "./unevaluatedItems" - -const unevaluated: Vocabulary = [unevaluatedProperties, unevaluatedItems] - -export default unevaluated diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts deleted file mode 100644 index 7d00f1b8d..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, not, Name} from "../../compile/codegen" -import {Type} from "../../compile/subschema" -import {alwaysValidSchema} from "../../compile/util" - -export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`should NOT have more than ${len} items`, - params: ({params: {len}}) => _`{limit: ${len}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "unevaluatedItems", - type: "array", - schemaType: ["boolean", "object"], - error, - code(cxt: KeywordCxt) { - const {gen, schema, data, it} = cxt - const items = it.items || 0 - if (items === true) return - const len = gen.const("len", _`${data}.length`) - if (schema === false) { - cxt.setParams({len: items}) - cxt.fail(_`${len} > ${items}`) - } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { - const valid = gen.var("valid", _`${len} <= ${items}`) - gen.if(not(valid), () => validateItems(valid, items)) - cxt.ok(valid) - } - it.items = true - - function validateItems(valid: Name, from: Name | number): void { - gen.forRange("i", from, len, (i) => { - cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid) - if (!it.allErrors) gen.if(not(valid), () => gen.break()) - }) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts deleted file mode 100644 index 655e645bc..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +++ /dev/null @@ -1,86 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import {_, not, and, Name, Code} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import N from "../../compile/names" -import {Type} from "../../compile/subschema" - -export type UnevaluatedPropertiesError = ErrorObject< - "unevaluatedProperties", - {unevaluatedProperty: string}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: "should NOT have unevaluated properties", - params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "unevaluatedProperties", - type: "object", - schemaType: ["boolean", "object"], - trackErrors: true, - error, - code(cxt) { - const {gen, schema, data, errsCount, it} = cxt - /* istanbul ignore if */ - if (!errsCount) throw new Error("ajv implementation error") - const {allErrors, props} = it - if (props instanceof Name) { - gen.if(_`${props} !== true`, () => - gen.forIn("key", data, (key: Name) => - gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)) - ) - ) - } else if (props !== true) { - gen.forIn("key", data, (key: Name) => - props === undefined - ? unevaluatedPropCode(key) - : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)) - ) - } - it.props = true - cxt.ok(_`${errsCount} === ${N.errors}`) - - function unevaluatedPropCode(key: Name): void { - if (schema === false) { - cxt.setParams({unevaluatedProperty: key}) - cxt.error() - if (!allErrors) gen.break() - return - } - - if (!alwaysValidSchema(it, schema)) { - const valid = gen.name("valid") - cxt.subschema( - { - keyword: "unevaluatedProperties", - dataProp: key, - dataPropType: Type.Str, - }, - valid - ) - if (!allErrors) gen.if(not(valid), () => gen.break()) - } - } - - function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code { - return _`!${evaluatedProps} || !${evaluatedProps}[${key}]` - } - - function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code { - const ps: Code[] = [] - for (const p in evaluatedProps) { - if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`) - } - return and(...ps) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/const.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/const.ts deleted file mode 100644 index 2ad06ab97..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/const.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_} from "../../compile/codegen" -import * as equal from "fast-deep-equal" - -export type ConstError = ErrorObject<"const", {allowedValue: any}> - -const error: KeywordErrorDefinition = { - message: "should be equal to constant", - params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "const", - $data: true, - error, - code(cxt: KeywordCxt) { - const eql = cxt.gen.scopeValue("func", { - ref: equal, - code: _`require("ajv/dist/compile/equal")`, - }) - // TODO optimize for scalar values in schema - cxt.fail$data(_`!${eql}(${cxt.data}, ${cxt.schemaCode})`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts deleted file mode 100644 index 4c616cfa9..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject} from "../../types" -import { - validatePropertyDeps, - error, - DependenciesErrorParams, - PropertyDependencies, -} from "../applicator/dependencies" - -export type DependentRequiredError = ErrorObject< - "dependentRequired", - DependenciesErrorParams, - PropertyDependencies -> - -const def: CodeKeywordDefinition = { - keyword: "dependentRequired", - type: "object", - schemaType: "object", - error, - code: (cxt) => validatePropertyDeps(cxt), -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/enum.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/enum.ts deleted file mode 100644 index 8438fe852..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/enum.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, or, Name, Code} from "../../compile/codegen" -import * as equal from "fast-deep-equal" - -export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}> - -const error: KeywordErrorDefinition = { - message: "should be equal to one of the allowed values", - params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "enum", - schemaType: "array", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schema, schemaCode, it} = cxt - if (!$data && schema.length === 0) throw new Error("enum must have non-empty array") - const useLoop = schema.length >= it.opts.loopEnum - const eql = cxt.gen.scopeValue("func", { - ref: equal, - code: _`require("ajv/dist/compile/equal")`, - }) - let valid: Code - if (useLoop || $data) { - valid = gen.let("valid") - cxt.block$data(valid, loopEnum) - } else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const vSchema = gen.const("vSchema", schemaCode) - valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i))) - } - cxt.pass(valid) - - function loopEnum(): void { - gen.assign(valid, false) - gen.forOf("v", schemaCode as Code, (v) => - gen.if(_`${eql}(${data}, ${v})`, () => gen.assign(valid, true).break()) - ) - } - - function equalCode(vSchema: Name, i: number): Code { - const sch = schema[i] - return sch && typeof sch === "object" - ? _`${eql}(${data}, ${vSchema}[${i}])` - : _`${data} === ${sch}` - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/index.ts deleted file mode 100644 index 3531b1962..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type {ErrorObject, Vocabulary} from "../../types" -import limitNumber, {LimitNumberError} from "./limitNumber" -import multipleOf, {MultipleOfError} from "./multipleOf" -import limitLength from "./limitLength" -import pattern, {PatternError} from "./pattern" -import limitProperties from "./limitProperties" -import required, {RequiredError} from "./required" -import limitItems from "./limitItems" -import uniqueItems, {UniqueItemsError} from "./uniqueItems" -import constKeyword, {ConstError} from "./const" -import enumKeyword, {EnumError} from "./enum" - -const validation: Vocabulary = [ - // number - limitNumber, - multipleOf, - // string - limitLength, - pattern, - // object - limitProperties, - required, - // array - limitItems, - uniqueItems, - // any - {keyword: "type", schemaType: ["string", "array"]}, - {keyword: "nullable", schemaType: "boolean"}, - constKeyword, - enumKeyword, -] - -export default validation - -type LimitError = ErrorObject< - "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", - {limit: number}, - number | {$data: string} -> - -export type ValidationKeywordError = - | LimitError - | LimitNumberError - | MultipleOfError - | PatternError - | RequiredError - | UniqueItemsError - | ConstError - | EnumError diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitContains.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitContains.ts deleted file mode 100644 index 17eee91d6..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {checkStrictMode} from "../../compile/validate" - -const def: CodeKeywordDefinition = { - keyword: ["maxContains", "minContains"], - type: "array", - schemaType: "number", - code({keyword, parentSchema, it}: KeywordCxt) { - if (parentSchema.contains === undefined) { - checkStrictMode(it, `"${keyword}" without "contains" is ignored`) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitItems.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitItems.ts deleted file mode 100644 index 9bf865eb6..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, operators} from "../../compile/codegen" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxItems" ? "more" : "fewer" - return str`should NOT have ${comp} than ${schemaCode} items` - }, - params: ({schemaCode}) => _`{limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode} = cxt - const op = keyword === "maxItems" ? operators.GT : operators.LT - cxt.fail$data(_`${data}.length ${op} ${schemaCode}`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitLength.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitLength.ts deleted file mode 100644 index 61eff2cfe..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, operators} from "../../compile/codegen" -import ucs2length from "../../compile/ucs2length" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxLength" ? "more" : "fewer" - return str`should NOT have ${comp} than ${schemaCode} characters` - }, - params: ({schemaCode}) => _`{limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode, it} = cxt - const op = keyword === "maxLength" ? operators.GT : operators.LT - let len - if (it.opts.unicode === false) { - len = _`${data}.length` - } else { - const u2l = cxt.gen.scopeValue("func", { - ref: ucs2length, - code: _`require("ajv/dist/compile/ucs2length").default`, - }) - len = _`${u2l}(${data})` - } - cxt.fail$data(_`${len} ${op} ${schemaCode}`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts deleted file mode 100644 index 50f638525..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, operators, Code} from "../../compile/codegen" - -const ops = operators - -type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum" - -type Comparison = "<=" | ">=" | "<" | ">" - -const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = { - maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT}, - minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT}, - exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE}, - exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE}, -} - -export type LimitNumberError = ErrorObject< - Kwd, - {limit: number; comparison: Comparison}, - number | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({keyword, schemaCode}) => str`should be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`, - params: ({keyword, schemaCode}) => - _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: Object.keys(KWDs), - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode} = cxt - cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts deleted file mode 100644 index ec5943deb..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str, operators} from "../../compile/codegen" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxProperties" ? "more" : "fewer" - return str`should NOT have ${comp} than ${schemaCode} items` - }, - params: ({schemaCode}) => _`{limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode} = cxt - const op = keyword === "maxProperties" ? operators.GT : operators.LT - cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts deleted file mode 100644 index da09f3cd2..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {_, str} from "../../compile/codegen" - -export type MultipleOfError = ErrorObject< - "multipleOf", - {multipleOf: number}, - number | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`should be multiple of ${schemaCode}`, - params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, schemaCode, it} = cxt - // const bdt = bad$DataType(schemaCode, def.schemaType, $data) - const prec = it.opts.multipleOfPrecision - const res = gen.let("res") - const invalid = prec - ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` - : _`${res} !== parseInt(${res})` - cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/pattern.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/pattern.ts deleted file mode 100644 index bd9bdd312..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/pattern.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {usePattern} from "../code" -import {_, str} from "../../compile/codegen" - -export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`should match pattern "${schemaCode}"`, - params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schema, schemaCode} = cxt - const regExp = $data ? _`(new RegExp(${schemaCode}, "u"))` : usePattern(gen, schema) // TODO regexp should be wrapped in try/catch - cxt.fail$data(_`!${regExp}.test(${data})`) - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/required.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/required.ts deleted file mode 100644 index 35db5294d..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/required.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import { - checkReportMissingProp, - checkMissingProp, - reportMissingProp, - propertyInData, - noPropertyInData, -} from "../code" -import {_, str, nil, not, Name, Code} from "../../compile/codegen" -import {checkStrictMode} from "../../compile/validate" - -export type RequiredError = ErrorObject< - "required", - {missingProperty: string}, - string[] | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({params: {missingProperty}}) => str`should have required property '${missingProperty}'`, - params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "required", - type: "object", - schemaType: "array", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, schema, schemaCode, data, $data, it} = cxt - const {opts} = it - if (!$data && schema.length === 0) return - const useLoop = schema.length >= opts.loopRequired - if (it.allErrors) allErrorsMode() - else exitOnErrorMode() - - if (opts.strictRequired) { - const props = cxt.parentSchema.properties - const {definedProperties} = cxt.it - for (const requiredKey of schema) { - if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)` - checkStrictMode(it, msg, it.opts.strictRequired) - } - } - } - - function allErrorsMode(): void { - if (useLoop || $data) { - cxt.block$data(nil, loopAllRequired) - } else { - for (const prop of schema) { - checkReportMissingProp(cxt, prop) - } - } - } - - function exitOnErrorMode(): void { - const missing = gen.let("missing") - if (useLoop || $data) { - const valid = gen.let("valid", true) - cxt.block$data(valid, () => loopUntilMissing(missing, valid)) - cxt.ok(valid) - } else { - gen.if(checkMissingProp(cxt, schema, missing)) - reportMissingProp(cxt, missing) - gen.else() - } - } - - function loopAllRequired(): void { - gen.forOf("prop", schemaCode as Code, (prop) => { - cxt.setParams({missingProperty: prop}) - gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()) - }) - } - - function loopUntilMissing(missing: Name, valid: Name): void { - cxt.setParams({missingProperty: missing}) - gen.forOf( - missing, - schemaCode as Code, - () => { - gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties)) - gen.if(not(valid), () => { - cxt.error() - gen.break() - }) - }, - nil - ) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts deleted file mode 100644 index 7fbaeca84..000000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type KeywordCxt from "../../compile/context" -import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType" -import {_, str, Name} from "../../compile/codegen" -import * as equal from "fast-deep-equal" - -export type UniqueItemsError = ErrorObject< - "uniqueItems", - {i: number; j: number}, - boolean | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({params: {i, j}}) => - str`should NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt - if (!$data && !schema) return - const valid = gen.let("valid") - const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : [] - cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`) - cxt.ok(valid) - - function validateUniqueItems(): void { - const i = gen.let("i", _`${data}.length`) - const j = gen.let("j") - cxt.setParams({i, j}) - gen.assign(valid, true) - gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)) - } - - function canOptimize(): boolean { - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array") - } - - function loopN(i: Name, j: Name): void { - const item = gen.name("item") - const wrongType = checkDataTypes(itemTypes, item, it.opts.strict, DataType.Wrong) - const indices = gen.const("indices", _`{}`) - gen.for(_`;${i}--;`, () => { - gen.let(item, _`${data}[${i}]`) - gen.if(wrongType, _`continue`) - if (itemTypes.length > 1) gen.if(_`typeof ${item} == "string"`, _`${item} += "_"`) - gen - .if(_`typeof ${indices}[${item}] == "number"`, () => { - gen.assign(j, _`${indices}[${item}]`) - cxt.error() - gen.assign(valid, false).break() - }) - .code(_`${indices}[${item}] = ${i}`) - }) - } - - function loopN2(i: Name, j: Name): void { - const eql = cxt.gen.scopeValue("func", { - ref: equal, - code: _`require("ajv/dist/compile/equal")`, - }) - const outer = gen.name("outer") - gen.label(outer).for(_`;${i}--;`, () => - gen.for(_`${j} = ${i}; ${j}--;`, () => - gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => { - cxt.error() - gen.assign(valid, false).break(outer) - }) - ) - ) - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/package.json b/node_modules/table/node_modules/ajv/package.json deleted file mode 100644 index 0c2109d45..000000000 --- a/node_modules/table/node_modules/ajv/package.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "_from": "ajv@^7.0.2", - "_id": "ajv@7.2.3", - "_inBundle": false, - "_integrity": "sha512-idv5WZvKVXDqKralOImQgPM9v6WOdLNa0IY3B3doOjw/YxRGT8I+allIJ6kd7Uaj+SF1xZUSU+nPM5aDNBVtnw==", - "_location": "/table/ajv", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ajv@^7.0.2", - "name": "ajv", - "escapedName": "ajv", - "rawSpec": "^7.0.2", - "saveSpec": null, - "fetchSpec": "^7.0.2" - }, - "_requiredBy": [ - "/table" - ], - "_resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.3.tgz", - "_shasum": "ca78d1cf458d7d36d1c3fa0794dd143406db5772", - "_spec": "ajv@^7.0.2", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/table", - "author": { - "name": "Evgeny Poberezkin" - }, - "bugs": { - "url": "https://github.com/ajv-validator/ajv/issues" - }, - "bundleDependencies": false, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" - }, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "deprecated": false, - "description": "Another JSON Schema Validator", - "devDependencies": { - "@ajv-validator/config": "^0.3.0", - "@types/chai": "^4.2.12", - "@types/mocha": "^8.0.3", - "@types/node": "^14.0.27", - "@types/require-from-string": "^1.2.0", - "@typescript-eslint/eslint-plugin": "^3.8.0", - "@typescript-eslint/parser": "^3.8.0", - "@vuepress/shared-utils": "^1.8.2", - "ajv-formats": "^1.5.0", - "browserify": "^17.0.0", - "chai": "^4.0.1", - "cross-env": "^7.0.2", - "eslint": "^7.8.1", - "eslint-config-prettier": "^7.0.0", - "glob": "^7.0.0", - "husky": "^5.0.9", - "if-node-version": "^1.0.0", - "jimp": "^0.16.1", - "js-beautify": "^1.7.3", - "json-schema-test": "^2.0.0", - "karma": "^5.0.0", - "karma-chrome-launcher": "^3.0.0", - "karma-mocha": "^2.0.0", - "lint-staged": "^10.2.11", - "mocha": "^8.0.1", - "node-fetch": "^2.6.1", - "nyc": "^15.0.0", - "prettier": "^2.0.5", - "terser": "^5.2.1", - "ts-node": "^9.0.0", - "tsify": "^5.0.2", - "typescript": "^4.2.0", - "vuepress": "^1.8.2" - }, - "files": [ - "lib/", - "dist/", - "scripts/", - ".tonic_example.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - }, - "homepage": "https://github.com/ajv-validator/ajv", - "husky": { - "hooks": { - "pre-commit": "lint-staged && npm test" - } - }, - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "license": "MIT", - "lint-staged": { - "*.{json,yaml,js,ts}": "prettier --write" - }, - "main": "dist/ajv.js", - "name": "ajv", - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "prettier": "@ajv-validator/config/prettierrc.json", - "repository": { - "type": "git", - "url": "git+https://github.com/ajv-validator/ajv.git" - }, - "scripts": { - "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link ajv && npm i && node ./jtd", - "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/jtd-schema.ts", - "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", - "docs:build": "./scripts/prepare-site && vuepress build docs", - "docs:dev": "./scripts/prepare-site && vuepress dev docs", - "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", - "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", - "prepublish": "npm run build", - "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", - "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", - "test": "npm link && npm link ajv && npm run json-tests && npm run eslint && npm run test-cov", - "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", - "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", - "test-ci": "AJV_FULL_TEST=true npm test", - "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", - "test-cov": "nyc npm run test-spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-karma": "karma start", - "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot -f \"\\$recursiveRef with no \\$recursiveAnchor in the initial target schema resource\" -i" - }, - "tonicExampleFilename": ".tonic_example.js", - "types": "dist/ajv.d.ts", - "version": "7.2.3" -} diff --git a/node_modules/table/node_modules/ajv/scripts/.eslintrc.yml b/node_modules/table/node_modules/ajv/scripts/.eslintrc.yml deleted file mode 100644 index 16d8b308a..000000000 --- a/node_modules/table/node_modules/ajv/scripts/.eslintrc.yml +++ /dev/null @@ -1,5 +0,0 @@ -parserOptions: - sourceType: script -rules: - no-console: 0 - no-empty: [2, allowEmptyCatch: true] diff --git a/node_modules/table/node_modules/ajv/scripts/bundle.js b/node_modules/table/node_modules/ajv/scripts/bundle.js deleted file mode 100644 index 62560f24a..000000000 --- a/node_modules/table/node_modules/ajv/scripts/bundle.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict" - -const fs = require("fs") -const path = require("path") -const browserify = require("browserify") -const {minify} = require("terser") - -const [sourceFile, outFile, globalName] = process.argv.slice(2) - -const json = require(path.join(__dirname, "..", "package.json")) -const bundleDir = path.join(__dirname, "..", "bundle") -if (!fs.existsSync(bundleDir)) fs.mkdirSync(bundleDir) - -browserify({standalone: globalName}) - .require(path.join(__dirname, "../dist", sourceFile), {expose: sourceFile}) - .bundle(saveAndMinify) - -async function saveAndMinify(err, buf) { - if (err) { - console.error("browserify error:", err) - process.exit(1) - } - - const bundlePath = path.join(bundleDir, outFile) - const opts = { - ecma: 2018, - warnings: true, - compress: { - pure_getters: true, - keep_infinity: true, - unsafe_methods: true, - }, - format: { - preamble: `/* ${json.name} ${json.version} (${globalName}): ${json.description} */`, - }, - sourceMap: { - filename: outFile + ".min.js", - url: outFile + ".min.js.map", - }, - } - - const result = await minify(buf.toString(), opts) - - fs.writeFileSync(bundlePath + ".bundle.js", buf) - fs.writeFileSync(bundlePath + ".min.js", result.code) - fs.writeFileSync(bundlePath + ".min.js.map", result.map) - if (result.warnings) result.warnings.forEach((msg) => console.warn("terser.minify warning:", msg)) -} diff --git a/node_modules/table/node_modules/ajv/scripts/get-contributors.js b/node_modules/table/node_modules/ajv/scripts/get-contributors.js deleted file mode 100644 index 4778886d1..000000000 --- a/node_modules/table/node_modules/ajv/scripts/get-contributors.js +++ /dev/null @@ -1,57 +0,0 @@ -// Credit for the script goes to svelte: -// https://github.com/sveltejs/svelte/blob/ce3a5791258ec6ecf8c1ea022cb871afe805a45c/site/scripts/get-contributors.js - -const fs = require("fs") -const fetch = require("node-fetch") -const Jimp = require("jimp") - -process.chdir(__dirname) - -const base = `https://api.github.com/repos/ajv-validator/ajv/contributors` -const {GH_TOKEN_PUBLIC} = process.env - -const SIZE = 64 - -async function main() { - const contributors = [] - let page = 1 - - // eslint-disable-next-line no-constant-condition - while (true) { - const res = await fetch(`${base}?per_page=100&page=${page++}`, { - headers: {Authorization: `token ${GH_TOKEN_PUBLIC}`}, - }) - const list = await res.json() - if (list.length === 0) break - contributors.push(...list) - } - - const bots = ["dependabot-preview[bot]", "greenkeeper[bot]", "greenkeeperio-bot"] - - const authors = contributors - .filter((a) => !bots.includes(a.login)) - .sort((a, b) => b.contributions - a.contributions) - - const sprite = new Jimp(SIZE * authors.length, SIZE) - - for (let i = 0; i < authors.length; i += 1) { - const author = authors[i] - console.log(`${i + 1} / ${authors.length}: ${author.login}`) - const image_data = await fetch(author.avatar_url) - const buffer = await image_data.arrayBuffer() - const image = await Jimp.read(buffer) - image.resize(SIZE, SIZE) - sprite.composite(image, i * SIZE, 0) - } - - await sprite.quality(80).write(`../docs/.vuepress/components/Contributors/contributors.jpg`) - - const str = `[\n\t${authors.map((a) => `'${a.login}'`).join(",\n\t")}\n]` - - fs.writeFileSync( - `../docs/.vuepress/components/Contributors/_contributors.js`, - `export default ${str};` - ) -} - -main() diff --git a/node_modules/table/node_modules/ajv/scripts/jsontests.js b/node_modules/table/node_modules/ajv/scripts/jsontests.js deleted file mode 100644 index 88423d81b..000000000 --- a/node_modules/table/node_modules/ajv/scripts/jsontests.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict" - -const testSuitePaths = { - draft6: "spec/JSON-Schema-Test-Suite/tests/draft6/", - draft7: "spec/JSON-Schema-Test-Suite/tests/draft7/", - draft2019: "spec/JSON-Schema-Test-Suite/tests/draft2019-09/", - tests: "spec/tests/", - security: "spec/security/", - extras: "spec/extras/", - async: "spec/async/", -} - -const glob = require("glob") -const fs = require("fs") - -for (const suite in testSuitePaths) { - const p = testSuitePaths[suite] - const files = glob.sync(`${p}{**/,}*.json`) - if (files.length === 0) { - console.error(`Missing folder ${p}\nTry: git submodule update --init\n`) - process.exit(1) - } - const code = files - .map((f) => { - const name = f.replace(p, "").replace(/\.json$/, "") - const testPath = f.replace(/^spec/, "..") - return `\n {name: "${name}", test: require("${testPath}")},` - }) - .reduce((list, f) => list + f) - fs.writeFileSync(`./spec/_json/${suite}.js`, `module.exports = [${code}\n]\n`) -} diff --git a/node_modules/table/node_modules/ajv/scripts/prepare-site b/node_modules/table/node_modules/ajv/scripts/prepare-site deleted file mode 100755 index cf33029db..000000000 --- a/node_modules/table/node_modules/ajv/scripts/prepare-site +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -function copyReplace { - sed "s/](.\/docs\//](.\//g" $1 > $2 -} - -copyReplace README.md docs/README.md -copyReplace CODE_OF_CONDUCT.md docs/code_of_conduct.md -copyReplace CONTRIBUTING.md docs/contributing.md -copyReplace LICENSE docs/license.md - -echo "preparing contributors..." -node scripts/get-contributors.js diff --git a/node_modules/table/node_modules/ajv/scripts/prepare-tests b/node_modules/table/node_modules/ajv/scripts/prepare-tests deleted file mode 100755 index 1b0789632..000000000 --- a/node_modules/table/node_modules/ajv/scripts/prepare-tests +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env sh - -set -e - -mkdir -p .browser - -echo -echo Preparing browser tests: - -find spec -type f -name '*.spec.*s' | \ -xargs -I {} sh -c \ -'export f="{}"; echo $f; ./node_modules/.bin/browserify $f -p [ tsify -p ./spec/tsconfig.json ] -x ajv -u buffer -o $(echo $f | sed -e "s/spec/.browser/" | sed -e "s/.spec.ts/.spec.js/");' diff --git a/node_modules/table/node_modules/ajv/scripts/publish-bundles b/node_modules/table/node_modules/ajv/scripts/publish-bundles deleted file mode 100755 index 311c21608..000000000 --- a/node_modules/table/node_modules/ajv/scripts/publish-bundles +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ $GITHUB_REF == refs/tags/v* ]]; then - npm run bundle - - echo "About to publish $GITHUB_REF to ajv-dist..." - - git config --global user.name "$GIT_USER_NAME" - git config --global user.email "$GIT_USER_EMAIL" - - git clone https://"${GH_TOKEN_PUBLIC}"@github.com/ajv-validator/ajv-dist.git ../ajv-dist - - rm -rf ../ajv-dist/dist - mkdir ../ajv-dist/dist - cp ./bundle/*.* ../ajv-dist/dist - cd ../ajv-dist - - VERSION=${GITHUB_REF#refs/tags/v} - - sed -E "s/\"version\": \"([^\"]*)\"/\"version\": \"$VERSION\"/" package.json > new_package.json - mv new_package.json package.json - - if [[ $(git status --porcelain) ]]; then - echo "Changes detected. Updating master branch..." - git add -A - git commit -m "$VERSION: updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" - git push --quiet origin master > /dev/null 2>&1 - fi - - echo "Publishing tag..." - git tag "v$VERSION" - git push --tags > /dev/null 2>&1 - - echo "Done" -fi diff --git a/node_modules/table/node_modules/ajv/scripts/publish-site b/node_modules/table/node_modules/ajv/scripts/publish-site deleted file mode 100755 index 0e004cf5d..000000000 --- a/node_modules/table/node_modules/ajv/scripts/publish-site +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "About to publish $GITHUB_REF to gh-pages..." -rm -rf ../gh-pages - -npm run docs:build - -git config --global user.name "$GIT_USER_NAME" -git config --global user.email "$GIT_USER_EMAIL" -git clone -b gh-pages --single-branch https://"${GH_TOKEN_PUBLIC}"@github.com/ajv-validator/ajv.git ../gh-pages - -rsync -a ./docs/.vuepress/dist/ ../gh-pages - -cd ../gh-pages - -if [[ $(git status --porcelain) ]]; then - echo "Changes detected. Updating gh-pages branch..." - git add -A - git commit -m "updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" - git push --quiet origin gh-pages > /dev/null 2>&1 -fi - -echo "Done" diff --git a/node_modules/table/node_modules/json-schema-traverse/.eslintrc.yml b/node_modules/table/node_modules/json-schema-traverse/.eslintrc.yml deleted file mode 100644 index 618559ab6..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/.eslintrc.yml +++ /dev/null @@ -1,27 +0,0 @@ -extends: eslint:recommended -env: - node: true - browser: true -rules: - block-scoped-var: 2 - complexity: [2, 15] - curly: [2, multi-or-nest, consistent] - dot-location: [2, property] - dot-notation: 2 - indent: [2, 2, SwitchCase: 1] - linebreak-style: [2, unix] - new-cap: 2 - no-console: [2, allow: [warn, error]] - no-else-return: 2 - no-eq-null: 2 - no-fallthrough: 2 - no-invalid-this: 2 - no-return-assign: 2 - no-shadow: 1 - no-trailing-spaces: 2 - no-use-before-define: [2, nofunc] - quotes: [2, single, avoid-escape] - semi: [2, always] - strict: [2, global] - valid-jsdoc: [2, requireReturn: false] - no-control-regex: 0 diff --git a/node_modules/table/node_modules/json-schema-traverse/.github/FUNDING.yml b/node_modules/table/node_modules/json-schema-traverse/.github/FUNDING.yml deleted file mode 100644 index 44f80f417..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: epoberezkin -tidelift: "npm/json-schema-traverse" diff --git a/node_modules/table/node_modules/json-schema-traverse/.github/workflows/build.yml b/node_modules/table/node_modules/json-schema-traverse/.github/workflows/build.yml deleted file mode 100644 index f8ef5ba80..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/.github/workflows/build.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: build - -on: - push: - branches: [master] - pull_request: - branches: ["*"] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/table/node_modules/json-schema-traverse/.github/workflows/publish.yml b/node_modules/table/node_modules/json-schema-traverse/.github/workflows/publish.yml deleted file mode 100644 index 924825b12..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/.github/workflows/publish.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: publish - -on: - release: - types: [published] - -jobs: - publish-npm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 14 - registry-url: https://registry.npmjs.org/ - - run: npm install - - run: npm test - - name: Publish beta version to npm - if: "github.event.release.prerelease" - run: npm publish --tag beta - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish to npm - if: "!github.event.release.prerelease" - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/node_modules/table/node_modules/json-schema-traverse/README.md b/node_modules/table/node_modules/json-schema-traverse/README.md deleted file mode 100644 index f3e60073a..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# json-schema-traverse -Traverse JSON Schema passing each schema object to callback - -[![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild) -[![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse) -[![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) - - -## Install - -``` -npm install json-schema-traverse -``` - - -## Usage - -```javascript -const traverse = require('json-schema-traverse'); -const schema = { - properties: { - foo: {type: 'string'}, - bar: {type: 'integer'} - } -}; - -traverse(schema, {cb}); -// cb is called 3 times with: -// 1. root schema -// 2. {type: 'string'} -// 3. {type: 'integer'} - -// Or: - -traverse(schema, {cb: {pre, post}}); -// pre is called 3 times with: -// 1. root schema -// 2. {type: 'string'} -// 3. {type: 'integer'} -// -// post is called 3 times with: -// 1. {type: 'string'} -// 2. {type: 'integer'} -// 3. root schema - -``` - -Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. - -Callback is passed these parameters: - -- _schema_: the current schema object -- _JSON pointer_: from the root schema to the current schema object -- _root schema_: the schema passed to `traverse` object -- _parent JSON pointer_: from the root schema to the parent schema object (see below) -- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) -- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema -- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` - - -## Traverse objects in all unknown keywords - -```javascript -const traverse = require('json-schema-traverse'); -const schema = { - mySchema: { - minimum: 1, - maximum: 2 - } -}; - -traverse(schema, {allKeys: true, cb}); -// cb is called 2 times with: -// 1. root schema -// 2. mySchema -``` - -Without option `allKeys: true` callback will be called only with root schema. - - -## Enterprise support - -json-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -## License - -[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/node_modules/table/node_modules/json-schema-traverse/index.d.ts b/node_modules/table/node_modules/json-schema-traverse/index.d.ts deleted file mode 100644 index 0772daedb..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -declare function traverse( - schema: traverse.SchemaObject, - opts: traverse.Options, - cb?: traverse.Callback -): void; - -declare function traverse( - schema: traverse.SchemaObject, - cb: traverse.Callback -): void; - -declare namespace traverse { - interface SchemaObject { - $id?: string; - $schema?: string; - [x: string]: any; - } - - type Callback = ( - schema: SchemaObject, - jsonPtr: string, - rootSchema: SchemaObject, - parentJsonPtr?: string, - parentKeyword?: string, - parentSchema?: SchemaObject, - keyIndex?: string | number - ) => void; - - interface Options { - allKeys?: boolean; - cb?: - | Callback - | { - pre?: Callback; - post?: Callback; - }; - } -} - -export = traverse; diff --git a/node_modules/table/node_modules/json-schema-traverse/index.js b/node_modules/table/node_modules/json-schema-traverse/index.js deleted file mode 100644 index e521bfa85..000000000 --- a/node_modules/table/node_modules/json-schema-traverse/index.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -var traverse = module.exports = function (schema, opts, cb) { - // Legacy support for v0.3.1 and earlier. - if (typeof opts == 'function') { - cb = opts; - opts = {}; - } - - cb = opts.cb || cb; - var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; - var post = cb.post || function() {}; - - _traverse(opts, pre, post, schema, '', schema); -}; - - -traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true, - if: true, - then: true, - else: true -}; - -traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true -}; - -traverse.propsKeywords = { - $defs: true, - definitions: true, - properties: true, - patternProperties: true, - dependencies: true -}; - -traverse.skipKeywords = { - default: true, - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true -}; - - -function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema) { - var sch = schema[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i=0; i=10.0.0" - }, - "homepage": "https://github.com/gajus/table#readme", - "husky": { - "hooks": { - "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", - "pre-commit": "npm run lint && npm run test && npm run build" - } - }, - "keywords": [ - "ascii", - "text", - "table", - "align", - "ansi" - ], - "license": "BSD-3-Clause", - "main": "./dist/index.js", - "name": "table", - "nyc": { - "include": [ - "src/**/*.js" - ], - "instrument": false, - "reporter": [ - "text-lcov" - ], - "require": [ - "@babel/register" - ], - "sourceMap": false - }, - "repository": { - "type": "git", - "url": "git+https://github.com/gajus/table.git" - }, - "scripts": { - "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && npm run create-validators && flow-copy-source src dist", - "create-readme": "gitdown ./.README/README.md --output-file ./README.md", - "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > dist/validators.js", - "lint": "npm run build && eslint ./src ./test && flow", - "test": "mocha --require @babel/register" - }, - "version": "6.0.7" -} diff --git a/node_modules/v8-compile-cache/CHANGELOG.md b/node_modules/v8-compile-cache/CHANGELOG.md deleted file mode 100644 index d4da25694..000000000 --- a/node_modules/v8-compile-cache/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# `v8-module-cache` Changelog - -## 2021-03-05, Version 2.3.0 - -* Fix use require.main instead of module.parent [#34](https://github.com/zertosh/v8-compile-cache/pull/34). - -## 2020-10-28, Version 2.2.0 - -* Added `V8_COMPILE_CACHE_CACHE_DIR` option [#23](https://github.com/zertosh/v8-compile-cache/pull/23). - -## 2020-05-30, Version 2.1.1 - -* Stop using process.umask() [#28](https://github.com/zertosh/v8-compile-cache/pull/28). - -## 2019-08-04, Version 2.1.0 - -* Fix Electron by calling the module wrapper with `Buffer` [#10](https://github.com/zertosh/v8-compile-cache/pull/10). - -## 2019-05-10, Version 2.0.3 - -* Add `LICENSE` file [#19](https://github.com/zertosh/v8-compile-cache/pull/19). -* Add "repository" to `package.json` (see [eea336e](https://github.com/zertosh/v8-compile-cache/commit/eea336eaa8360f9ded9342b8aa928e56ac6a7529)). -* Support `require.resolve.paths` (added in Node v8.9.0) [#20](https://github.com/zertosh/v8-compile-cache/pull/20)/[#22](https://github.com/zertosh/v8-compile-cache/pull/22). - -## 2018-08-06, Version 2.0.2 - -* Re-publish. - -## 2018-08-06, Version 2.0.1 - -* Support `require.resolve` options (added in Node v8.9.0). - -## 2018-04-30, Version 2.0.0 - -* Use `Buffer.alloc` instead of `new Buffer()`. -* Drop support for Node 5.x. - -## 2018-01-23, Version 1.1.2 - -* Instead of checking for `process.versions.v8`, check that `script.cachedDataProduced` is `true` (rather than `null`/`undefined`) for support to be considered existent. - -## 2018-01-23, Version 1.1.1 - -* Check for the existence of `process.versions.v8` before attaching hook (see [f8b0388](https://github.com/zertosh/v8-compile-cache/commit/f8b038848be94bc2c905880dd50447c73393f364)). - -## 2017-03-27, Version 1.1.0 - -* Safer cache directory creation (see [bcb3b12](https://github.com/zertosh/v8-compile-cache/commit/bcb3b12c819ab0927ec4408e70f612a6d50a9617)). - - The cache is now suffixed with the user's uid on POSIX systems (i.e. `/path/to/tmp/v8-compile-cache-1234`). - -## 2017-02-21, Version 1.0.0 - -* Initial release. diff --git a/node_modules/v8-compile-cache/README.md b/node_modules/v8-compile-cache/README.md deleted file mode 100644 index 6e0b99fba..000000000 --- a/node_modules/v8-compile-cache/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# v8-compile-cache - -[![Build Status](https://travis-ci.org/zertosh/v8-compile-cache.svg?branch=master)](https://travis-ci.org/zertosh/v8-compile-cache) - -`v8-compile-cache` attaches a `require` hook to use [V8's code cache](https://v8project.blogspot.com/2015/07/code-caching.html) to speed up instantiation time. The "code cache" is the work of parsing and compiling done by V8. - -The ability to tap into V8 to produce/consume this cache was introduced in [Node v5.7.0](https://nodejs.org/en/blog/release/v5.7.0/). - -## Usage - -1. Add the dependency: - - ```sh - $ npm install --save v8-compile-cache - ``` - -2. Then, in your entry module add: - - ```js - require('v8-compile-cache'); - ``` - -**Requiring `v8-compile-cache` in Node <5.7.0 is a noop – but you need at least Node 4.0.0 to support the ES2015 syntax used by `v8-compile-cache`.** - -## Options - -Set the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache. - -Cache directory is defined by environment variable `V8_COMPILE_CACHE_CACHE_DIR` or defaults to `/v8-compile-cache-`. - -## Internals - -Cache files are suffixed `.BLOB` and `.MAP` corresponding to the entry module that required `v8-compile-cache`. The cache is _entry module specific_ because it is faster to load the entire code cache into memory at once, than it is to read it from disk on a file-by-file basis. - -## Benchmarks - -See https://github.com/zertosh/v8-compile-cache/tree/master/bench. - -**Load Times:** - -| Module | Without Cache | With Cache | -| ---------------- | -------------:| ----------:| -| `babel-core` | `218ms` | `185ms` | -| `yarn` | `153ms` | `113ms` | -| `yarn` (bundled) | `228ms` | `105ms` | - -_^ Includes the overhead of loading the cache itself._ - -## Acknowledgements - -* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: - - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js - - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js -* `mkdirpSync` is based on: - - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 diff --git a/node_modules/v8-compile-cache/package.json b/node_modules/v8-compile-cache/package.json deleted file mode 100644 index b75fab985..000000000 --- a/node_modules/v8-compile-cache/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "v8-compile-cache@^2.0.3", - "_id": "v8-compile-cache@2.3.0", - "_inBundle": false, - "_integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "_location": "/v8-compile-cache", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "v8-compile-cache@^2.0.3", - "name": "v8-compile-cache", - "escapedName": "v8-compile-cache", - "rawSpec": "^2.0.3", - "saveSpec": null, - "fetchSpec": "^2.0.3" - }, - "_requiredBy": [ - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "_shasum": "2de19618c66dc247dcfb6f99338035d8245a2cee", - "_spec": "v8-compile-cache@^2.0.3", - "_where": "/Users/christopher/Projects/github-actions-asana/node_modules/eslint", - "author": { - "name": "Andres Suarez", - "email": "zertosh@gmail.com" - }, - "bugs": { - "url": "https://github.com/zertosh/v8-compile-cache/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Require hook for automatic V8 compile cache persistence", - "devDependencies": { - "babel-core": "6.26.3", - "eslint": "^7.12.1", - "flow-parser": "0.136.0", - "rimraf": "^2.5.4", - "rxjs": "6.6.3", - "semver": "^5.3.0", - "tap": "^9.0.0", - "temp": "^0.8.3", - "yarn": "1.22.10" - }, - "files": [ - "v8-compile-cache.js" - ], - "homepage": "https://github.com/zertosh/v8-compile-cache#readme", - "license": "MIT", - "main": "v8-compile-cache.js", - "name": "v8-compile-cache", - "repository": { - "type": "git", - "url": "git+https://github.com/zertosh/v8-compile-cache.git" - }, - "scripts": { - "bench": "bench/run.sh", - "eslint": "eslint --max-warnings=0 .", - "posttest": "npm run eslint", - "tap": "tap test/*-test.js", - "test": "npm run tap" - }, - "version": "2.3.0" -} diff --git a/node_modules/v8-compile-cache/v8-compile-cache.js b/node_modules/v8-compile-cache/v8-compile-cache.js deleted file mode 100644 index f094da40f..000000000 --- a/node_modules/v8-compile-cache/v8-compile-cache.js +++ /dev/null @@ -1,371 +0,0 @@ -'use strict'; - -const Module = require('module'); -const crypto = require('crypto'); -const fs = require('fs'); -const path = require('path'); -const vm = require('vm'); -const os = require('os'); - -const hasOwnProperty = Object.prototype.hasOwnProperty; - -//------------------------------------------------------------------------------ -// FileSystemBlobStore -//------------------------------------------------------------------------------ - -class FileSystemBlobStore { - constructor(directory, prefix) { - const name = prefix ? slashEscape(prefix + '.') : ''; - this._blobFilename = path.join(directory, name + 'BLOB'); - this._mapFilename = path.join(directory, name + 'MAP'); - this._lockFilename = path.join(directory, name + 'LOCK'); - this._directory = directory; - this._load(); - } - - has(key, invalidationKey) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - return this._invalidationKeys[key] === invalidationKey; - } else if (hasOwnProperty.call(this._storedMap, key)) { - return this._storedMap[key][0] === invalidationKey; - } - return false; - } - - get(key, invalidationKey) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - if (this._invalidationKeys[key] === invalidationKey) { - return this._memoryBlobs[key]; - } - } else if (hasOwnProperty.call(this._storedMap, key)) { - const mapping = this._storedMap[key]; - if (mapping[0] === invalidationKey) { - return this._storedBlob.slice(mapping[1], mapping[2]); - } - } - } - - set(key, invalidationKey, buffer) { - this._invalidationKeys[key] = invalidationKey; - this._memoryBlobs[key] = buffer; - this._dirty = true; - } - - delete(key) { - if (hasOwnProperty.call(this._memoryBlobs, key)) { - this._dirty = true; - delete this._memoryBlobs[key]; - } - if (hasOwnProperty.call(this._invalidationKeys, key)) { - this._dirty = true; - delete this._invalidationKeys[key]; - } - if (hasOwnProperty.call(this._storedMap, key)) { - this._dirty = true; - delete this._storedMap[key]; - } - } - - isDirty() { - return this._dirty; - } - - save() { - const dump = this._getDump(); - const blobToStore = Buffer.concat(dump[0]); - const mapToStore = JSON.stringify(dump[1]); - - try { - mkdirpSync(this._directory); - fs.writeFileSync(this._lockFilename, 'LOCK', {flag: 'wx'}); - } catch (error) { - // Swallow the exception if we fail to acquire the lock. - return false; - } - - try { - fs.writeFileSync(this._blobFilename, blobToStore); - fs.writeFileSync(this._mapFilename, mapToStore); - } finally { - fs.unlinkSync(this._lockFilename); - } - - return true; - } - - _load() { - try { - this._storedBlob = fs.readFileSync(this._blobFilename); - this._storedMap = JSON.parse(fs.readFileSync(this._mapFilename)); - } catch (e) { - this._storedBlob = Buffer.alloc(0); - this._storedMap = {}; - } - this._dirty = false; - this._memoryBlobs = {}; - this._invalidationKeys = {}; - } - - _getDump() { - const buffers = []; - const newMap = {}; - let offset = 0; - - function push(key, invalidationKey, buffer) { - buffers.push(buffer); - newMap[key] = [invalidationKey, offset, offset + buffer.length]; - offset += buffer.length; - } - - for (const key of Object.keys(this._memoryBlobs)) { - const buffer = this._memoryBlobs[key]; - const invalidationKey = this._invalidationKeys[key]; - push(key, invalidationKey, buffer); - } - - for (const key of Object.keys(this._storedMap)) { - if (hasOwnProperty.call(newMap, key)) continue; - const mapping = this._storedMap[key]; - const buffer = this._storedBlob.slice(mapping[1], mapping[2]); - push(key, mapping[0], buffer); - } - - return [buffers, newMap]; - } -} - -//------------------------------------------------------------------------------ -// NativeCompileCache -//------------------------------------------------------------------------------ - -class NativeCompileCache { - constructor() { - this._cacheStore = null; - this._previousModuleCompile = null; - } - - setCacheStore(cacheStore) { - this._cacheStore = cacheStore; - } - - install() { - const self = this; - const hasRequireResolvePaths = typeof require.resolve.paths === 'function'; - this._previousModuleCompile = Module.prototype._compile; - Module.prototype._compile = function(content, filename) { - const mod = this; - - function require(id) { - return mod.require(id); - } - - // https://github.com/nodejs/node/blob/v10.15.3/lib/internal/modules/cjs/helpers.js#L28 - function resolve(request, options) { - return Module._resolveFilename(request, mod, false, options); - } - require.resolve = resolve; - - // https://github.com/nodejs/node/blob/v10.15.3/lib/internal/modules/cjs/helpers.js#L37 - // resolve.resolve.paths was added in v8.9.0 - if (hasRequireResolvePaths) { - resolve.paths = function paths(request) { - return Module._resolveLookupPaths(request, mod, true); - }; - } - - require.main = process.mainModule; - - // Enable support to add extra extension types - require.extensions = Module._extensions; - require.cache = Module._cache; - - const dirname = path.dirname(filename); - - const compiledWrapper = self._moduleCompile(filename, content); - - // We skip the debugger setup because by the time we run, node has already - // done that itself. - - // `Buffer` is included for Electron. - // See https://github.com/zertosh/v8-compile-cache/pull/10#issuecomment-518042543 - const args = [mod.exports, require, mod, filename, dirname, process, global, Buffer]; - return compiledWrapper.apply(mod.exports, args); - }; - } - - uninstall() { - Module.prototype._compile = this._previousModuleCompile; - } - - _moduleCompile(filename, content) { - // https://github.com/nodejs/node/blob/v7.5.0/lib/module.js#L511 - - // Remove shebang - var contLen = content.length; - if (contLen >= 2) { - if (content.charCodeAt(0) === 35/*#*/ && - content.charCodeAt(1) === 33/*!*/) { - if (contLen === 2) { - // Exact match - content = ''; - } else { - // Find end of shebang line and slice it off - var i = 2; - for (; i < contLen; ++i) { - var code = content.charCodeAt(i); - if (code === 10/*\n*/ || code === 13/*\r*/) break; - } - if (i === contLen) { - content = ''; - } else { - // Note that this actually includes the newline character(s) in the - // new output. This duplicates the behavior of the regular - // expression that was previously used to replace the shebang line - content = content.slice(i); - } - } - } - } - - // create wrapper function - var wrapper = Module.wrap(content); - - var invalidationKey = crypto - .createHash('sha1') - .update(content, 'utf8') - .digest('hex'); - - var buffer = this._cacheStore.get(filename, invalidationKey); - - var script = new vm.Script(wrapper, { - filename: filename, - lineOffset: 0, - displayErrors: true, - cachedData: buffer, - produceCachedData: true, - }); - - if (script.cachedDataProduced) { - this._cacheStore.set(filename, invalidationKey, script.cachedData); - } else if (script.cachedDataRejected) { - this._cacheStore.delete(filename); - } - - var compiledWrapper = script.runInThisContext({ - filename: filename, - lineOffset: 0, - columnOffset: 0, - displayErrors: true, - }); - - return compiledWrapper; - } -} - -//------------------------------------------------------------------------------ -// utilities -// -// https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98 -// https://github.com/zertosh/slash-escape/blob/e7ebb99/slash-escape.js -//------------------------------------------------------------------------------ - -function mkdirpSync(p_) { - _mkdirpSync(path.resolve(p_), 0o777); -} - -function _mkdirpSync(p, mode) { - try { - fs.mkdirSync(p, mode); - } catch (err0) { - if (err0.code === 'ENOENT') { - _mkdirpSync(path.dirname(p)); - _mkdirpSync(p); - } else { - try { - const stat = fs.statSync(p); - if (!stat.isDirectory()) { throw err0; } - } catch (err1) { - throw err0; - } - } - } -} - -function slashEscape(str) { - const ESCAPE_LOOKUP = { - '\\': 'zB', - ':': 'zC', - '/': 'zS', - '\x00': 'z0', - 'z': 'zZ', - }; - const ESCAPE_REGEX = /[\\:/\x00z]/g; // eslint-disable-line no-control-regex - return str.replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]); -} - -function supportsCachedData() { - const script = new vm.Script('""', {produceCachedData: true}); - // chakracore, as of v1.7.1.0, returns `false`. - return script.cachedDataProduced === true; -} - -function getCacheDir() { - const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR; - if (v8_compile_cache_cache_dir) { - return v8_compile_cache_cache_dir; - } - - // Avoid cache ownership issues on POSIX systems. - const dirname = typeof process.getuid === 'function' - ? 'v8-compile-cache-' + process.getuid() - : 'v8-compile-cache'; - const version = typeof process.versions.v8 === 'string' - ? process.versions.v8 - : typeof process.versions.chakracore === 'string' - ? 'chakracore-' + process.versions.chakracore - : 'node-' + process.version; - const cacheDir = path.join(os.tmpdir(), dirname, version); - return cacheDir; -} - -function getMainName() { - // `require.main.filename` is undefined or null when: - // * node -e 'require("v8-compile-cache")' - // * node -r 'v8-compile-cache' - // * Or, requiring from the REPL. - const mainName = require.main && typeof require.main.filename === 'string' - ? require.main.filename - : process.cwd(); - return mainName; -} - -//------------------------------------------------------------------------------ -// main -//------------------------------------------------------------------------------ - -if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { - const cacheDir = getCacheDir(); - const prefix = getMainName(); - const blobStore = new FileSystemBlobStore(cacheDir, prefix); - - const nativeCompileCache = new NativeCompileCache(); - nativeCompileCache.setCacheStore(blobStore); - nativeCompileCache.install(); - - process.once('exit', () => { - if (blobStore.isDirty()) { - blobStore.save(); - } - nativeCompileCache.uninstall(); - }); -} - -module.exports.__TEST__ = { - FileSystemBlobStore, - NativeCompileCache, - mkdirpSync, - slashEscape, - supportsCachedData, - getCacheDir, - getMainName, -}; diff --git a/node_modules/yocto-queue/index.d.ts b/node_modules/yocto-queue/index.d.ts new file mode 100644 index 000000000..9541986b4 --- /dev/null +++ b/node_modules/yocto-queue/index.d.ts @@ -0,0 +1,56 @@ +declare class Queue implements Iterable { + /** + The size of the queue. + */ + readonly size: number; + + /** + Tiny queue data structure. + + The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + + @example + ``` + import Queue = require('yocto-queue'); + + const queue = new Queue(); + + queue.enqueue('🦄'); + queue.enqueue('🌈'); + + console.log(queue.size); + //=> 2 + + console.log(...queue); + //=> '🦄 🌈' + + console.log(queue.dequeue()); + //=> '🦄' + + console.log(queue.dequeue()); + //=> '🌈' + ``` + */ + constructor(); + + [Symbol.iterator](): IterableIterator; + + /** + Add a value to the queue. + */ + enqueue(value: ValueType): void; + + /** + Remove the next value in the queue. + + @returns The removed value or `undefined` if the queue is empty. + */ + dequeue(): ValueType | undefined; + + /** + Clear the queue. + */ + clear(): void; +} + +export = Queue; diff --git a/node_modules/yocto-queue/index.js b/node_modules/yocto-queue/index.js new file mode 100644 index 000000000..2f3e6dcd7 --- /dev/null +++ b/node_modules/yocto-queue/index.js @@ -0,0 +1,68 @@ +class Node { + /// value; + /// next; + + constructor(value) { + this.value = value; + + // TODO: Remove this when targeting Node.js 12. + this.next = undefined; + } +} + +class Queue { + // TODO: Use private class fields when targeting Node.js 12. + // #_head; + // #_tail; + // #_size; + + constructor() { + this.clear(); + } + + enqueue(value) { + const node = new Node(value); + + if (this._head) { + this._tail.next = node; + this._tail = node; + } else { + this._head = node; + this._tail = node; + } + + this._size++; + } + + dequeue() { + const current = this._head; + if (!current) { + return; + } + + this._head = this._head.next; + this._size--; + return current.value; + } + + clear() { + this._head = undefined; + this._tail = undefined; + this._size = 0; + } + + get size() { + return this._size; + } + + * [Symbol.iterator]() { + let current = this._head; + + while (current) { + yield current.value; + current = current.next; + } + } +} + +module.exports = Queue; diff --git a/node_modules/yocto-queue/license b/node_modules/yocto-queue/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/yocto-queue/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/yocto-queue/package.json b/node_modules/yocto-queue/package.json new file mode 100644 index 000000000..71a91017b --- /dev/null +++ b/node_modules/yocto-queue/package.json @@ -0,0 +1,43 @@ +{ + "name": "yocto-queue", + "version": "0.1.0", + "description": "Tiny queue data structure", + "license": "MIT", + "repository": "sindresorhus/yocto-queue", + "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": [ + "queue", + "data", + "structure", + "algorithm", + "queues", + "queuing", + "list", + "array", + "linkedlist", + "fifo", + "enqueue", + "dequeue", + "data-structure" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/yocto-queue/readme.md b/node_modules/yocto-queue/readme.md new file mode 100644 index 000000000..c72fefc48 --- /dev/null +++ b/node_modules/yocto-queue/readme.md @@ -0,0 +1,64 @@ +# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) + +> Tiny queue data structure + +You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays. + +> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle. + +## Install + +``` +$ npm install yocto-queue +``` + +## Usage + +```js +const Queue = require('yocto-queue'); + +const queue = new Queue(); + +queue.enqueue('🦄'); +queue.enqueue('🌈'); + +console.log(queue.size); +//=> 2 + +console.log(...queue); +//=> '🦄 🌈' + +console.log(queue.dequeue()); +//=> '🦄' + +console.log(queue.dequeue()); +//=> '🌈' +``` + +## API + +### `queue = new Queue()` + +The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + +#### `.enqueue(value)` + +Add a value to the queue. + +#### `.dequeue()` + +Remove the next value in the queue. + +Returns the removed value or `undefined` if the queue is empty. + +#### `.clear()` + +Clear the queue. + +#### `.size` + +The size of the queue. + +## Related + +- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache diff --git a/package-lock.json b/package-lock.json index fb2d2d526..3a042db7c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "asana": "^0.18.5" }, "devDependencies": { - "eslint": "^7.22.0", + "eslint": "^8.36.0", "jest": "^26.6.3", "prettier": "2.2.1" } @@ -546,33 +546,66 @@ "node": ">=0.1.95" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", + "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", + "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", + "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.5.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" @@ -581,6 +614,72 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", + "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "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", @@ -839,6 +938,41 @@ "integrity": "sha512-77lub4Hu7iZVuxFU+CD50tJ+0rKTxqcNNYrfx8etHmWUdMWdgSHGZx7BfIex/leDW4oxkzY/FQUmHMpp0vnZeg==", "license": "UNLICENSED" }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@octokit/auth-token": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", @@ -1080,9 +1214,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.1.0.tgz", - "integrity": "sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1114,9 +1248,9 @@ } }, "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -1146,15 +1280,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1183,9 +1308,9 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "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" @@ -1301,15 +1426,6 @@ "node": ">=0.10.0" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -1935,9 +2051,9 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "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" @@ -2156,18 +2272,6 @@ "once": "^1.4.0" } }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2218,141 +2322,136 @@ } }, "node_modules/eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", + "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.5.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, "engines": { - "node": ">=4.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/eslint/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": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, "engines": { - "node": ">=4" + "node": ">= 8" } }, - "node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/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==", + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">= 8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/globals": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", - "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2364,6 +2463,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/eslint/node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2377,6 +2488,21 @@ "node": ">= 0.8.0" } }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -2394,6 +2520,36 @@ "node": ">= 0.8.0" } }, + "node_modules/eslint/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/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -2412,21 +2568,6 @@ "node": ">= 0.8.0" } }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint/node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2488,38 +2629,20 @@ } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", + "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -2536,9 +2659,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -2840,6 +2963,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -2973,12 +3105,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3056,15 +3182,15 @@ } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/globals": { @@ -3082,6 +3208,12 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -3263,9 +3395,9 @@ } }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -3472,7 +3604,7 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3497,9 +3629,9 @@ } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -3517,6 +3649,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "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", @@ -4330,6 +4471,16 @@ "node": ">= 10.14.2" } }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4585,6 +4736,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4690,9 +4847,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "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" @@ -5266,15 +5423,6 @@ "node": ">= 10" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/prompts": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", @@ -5319,6 +5467,26 @@ "node": ">=0.6" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -5384,18 +5552,6 @@ "node": ">=0.10.0" } }, - "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -5527,15 +5683,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -5592,6 +5739,16 @@ "node": ">=0.12" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5616,6 +5773,29 @@ "node": "6.* || >= 7.*" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5935,23 +6115,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, "node_modules/snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -6313,12 +6476,12 @@ } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "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.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -6394,43 +6557,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", - "dev": true, - "dependencies": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.3.tgz", - "integrity": "sha512-idv5WZvKVXDqKralOImQgPM9v6WOdLNa0IY3B3doOjw/YxRGT8I+allIJ6kd7Uaj+SF1xZUSU+nPM5aDNBVtnw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -6748,12 +6874,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-to-istanbul": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz", @@ -7005,6 +7125,18 @@ "engines": { "node": ">=6" } + }, + "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" + } } }, "dependencies": { @@ -7464,34 +7596,99 @@ "minimist": "^1.2.0" } }, + "@eslint-community/eslint-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", + "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", + "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "dev": true + }, "@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", + "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.5.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "argparse": "^2.0.1" } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true } } }, + "@eslint/js": { + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", + "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", + "dev": true + }, + "@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -7708,6 +7905,32 @@ "resolved": "https://npm.pkg.github.com/download/@mobsuccess-devops/asana-magics/1.0.1-ci-4263876762.0/a74d8aebb535cae437157e15b019a385eedb3c0c", "integrity": "sha512-77lub4Hu7iZVuxFU+CD50tJ+0rKTxqcNNYrfx8etHmWUdMWdgSHGZx7BfIex/leDW4oxkzY/FQUmHMpp0vnZeg==" }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, "@octokit/auth-token": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", @@ -7943,9 +8166,9 @@ "dev": true }, "acorn": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.1.0.tgz", - "integrity": "sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true }, "acorn-globals": { @@ -7967,9 +8190,9 @@ } }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, @@ -7990,12 +8213,6 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -8014,9 +8231,9 @@ } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -8102,12 +8319,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -8615,9 +8826,9 @@ } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -8784,15 +8995,6 @@ "once": "^1.4.0" } }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -8828,58 +9030,58 @@ } }, "eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", + "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.5.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "cross-spawn": { "version": "7.0.3", @@ -8892,15 +9094,40 @@ "which": "^2.0.1" } }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, "globals": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", - "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -8911,6 +9138,15 @@ "type-check": "~0.4.0" } }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -8925,6 +9161,24 @@ "word-wrap": "^1.2.3" } }, + "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, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -8937,15 +9191,6 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -8988,69 +9233,30 @@ } }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", + "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", "dev": true, "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" } }, "esprima": { @@ -9060,9 +9266,9 @@ "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -9307,6 +9513,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -9409,12 +9624,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -9471,12 +9680,12 @@ } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "globals": { @@ -9491,6 +9700,12 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -9634,9 +9849,9 @@ } }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, "import-fresh": { @@ -9794,7 +10009,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { @@ -9810,9 +10025,9 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -9824,6 +10039,12 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -10460,6 +10681,12 @@ "supports-color": "^7.0.0" } }, + "js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -10664,6 +10891,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -10742,9 +10975,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -11183,12 +11416,6 @@ "react-is": "^17.0.1" } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "prompts": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", @@ -11224,6 +11451,12 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -11276,12 +11509,6 @@ "safe-regex": "^1.1.0" } }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -11381,12 +11608,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -11430,6 +11651,12 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -11445,6 +11672,15 @@ "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", "dev": true }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -11710,17 +11946,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -12019,12 +12244,12 @@ } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { @@ -12076,38 +12301,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", - "dev": true, - "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ajv": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.3.tgz", - "integrity": "sha512-idv5WZvKVXDqKralOImQgPM9v6WOdLNa0IY3B3doOjw/YxRGT8I+allIJ6kd7Uaj+SF1xZUSU+nPM5aDNBVtnw==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -12358,12 +12551,6 @@ "dev": true, "optional": true }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "v8-to-istanbul": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz", @@ -12570,6 +12757,12 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } + }, + "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 } } } diff --git a/package.json b/package.json index 7dcbf331c..8cbaefbc5 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "asana": "^0.18.5" }, "devDependencies": { - "eslint": "^7.22.0", + "eslint": "^8.36.0", "jest": "^26.6.3", "prettier": "2.2.1" }
+ + 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. +
+